2016-12-15 15:34:30 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
2020-12-17 17:17:34 +00:00
|
|
|
# shellcheck disable=SC1091
|
2016-12-15 15:34:30 +00:00
|
|
|
. /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"
|
2018-03-20 15:08:59 +00:00
|
|
|
debugid="-debug"
|
2016-12-15 15:34:30 +00:00
|
|
|
else
|
|
|
|
debugname=""
|
2018-03-20 15:08:59 +00:00
|
|
|
debugid=""
|
2016-12-15 15:34:30 +00:00
|
|
|
fi
|
|
|
|
|
2020-12-17 17:17:34 +00:00
|
|
|
# shellcheck will complain about bootprefix being referenced but not assigned,
|
|
|
|
# but that is perfectly OK here.
|
|
|
|
# shellcheck disable=SC2154
|
|
|
|
cat > "$output" <<EOF
|
2016-12-15 15:34:30 +00:00
|
|
|
title ${NAME} (${kernelver}) ${VERSION}${debugname}
|
2018-03-20 15:08:59 +00:00
|
|
|
version ${kernelver}${debugid}
|
2016-12-15 15:34:30 +00:00
|
|
|
linux ${bootprefix}/vmlinuz-${kernelver}
|
|
|
|
initrd ${bootprefix}/initramfs-${kernelver}.img
|
|
|
|
options \$kernelopts
|
2020-04-14 21:53:23 +00:00
|
|
|
id ${ID}-${date}-${kernelver}${debugid}
|
2016-12-15 15:34:30 +00:00
|
|
|
grub_users \$grub_users
|
|
|
|
grub_arg --unrestricted
|
|
|
|
grub_class kernel${variant}
|
|
|
|
EOF
|