readonly rootfs and /dev (was Re: /proc/misc has bad mode)

David Monro (davidm@cs.su.oz.au)
Wed, 24 Apr 1996 23:14:34 +1000 (EST)


Rather than these schemes which change links at run time, is there anything
wrong with the following:

/dev is a symlink which points to /var/dev

The simplest option is to have /var/dev on the rootfs have those device entries
required to get up and running (which can have very restrictive permissions
since processes running before we mount all our filesystems will be running as
root). The only problem I can see is overmounting this directory might get a
'/var busy' message if something is using it as a cwd.

If this is a problem, /var on the rootfs could have dev as a symlink to
/boot/dev, which has the necessary devices to get up and running to start with
(again with restrictive permissions, especially as these device entries will be
visible when multi user).

When the real /var gets mounted (which of course has to be read-write), a full
dev directory appears.

Am I missing something? Actually I think the first option (have a small
/var/dev) should work - I don't think an open file under a directory prevents
overmounting, only things using something under that directory as a working
directory, and I can't see much using /dev as cwd that early in the game.

If I am talking through my hat, let me know. (My interest in a r/o rootfs isn't
for stability reasons, but I have been thinking about a shared rootfs for
diskless boxes. My remaining problems are /etc/mtab (/proc/mounts should fix
this) and some sort of hacked mount or nfsd so each box gets a different /var).
Everything else (eg hostname determination) works already, courtesy of
etherboot!

David