On Mon, Mar 30, 2015 at 1:33 AM, Colin Percival <cperc...@freebsd.org> wrote: > Author: cperciva > Date: Mon Mar 30 08:33:19 2015 > New Revision: 280840 > URL: https://svnweb.freebsd.org/changeset/base/280840 > > Log: > Clean up filesystem unmounting in vmimage builds: > * Remove vm_umount_base function which is currently unused. > * Add umount_loop function which loops attempting to unmount one filesystem. > * Replace calls to umount with calls to umount_loop. > * Don't attempt to unmount ${DESTDIR}/dev if it isn't mounted. > > The looping is necessary because sometimes umount fails due to filesystems > being busy. The most common cause of such busyness is periodic(8) jobs > running `find / ...`. > > Reviewed by: gjb > > Modified: > head/release/tools/vmimage.subr > > Modified: head/release/tools/vmimage.subr > ============================================================================== > --- head/release/tools/vmimage.subr Mon Mar 30 07:11:49 2015 > (r280839) > +++ head/release/tools/vmimage.subr Mon Mar 30 08:33:19 2015 > (r280840) > @@ -45,8 +45,10 @@ err() { > } > > cleanup() { > - umount ${DESTDIR}/dev 2>/dev/null > - umount ${DESTDIR} > + if mount | grep -qE "devfs on ${DESTDIR}/dev"; then > + umount_loop ${DESTDIR}/dev 2>/dev/null > + fi
if [ -c "${DESTDIR}/dev" ]; then umount_loop fi etc, is probably more foolproof here. _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"