devfs
[Top] [All Lists]

RE: Boot problems

To: Borzenkov Andrey <Andrey.Borzenkov@xxxxxxxxxxx>
Subject: RE: Boot problems
From: David Fokkema <fokkema@xxxxxxxxx>
Date: Tue, 17 Dec 2002 15:52:10 +0100 (MET)
Cc: "'Marton Kadar'" <marton.kadar@xxxxxxxx>, <devfs@xxxxxxxxxxx>
In-reply-to: <6134254DE87BD411908B00A0C99B044F03A0B59F@MOWD019A>
Sender: devfs-bounce@xxxxxxxxxxx
> 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.

Hmmm. I'll try, but I have to take a look at the code to really understand
this, I guess. Why would it succeed with ide/host0/etc.?

> > 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,

Got me there. Although I'm not sure the bios, on booting, will try ALL
CD-ROM drives, except just the first one.

> 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.

Well, by 'hardwiring' the floppy to ide/host0/etc. and a non-bootable
CD-ROM in the drive, I managed to put a whole server system on CD-ROM,
including the RPMS I created for the distribution, and some simple install
scripts. /tmp, /var and /etc are recreated in tmpfs, including original
directories and files of /var and /etc. So, basically, if I boot from
floppy and CD, I have a fully working linux system (w/o X) which I can
test on different servers with different hardware. And also, I can install
them from the CD. I use devfs without symlinks, and so far it works,
although on my home system, I need the compatibility links for scsi
devices for cdrtools. I guess the device locations are wired into the
binaries.

I will try the patch and try initrc. Thanks for the help!

David


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