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

Re: /etc/rc is not run anymore

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.

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

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.


Erik B. Andersen   Web:    http://www.xmission.com/~andersen/ 
                   email:  andersee@debian.org
--This message was written using 73% post-consumer electrons--

Reply to: