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.
"H. J. Lu" <[email protected]> wrote:
>
> 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".
H. J. Lu <[email protected]> wrote:
> 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.
--
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
On Fri, Aug 08, 2003 at 08:49:16PM +1000, Herbert Xu wrote:
> H. J. Lu <[email protected]> wrote:
> > 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.
> 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.
{pts/1}% grep \"/sys\" *
do_mounts.c: sys_mkdir("/sys", 0700);
do_mounts.c: if (sys_mount("sysfs", "/sys", "sysfs", 0, NULL) < 0)
do_mounts.c: sys_umount("/sys", 0);
do_mounts.c: sys_rmdir("/sys");
or do you mean something different?
-andrey