Pablo Greco 7b2c62
#!/bin/bash
Pablo Greco 7b2c62
set -e
Pablo Greco 7b2c62
Pablo Greco 7b2c62
. /etc/os-release
Pablo Greco 7b2c62
Pablo Greco 7b2c62
kernelver=$1 && shift
Pablo Greco 7b2c62
rootfs=$1 && shift
Pablo Greco 7b2c62
variant=$1 && shift
Pablo Greco 7b2c62
Pablo Greco f3902b
output="${rootfs}/lib/modules/${kernelver}/bls_sample.conf"
Pablo Greco 7b2c62
date=$(date -u +%Y%m%d%H%M%S)
Pablo Greco 7b2c62
Pablo Greco 7b2c62
if [ "${variant:-5}" = "debug" ]; then
Pablo Greco 7b2c62
    debugname=" with debugging"
Pablo Greco 7b2c62
    debugid="-debug"
Pablo Greco 7b2c62
else
Pablo Greco 7b2c62
    debugname=""
Pablo Greco 7b2c62
    debugid=""
Pablo Greco 7b2c62
fi
Pablo Greco 7b2c62
Pablo Greco 7b2c62
cat >${output} <
Pablo Greco 7b2c62
title ${NAME} (${kernelver}) ${VERSION}${debugname}
Pablo Greco 7b2c62
version ${kernelver}${debugid}
Pablo Greco 7b2c62
linux ${bootprefix}/vmlinuz-${kernelver}
Pablo Greco 7b2c62
initrd ${bootprefix}/initramfs-${kernelver}.img
Pablo Greco 7b2c62
options \$kernelopts
Pablo Greco 7b2c62
grub_users \$grub_users
Pablo Greco 7b2c62
grub_arg --unrestricted
Pablo Greco 7b2c62
grub_class kernel${variant}
Pablo Greco 7b2c62
EOF