Subject: Re: /kern/kernel
To: None <current-users@netbsd.org>
From: Greg A. Woods <woods@most.weird.com>
List: current-users
Date: 09/14/1998 15:25:37
[ On Mon, September 14, 1998 at 08:23:55 (-0400), der Mouse wrote: ]
> Subject: Re: /kern/kernel
>
> The problem is, / is mounted read-only. To remount it read-write,
> userland does "mount -o update /dev/whatever /". This doesn't work,
> because when the kernel looks up / to get the mounted-on vnode, it gets
> a different vnode from the one the root device is currently mounted on.
> I'm thinking about possible ways to fix this, but so far all I have is
> ideas. (The one I currently favor is to remember the *real* root and
> have mount(2) silently substitute that when userland tries to mount
> onto rootvnode. Note this doesn't affect how mount(2) interacts with
> chroot(2), because I'm talking about rootvnode, not fd_rdir.)
I believe this is why SCO Xenix (and possibly other implementations)
have a /dev/root and /dev/rroot. These are virtual devices that always
point at the "real" one -- i.e. the one set at boot time either because
that's where the kernel was loaded from, or that's where the user
specified for the equivalent of a "boot -a". That way "mount -o
update,rw /dev/root /" is always correct. Although if I remember right
finding out what the real root disk is from user-land is left as an
exercise to the user.....
--
Greg A. Woods
+1 416 218-0098 VE3TCP <gwoods@acm.org> <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>