Subject: Re: misc/36508: Init scripts to enable mounting from read only filesystems
To: None <gnats-bugs@NetBSD.org>
From: Johnny C. Lam <jlam@pkgsrc.org>
List: netbsd-bugs
Date: 06/28/2007 22:20:46
I don't think these scripts will be good in the general case.

Take the case of /var.  It is almost certainly a critical file system
to mount, and so must really be done either within mountcritlocal or
as a script that REQUIRES root and is BEFORE mountcritlocal.

I don't think the suggestion to populate /var "only sometimes" makes
sense.  I understand the difficulty where /var needs to be mounted
extremely early and one can't rely on the presence of utilities stored
on /usr, e.g. mtree, chown, chgrp, etc., to help with populating /var.

Why not create a "mountvar" script that REQUIRES root and is BEFORE
mountcritlocal that has an additional action "create" that creates
a .tar file on the root filesystem?  Then the "start" action could
mount the tmpfs filesystem onto /var and then just extract the .tar
file directly into /var using /bin/pax.  This avoids any problems
with not having /usr mounted at boot time.

The "mounttmp" script should probably grow the option to just symlink
/tmp to /var/tmp and avoid needing two separate tmpfs mounts for both
n /var and /tmp.  the cases where one might want to deal with read-only
root, e.g. for an embedded device, symlinking /tmp to /var/tmp is
fairly common.  I would guess the "mounttmp" script would REQUIRE
mountvar and is BEFORE mountcritlocal.

I do think that these "mountvar" and "mounttmp" scripts should be just
incorporated directly into the mountcritlocal script.

	Cheers,

	-- Johnny Lam <jlam@pkgsrc.org>