15571 long volume IDs break x86 ISO image builds if customized grub menu is long
authorAlexander Eremin <eremin@milax.org>
Tue, 27 Apr 2010 10:58:04 +0400
changeset 817 8abc87bee984
parent 816 316f206c9570
child 818 d33ffaf9a0b2
15571 long volume IDs break x86 ISO image builds if customized grub menu is long
usr/src/cmd/distro_const/auto_install/ai_sparc_image.xml
usr/src/cmd/distro_const/auto_install/ai_x86_image.xml
usr/src/cmd/distro_const/slim_cd/all_lang_slim_cd_x86.xml
usr/src/cmd/distro_const/slim_cd/slim_cd_x86.xml
usr/src/cmd/distro_const/utils/boot_archive_configure
usr/src/cmd/distro_const/utils/create_iso
usr/src/cmd/distro_const/utils/post_boot_archive_pkg_image_mod
usr/src/cmd/distro_const/vmc/prepare_ai_image
usr/src/cmd/slim-install/svc/media-fs-root
usr/src/lib/libict_pymod/ict.py
--- a/usr/src/cmd/distro_const/auto_install/ai_sparc_image.xml	Mon Apr 26 08:02:59 2010 -0700
+++ b/usr/src/cmd/distro_const/auto_install/ai_sparc_image.xml	Tue Apr 27 10:58:04 2010 +0400
@@ -18,13 +18,12 @@
    
     CDDL HEADER END
    
-    Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-    Use is subject to license terms.
+    Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
 
     XML specification for building an OpenSolaris installer iso image
 -->
 
-<distribution name="OpenSolaris_AI_sparc">
+<distribution name="OpenSolaris_AI_SPARC">
 	<distro_constr_params>
 		<!--
 		     Where to build. This can be a zfs dataset or a mountpoint.
--- a/usr/src/cmd/distro_const/auto_install/ai_x86_image.xml	Mon Apr 26 08:02:59 2010 -0700
+++ b/usr/src/cmd/distro_const/auto_install/ai_x86_image.xml	Tue Apr 27 10:58:04 2010 +0400
@@ -18,13 +18,12 @@
    
     CDDL HEADER END
    
-    Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-    Use is subject to license terms.
+    Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
 
     XML specification for building an OpenSolaris installer iso image
 -->
 
-<distribution name="OpenSolaris_AI">
+<distribution name="OpenSolaris_AI_X86">
 	<distro_constr_params>
 		<!--
 		     Where to build. This can be a zfs dataset or a mountpoint.
--- a/usr/src/cmd/distro_const/slim_cd/all_lang_slim_cd_x86.xml	Mon Apr 26 08:02:59 2010 -0700
+++ b/usr/src/cmd/distro_const/slim_cd/all_lang_slim_cd_x86.xml	Tue Apr 27 10:58:04 2010 +0400
@@ -18,14 +18,13 @@
    
     CDDL HEADER END
    
-    Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-    Use is subject to license terms.
+    Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
 
     XML specification for building the all languages OpenSolaris
     live CD iso and usb image
 -->
 
-<distribution name="OpenSolaris">
+<distribution name="OpenSolaris_Live_X86">
 	<distro_constr_params>
 		<!--
 		     Where to build. This can be a zfs dataset or a mountpoint.
--- a/usr/src/cmd/distro_const/slim_cd/slim_cd_x86.xml	Mon Apr 26 08:02:59 2010 -0700
+++ b/usr/src/cmd/distro_const/slim_cd/slim_cd_x86.xml	Tue Apr 27 10:58:04 2010 +0400
@@ -18,14 +18,13 @@
    
     CDDL HEADER END
    
-    Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-    Use is subject to license terms.
+    Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
 
     XML specification for building the limited language OpenSolaris
     live CD iso and usb image
 -->
 
-<distribution name="OpenSolaris">
+<distribution name="OpenSolaris_Live_X86">
 	<distro_constr_params>
 		<!--
 		     Where to build. This can be a zfs dataset or a mountpoint.
--- a/usr/src/cmd/distro_const/utils/boot_archive_configure	Mon Apr 26 08:02:59 2010 -0700
+++ b/usr/src/cmd/distro_const/utils/boot_archive_configure	Tue Apr 27 10:58:04 2010 +0400
@@ -19,8 +19,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
 # =============================================================================
@@ -55,26 +54,26 @@
 
 	# Create a fresh empty list of processed files.
         PROC_FILELIST=${TMP_DIR}/plist
-        $RM -f ${PROC_FILELIST}
+        rm -f ${PROC_FILELIST}
         $TOUCH ${PROC_FILELIST}
 
 	# Loop through all files in the package image area
-        for pi_file in `cat ${PKG_IMG_FILELIST}`
+        for pi_file in $(cat ${PKG_IMG_FILELIST})
         do
 		#
                 # Skip this file if it has already been processed or it
                 # already exists in the boot archive
                 #
