svn commit: r197542 - head/tools/tools/nanobsd

Simon L. Nielsen simon at FreeBSD.org
Sun Sep 27 21:01:07 UTC 2009


Author: simon
Date: Sun Sep 27 21:01:07 2009
New Revision: 197542
URL: http://svn.freebsd.org/changeset/base/197542

Log:
  - When we run our trap cleanup handler, echo that we are running this
    handler to make it more clear why we are 'suddenly' running df,
    umount, and mdconfig.
  - Remove trap handler again after we have unconfigured the memory
    device etc.  Before we could end up running the trap handler if a
    later stage failed, which was a bit confusing and not really useful.
  
  MFC after:	2 weeks

Modified:
  head/tools/tools/nanobsd/nanobsd.sh

Modified: head/tools/tools/nanobsd/nanobsd.sh
==============================================================================
--- head/tools/tools/nanobsd/nanobsd.sh	Sun Sep 27 20:50:54 2009	(r197541)
+++ head/tools/tools/nanobsd/nanobsd.sh	Sun Sep 27 21:01:07 2009	(r197542)
@@ -439,7 +439,7 @@ create_i386_diskimage ( ) (
 			-y ${NANO_HEADS}`
 	fi
 
-	trap "df -i ${MNT} ; umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT
+	trap "echo 'Running exit trap code' ; df -i ${MNT} ; umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT
 
 	fdisk -i -f ${NANO_OBJ}/_.fdisk ${MD}
 	fdisk ${MD}
@@ -491,6 +491,9 @@ create_i386_diskimage ( ) (
 	echo "Writing out _.disk.image..."
 	dd if=/dev/${MD}s1 of=${NANO_DISKIMGDIR}/_.disk.image bs=64k
 	mdconfig -d -u $MD
+
+	trap - 1 2 15 EXIT
+
 	) > ${NANO_OBJ}/_.di 2>&1
 )
 


More information about the svn-src-all mailing list