REVIEW: cleanvar.patch

Brooks Davis brooks at one-eyed-alien.net
Tue Jan 20 07:59:34 PST 2004


On Tue, Jan 20, 2004 at 10:09:53AM +0100, Ruben de Groot wrote:
> On Mon, Jan 19, 2004 at 09:49:19PM +0100, Poul-Henning Kamp typed:
> 
> [...]
> 
> > +# If we do not have a writable /var, create a memory
> > +# filesystem for /var.  We don't have /usr yet so
>                               ^^^^^^^^^^^^^^^^^^^
> > +# use mkdir instead of touch to test.  We want mount
> > +# to record its mounts so we have to make sure /var/db
> > +# exists before doing the mount -a.
> > +#
> > +
> > +if (/bin/mkdir /var/.diskless 2> /dev/null); then
> > +        rmdir /var/.diskless
> > +else
> > +	mkdir -p /var
> > +	mount_md ${varsize:=32m} /var
> > +fi
> > +
> > +# Populate /var if it looks empty
> > +if [ -d /var/run -a -d /var/db -a -d /var/empty ] ; then
> > +	true
> > +else
> > +	/usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var > /dev/null 2>&1
>         ^^^^^^^^^^^^^^^
> Where did we get /usr ?

In rc.d/diskless, we run a mount -a before we get here which would be
inappropriate in this case.

In most cases we do have /usr since this comes after mountcritlocal
which mounts all local file systems.  Only the case of a remote /usr
seperate from / doesn't work here.  I think there's some argument that
we should move mtree and possiably newsyslog to /sbin to support the
population of /var.

-- Brooks

-- 
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20040120/fa9beca5/attachment.bin


More information about the freebsd-current mailing list