[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#409820: marked as done (initramfs-tools: mbr_check() does not work reliable with lilo and grub around)



Your message dated Thu, 08 Mar 2007 00:32:03 +0000
with message-id <E1HP6Y7-0004RF-4s@ries.debian.org>
and subject line Bug#409820: fixed in initramfs-tools 0.85f
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: initramfs-tools
Severity: important


Inside the mbr_check function in /usr/sbin/update-initramfs we have:

        dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | grep -q LILO \
                && run_lilo && return 0

This does not work reliable in the following scenario:

* lilo is installed first
* grub is installed afterwards

It does not work in that case because grub does *not* clear lilo's
signature. So the string LILO might be found even though grub is the
used and present bootmanager.  With the above code we install lilo
in the MBR wheras we want to use grub. => The system might not even
boot anymore after upgrading and executing update-initramfs.

My proposed fix is to use:

   dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | hexdump | \
      grep -q '0000000 ebfa .... .... 494c 4f4c' \
      && run_lilo && return 0

This will check for lilo's clear interrupt instruction (fa), the
jump instruction (eb) and the string LILO itself (494c 4f4c).
(hexdump is part of bsdmainutils, if you have another variant you
prefer feel free to adjust above code, I can test it for you of
course.)

JFTR the header looks like the following on a x86 32 bit system
(notice the use of hexdump's -C option in the second command):

# dd if=/dev/hda bs=512 skip=0 count=1 2> /dev/null | hexdump | head -1
0000000 ebfa 0121 01b5 494c 4f4c 0616 b884 4575
# dd if=/dev/hda bs=512 skip=0 count=1 2> /dev/null | hexdump -C | head -1
00000000  fa eb 21 01 b5 01 4c 49  4c 4f 16 06 84 b8 75 45  |úë!.µ.LILO...žuE|

On another x86 32 bit system where initramfs-tools' current check
fails:

# dd if=/dev/sda bs=512 skip=0 count=1 2> /dev/null | hexdump | head -1
0000000 48eb 0190 01b4 494c 4f4c 0716 0783 45c7
# dd if=/dev/sda bs=512 skip=0 count=1 2> /dev/null | hexdump -C | head -1
00000000  eb 48 90 01 b4 01 4c 49  4c 4f 16 07 83 07 c7 45  |.H....LILO.....E|

I'v tested my proposed fix on several boxes with lilo 22.6.1 and
22.7.3 and on one system where lilo was around and grub is present
now. The tested lilo versions are the ones used in current stable,
testing and unstable so we should have an appropriate fix which
should enter Etch. If you have any package(s) for testing please let
me know...

regards,
-mika-


--- End Message ---
--- Begin Message ---
Source: initramfs-tools
Source-Version: 0.85f

We believe that the bug you reported is fixed in the latest version of
initramfs-tools, which is due to be installed in the Debian FTP archive:

initramfs-tools_0.85f.dsc
  to pool/main/i/initramfs-tools/initramfs-tools_0.85f.dsc
initramfs-tools_0.85f.tar.gz
  to pool/main/i/initramfs-tools/initramfs-tools_0.85f.tar.gz
initramfs-tools_0.85f_all.deb
  to pool/main/i/initramfs-tools/initramfs-tools_0.85f_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 409820@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
maximilian attems <maks@sternwelten.at> (supplier of updated initramfs-tools package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Wed,  7 Mar 2007 23:34:17 +0100
Source: initramfs-tools
Binary: initramfs-tools
Architecture: source all
Version: 0.85f
Distribution: unstable
Urgency: high
Maintainer: Debian kernel team <debian-kernel@lists.debian.org>
Changed-By: maximilian attems <maks@sternwelten.at>
Description: 
 initramfs-tools - tools for generating an initramfs
Closes: 405157 405190 405194 409820
Changes: 
 initramfs-tools (0.85f) unstable; urgency=high
 .
   Release "Au lieu d'aller voter Casse leur la margoulette"
 .
   * update-initramfs: Grub _doesn't_ clear LILO string in mbr, but the inverse
     is done. Fix mbr_check() to first check for GRUB. Fixes accidental lilo
     call in the case that Grub is the used bootloader. (closes: 409820)
     Thanks Michael Prokop <mika@grml.org> for bringing up the case.
 .
   * initramfs.conf.5, mkinitramfs.5: Fix typos. Document version.
     (closes: 405157, 405190, 405194)
 .
   * update-initramfs: Be more screamy about lilo error, people seem to
     overlook recent lilo failures.
 .
   * scripts/init-top/framebuffer: Remove unused variables.
 .
   * init: Export ROOTDELAY to let udev boot script handle eventual rootdelay.
     downgrades 401916
Files: 
 d73cf2df014c9faf829f6d978ba399ce 625 utils optional initramfs-tools_0.85f.dsc
 dfcb8607970ba7abfa451374268c8b9e 56722 utils optional initramfs-tools_0.85f.tar.gz
 1a24b6a8e76232f5399827c17bcac1b2 62764 utils optional initramfs-tools_0.85f_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFF71XBgm/Kwh6ICoQRAobVAKCw0G8suvlwe4/XH8kh4omEssWvZwCgtzh3
3n6W6qkLx+FtbWGxRMZFg9s=
=yKdC
-----END PGP SIGNATURE-----


--- End Message ---

Reply to: