diff options
| author | maximilian attems <maks@debian.org> | 2007-04-02 13:29:25 +0200 |
|---|---|---|
| committer | maximilian attems <maks@debian.org> | 2007-04-02 13:29:25 +0200 |
| commit | c4343742b3bf028e467ac8a58ead95c9bfefc628 (patch) | |
| tree | 9f99e841f9829111bc78f828be819fe9022428a0 /update-initramfs | |
| parent | d21a00a23405d1db81ab05a12342145276ef2af0 (diff) | |
| download | initramfs-tools-c4343742b3bf028e467ac8a58ead95c9bfefc628.tar.gz initramfs-tools-c4343742b3bf028e467ac8a58ead95c9bfefc628.zip | |
first prerelease 0.86 + merge 0.85f
* kick mdrun script
* update control for lenny + ubuntu
* add _all_ ide, block and drivers
* use MODPROBE_OPTIONS and kill any modprobed arg
* small doc + whitespace fixes
Diffstat (limited to 'update-initramfs')
| -rwxr-xr-x | update-initramfs | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/update-initramfs b/update-initramfs index 52e603b..a676fe9 100755 --- a/update-initramfs +++ b/update-initramfs @@ -4,6 +4,8 @@ STATEDIR=/var/lib/initramfs-tools BOOTDIR=/boot CONF=/etc/initramfs-tools/update-initramfs.conf KPKGCONF=/etc/kernel-img.conf +mode="" +version="" set -e @@ -136,7 +138,7 @@ run_lilo() { # show lilo errors on failure if ! lilo -t > /dev/null 2>&1 ; then - echo "update-initramfs: lilo run failed for ${initramfs}:" + echo "Error lilo fails for new ${initramfs}:" echo lilo -t fi @@ -146,6 +148,16 @@ run_lilo() # check if lilo is on mbr mbr_check() { + # try to discover grub and be happy + [ -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 @@ -162,16 +174,6 @@ mbr_check() dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | grep -q LILO \ && run_lilo && return 0 - # try to discover grub and be happy - [ -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 - # no idea which bootloader is used echo echo "WARNING: grub and lilo installed." |
