src/brand/pkgcreatezone
changeset 1493 625950c12e71
parent 1483 2276b6786711
child 1504 265a1d6b86bd
--- a/src/brand/pkgcreatezone	Fri Nov 13 13:04:50 2009 -0800
+++ b/src/brand/pkgcreatezone	Fri Nov 13 15:13:18 2009 -0700
@@ -68,14 +68,6 @@
 
 m_done=$(gettext      " done.")
 
-is_brand_labeled() {
-	brand_labeled=0
-	brand=$(/usr/sbin/zoneadm -z $ZONENAME list -p | awk -F: '{print $6}')
-	if [[ $brand == "labeled" ]]; then
-		brand_labeled=1
-	fi
-}
-
 trap_cleanup() {
 	print "$f_interrupted"
 	exit $int_code
@@ -147,6 +139,7 @@
 zonepath="$ZONEPATH"
 
 is_brand_labeled
+brand_labeled=$?
 
 ZONEROOT=$ZONEPATH/root
 secinfo=""
@@ -423,9 +416,7 @@
 #
 # Get packages for TX zones if appropriate.
 #
-if [ $brand_labeled -ne 0 ]; then
-	pkglist="$pkglist system/trusted/trusted-nonglobal"
-fi
+(( $brand_labeled == 1 )) && pkglist="$pkglist system/trusted/trusted-nonglobal"
 
 #
 # Get man(1) but not the man pages
@@ -486,13 +477,13 @@
 /usr/sbin/sysidconfig -b $ZONEROOT -a /lib/svc/method/sshd
 touch $ZONEROOT/etc/.UNCONFIGURED
 
-# Umount the dataset on the root.
-/usr/sbin/umount $ZONEROOT
-
 printf "$m_complete\n\n" ${SECONDS}
-if [ $brand_labeled -eq 0 ]; then
+if (( $brand_labeled == 0 )); then
 	printf "$m_postnote\n"
 	printf "$m_postnote2\n"
+else
+	# Umount the dataset on the root.
+	umount $ZONEROOT || printf "$f_zfs_unmount" "$ZONEPATH/root"
 fi
 
 exit $ZONE_SUBPROC_OK