-                $GREP "^${pi_file}$" ${PROC_FILELIST} > /dev/null
+                $GREP "^${pi_file}\$" ${PROC_FILELIST} > /dev/null
                 [ $? -eq 0 ] && continue
-                $GREP "^${pi_file}$" ${BOOT_ARCHIVE_FILELIST} > /dev/null
+                $GREP "^${pi_file}\$" ${BOOT_ARCHIVE_FILELIST} > /dev/null
                 [ $? -eq 0 ] && continue
 
 		#
 		# Create any missing directory path to the file and
 		# add it to the list of processed files/dirs.
 		#
-                dir=`dirname $pi_file`
+                dir=$(dirname $pi_file)
                 if [ ! -d $dir ]; then
                         $MKDIR -p $dir
                         echo $dir >> ${BOOT_ARCHIVE_FILELIST}
@@ -86,7 +85,7 @@
                 [ -d ${BOOT_ARCHIVE_FILELIST}/${p} ] && p=$p/
 
 		# Create the link from the boot archive to the actual file.
-                $LN -sf ${MNT_PT}/${pi_file} ${pi_file}
+                ln -sf ${MNT_PT}/${pi_file} ${pi_file}
 
 		# Add the file to the list of processed files/dirs.
                 echo "$p" >> ${PROC_FILELIST}
