17995 Add packages required by SC to pkgcreatezone
authorSusan Kamm-Worrell <Susan.Kamm-Worrell@Sun.COM>
Fri, 29 Apr 2011 10:56:29 -0700
changeset 2321 5741d6cd0988
parent 2320 b02a1adb7324
child 2322 06de944cbceb
17995 Add packages required by SC to pkgcreatezone 17996 Update pkgcreatezone to use SC to cause configuration after install 17997 unconfigure_zone needs to use SC for unconfiguration
src/brand/common.ksh
src/brand/pkgcreatezone
--- a/src/brand/common.ksh	Fri Apr 29 14:44:56 2011 -0700
+++ b/src/brand/common.ksh	Fri Apr 29 10:56:29 2011 -0700
@@ -242,8 +242,19 @@
 	ZONE_IS_MOUNTED=1
 	zoneadm -z $ZONENAME mount -f || fatal "$e_badmount"
 
-	zlogin -S $ZONENAME /usr/sbin/sys-unconfig -R /a \
-	    </dev/null >/dev/null 2>&1
+	# If unconfig service exists and is online then use sysconfig
+	SC_ONLINE=$(svcprop -p restarter/state \
+	    svc:/milestone/unconfig:default 2> /dev/null)
+	if (( $? == 0 )) && [[ $SC_ONLINE == "online" ]]; then
+		zlogin -S $ZONENAME "export _UNCONFIG_ALT_ROOT=/a; \
+		    /usr/sbin/sysconfig unconfigure -g system; \
+		    export _UNCONFIG_ALT_ROOT= ;" \
+		    </dev/null >/dev/null 2>&1
+	else
+		zlogin -S $ZONENAME /usr/sbin/sys-unconfig -R /a \
+		    </dev/null >/dev/null 2>&1
+	fi
+
 	if (( $? != 0 )); then
 		error "$e_unconfig"
 		failed=1
--- a/src/brand/pkgcreatezone	Fri Apr 29 14:44:56 2011 -0700
+++ b/src/brand/pkgcreatezone	Fri Apr 29 10:56:29 2011 -0700
@@ -560,6 +560,15 @@
 pkglist="$pkglist \
 	pkg:///text/doctools"
 
+# 
+# packages needed for sysconfig in zone
+#
+pkglist="$pkglist \
+	pkg:///system/install
+	pkg:///system/install/configuration
+	pkg:///system/library/install
+	pkg:///security/sudo"
+
 #
 # Add in any extra packages requested by the user.
 #
@@ -590,13 +599,25 @@
 printf "$m_done\n"
 
 #
-# Make sure sysidtools run; we manually poke in the SSH action
-# so that we get an SSH key.  Yes, this is seriously borken.
-# See http://defect.opensolaris.org/bz/show_bug.cgi?id=741
+# If unconfig service exists and is online then copy in enable_sci.xml
+# sysconfig file to trigger config cycle on boot of zone.
 #
-printf "$m_more_brokenness\n"
-/usr/sbin/sysidconfig -b $ZONEROOT -a /lib/svc/method/sshd
-touch $ZONEROOT/etc/.UNCONFIGURED
+SC_ONLINE=$(svcprop -p restarter/state \
+    svc:/milestone/unconfig:default 2> /dev/null)
+if (( $? == 0 )) && [[ $SC_ONLINE == "online" ]]; then
+	cp /usr/share/auto_install/sc_profiles/enable_sci.xml \
+	    $ZONEROOT/etc/svc/profile/site
+else
+	#
+	# Make sure sysidtools run; we manually poke in the SSH action
+	# so that we get an SSH key.  Yes, this is seriously borken.
+	# See http://defect.opensolaris.org/bz/show_bug.cgi?id=741
+	#
+	printf "$m_more_brokenness\n"
+	/usr/sbin/sysidconfig -b $ZONEROOT -a /lib/svc/method/sshd
+
+	touch $ZONEROOT/etc/.UNCONFIGURED
+fi
 
 #
 # Labeled zones need to be able to modify /etc/gconf files, when gnome