svn commit: r274653 - head/usr.sbin/freebsd-update

Ian Lepore ian at FreeBSD.org
Tue Nov 18 15:05:33 UTC 2014


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




More information about the svn-src-head mailing list