[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /etc/rc is not run anymore

Erik Andersen wrote:
> On Thu Nov 11, 1999 at 11:40:55PM -0500, Adam Di Carlo wrote:
> > 
> > Yurk -- this stuff is going a bit beyond me... can someone fix this up
> > whatever needs to be fixed?
> Nothing really complicated. The problem is the kernel doesn't know
> what the device special file for the / filesystem is since before
> it mounts /, there are no device special files around (kindof a
> chicken-and-the-egg problem). In /proc/mounts the kernel just calls the
> / filesystem's device "/dev/root" (a device which doesn't really exist).
> Run 'cat /proc/mounts' to see what I mean.
> To find out what the root filesystem's real device special file is, you
> can do several things. You can hard code it into "/etc/fstab" (if it is
> expected to always stay the same (i.e. /dev/fd0 or /dev/ram1) so then
> if somebody calls getfsfile("/"), glibc looks into /etc/fstab and calls
> "/dev/root" whatever you put into /etc/fstab.
> Another way is to stat("/") and then stat each entry in /dev until you
> find a dev_t that matches. This is messy and slow.

And what about root filesystem on NFS ?  It is named server:/mountpath but I
don't think it could be derived automagically :(

> Fortunatly, in this case, to remount / read-write, it doesn't matter
> what we put in for the device name.

Yes.  Therefore no need to resolve /dev/root.

> Sorry for the long winded explanation. This is one of those wierd things
> that I wish I had known the first time it bit me (it doesn't bite many
> people, but then most people don't rewrite mount to not use /etc/mtab...
> :)
> Anyway, I'm fixing it up.

Btw, I discovered that busybox' mount is not used by boot floppies!
mount/umount are going from the mount package.
I guess it is because your mount program does not support NFS.  Are you
planning to add it?  We could save 50k to 100k on the rootdisk (mount+umount
takes 120k on sparc for the moment) if you would do but you need to support all
filesystems the bootdisks might use. Basically ext2, nfs and iso9660, but also
msdos/fat/vfat (for PC), ufs (for Sun), ...


 Eric Delaunay                 | "La guerre justifie l'existence des militaires.
 delaunay@lix.polytechnique.fr | En les supprimant." Henri Jeanson (1900-1970)

Reply to: