summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaximilian attems <maks@debian.org>2009-01-11 23:56:50 +0100
committermaximilian attems <maks@debian.org>2009-01-12 00:00:07 +0100
commit254a54d61d3e2c5463798fa29280c3d1d24c49bf (patch)
treed6450af4b0c6cafcd1debc729caa6260efca8682
parent79c0badcec17942a869ef992ceda2335cfa1d7b2 (diff)
downloadinitramfs-tools-254a54d61d3e2c5463798fa29280c3d1d24c49bf.tar.gz
initramfs-tools-254a54d61d3e2c5463798fa29280c3d1d24c49bf.zip
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 <schizo@debian.org> (closes: #511514)
-rwxr-xr-xupdate-initramfs5
1 files changed, 3 insertions, 2 deletions
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}")