Date: Tue, 18 Nov 2014 08:05:22 -0700 From: Ian Lepore <ian@FreeBSD.org> To: Konstantin Belousov <kostikbel@gmail.com> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mark Felder <feld@FreeBSD.org> Subject: Re: svn commit: r274653 - head/usr.sbin/freebsd-update Message-ID: <1416323122.1147.46.camel@revolution.hippie.lan> In-Reply-To: <20141118142449.GW17068@kib.kiev.ua> References: <201411181338.sAIDc9U3051869@svn.freebsd.org> <20141118142449.GW17068@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 2014-11-18 at 16:24 +0200, Konstantin Belousov wrote: > On Tue, Nov 18, 2014 at 01:38:09PM +0000, Mark Felder wrote: > > Author: feld (ports committer) > > Date: Tue Nov 18 13:38:09 2014 > > New Revision: 274653 > > URL: https://svnweb.freebsd.org/changeset/base/274653 > > > > Log: > > Re-work non-persistent filesystem detection as it was not possible to > > detect /dev/md backed mfs filesystems that way. > > > > Differential Revision: https://reviews.freebsd.org/D1163 > > Approved by: ian > > > > Modified: > > head/usr.sbin/freebsd-update/freebsd-update.sh > > > > Modified: head/usr.sbin/freebsd-update/freebsd-update.sh > > ============================================================================== > > --- head/usr.sbin/freebsd-update/freebsd-update.sh Tue Nov 18 13:38:07 2014 (r274652) > > +++ head/usr.sbin/freebsd-update/freebsd-update.sh Tue Nov 18 13:38:09 2014 (r274653) > > @@ -604,14 +604,13 @@ fetchupgrade_check_params () { > > echo ${WORKDIR} > > exit 1 > > fi > > - for i in tmpfs mdmfs; do > > - if df -t ${i} ${WORKDIR} >/dev/null 2>1; then > > - echo -n "`basename $0`: " > > - echo -n "${_WORKDIR_bad2}" > > - echo ${WORKDIR} > > - exit 1 > > - fi > > - done > > + case `df -T ${WORKDIR}` in */dev/md[0-9]* | *tmpfs*) > > + echo -n "`basename $0`: " > > + echo -n "${_WORKDIR_bad2}" > > + echo ${WORKDIR} > > + exit 1 > > + ;; > > + esac > > chmod 700 ${WORKDIR} > > cd ${WORKDIR} || exit 1 > > > Why do you suppose that md-backed volumes are not persistent ? > vnode-backed devices are stable. > This is intended to guard against /var being an mfs due to diskless or readonly-root setup by rc.d/var during freebsd-update. I suppose it's possible for someone to configure /var in a persistant file-backed md on such a system. (Hmm, that's maybe even useful with nfs root, I may give that a try.) It looks like the information needed to figure out whether it's persistant or not is available in the kern.geom.conftxt sysctl, but parsing that with shell script is going to lead to some ugly hieroglyphics. Maybe a reasonable compromise would be instead of hard-fail, just warn the user that a memory-backed /var doesn't work and prompt them? (I'm not sure if the script is interactive at this point or not.) -- Ian
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1416323122.1147.46.camel>