2006-11-13 10:52:10

by Ivan Ukhov

[permalink] [raw]
Subject: /dev before the root filesystem is mounted

Hi,

I want the kernel (2.4) to display (just using printk) all available
devices with full path (/dev/...) before the root filesystem is
mounted. So I'm trying to add something into mount_block_root function
in init/do_mounts.c to do it. But I really haven't got any idia what
exactly I should do. Can you help me please?

Thanks a lot.


2006-11-13 11:36:41

by Jan Engelhardt

[permalink] [raw]
Subject: Re: /dev before the root filesystem is mounted


> I want the kernel (2.4) to display (just using printk) all available
> devices with full path (/dev/...) before the root filesystem is
> mounted.

Case 1: You do not use an initrd/initramfs:
/ is empty, /dev does not exist.

Case 2: You do use an initrd/initramfs
You populated /dev during creation of the initrd/initramfs image OR
your init script inside the initrd/initramfs mknods the nodes when run.


-`J'
--

2006-11-13 12:19:14

by Ivan Ukhov

[permalink] [raw]
Subject: Re: /dev before the root filesystem is mounted

i dont use initrd. the kernel understands argument 'root=/dev/...', so
/dev should exist, mb not in a real filesystem, but just in ram or
something. i just want to know what devices are available for being
the root filesystem for the kernel (displaying all available devices
will be enough for me).

2006/11/13, Jan Engelhardt <[email protected]>:
>
> > I want the kernel (2.4) to display (just using printk) all available
> > devices with full path (/dev/...) before the root filesystem is
> > mounted.
>
> Case 1: You do not use an initrd/initramfs:
> / is empty, /dev does not exist.
>
> Case 2: You do use an initrd/initramfs
> You populated /dev during creation of the initrd/initramfs image OR
> your init script inside the initrd/initramfs mknods the nodes when run.
>
>
> -`J'
> --
>

2006-11-13 12:26:22

by Jan Engelhardt

[permalink] [raw]
Subject: Re: /dev before the root filesystem is mounted


On Nov 13 2006 15:15, Ivan Ukhov wrote:
> i dont use initrd. the kernel understands argument 'root=/dev/...', so
> /dev should exist, mb not in a real filesystem, but just in ram or
> something. i just want to know what devices are available for being
> the root filesystem for the kernel (displaying all available devices
> will be enough for me).

/dev does not exist. How should it? The root filesystem / is empty, other
people can verify that, or you can verify it yourself with an
initramfs (which, unlike an initrd, is copied to / instead of being
mounted).

Yes, the kernel understands root=/dev/ but that's a hack, a strstr(s,
"/dev/"). Should you want to use, say, root=/devices/hda instead,
that would only succeed when using an initrd/initramfs.

To display the accepted block devices (this is most likely what you
really wanted), check out

ftp://ftp-1.gwdg.de/pub/linux/misc/suser-jengelh/kernel/linux-2.6.18-jen35/show_partitions.diff


Please (a) don't top post (b) don't strip Cc:s.

>
> 2006/11/13, Jan Engelhardt <[email protected]>:
>>
>> > I want the kernel (2.4) to display (just using printk) all available
>> > devices with full path (/dev/...) before the root filesystem is
>> > mounted.
>>
>> Case 1: You do not use an initrd/initramfs:
>> / is empty, /dev does not exist.
>>
>> Case 2: You do use an initrd/initramfs
>> You populated /dev during creation of the initrd/initramfs image OR
>> your init script inside the initrd/initramfs mknods the nodes when run.
>>
>>
>> -`J'
>> --
>>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
>

-`J'
--

2006-11-13 13:32:46

by Erik Mouw

[permalink] [raw]
Subject: Re: /dev before the root filesystem is mounted

On Mon, Nov 13, 2006 at 03:15:26PM +0300, Ivan Ukhov wrote:
> i dont use initrd. the kernel understands argument 'root=/dev/...', so
> /dev should exist, mb not in a real filesystem, but just in ram or
> something. i just want to know what devices are available for being
> the root filesystem for the kernel (displaying all available devices
> will be enough for me).

/dev does not exist because there is no root filesystem mounted. Please
read http://kernelnewbies.org/RootFileSystem .


Erik

--
+-- Erik Mouw -- http://www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands