diff options
author | 2019-10-13 06:00:44 +0200 | |
---|---|---|
committer | 2019-10-13 16:13:03 +0200 | |
commit | e3ae3cac3825f290b2eca2f7e7d85c235e3e8d4e (patch) | |
tree | 4d34123a972d23960564d125d1d39edd52d3a0ed /gen_bootloader.sh | |
parent | gen_bootloader.sh: set_bootloader_grub_duplicate_default(): Fix code style (diff) | |
download | genkernel-e3ae3cac3825f290b2eca2f7e7d85c235e3e8d4e.tar.gz genkernel-e3ae3cac3825f290b2eca2f7e7d85c235e3e8d4e.tar.bz2 genkernel-e3ae3cac3825f290b2eca2f7e7d85c235e3e8d4e.zip |
gen_bootloader.sh: Recognize set kernel/initramfs name for grub legacy
Fixes 769a07fd ("Make initramfs and kernel filename customizable")
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'gen_bootloader.sh')
-rwxr-xr-x | gen_bootloader.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gen_bootloader.sh b/gen_bootloader.sh index 9178d00..68eb721 100755 --- a/gen_bootloader.sh +++ b/gen_bootloader.sh @@ -129,14 +129,14 @@ set_bootloader_grub() { } set_bootloader_grub_duplicate_default_replace_kernel_initrd() { - sed -r -e "/^[[:space:]]*kernel/s/kernel-[[:alnum:][:punct:]]+/${GK_FILENAME_KERNEL}/" - | - sed -r -e "/^[[:space:]]*initrd/s/init(rd|ramfs)-[[:alnum:][:punct:]]+/${GK_FILENAME_INITRAMFS}/" + sed -r -e "s/(^[[:space:]]*kernel[[:space:]=]*\/)(${GK_FILENAME_KERNEL%%-*}|${GK_FILENAME_KERNEL_SYMLINK%%-*}|kernel)(-[[:alnum:][:punct:]]+)?/\1${GK_FILENAME_KERNEL}/" - | + sed -r -e "s/(^[[:space:]]*initrd[[:space:]=]*\/)(${GK_FILENAME_INITRAMFS%%-*}|${GK_FILENAME_INITRAMFS_SYMLINK%%-*}|initrd|initramfs)(-[[:alnum:][:punct:]]+)?/\1${GK_FILENAME_INITRAMFS}/" } set_bootloader_grub_check_for_existing_entry() { local GRUB_CONF=$1 - if grep -q "^[[:space:]]*kernel[[:space:]=]*.*/${GK_FILENAME_KERNEL}\([[:space:]]\|$\)" "${GRUB_CONF}" && - grep -q "^[[:space:]]*initrd[[:space:]=]*.*/${GK_FILENAME_INITRAMFS}\([[:space:]]\|$\)" "${GRUB_CONF}" + if grep -q "^[[:space:]]*kernel[[:space:]=]*/${GK_FILENAME_KERNEL}\([[:space:]]\|$\)" "${GRUB_CONF}" && + grep -q "^[[:space:]]*initrd[[:space:]=]*/${GK_FILENAME_INITRAMFS}\([[:space:]]\|$\)" "${GRUB_CONF}" then return 0 fi |