devfs
[Top] [All Lists]

RE: Boot problems

To: "'David Fokkema'" <fokkema@xxxxxxxxx>, "'Marton Kadar'" <marton.kadar@xxxxxxxx>
Subject: RE: Boot problems
From: Borzenkov Andrey <Andrey.Borzenkov@xxxxxxxxxxx>
Date: Tue, 17 Dec 2002 17:38:26 +0300
Cc: devfs@xxxxxxxxxxx
Importance: Normal
In-reply-to: <Pine.SOL.4.43.0212171404240.4303-100000@selene.nat.vu.nl>
Sender: devfs-bounce@xxxxxxxxxxx
First, sorry, I was not reading carefully enough initially.


> 
> Hi Marton,
> 
> > And the case seems to be that the comfortable symlinks
> > you intend to use are symlinks only, and as such they
> > can be used only as file references. They in themselves
> > are not part of the bare underlying namespace that you
> > must use to specify your root device.
> 
> That would be awful. Even without devfsd, the kernel itself knows which
> symlink to attach to which device. So, why not implement this at boot
> time?
> 

Actually this seems to be implemented, at least in my (vendor-modified)
kernel sources; the relevant part is in init/do_mounts.c:create_dev()

  handle = devfs_find_handle(NULL, dev ? NULL : devfs_name,
                        MAJOR(dev), MINOR(dev), DEVFS_SPECIAL_BLK, 1);

Note that we call it with traverse_symlinks = 1 so it _should_ find
cdroms/cdrom0 that is symlinked to ../../ide/...

Which means that either this part is different in vanilla kernel or this
part is executed before cdrom module gets chance to create symlink. I am
using 2.4.19-16mdk (Mandrake 9.0).

... hmm ... what happens is, first /dev/root is created for MAJOR/MINOR  and
then we try to create /dev/root from passed name, but this should fail
because /dev/root already exists ... would you try following: in
init/do_mounts.c:mount_root() add sys_unlink("/dev/root"); just between

        devfs_make_root(root_device_name);
         => sys_unlink("/dev/root"); <= add here
        create_dev("/dev/root", ROOT_DEV, root_device_name);

Note that code is already messy enough, so I am not sure if it is the
correct solution in long term. But if this works you may want to drop a note
to lkml.

[...]

> 
> My idea is to create a nice boot floppy, read all 1440Ks of it with dd to
> boot.img, and use that one on an eltorito bootable CD.
> 

Use initrd. It is simple and general enough. Besides, note, that you have no
idea if CD-ROM you are booting from will be actually cdrom0. So any code
general enough should ask what device has to be mounted as CD-ROM. And,
finally, why would you actually _need_ root on CD-ROM? Put any tools you
want there, mount it in any convenient place (/tools or /usr) and let / be
in RAM. 

-andrey


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