kernel/generate_bls_conf.sh
Herton R. Krzesinski 31c1ab6192 kernel-5.10.0-0.rc6.92
* Fri Dec 04 2020 Herton R. Krzesinski <herton@redhat.com> [5.10.0-0.rc6.92]
- v5.10-rc6 rebase
Resolves: rhbz#1903802

Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
2020-12-04 15:24:35 -05:00

36 lines
821 B
Bash
Executable File

#!/bin/bash
set -e
# shellcheck disable=SC1091
. /etc/os-release
kernelver=$1 && shift
rootfs=$1 && shift
variant=$1 && shift
output="${rootfs}/lib/modules/${kernelver}/bls.conf"
date=$(date -u +%Y%m%d%H%M%S)
if [ "${variant:-5}" = "debug" ]; then
debugname=" with debugging"
debugid="-debug"
else
debugname=""
debugid=""
fi
# shellcheck will complain about bootprefix being referenced but not assigned,
# but that is perfectly OK here.
# shellcheck disable=SC2154
cat > "$output" <<EOF
title ${NAME} (${kernelver}) ${VERSION}${debugname}
version ${kernelver}${debugid}
linux ${bootprefix}/vmlinuz-${kernelver}
initrd ${bootprefix}/initramfs-${kernelver}.img
options \$kernelopts
id ${ID}-${date}-${kernelver}${debugid}
grub_users \$grub_users
grub_arg --unrestricted
grub_class kernel${variant}
EOF