devfs
[Top] [All Lists]

Re: option "root=" doesn't work with devfs device names

To: "Per_Lidén" <per@xxxxxxxxxxx>
Subject: Re: option "root=" doesn't work with devfs device names
From: Brad Chapman <jabiru_croc@xxxxxxxxx>
Date: Wed, 16 Oct 2002 13:58:56 -0700 (PDT)
Cc: devfs@xxxxxxxxxxx
In-reply-to: <Pine.LNX.4.44.0210162018130.9032-100000@ce00521-p19-hertas5.cenara.com>
Sender: devfs-bounce@xxxxxxxxxxx
Sir,

--- Per_Lidén <per@xxxxxxxxxxx> wrote:
> Hi,
> 
> The "root=" kernel option doesn't work when used together with devfs
> device names, e.g. root=/dev/discs/disc0/part1.
> 
> in do_mounts.c:
> 
> static int __init root_dev_setup(char *line)
> {
>         int i;
>         char ch;
> 
>         ROOT_DEV = name_to_kdev_t(line);
>                    ^^^^^^^^^^^^^^^^^^^^
> 
> The call to name_to_kdev_t() should return 0 if the device name starts
> with "/dev/" but was not found in root_dev_names[] (which is the case if
> e.g.  root=/dev/discs/disc0/part1 is used as a kernel option). But instead
> of returning 0, name_to_kdev_t() will treat "discs/disc0/part1" as a
> hex-number, which results in "discs/disc0/part1" being passed to
> simple_strtoul(). The returned value from name_to_kdev_t() will thus be
> garbage, and later calls to create_dev() will fail to create the
> appropriate devfs entries because ROOT_DEV is non-zero.

Ah, so THIS is why it never seemed to work right. I always thought it was
a kernel problem but couldn't figure out what to look for.

> 
> The end result is a kernel panic "VFS: Unable to mount root fs on ...".
> 
> This has been broken since 2.4.19.
> 
> The patch below fixes this problem. It would be nice if this problem was
> solved before 2.4.20 was released.

So with this patch a root= entry of /dev/discs/disc0/part1 returns the correct
device entry in devfs?

Brad

> 
> /Per
>


__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com

<Prev in Thread] Current Thread [Next in Thread>