chengshan / rpms / kernel

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