Kernel panic with geninitrd and root=/dev/vgname/lvname

Elan Ruusamäe glen at pld-linux.org
Tue May 13 23:05:55 CEST 2014


On 14.05.2014 00:01, Elan Ruusamäe wrote:
> On 13.05.2014 02:33, Łukasz Krotowski wrote:
>> Hi,
>> our geninitrd in function initrd_gen_setrootdev() tries to fill
>> /proc/sys/kernel/real-root-dev based on /proc/partitions. But, when
>> booted with root=/dev/vgname/lvname:
>> - /proc/sys/kernel/real-root-dev is already filled with proper number
>> by initrd_gen_lvm(),
>> - /proc/partitions contains dm-X not vgname/lvname hence root device
>> is not found. And that causes panic.
>>
>> My local fix is:
>> + if [ "$(busybox cat /proc/sys/kernel/real-root-dev)" -eq 0 -a
>> "${ROOT##/dev/}" != "${ROOT}" ]; then
>> - if [ "${ROOT##/dev/}" != "${ROOT}" ]; then
>>
>> Since I don't know how to change geninitrd I'm signaling this issue
>> here. FWIW I use geninitrd with --initrdfs=rom.
>
> seems the bug doesn't exist with --initrdfs=initramfs
>
> and the problem is that busybox 1.21 -> 1.22 ls -l format has changed, 
> so the unreliable fallback to ls -l, reading minor-major of 254,0 it 
> gets 0,0
the same in copy-paste format:

21:42:59 root[load: 0.38]@pld /root# ./busybox-1.21.1 ls -l /dev/sys/rootfs
lrwxrwxrwx 1 7 /dev/sys/rootfs -> ../dm-0

21:43:04 root[load: 0.35]@pld /root# ./busybox-1.22.1 ls -l /dev/sys/rootfs
lrwxrwxrwx 1 root root 7 May 13 21:33 /dev/sys/rootfs -> ../dm-0




-- 
glen



More information about the pld-devel-en mailing list