From 254a54d61d3e2c5463798fa29280c3d1d24c49bf Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 11 Jan 2009 23:56:50 +0100 Subject: update-initramfs: Fix run_bootloader() to check for grub2 makes it respect "do_bootloader = no" if both lilo and grub2 are installed. simplify grub check as both grub2 and grub have an update-grub script. based on patch and report by Clint Adams (closes: #511514) --- update-initramfs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'update-initramfs') diff --git a/update-initramfs b/update-initramfs index 11f630f..b5f6f53 100755 --- a/update-initramfs +++ b/update-initramfs @@ -188,6 +188,7 @@ run_lilo() mbr_check() { # try to discover grub and be happy + # FIXME: check grub2 /boot/grub/grub.cfg [ -r /boot/grub/menu.lst ] \ && groot=$(awk '/^root/{print substr($2, 2, 3); exit}' \ /boot/grub/menu.lst) @@ -232,8 +233,8 @@ mbr_check() run_bootloader() { # if both lilo and grub around, figure out if lilo needs to be run - if [ -x /sbin/grub ] || [ -e /boot/grub/menu.lst ] \ - || [ -x /usr/sbin/grub ]; then + if [ -x "$(command -v update-grub)" ] || [ -e /boot/grub/menu.lst ] \ + || [ -e /boot/grub/grub.cfg ]; then if [ -e /etc/lilo.conf ] && [ -x /sbin/lilo ]; then [ -r "${KPKGCONF}" ] && \ do_b=$(awk '/^do_bootloader/{print $3}' "${KPKGCONF}") -- cgit v1.2.3