From owner-freebsd-current@FreeBSD.ORG Mon Jan 19 13:20:26 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B43A116A4CE for ; Mon, 19 Jan 2004 13:20:26 -0800 (PST) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 52E1743D2F for ; Mon, 19 Jan 2004 13:20:25 -0800 (PST) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.10/8.12.3) with ESMTP id i0JLKKaT012206; Mon, 19 Jan 2004 13:20:20 -0800 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.10/8.12.3/Submit) id i0JLKKNi012205; Mon, 19 Jan 2004 13:20:20 -0800 Date: Mon, 19 Jan 2004 13:20:20 -0800 From: Brooks Davis To: Poul-Henning Kamp Message-ID: <20040119212006.GA8895@Odin.AC.HMC.Edu> References: <98643.1074545359@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sm4nu43k4a2Rpi4c" Content-Disposition: inline In-Reply-To: <98643.1074545359@critter.freebsd.dk> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu cc: current@freebsd.org Subject: Re: REVIEW: cleanvar.patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2004 21:20:26 -0000 --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--