Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Jan 2004 13:20:20 -0800
From:      Brooks Davis <brooks@one-eyed-alien.net>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        current@freebsd.org
Subject:   Re: REVIEW: cleanvar.patch
Message-ID:  <20040119212006.GA8895@Odin.AC.HMC.Edu>
In-Reply-To: <98643.1074545359@critter.freebsd.dk>
References:  <98643.1074545359@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help

--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

You might want to post this to the FreeBSD-rc list
(freebsd-rc@yahoogroups.com).

On Mon, Jan 19, 2004 at 09:49:19PM +0100, Poul-Henning Kamp wrote:
>=20
>=20
> This patch adds code which detects an read-only /var and puts
> a MD(4) disk on it in that case.
>=20
> This is really a move of some diskless specific code to the
> more general use of read-only rootfs systems.

Overall this seems like a good idea.  I'm not sure cleanvar is the right
place (as opposed to a new script cleanvar depends on), but this is
probably as good as any.

> +# Provide a function for normalizing the mounting of memory
> +# filesystems.  This should allow the rest of the code here to remain
> +# as close as possible between 5-current and 4-stable.
> +#   $1 =3D size
> +#   $2 =3D mount point
> +#   $3 =3D (optional) bytes-per-inode
> +mount_md() {
> +	if [ -n "$3" ]; then
> +		bpi=3D"-i $3"
> +	fi
> +	/sbin/mdmfs $bpi -s $1 -M md $2
> +}

Since this would now appear in three files, maybe it should go in
/etc/rc.subr.

> +# 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

You also need to create the sendmail files if sendmail is enabled:

case ${sendmail_enable} in
[Nn][Oo][Nn][Ee])
	;;
*)
	/usr/sbin/mtree -deU -f /etc/mtree/BSD.sendmail.dist -p / > /dev/null
	;;
esac


> +	LOGFILES=3D`/usr/bin/awk '$1 !=3D "#" { printf "%s ", $1 } ' /etc/newsy=
slog.conf`
> +	if [ -n "$LOGFILES" ]; then
> +		/usr/bin/touch $LOGFILES
> +	fi

It's kind of lame that we have to do this when newsyslog has the -CC
option.  I guess we're stuck with it given we don't have /usr yet.

> +	/usr/bin/touch /var/log/lastlog
> +
> +fi

-- Brooks

--=20
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

--sm4nu43k4a2Rpi4c
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFADEoDXY6L6fI4GtQRAkLzAJ0dZZxDl5sKPUiuKlUx3cBe5/MohQCghGh0
yMzbRTGV68VQr7unBq0F+Oo=
=Z0TS
-----END PGP SIGNATURE-----

--sm4nu43k4a2Rpi4c--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040119212006.GA8895>