@@ -119,7 +118,8 @@
 
 # Verify argument count
 if [ $# != 6 ] ; then
-	print -u2 "$0: Requires 6 args: Reader socket, pkg_image area,"
+	print -u2 -f "%s: Requires 6 args: Reader socket, pkg_image area,\n" \
+	    "$0"
 	print -u2 "    tmp dir, boot archive build area, media area,"
 	print -u2 "    img_type_file."
 	exit 1
@@ -129,38 +129,40 @@
 MFEST_SOCKET=$1
 PKG_IMG_PATH=$2
 if [ ! -d $PKG_IMG_PATH ] ; then
-	print -u2 "$0: Image package area $PKG_IMG_PATH is not valid"
+	print -u2 -f "%s: Image package area %s is not valid\n" \
+	    "$0" "$PKG_IMG_PATH"
 	exit 1
 fi
 
 TMP_DIR=$3
 if [ ! -d $TMP_DIR ] ; then
-	print -u2 "$0: Temporary area $TMP_DIR is not valid"
+	print -u2 -f "%s: Temporary area %s is not valid\n" "$0" "$TMP_DIR"
 	exit 1
 fi
 
 BA_BUILD=$4
 if [ ! -d $BA_BUILD ] ; then
-	print -u2 "$0: Boot archive build area is not valid"
+	print -u2 -f "%s: Boot archive build area is not valid\n" "$0"
 	exit 1
 fi
 
 IMG_TYPE_MARKER_FILE=$6
 
+builtin cd
+builtin cp
+builtin rm
+builtin mkdir
+builtin chmod
+builtin chown
+builtin ln
+
 # Define a few commands.
-CD=cd		# Built into the shell
-CP=cp		# Built into the shell
-CHMOD=/usr/bin/chmod
-CHOWN=/usr/bin/chown
 CHROOT=/usr/sbin/chroot
 DEVFSADM=/usr/sbin/devfsadm
 ED=/usr/bin/ed
 FIND=/usr/bin/find
 GREP=/usr/xpg4/bin/grep
-GGREP=/usr/bin/ggrep
-LN=/usr/bin/ln
-MKDIR=/usr/bin/mkdir
-RM=/usr/bin/rm
+MAKEUUID=/usr/bin/makeuuid
 TOUCH=/usr/bin/touch
 TR=/usr/bin/tr
 SED=/usr/bin/sed
@@ -170,8 +172,8 @@
 MANIFEST_READ=/usr/bin/ManifestRead
 MKREPO=/usr/share/distro_const/mkrepo
 
-# Name of volume ID file in the boot archive
-VOLID_FILENAME=.volumeid
+# Name of volume set ID file in the boot archive
+VOLSETID_FILENAME=.volsetid
 
 # hostname name for the image
 HOSTNAME="opensolaris"
@@ -245,11 +247,12 @@
 
 $SED "s/127.*$/& ${HOSTNAME}/" $BA_BUILD/etc/inet/hosts > $TMP_DIR/hosts.mod
 if [ "$?" != "0" ] ; then
-	print -u2 "$0: Failed to modify $BA_BUILD/etc/inet/hosts."
+	print -u2 -f "%s: Failed to modify %s/etc/inet/hosts.\n" \
+	    "$0" "$BA_BUILD"
 	exit 1
 fi
-$CP $TMP_DIR/hosts.mod $BA_BUILD/etc/inet/hosts
-$RM $TMP_DIR/hosts.mod
+cp $TMP_DIR/hosts.mod $BA_BUILD/etc/inet/hosts
+rm $TMP_DIR/hosts.mod
 
 print "Preloading SMF repository..."
 
@@ -266,12 +269,12 @@
 PROF_NODE_PATH="distro_constr_params/output_image/boot_archive/\
 smf_service_profile/profile"
 
-SVC_PROFS=`$MANIFEST_READ $MFEST_SOCKET ${PROF_NODE_PATH}/path`
+SVC_PROFS=$($MANIFEST_READ $MFEST_SOCKET ${PROF_NODE_PATH}/path)
 
-for PROF in `$MANIFEST_READ $MFEST_SOCKET ${PROF_NODE_PATH}/path` ; do
+for PROF in $($MANIFEST_READ $MFEST_SOCKET ${PROF_NODE_PATH}/path) ; do
 	USE_SYS_NODE=${PROF_NODE_PATH}"[path=\""${PROF}"\"]/use_build_sys_file"
-	USE_SYS=`$MANIFEST_READ $MFEST_SOCKET ${USE_SYS_NODE}|\
-	    ${TR} '[:upper:]' '[:lower:]'`
+	USE_SYS=$($MANIFEST_READ $MFEST_SOCKET ${USE_SYS_NODE}|\
+	    ${TR} '[:upper:]' '[:lower:]')
 	if [ "${USE_SYS}" != "true" ] ; then
 		DTD_ROOT=${BA_BUILD}
 		SVC_PROF=${PKG_IMG_PATH}/${PROF}
@@ -304,51 +307,39 @@
 	export SVCCFG_DTD=${DTD_ROOT}/usr/share/lib/xml/dtd/service_bundle.dtd.1
 	${SVCCFG_CMD} apply ${SVC_PROF}
 	if [ "$?" != "0" ] ; then
-		print -u2 "$0: Failed to apply ${SVC_PROF}."
+		print -u2 -f "%s: Failed to apply %s.\n" "$0" "${SVC_PROF}"
 		exit 1
 	fi
 done
 
 
-$CD $BA_BUILD
+cd $BA_BUILD
 
 # create ./bin -> ./usr/bin symlink
-$LN -s ./usr/bin
+ln -s ./usr/bin
 
 # Create mount points for misc and pkg zlibs.
-$MKDIR mnt/misc
-$CHMOD 0755 mnt/misc
-$MKDIR mnt/pkg
-$CHMOD 0755 mnt/pkg
-
-# create volume id file
+mkdir mnt/misc
+chmod 0755 mnt/misc
+mkdir mnt/pkg
+chmod 0755 mnt/pkg
 
-VOLNAME=`$MANIFEST_READ ${MFEST_SOCKET} "name"`
-if [ "XX${VOLNAME}" == "XX" ] ; then
-	print -u2 "$0: Error retrieving volume ID"
-	exit 1
-fi
+# create volume set id file
+VOLSETID=$($MAKEUUID)
 
-# Get grub title from manifest, if not specified there, use the build number
-# from /etc/release in BA_BUILD
-RELEASE=`$MANIFEST_READ ${MFEST_SOCKET} "img_params/grub_menu_modifications/title"`
-if [ "XX${RELEASE}" == "XX" ] ; then
-	RELEASE=$($GGREP -o 'snv_[0-9]*[a-z]\?' ${BA_BUILD}/etc/release)
-fi
-
-echo $VOLNAME $RELEASE > $VOLID_FILENAME
-$CHMOD 0444 $VOLID_FILENAME
-$CHOWN root:root $VOLID_FILENAME
+echo $VOLSETID > $VOLSETID_FILENAME
+chmod 0444 $VOLSETID_FILENAME
+chown root:root $VOLSETID_FILENAME
 
 # create the file marking the image type (e.g. .autoinstall or .livecd)
 $TOUCH $IMG_TYPE_MARKER_FILE
 
 # create ./.cdrom directory
-$MKDIR .cdrom
-$CHMOD 0755 .cdrom
+mkdir .cdrom
+chmod 0755 .cdrom
 
 # create a symlink in the boot archive to the opt directory in the misc archive
-$LN -s /mnt/misc/opt opt
+ln -s /mnt/misc/opt opt
 
 #
 # Additional /var /etc setup. A bunch of files in /var and /etc
@@ -363,7 +354,7 @@
 $FIND * > ${TMP_DIR}/boot_archive_filelist
 
 # /mnt/misc will contain pkg_image area /etc and /var contents
-($CD $PKG_IMG_PATH; $FIND etc var) > ${TMP_DIR}/mlst
+(cd $PKG_IMG_PATH; $FIND etc var) > ${TMP_DIR}/mlst
 create_sym_links ${TMP_DIR}/mlst  ${TMP_DIR}/boot_archive_filelist "/mnt/misc"
 
 exit 0
--- a/usr/src/cmd/distro_const/utils/create_iso	Mon Apr 26 08:02:59 2010 -0700
+++ b/usr/src/cmd/distro_const/utils/create_iso	Tue Apr 27 10:58:04 2010 +0400
@@ -19,8 +19,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
 # =============================================================================
@@ -50,7 +49,7 @@
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 if [ "$#" != "5" ] ; then
-	print -u2 "$0: Requires 5 args:"
+	print -u2 -f "%s: Requires 5 args:\n" "$0"
 	print -u2 "    Reader socket, pkg_image area, tmp dir,"
 	print -u2 "    boot archive build area, media area."
 	exit 1
@@ -59,46 +58,57 @@
 MFEST_SOCKET=$1
 PKG_IMG_PATH=$2
 if [ ! -d $PKG_IMG_PATH ] ; then
-	print -u2 "$0: Unable to access pkg_image area $PKG_IMG_PATH"
+	print -u2 -f "%s: Unable to access pkg_image area %s\n" \
+	    "$0" "$PKG_IMG_PATH"
         exit 1
 fi
 
 BA_BUILD=$4
 if [ ! -d $BA_BUILD ] ; then
-	print -u2 "$0: Unable to access bootroot directory $BA_BUILD"
+	print -u2 -f "%s: Unable to access bootroot directory %s\n" \
+	    "$0" "$BA_BUILD"
         exit 1
 fi
 
 MEDIA_DIR=$5
 if [ ! -d $MEDIA_DIR ] ; then
-	print -u2 "$0: Unable to access media directory $MEDIA_DIR"
+	print -u2 -f "%s: Unable to access media directory %s\n" \
+	    "$0" "$MEDIA_DIR"
 	exit 1
 fi
 
+builtin rm
+
 # Define a few commands.
-CAT=/usr/bin/cat
 MKISOFS=/usr/bin/mkisofs
-RM=/usr/bin/rm
 
 # Non core-OS commands.
 MANIFEST_READ=/usr/bin/ManifestRead
 
-DISTRO_NAME=`$MANIFEST_READ $MFEST_SOCKET "name"`
+DISTRO_NAME=$($MANIFEST_READ $MFEST_SOCKET "name")
 
-# Note: The maximum volumeid length is restricted to 32 characters
-VOLUMEID=$($CAT $BA_BUILD/.volumeid)
+# The maximum volumeid length is restricted to 32 characters
+if [ "${#DISTRO_NAME}" -gt 32 ]; then
+	print -u2 -f "%s: Volume ID string \"%s\" is too long\n" \
+	    "$0" "$DISTRO_NAME"
+	exit 1
+fi
+		
+VOLSETID=$( < "$BA_BUILD/.volsetid" )
 
 DIST_ISO=${MEDIA_DIR}/${DISTRO_NAME}.iso
 
 print "Making final ISO image"
 
-$RM -f "$DIST_ISO"
+rm -f "$DIST_ISO"
 
-if [ `uname -m` == "i86pc" ] ; then
+PLATFORM=$(uname -m)
+
+if [[ "${PLATFORM}" == "i86pc" ]] ; then
 	$MKISOFS -o "$DIST_ISO" -b boot/grub/stage2_eltorito -c .catalog \
 	    -no-emul-boot -boot-load-size 4 -boot-info-table -N -l -R -U \
-	    -allow-multidot -no-iso-translate -cache-inodes -d -D -V \
-	    "$VOLUMEID" "$PKG_IMG_PATH"
+	    -allow-multidot -no-iso-translate -cache-inodes -d -D -volset \
+	    "$VOLSETID" -V "$DISTRO_NAME" "$PKG_IMG_PATH"
 else
 	# 
 	# First create the hsfs bootblock
@@ -106,19 +116,20 @@
 	# the bootblock. The hsfs bootblock starts at offset
 	# 512.
 	#
-	/usr/bin/dd if="${BA_BUILD}/platform/`uname -m`/lib/fs/hsfs/bootblk" \
+	/usr/bin/dd if="${BA_BUILD}/platform/${PLATFORM}/lib/fs/hsfs/bootblk" \
 	    of="${PKG_IMG_PATH}/boot/hsfs.bootblock" \
 	    bs=1b oseek=1 count=15 conv=sync 2> /dev/null
 	if [ "$?" != "0" ] ; then
-		print -u2 "$0: hsfs.bootblock creation failed"
+		print -u2 -f "%s: hsfs.bootblock creation failed\n" "$0"
 		exit 1
 	fi
 	$MKISOFS -o "$DIST_ISO" -G "${PKG_IMG_PATH}/boot/hsfs.bootblock" \
-	    -B ... -N -l -ldots -R -D -V "$VOLUMEID" "$PKG_IMG_PATH"
+	    -B ... -N -l -ldots -R -D -volset "$VOLSETID" -V \
+	    "$DISTRO_NAME" "$PKG_IMG_PATH"
 fi
 
 if [ "$?" != "0" ] ; then
-	print -u2 "$0: mkisofs of $DIST_ISO failed"
+	print -u2 -f "%s: mkisofs of %s failed\n" "$0" "$DIST_ISO"
 	exit 1	
 fi
 
--- a/usr/src/cmd/distro_const/utils/post_boot_archive_pkg_image_mod	Mon Apr 26 08:02:59 2010 -0700
+++ b/usr/src/cmd/distro_const/utils/post_boot_archive_pkg_image_mod	Tue Apr 27 10:58:04 2010 +0400
@@ -19,8 +19,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
 # =============================================================================
@@ -31,16 +30,18 @@
 # =============================================================================
 # =============================================================================
 
+builtin cd
+builtin cp
+builtin cut
+builtin grep
+builtin mkdir
+builtin mv
+builtin rm
+
 # Define a few commands.
-CP=/usr/bin/cp
-CUT=/usr/bin/cut
 ECHO=/usr/bin/echo
-GREP=/usr/bin/grep
 LOFIADM=/usr/sbin/lofiadm
-MKDIR=/usr/bin/mkdir
 MKISOFS=/usr/bin/mkisofs
-MV=/usr/bin/mv
-RM=/usr/bin/rm
 TIME=/usr/bin/time
 
 # Define non-core-OS commands.
@@ -73,7 +74,7 @@
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 if [ "$#" != "6" ] ; then
-	print -u2 "Usage: $0: Requires 6 args:"
+	print -u2 -f "Usage: %s: Requires 6 args:\n" "$0"
 	print -u2 "    Reader socket, pkg_image area, tmp_dir,"
 	print -u2 "    boot archive build area, media area, usr zlib compression algorithm"
 	exit 1
@@ -83,32 +84,34 @@
 
 PKG_IMG_PATH=$2
 if [ ! -d $PKG_IMG_PATH ] ; then
-	print -u2 "$0: Image package area $PKG_IMG_PATH is not valid"
+	print -u2 -f "%s: Image package area %s is not valid\n" \
+	    "$0" "$PKG_IMG_PATH"
 	exit 1
 fi
 
 TMP_DIR=$3
 if [ ! -d $TMP_DIR ] ; then
-	print -u2 "$0: Temporary area $TMP_DIR is not valid"
+	print -u2 -f "%s: Temporary area %s is not valid\n" "$0" "$TMP_DIR"
 	exit 1
 fi
 
 BA_BUILD=$4
 if [ ! -d ${BA_BUILD} ] ; then
-	print -u2 "$0: Boot archive build area $BA_BUILD is not valid"
+	print -u2 -f "%s: Boot archive build area %s is not valid\n" \
+	    "$0" "$BA_BUILD"
 	exit 1
 fi
 
-# Copying volumeid to live CD root		
-$CP ${BA_BUILD}/.volumeid ${PKG_IMG_PATH}
+# Copying volsetid to live CD root		
+cp ${BA_BUILD}/.volsetid ${PKG_IMG_PATH}
 
-USER_ZLIB_KEY=`$ECHO $6 | $CUT -s -d'=' -f1`
+USER_ZLIB_KEY=$($ECHO $6 | cut -s -d'=' -f1)
 if [ "XX${USER_ZLIB_KEY}" != "XXusr_zlib_compression" ] ; then
 	print -u2 "Key to specify usr zlib compression algorithm is not valid."
 	exit 1
 fi
 
-USER_ZLIB_ALG=`$ECHO $6 |$CUT -s -d'=' -f2`
+USER_ZLIB_ALG=$($ECHO $6 | cut -s -d'=' -f2)
 #
 # Just make sure the algorithm is not an empty string.  We will not
 # check to make sure whether it is a valid algorithm or not here.
@@ -121,34 +124,36 @@
 	exit 1
 fi
 
-COMPRESSION_TYPE=`$MANIFEST_READ $MFEST_SOCK \
-    "img_params/live_img_compression/type"`
+COMPRESSION_TYPE=$($MANIFEST_READ $MFEST_SOCK \
+    "img_params/live_img_compression/type")
 if [ "XX${COMPRESSION_TYPE}" = "XX" ] ; then
 	COMPRESSION_TYPE="gzip"
 fi
 
 # Note that DIST_ISO_SORT may or may not exist, given the type of image.
-DIST_ISO_SORT=`$MANIFEST_READ -k $MFEST_SOCK "iso_sort"`
+DIST_ISO_SORT=$($MANIFEST_READ -k $MFEST_SOCK "iso_sort")
 
 # Remove password lock file left around from user actions during
 # package installation; if left in place it becomes a symlink
 # into /mnt/misc which will cause the installer's attempt to
 # create a user account to fail
-$RM ${PKG_IMG_PATH}/etc/.pwd.lock
+rm ${PKG_IMG_PATH}/etc/.pwd.lock
 
 if [ ! -d $PKG_IMG_PATH ] ; then
-	print -u2 "$0: Image package area $PKG_IMG_PATH is not valid"
+	print -u2 -f "%s: Image package area %s is not valid\n" \
+	    "$0" "$PKG_IMG_PATH"
 	exit 1
 fi
 cd $PKG_IMG_PATH
 
 # sbin, kernel and lib are all in the root archive
 print "Removing sbin, kernel and lib from package image area"
-$RM -rf sbin kernel lib
+rm -rf sbin kernel lib
 
 print "Generating usr filesystem image"
 if [ ! -d $PKG_IMG_PATH ] ; then
-	print -u2 "$0: Image package area $PKG_IMG_PATH is not valid"
+	print -u2 -f "%s: Image package area %s is not valid\n" \
+	    "$0" "$PKG_IMG_PATH"
 	exit 1
 fi
 cd $PKG_IMG_PATH
@@ -165,13 +170,13 @@
     -d -D -V "compress" usr
 
 if [ $? -ne 0 ] ; then
-	print -u2 "$0: mkisofs of solaris failed"
+	print -u2 -f "%s: mkisofs of solaris failed\n" "$0"
 	exit 1	
 fi
 
 print "Confirm lofiadm is available in image..."
 if [ ! -f ${PKG_IMG_PATH}${LOFIADM} ] ; then
-	print -u2 "$0: ${PKG_IMG_PATH}${LOFIADM} NOT FOUND"
+	print -u2 -f "%s: %s%s NOT FOUND\n" "$0" "${PKG_IMG_PATH}" "${LOFIADM}"
 	exit 1
 fi
 
@@ -182,44 +187,45 @@
     -C ${USER_ZLIB_ALG} ${PKG_IMG_PATH}/solaris.zlib >/dev/null \
     2>$LOFI_OUT_STR
 if [ $? -ne 0 ] ; then
-	$GREP "invalid algorithm name" $LOFI_OUT_STR
+	grep "invalid algorithm name" $LOFI_OUT_STR
 	if [ $? -eq 0 ] ; then
-		print -u2 "$0: ${USER_ZLIB_ALG} is an invalid lofiadm" \
-		    "algorithm."
+		print -u2 -f "%s: %s is an invalid lofiadm algorithm\n." \
+		    "$0" "${USER_ZLIB_ALG}"
 		print -u2 "Please modify your USER_ZLIB_ALG parameter."
-		$RM $LOFI_OUT_STR
+		rm $LOFI_OUT_STR
 		exit 1
 	fi
-	$RM $LOFI_OUT_STR
-	print -u2 "$0: compression of usr filesystem failed"
+	rm $LOFI_OUT_STR
+	print -u2 -f "%s: compression of usr filesystem failed\n" "$0"
 	exit 1	
 fi
-$RM $LOFI_OUT_STR
+rm $LOFI_OUT_STR
 
 print "Generating misc filesystem image"
 if [ ! -d $PKG_IMG_PATH ] ; then
-	print -u2 "$0: Image package area $PKG_IMG_PATH is not valid"
+	print -u2 -f "%s: Image package area %s is not valid\n" \
+	    "$0" "$PKG_IMG_PATH"
 	exit 1
 fi
 cd $PKG_IMG_PATH
-$MKDIR miscdirs
-$MV opt miscdirs
-$MV etc miscdirs
-$MV var miscdirs
+mkdir miscdirs
+mv opt miscdirs
+mv etc miscdirs
+mv var miscdirs
 $MKISOFS -o solarismisc.zlib -N -l -R -U -allow-multidot \
     -no-iso-translate \
     -quiet -cache-inodes -d -D -V "compress" miscdirs
 if [ "$?" != "0" ] ; then
-	print -u2 "$0: mkisofs of solarismisc failed"
+	print -u2 -f "%s: mkisofs of solarismisc failed\n" "$0"
 	exit 1	
 fi
-$RM -rf miscdirs
+rm -rf miscdirs
 
 print "Compressing misc filesystem image using compression algorithm: ${COMPRESSION_TYPE}"
 LD_LIBRARY_PATH=${PKG_IMG_PATH}/usr/lib $TIME ${PKG_IMG_PATH}${LOFIADM} \
     -C $COMPRESSION_TYPE ${PKG_IMG_PATH}/solarismisc.zlib >/dev/null 2>&1
 if [ "$?" != "0" ] ; then
-	print -u2 "$0: compression of solarismisc failed"
+	print -u2 -f "%s: compression of solarismisc failed\n" "$0"
 	exit 1	
 fi
 
@@ -227,6 +233,6 @@
 # Delay rm of usr because lofiadm is used from usr to compress
 # solaris, pkg, and solarismisc
 #
-$RM -rf ${PKG_IMG_PATH}/usr
+rm -rf ${PKG_IMG_PATH}/usr
 
 exit 0
--- a/usr/src/cmd/distro_const/vmc/prepare_ai_image	Mon Apr 26 08:02:59 2010 -0700
+++ b/usr/src/cmd/distro_const/vmc/prepare_ai_image	Tue Apr 27 10:58:04 2010 +0400
@@ -22,8 +22,7 @@
 #
 
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
 #
@@ -82,7 +81,6 @@
 		#
 		sleep 5 
 		/usr/sbin/umount ${MNT_ISO}
-		/usr/sbin/umount ${MNT_MROOT}
 
 		if [[ ${lofi_dev} != "" ]] ; then
 			/usr/sbin/lofiadm -d ${lofi_dev}
@@ -92,8 +90,7 @@
 			/usr/sbin/lofiadm -d ${lofi_dev_mroot}
 		fi
 
-		rm -rf ${TMP_DIR}/menu.lst_$$ ${TMP_ISO} ${MNT_ISO} \
-		    ${SCRATCH} ${MNT_MROOT}
+		rm -rf ${TMP_DIR}/menu.lst_$$ ${TMP_ISO} ${MNT_ISO}
 
 	} > /dev/null 2>&1
 
@@ -147,9 +144,11 @@
 #######################################################################
 
 builtin cat
+builtin cut
 builtin chmod
 builtin cp
 builtin fgrep
+builtin grep
 builtin mkdir
 builtin mv
 builtin pwd
@@ -211,8 +210,6 @@
 #
 typeset -r  START_CWD=$(pwd)
 typeset -r  MNT_ISO="${TMP_DIR}/mnt_iso_$$" # mount for the ISO
-typeset -r  MNT_MROOT="${TMP_DIR}/mnt_mroot_$$" # mount for the microroot
-typeset -r  SCRATCH="${TMP_DIR}/tmp_mroot_$$"
 typeset -r  TMP_ISO="${TMP_DIR}/tmp_iso_$$"
 
 #
@@ -232,6 +229,7 @@
 set +o errexit
 
 typeset vol_id=""
+typeset vol_set_id=""
 typeset lofi_dev=""
 typeset lofi_dev_mroot=""
 typeset -i cmd_stat=0
@@ -242,7 +240,7 @@
 # ignoring any possible errors.
 #
 {
-	rm -rf ${VMC_NEW_ISO} ${MNT_ISO} ${MNT_MROOT} ${TMP_ISO} ${SCRATCH}
+	rm -rf ${VMC_NEW_ISO} ${MNT_ISO} ${TMP_ISO}
 } > /dev/null 2>&1
 
 #
@@ -252,18 +250,10 @@
 cmd_stat=$?
 vmc_error_handler ${cmd_stat} "\nFailed to make directory: ${MNT_ISO}"
 
-mkdir ${MNT_MROOT}
-cmd_stat=$?
-vmc_error_handler ${cmd_stat} "\nFailed to make directory: ${MNT_MROOT}"
-
 mkdir ${TMP_ISO}
 cmd_stat=$?
 vmc_error_handler ${cmd_stat} "\nFailed to make directory: ${TMP_ISO}"
 
-mkdir ${SCRATCH}
-cmd_stat=$?
-vmc_error_handler ${cmd_stat} "\nFailed to make directory: ${SCRATCH}"
-
 #
 # lofiadm/mount the ISO for read-only access
 #
@@ -330,39 +320,22 @@
 print -u1 "\n"
 
 #
-# The value stored in /.volumeid, found in the microroot, needs
-# to be specified on the mkisofs command so the volume ID on
-# the mew ISO this script generates matches the one on the
-# original ISO. 
+# The Volume ID and Volume set ID values needs to be specified on 
+# the mkisofs command so the volume ID and volume set ID on the new 
+# ISO this script generates matches them on the original ISO. 
 #
-if [[ -f ${MNT_ISO}/platform/i86pc/boot_archive ]] ; then
-	cp ${MNT_ISO}/platform/i86pc/boot_archive ${SCRATCH}/boot_archive.gz
-	/usr/bin/gunzip ${SCRATCH}/boot_archive.gz
-	cmd_stat=$?
-        vmc_error_handler ${cmd_stat} \
-	    "\ngunzip ${SCRATCH}/boot_archive failed"
-
-	lofi_dev_mroot=$(/usr/sbin/lofiadm -a ${SCRATCH}/boot_archive)
-	cmd_stat=$?
-        vmc_error_handler ${cmd_stat} \
-	    "\nWarning: lofiadm -a ${SCRATCH}/boot_archive failed"
-
-	mount -F ufs -o nologging ${lofi_dev_mroot} ${MNT_MROOT}
-	cmd_stat=$?
-	vmc_error_handler ${cmd_stat}  "\nWarning: failed to mount microroot"
-else
-	vmc_error_handler 1 "\nWarning: microroot not found"
+vol_id=$(/usr/sbin/fstyp -v ${lofi_dev} | grep "Volume id:" | \
+    cut -f2 -d: | /usr/bin/sed 's/^ *//;s/ *$//')
+if [[ ${vol_id} == "" ]] ; then
+        vmc_error_handler 1 \
+	    "\nWarning: unable to identify the volume ID of the original ISO"
 fi
 
-#
-# The vol_id this script writes has to match the one written to the image
-# when it was created. This is usually: automated_installer_image, but
-# it could be different.
-#
-vol_id=$(cat ${MNT_MROOT}/.volumeid)
-if [[ ${vol_id} == "" ]] ; then
-	vmc_error_handler 1 \
-	    "\nWarning: unable to identify the volume ID of the original ISO"
+vol_set_id=$(/usr/sbin/fstyp -v ${lofi_dev} | grep "Volume set id:" | \
+    cut -f2 -d: | /usr/bin/sed 's/^ *//;s/ *$//')
+if [[ ${vol_set_id} == "" ]] ; then
+        vmc_error_handler 1 \
+	    "\nWarning: unable to identify the volume set ID of the original ISO"
 fi
 
 #
@@ -384,7 +357,7 @@
 mkisofs -o "${VMC_NEW_ISO}" -b boot/grub/stage2_eltorito -c .catalog \
     -no-emul-boot -boot-load-size 4 -boot-info-table -N -l -R -U \
     -allow-multidot -no-iso-translate -cache-inodes -d -D \
-    -V "${vol_id}" "${TMP_ISO}"
+    -volset "${vol_set_id}" -V "${vol_id}" "${TMP_ISO}"
 cmd_stat=$?
 vmc_error_handler ${cmd_stat} "\nWarning: failed to create the ISO"
 
--- a/usr/src/cmd/slim-install/svc/media-fs-root	Mon Apr 26 08:02:59 2010 -0700
+++ b/usr/src/cmd/slim-install/svc/media-fs-root	Tue Apr 27 10:58:04 2010 +0400
@@ -30,6 +30,9 @@
 # Make sure that the libraries essential to this stage of booting can be found.
 LD_LIBRARY_PATH=/lib; export LD_LIBRARY_PATH
 
+builtin grep
+builtin rm
+
 #
 # Set flags to indicate whether we are in LiveCD, AI or text installer
 # environment
@@ -43,9 +46,7 @@
 
 PRTCONF=/usr/sbin/prtconf
 SED=/usr/bin/sed
-CAT=/usr/bin/cat
 CUT=/usr/bin/cut
-GREP=/usr/bin/grep
 MOUNT=/sbin/mount
 
 # compressed archives
@@ -56,7 +57,7 @@
 . /lib/svc/share/smf_include.sh
 . /lib/svc/share/fs_include.sh
 
-volumeid=`cat /.volumeid`
+volsetid=$( < "/.volsetid" )
 
 if [ $LIVECD = 1 ]; then
 	echo "\rPreparing live image for use" >/dev/msglog
@@ -75,7 +76,7 @@
 	/usr/lib/fs/ufs/fstyp $rdev 2>&1 | grep "^ufs$"
 	if [ $? -eq 0 ]; then
 		$MOUNT -F ufs -o nologging,noatime $dev /.cdrom || break
-		if [ "$volumeid" != "$($CAT /.cdrom/.volumeid)" ]; then
+		if [[ "$volsetid" != "$( < "/.cdrom/.volsetid" )" ]]; then
 			/sbin/umount -f $dev
 			continue
 		fi
@@ -98,7 +99,7 @@
 	# the same CD drive as the one we're booting from.
 	# 
 	/usr/lib/fs/hsfs/fstyp -v $rdev 2>&1 | \
-	    grep "Volume id: $volumeid" > /dev/null
+	    grep "Volume set id: $volsetid" > /dev/null
 	if [ $? -eq 0 ]; then
 		$MOUNT -F hsfs -o ro $dev /.cdrom || break
 	fi
@@ -166,7 +167,7 @@
 #
 /usr/sbin/devfsadm -I -P
 
-[ -f /etc/.dynamic_routing ] && /usr/bin/rm -f /etc/.dynamic_routing
+[ -f /etc/.dynamic_routing ] && rm -f /etc/.dynamic_routing
 
 #
 # Set up the optimized libc mounts
@@ -203,7 +204,7 @@
 #
 apply_platform_profile
 
-/usr/bin/rm -f /etc/svc/repository-boot*
+rm -f /etc/svc/repository-boot*
 
 # Mount opt
 /usr/sbin/mount -F lofs /mnt/misc/opt /opt
--- a/usr/src/lib/libict_pymod/ict.py	Mon Apr 26 08:02:59 2010 -0700
+++ b/usr/src/lib/libict_pymod/ict.py	Tue Apr 27 10:58:04 2010 +0400
@@ -19,8 +19,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 '''Install Completion Tasks (ICT)
 
@@ -2351,7 +2350,7 @@
         # Cleanup the files and directories that were copied into
         # the basedir directory that are not needed by the installed OS.
         file_cleanup_list = [ "/.livecd",
-                              "/.volumeid",
+                              "/.volsetid",
                               "/.textinstall",
                               "/etc/sysconfig/language",
                               "/.liveusb" ]