Skip to contentSkip to conversation

Initrd problem with 2.6 kernel

DISCUSSION H. J. Lu 3 participants 4 messages Aug 7, 2003 – Aug 8, 2003

lore
Share & tools
lore

H. J. Lu

author
#0 lore raw

There is a chicken and egg problem with initrd on 2.6. When root=/dev/xxx is passed to kernel, kernel will call try_name, which uses /sys/block/drive/dev, to find out the device number for ROOT_DEV. The problem is /sys/block/drive may not exist if the driver is loaded by /linuxrc in initrd. As the result, /linuxrc can't use /proc/sys/kernel/real-root-dev to determine the root device number.

H.J.

#1 lore raw
Quoted 7 lines · H. J. Lu

There is a chicken and egg problem with initrd on 2.6. When root=/dev/xxx is passed to kernel, kernel will call try_name, which uses /sys/block/drive/dev, to find out the device number for ROOT_DEV. The problem is /sys/block/drive may not exist if the driver is loaded by /linuxrc in initrd. As the result, /linuxrc can't use /proc/sys/kernel/real-root-dev to determine the root device number.

You should be able to use the numeric identifier:

	root=03:02

that's major:minor, and it recently changed. In 2.6.0-test2 that would be "0302".

#2 lore raw
In reply to H. J. Lu
Quoted 6 lines · H. J. Lu

There is a chicken and egg problem with initrd on 2.6. When root=/dev/xxx is passed to kernel, kernel will call try_name, which uses /sys/block/drive/dev, to find out the device number for ROOT_DEV. The problem is /sys/block/drive may not exist if the driver is loaded by /linuxrc in initrd. As the result, /linuxrc can't use /proc/sys/kernel/real-root-dev to determine the root device number.

You can replicate the sysfs probing in userspace. I did that in Debian initrd-tools 0.1.51.

Signature · 4 lines
Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
author
#3 lore raw
Quoted 10 lines · Herbert Xu
Quoted 6 lines · H. J. Lu

There is a chicken and egg problem with initrd on 2.6. When root=/dev/xxx is passed to kernel, kernel will call try_name, which uses /sys/block/drive/dev, to find out the device number for ROOT_DEV. The problem is /sys/block/drive may not exist if the driver is loaded by /linuxrc in initrd. As the result, /linuxrc can't use /proc/sys/kernel/real-root-dev to determine the root device number.

You can replicate the sysfs probing in userspace. I did that in Debian initrd-tools 0.1.51.

It sounds a good idea. I will give it a try.

Thanks.

H.J.