summaryrefslogtreecommitdiff
path: root/update-initramfs
diff options
context:
space:
mode:
authormaximilian attems <maks@debian.org>2009-03-30 00:23:54 +0200
committermaximilian attems <maks@debian.org>2009-03-30 00:23:54 +0200
commit89257a84d0bfcd46d5514c65245b7b3f57f67ddf (patch)
treee726af2f5ec772e89ed4dee3a41f517ef18f5429 /update-initramfs
parentff34476ecd5de0da1104b13e6b42e6cc9eff8792 (diff)
downloadinitramfs-tools-89257a84d0bfcd46d5514c65245b7b3f57f67ddf.tar.gz
initramfs-tools-89257a84d0bfcd46d5514c65245b7b3f57f67ddf.zip
update-initramfs: mbr_check() use /boot/grub/grub.cfg for grub2 search.
only comes into play if lilo is installed too and usage is not configured by do_bootloader in /etc/kernel-img.conf. (closes: #427509)
Diffstat (limited to 'update-initramfs')
-rwxr-xr-xupdate-initramfs6
1 files changed, 4 insertions, 2 deletions
diff --git a/update-initramfs b/update-initramfs
index 2eed8cb..8c085a5 100755
--- a/update-initramfs
+++ b/update-initramfs
@@ -187,8 +187,10 @@ run_lilo()
# check if lilo is on mbr
mbr_check()
{
- # try to discover grub and be happy
- # FIXME: check grub2 /boot/grub/grub.cfg
+ # try to discover grub|grub2 and be happy
+ [ -r /boot/grub/grub.cfg ] \
+ && groot=$(awk '/^set root=/{print substr($2, 7, 3); exit}' \
+ /boot/grub/grub.cfg)
[ -r /boot/grub/menu.lst ] \
&& groot=$(awk '/^root/{print substr($2, 2, 3); exit}' \
/boot/grub/menu.lst)