initramfs: doesn't work with lilo as bootloader

Bug #19609 reported by Andreas Schultz
20
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
Fix Released
Critical
Jeff Bailey

Bug Description

scripts/local test if the root device exists. It apparently expects ROOT to be
something like /dev/hda.
lilo passes the root device as a numeric id of the root device, e.g. fd00 for a
LVM device. The root device test will fail on this.

Using grub is not alternative for me, since grub doesn't support booting of
RAID1 device the same way as lilo does (redundant boot records).

# cat /proc/cmdline
BOOT_IMAGE=Linux rw root=fd00 ramdisk_size=32768 nmi_watchdog=1
console=ttyS0,9600 console=tty0

Andreas

Revision history for this message
Jeff Bailey (jbailey) wrote :

Mostly as a note to myself, this should work for regular and md partitions, but
not for lvm. lvm triggers based on the presence of a volume group name.

parse_numeric() {
        case $1 in
        *:*)
                minor=${1#*:}
                major=${1%:*}
                ;;
        *)
                minor=$((0x${1#??}))
                major=$((0x${1%??}))
                ;;
        esac

        mknod /dev/root b ${major} ${minor}
        ROOT=/dev/root

}

Revision history for this message
Jeff Bailey (jbailey) wrote :

BTW, A work around for now is to add

ramdisk=/usr/sbin/mkinitrd

to kernel-img.conf, which will force the old mkinitrd. This isn't a long term
solution, though.

Tks,
Jeff Bailey

Revision history for this message
Jeffrey Baker (jwbaker) wrote :

I'm insufficiently empowered on this Bugzilla, but someone else might want to
dupe #13504 to this one.

Revision history for this message
Andreas Schultz (aschultz) wrote :

(In reply to comment #2)
> BTW, A work around for now is to add
>
> ramdisk=/usr/sbin/mkinitrd

A better workarround is to add your root device to the append="" or addappend=""
line in lilo.conf.

e.g. mine looks like:

append="ramdisk_size=32768 nmi_watchdog=1"
serial=0,9600n8

image=/vmlinuz
        addappend="root=/dev/mapper/nsys-root"
        initrd=/initrd.img
        label=Linux
        read-write

This results in a kernel cmdline:

# cat /proc/cmdline
auto BOOT_IMAGE=Linux rw root=fd00 ramdisk_size=32768 nmi_watchdog=1
root=/dev/mapper/nsys-root

root is passed twice, but neither the kernel nor the initramfs scripts seem to mind.

Andreas

Revision history for this message
Jeff Bailey (jbailey) wrote :

> # cat /proc/cmdline
> auto BOOT_IMAGE=Linux rw root=fd00 ramdisk_size=32768 nmi_watchdog=1
> root=/dev/mapper/nsys-root
>
> root is passed twice, but neither the kernel nor the initramfs scripts seem to
mind.

Ah, thanks for the tip! The initramfs will take whever the last root= is for
its definition.

Tks,
Jeff Bailey

Revision history for this message
Matt Zimmerman (mdz) wrote :

*** Bug 19747 has been marked as a duplicate of this bug. ***

Revision history for this message
Nathan Howell (neh) wrote :

This bug affects anyone using an xfs root fs as well. When I installed hoary
using an xfs root, I automatically got lilo, which in breezy means unbootable.

Revision history for this message
Jeff Bailey (jbailey) wrote :

Lilo is now supported with initramfs-tools 0.23.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.