summaryrefslogtreecommitdiff
path: root/update-initramfs
diff options
context:
space:
mode:
authormaximilian attems <maks@debian.org>2010-03-25 01:22:07 +0100
committermaximilian attems <maks@debian.org>2010-03-25 01:25:05 +0100
commitcc33aa5bfb7f687935ef682aa2cce0842af15ea4 (patch)
tree5e7df0a33237ec09c4f766c422e8f7b34faaaa69 /update-initramfs
parentb5c928d159623f617f872323b7064ebfbf19a269 (diff)
downloadinitramfs-tools-cc33aa5bfb7f687935ef682aa2cce0842af15ea4.tar.gz
initramfs-tools-cc33aa5bfb7f687935ef682aa2cce0842af15ea4.zip
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 <maks@debian.org>
Diffstat (limited to 'update-initramfs')
-rwxr-xr-xupdate-initramfs52
1 files 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