From cc33aa5bfb7f687935ef682aa2cce0842af15ea4 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 25 Mar 2010 01:22:07 +0100 Subject: update-initramfs: Stop second guessing lilo usage. If people have both lilo and grub installed they need to figured out on their own, what they want. The mbr detection is error prone and a nice hack, but has survived it's time now that grub.cfg would need to be parsed in a different way. warn people that they should act. (closes: #574553) Signed-off-by: maximilian attems --- update-initramfs | 52 ++++------------------------------------------------ 1 file changed, 4 insertions(+), 48 deletions(-) diff --git a/update-initramfs b/update-initramfs index b7f9003..5085b0d 100755 --- a/update-initramfs +++ b/update-initramfs @@ -184,53 +184,6 @@ run_lilo() lilo } -# check if lilo is on mbr -mbr_check() -{ - # 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) - [ -e /boot/grub/device.map ] && [ -n "${groot}" ] \ - && dev=$(awk "/${groot}/{ print \$NF}" /boot/grub/device.map) - [ -n "${dev}" ] && [ -r ${dev} ] \ - && dd if="${dev}" bs=512 skip=0 count=1 2> /dev/null \ - | grep -q GRUB && return 0 - - # check out lilo.conf for validity - boot=$(awk -F = '/^boot=/{ print $2}' /etc/lilo.conf) - [ -z "${boot}" ] && return 0 - case ${boot} in - /dev/md/*) - if [ -r /proc/mdstat ]; then - MD=${boot#/dev/md/} - boot="/dev/$(awk "/^md${MD}/{print substr(\$5, 1, 3)}" \ - /proc/mdstat)" - fi - ;; - /dev/md*) - if [ -r /proc/mdstat ]; then - MD=${boot#/dev/} - boot="/dev/$(awk "/^${MD}/{print substr(\$5, 1, 3)}" \ - /proc/mdstat)" - fi - ;; - esac - [ ! -r "${boot}" ] && return 0 - dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | grep -q LILO \ - && run_lilo && return 0 - - # no idea which bootloader is used - echo - echo "WARNING: grub and lilo installed." - echo "If you use grub as bootloader everything is fine." - echo "If you use lilo as bootloader you must run lilo!" - echo -} - # Invoke bootloader run_bootloader() { @@ -250,7 +203,10 @@ run_bootloader() fi # do_bootloader unconfigured - mbr_check + echo + echo "WARNING: grub and lilo installed." + echo "Please deinstall unused bootloader." + echo return 0 fi if [ -r /etc/lilo.conf ] && command -v lilo >/dev/null 2>&1; then -- cgit v1.2.3