changeset 13692:05fa76d16740

2675 EOF itutools Reviewed by: Richard Lowe <richlowe@richlowe.net> Reviewed by: Milan Jurik <milan.jurik@xylab.cz> Reviewed by: Garrett D'Amore <garrett@damore.org> Reviewed by: Andrew Stormont <Andrew.Stormont@nexenta.com> Approved by: Eric Schrock <Eric.Schrock@delphix.com>
author Alexander Eremin <a.eremin@nexenta.com>
date Mon, 14 May 2012 12:16:08 -0700
parents e1aca0f20bff
children b236aca9d46b
files usr/src/cmd/boot/scripts/root_archive.ksh usr/src/cmd/itutools/Makefile usr/src/cmd/itutools/itu.ksh usr/src/cmd/itutools/mkbootmedia.ksh usr/src/cmd/itutools/pkg2du.ksh usr/src/cmd/itutools/updatemedia.ksh usr/src/man/man1m/Makefile usr/src/man/man1m/itu.1m usr/src/man/man1m/mkbootmedia.1m usr/src/man/man1m/pkg2du.1m usr/src/man/man1m/root_archive.1m usr/src/man/man1m/updatemedia.1m usr/src/pkg/manifests/SUNWcs.man1m.inc usr/src/pkg/manifests/SUNWcs.mf
diffstat 14 files changed, 10 insertions(+), 3865 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/boot/scripts/root_archive.ksh	Mon May 14 12:05:00 2012 -0700
+++ b/usr/src/cmd/boot/scripts/root_archive.ksh	Mon May 14 12:16:08 2012 -0700
@@ -23,6 +23,7 @@
 # Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2012 Nexenta Systems, Inc. All rights reserved.
 
 # utility to pack and unpack a boot/root archive
 # both ufs and hsfs (iso9660) format archives are unpacked
@@ -30,23 +31,15 @@
 #
 # usage: pack   <archive> <root>
 #        unpack <archive> <root>
-#        packmedia   <solaris_image> <root>
-#        unpackmedia <solaris_image> <root>
 #
 #   Where <root> is the directory to unpack to and will be cleaned out
 #   if it exists.
 #
-#   In the case of (un)packmedia, the image is packed or unpacked to/from
-#   Solaris media and all the things that don't go into the ramdisk image
-#   are (un)cpio'd as well
-#
 
 usage()
 {
 	printf "usage: root_archive pack <archive> <root>\n"
 	printf "       root_archive unpack <archive> <root>\n"
-	printf "       root_archive packmedia   <solaris_image> <root>\n"
-	printf "       root_archive unpackmedia <solaris_image> <root>\n"
 	exit 1
 }
 
@@ -65,559 +58,6 @@
 	rm -f /tmp/flist$$
 }
 
-preload_Gnome()
-{
-	MEDIA="$1"
-	MINIROOT="$2"
-
-	
-	(
-		# Prepopulate the gconf database. This needs to be done and
-		# done first for several reasons. 1) Archiving out the gnome
-		# libraries and binaries causes the gconftool-2 to not run
-		# appropriately at boot time. 2) The binaries and libraries
-		# needed to run this are big and thus we want to archive
-		# them separately. 3) Having schemas prepopluated in the
-		# miniroot means faster boot times.
-		#
-
-		cd "$MINIROOT"
-		HOME="./tmp/root"
-		export HOME
-		umask 0022
-		mumble=.tmp_proto/root/etc/gconf/gconf.xml.defaults
-		GCONF_CONFIG_SOURCE="xml:merged:$MINIROOT/$mumble"
-		export GCONF_CONFIG_SOURCE
-		SCHEMADIR="$MINIROOT/.tmp_proto/root/etc/gconf/schemas"
-		export SCHEMADIR
-		/usr/bin/gconftool-2 --makefile-install-rule \
-		    $SCHEMADIR/*.schemas >/dev/null 2>&1
-		echo '
-		xml:readwrite:/tmp/root/.gconf
-		xml:readonly:/etc/gconf/gconf.xml.defaults
-		' > /"$MINIROOT"/.tmp_proto/root/etc/gconf/2/path
-	)
-}
-
-archive_Gnome()
-{
-	MEDIA="$1"
-	MINIROOT="$2"
-
-	RELEASE=`/bin/ls -d "$MEDIA/Solaris_"*`
-	RELEASE=`basename "$RELEASE"`
-	CPIO_DIR="$MEDIA/$RELEASE/Tools/Boot"
-
-	# Create the gnome archive
-	#
-	(
-		# usr/share gnome stuff
-		cd "$MINIROOT"
-		find usr/share/GConf usr/share/application-registry \
-		    usr/share/autostart usr/share/dtds \
-		    usr/share/emacs usr/share/gnome usr/share/gnome-2.0 \
-		    usr/share/gnome-background-properties \
-		    usr/share/gtk-engines usr/share/gui-install \
-		    usr/share/icon-naming-utils usr/share/control-center \
-		    usr/share/icons usr/share/locale usr/share/metacity \
-		    usr/share/mime usr/share/mime-info usr/share/pixmaps \
-		    usr/share/scrollkeeper usr/share/sgml usr/share/themes \
-		    usr/share/xml \
-		    -print > /tmp/gnome_share.$$ 2>/dev/null
-
-		if [ ! -f /tmp/gnome_share.$$ ] ; then
-			echo "/tmp/gnome_share.$$ file list not found."
-			return
-		fi
-
-		# usr/lib gnome stuff
-
-		find usr/lib/libgnome*\.so\.* \
-		    usr/lib/libgst*\.so\.* usr/lib/libgconf*\.so\.* \
-		    usr/lib/libgdk*\.so\.* usr/lib/libgtk*\.so\.* \
-		    usr/lib/libglade*\.so\.* usr/lib/libmetacity*\.so\.* \
-		    usr/lib/libfontconfig*\.so\.* usr/lib/libgmodule*\.so\.* \
-		    usr/lib/libgobject*\.so\.* usr/lib/libgthread*\.so\.* \
-		    usr/lib/libpopt*\.so\.* usr/lib/libstartup*\.so\.* \
-		    usr/lib/libexif*\.so\.* usr/lib/libtiff*\.so\.* \
-		    usr/lib/libstartup*\.so\.* \
-		    usr/lib/libexif*\.so\.* usr/lib/libORBit*\.so\.* \
-	 	    usr/lib/libmlib*\.so\.* usr/lib/libxsl*\.so\.* \
-		    usr/lib/libpango*\.so\.* usr/lib/libpng*\.so\.* \
-		    usr/lib/liboil*\.so\.* usr/lib/libbonobo*\.so\.* \
-		    usr/lib/libart*\.so\.* usr/lib/libcairo*\.so\.* \
-		    usr/lib/libjpeg*\.so\.* \
-		    usr/lib/libpolkit*\.so\.* \
-			-print | egrep -v '\.so\.[0]$' > \
-		       /tmp/gnome_lib.$$ 2>/dev/null
-
-		find usr/lib/nautilus usr/lib/pango usr/lib/iconv \
-		    usr/lib/metacity-dialog usr/lib/window-manager-settings \
-		    usr/lib/bonobo-2.0 usr/lib/bononbo usr/lib/gtk-2.0 \
-		    usr/lib/GConf usr/lib/bonobo-activation-server \
-		    usr/lib/python2.4 usr/lib/gstreamer-0.10 \
-		    usr/lib/gconf-sanity-check-2 usr/lib/gconfd \
-		    usr/lib/gnome-vfs-2.0 usr/lib/dbus-daemon \
-		    usr/lib/gnome-vfs-daemon usr/lib/gnome-settings-daemon \
-		    usr/lib/gnome_segv2 usr/lib/orbit-2.0 \
-		    usr/lib/libmlib \
-		    print > /tmp/gnome_libdir.$$ 2>/dev/null
-
-		if [ ! -f /tmp/gnome_lib.$$  -a ! -f gnome_libdir.$$ ] ; then
-			echo "/tmp/gnome_lib.$$ file list not found."
-			return
-		fi
-
-		# /usr/sfw gnome stuff
-		find usr/sfw/bin usr/sfw/include usr/sfw/share usr/sfw/src \
-		    -print > /tmp/gnome_sfw.$$ 2>/dev/null
-
-		if [ ! -f /tmp/gnome_sfw.$$ ] ; then
-			echo "/tmp/gnome_sfw.$$ file list not found."
-			return
-		fi
-
-		# gnome app binaries usr/bin
-		find usr/bin/gnome* usr/bin/gui-install usr/bin/bonobo* \
-		    usr/bin/gtk-* usr/bin/fax* usr/bin/gdk* usr/bin/gif2tiff \
-		    usr/bin/install-lan \
-		    usr/bin/metacity* usr/bin/gst-* usr/bin/gconftool-2 \
-		    usr/bin/pango* usr/bin/desktop* usr/bin/djpeg \
-		    usr/bin/notify-send usr/bin/oil-bugreport \
-		    usr/bin/bmp2tiff usr/bin/thembus-theme-applier \
-		    usr/bin/thumbnail usr/lib/update-* \
-		    usr/bin/ras2tiff usr/bin/raw2tiff usr/bin/rdjpgcom \
-		    usr/bin/thumbnail usr/bin/dbus* \
-		    usr/bin/tiff* usr/bin/rgb2ycbcr \
-		    usr/bin/fc-cache usr/bin/fc-list \
-			-print > /tmp/gnome_bin.$$ 2>/dev/null
-
-		if [ ! -f /tmp/gnome_bin.$$ ] ; then
-			echo "/tmp/gnome_bin.$$ file list not found."
-			return
-		fi
-
-		# Cat all the files together and create the gnome archive
-		#
-
-		cat /tmp/gnome_libdir.$$ /tmp/gnome_lib.$$ \
-		     /tmp/gnome_share.$$ /tmp/gnome_sfw.$$ /tmp/gnome_bin.$$ \
-		    > /tmp/gnome.$$
-
-		if [ ! -f /tmp/gnome.$$ ] ; then
-			echo "/tmp/gnome.$$ file not found."
-			return
-		fi
-		# Save off this file in the miniroot for use later
-		# when unpacking. Clean up old cruft if there.
-		#
-
-		if [ -f .tmp_proto/gnome_saved ]; then
-			rm -f .tmp_proto/gnome_saved
-		fi
-
-		cp /tmp/gnome.$$ .tmp_proto/gnome_saved
-
-		# Create gnome archive
-		#
-
-		cpio -ocmPuB < /tmp/gnome.$$ 2>/dev/null | bzip2 > \
-		    "$CPIO_DIR/gnome.cpio.bz2"
-
-		# Remove files from miniroot that are in archive.
-		# Create symlinks for files in archive
-		
-		rm -rf `cat /tmp/gnome_share.$$`
-
-		for i in `cat /tmp/gnome_share.$$`
-		do
-			ln -s /tmp/root/$i $i 2>/dev/null
-		done
-
-		rm -rf `cat /tmp/gnome_lib.$$`
-		for i in `cat /tmp/gnome_lib.$$`
-		do	
-			ln -s /tmp/root/$i $i 2>/dev/null
-		done
-
-		rm -rf `cat /tmp/gnome_libdir.$$`
-		for i in `cat /tmp/gnome_libdir.$$`
-		do
-			ln -s /tmp/root/$i $i 2>/dev/null
-		done
-
-		rm -rf `cat /tmp/gnome_sfw.$$`
-		for i in `cat /tmp/gnome_sfw.$$`
-		do
-			ln -s /tmp/root/$i $i 2>/dev/null
-		done
-
-		rm -rf `cat /tmp/gnome_bin.$$`
-		for i in `cat /tmp/gnome_bin.$$`
-		do
-			ln -s /tmp/root/$i $i 2>/dev/null
-		done
-		rm -f /tmp/gnome_share.$$
-		rm -f /tmp/gnome_lib.$$
-		rm -f /tmp/gnome_libdir.$$
-		rm -f /tmp/gnome_bin.$$
-	)
-}
-
-archive_JavaGUI()
-{
-	MEDIA="$1"
-	MINIROOT="$2"
-
-	RELEASE=`/bin/ls -d "$MEDIA/Solaris_"*`
-	RELEASE=`basename "$RELEASE"`
-
-	CPIO_DIR="$MEDIA/$RELEASE/Tools/Boot"
-	
-	# Archive the java wizard components that are only used in the
-	# non developer express path.
-	#
-	(
-		# path is usr/lib/install/data
-		cd "$MINIROOT"
-		find usr/lib/install/data/wizards \
-		    -print > /tmp/java_ui.$$ 2>/dev/null
-
-		if [ ! -f /tmp/java_ui.$$ ] ; then
-			echo "/tmp/java_ui.$$ file list not found."
-			return
-		fi
-
-		cpio -ocmPuB < /tmp/java_ui.$$ 2>/dev/null | bzip2 > \
-		    "$CPIO_DIR/javaui.cpio.bz2"
-
-		rm -rf `cat /tmp/java_ui.$$`
-		ln -s /tmp/root/usr/lib/install/data/wizards \
-		    usr/lib/install/data/wizards 2>/dev/null
-
-		rm -f /tmp/java_ui.$$
-	
-	)
-}
-
-archive_Misc()
-{
-	MEDIA="$1"
-	MINIROOT="$2"
-
-	RELEASE=`/bin/ls -d "$MEDIA/Solaris_"*`
-	RELEASE=`basename "$RELEASE"`
-
-	CPIO_DIR="$MEDIA/$RELEASE/Tools/Boot"
-
-	# Archive misc stuff that is needed by non devex installer
-	#
-	(
-		# usr/lib stuff
-		cd "$MINIROOT"
-		find usr/lib/lp -print > /tmp/lp.$$ 2>/dev/null
-		if [ ! -f /tmp/lp.$$ ] ; then
-			echo "/tmp/lp.$$ file list not found."
-			return
-		fi
-
-		cpio -ocmPuB < /tmp/lp.$$ 2>/dev/null | bzip2 > \
-		    "$CPIO_DIR/lpmisc.cpio.bz2"
-
-		rm -rf `cat /tmp/lp.$$`
-		ln -s /tmp/root/usr/lib/lp usr/lib/lp 2>/dev/null
-		
-		rm -f /tmp/lp.$$
-	)
-
-}
-
-archive_Perl()
-{
-	MEDIA="$1"
-	MINIROOT="$2"
-
-	RELEASE=`/bin/ls -d "$MEDIA/Solaris_"*`
-	RELEASE=`basename "$RELEASE"`
-
-	CPIO_DIR="$MEDIA/$RELEASE/Tools/Boot"
-
-	# Archive perl, it is only needed by gnome gui.
-	#
-	(
-		# in usr
-		cd "$MINIROOT"
-		find usr/perl5 -print > /tmp/perl.$$ 2>/dev/null
-
-		if [ ! -f /tmp/perl.$$ ] ; then
-			echo "/tmp/perl.$$ file list not found."
-			return
-		fi
-		cpio -ocmPuB < /tmp/perl.$$ 2>/dev/null | bzip2 > \
-		    "$CPIO_DIR/perl.cpio.bz2"
-
-		rm -rf `cat /tmp/perl.$$` 2>/dev/null
-		ln -s /tmp/root/usr/perl5 usr/perl5 2>/dev/null
-
-		rm -f /tmp/perl.$$
-	)
-}
-archive_X()
-{
-	MEDIA="$1"
-	MINIROOT="$2"
-
-	RELEASE=`/bin/ls -d "$MEDIA/Solaris_"*`
-	RELEASE=`basename "$RELEASE"`
-
-	CPIO_DIR="$MEDIA/$RELEASE/Tools/Boot"
-
-	# create the graphics and non-graphics X archive
-	#
-	(
-		cd "$MINIROOT"
-		find usr/openwin usr/dt usr/X11 -print 2> /dev/null |\
-		    cpio -ocmPuB 2> /dev/null | bzip2 > "$CPIO_DIR/X.cpio.bz2"
-
-		find usr/openwin/bin/mkfontdir \
-		     usr/openwin/lib/installalias \
-		     usr/openwin/server/lib/libfont.so.1 \
-		     usr/openwin/server/lib/libtypesclr.so.0 \
-			 -print | cpio -ocmPuB 2> /dev/null | bzip2 > \
-			 "$CPIO_DIR/X_small.cpio.bz2"
-
-		rm -rf usr/dt usr/openwin usr/X11
-		ln -s /tmp/root/usr/dt usr/dt
-		ln -s /tmp/root/usr/openwin usr/openwin
-		ln -s /tmp/root/usr/X11 usr/X11
-	)
-}
-
-archive_lu()
-{
-	MEDIA="$1"
-	MINIROOT="$2"
-
-	RELEASE=`/bin/ls -d "$MEDIA/Solaris_"*`
-	RELEASE=`basename "$RELEASE"`
-
-	CPIO_DIR="$MEDIA/$RELEASE/Tools/Boot"
-
-	(
-		cd "$MINIROOT"
-		find usr/lib/install usr/snadm usr/sbin usr/lib/locale \
-		    boot/grub boot/solaris/bootenv.rc \
-		    tmp/root/boot/grub tmp/root/boot/solaris/bootenv.rc \
-		    2> /dev/null | cpio -ocmPuB 2> /dev/null | bzip2 \
-		    > "$CPIO_DIR"/lu.cpio.bz2
-		ls platform > "$CPIO_DIR/lu.platforms"
-	)
-}
-
-cleanout_pkgdata()
-{
-	rm -Rf tmp/root/var/sadm/install tmp/root/var/sadm/pkg
-}
-
-packmedia()
-{
-	MEDIA="$1"
-	MINIROOT="$2"
-
-	RELEASE=`/bin/ls -d "$MEDIA/Solaris_"*`
-	RELEASE=`basename "$RELEASE"`
-	ARCHIVES="X X_small perl lpmisc javaui gnome"
-
-	mkdir -p "$MEDIA/$RELEASE/Tools/Boot"
-
-	if [ -d "$MINIROOT/platform/i86pc" ] ; then
-		mkdir -p "$MEDIA/boot/amd64"
-		mkdir -p "$MEDIA/boot/platform/i86pc/kernel"
-		mkdir -p "$MEDIA/boot/platform/i86pc/kernel/amd64"
-		mkdir -p "$MEDIA/boot/platform/i86xpv/kernel"
-		mkdir -p "$MEDIA/boot/platform/i86xpv/kernel/amd64"
-		cp "$MINIROOT/platform/i86pc/multiboot" "$MEDIA/boot"
-		cp "$MINIROOT/platform/i86pc/kernel/unix" \
-		    "$MEDIA/boot/platform/i86pc/kernel/unix"
-		cp "$MINIROOT/platform/i86pc/kernel/amd64/unix" \
-		    "$MEDIA/boot/platform/i86pc/kernel/amd64/unix"
-		cp "$MINIROOT/platform/i86xpv/kernel/unix" \
-		    "$MEDIA/boot/platform/i86xpv/kernel/unix"
-		cp "$MINIROOT/platform/i86xpv/kernel/amd64/unix" \
-		    "$MEDIA/boot/platform/i86xpv/kernel/amd64/unix"
-		(
-			cd "$MEDIA/$RELEASE/Tools/Boot"
-			ln -sf ../../../boot/x86.miniroot
-			ln -sf ../../../boot/multiboot
-			ln -sf ../../../boot/platform/i86pc/kernel/unix
-			ln -sf ../../../boot/platform/i86pc/kernel/amd64/unix
-			ln -sf ../../../boot/platform/i86xpv/kernel/unix
-			ln -sf ../../../boot/platform/i86xpv/kernel/amd64/unix
-			ln -sf ../../../boot/grub/pxegrub
-		)
-	fi
-
-	if [ -d "$MINIROOT/platform/sun4u" ] ; then
-		mkdir -p "$MEDIA/boot"
-		dd if="$MINIROOT/platform/sun4u/lib/fs/hsfs/bootblk" \
-		    of="$MEDIA/boot/hsfs.bootblock" \
-		    bs=1b oseek=1 count=15 conv=sync 2> /dev/null
-	fi
-
-	for arch in sun4u sun4v ; do
-		if [ -d "$MINIROOT/platform/$arch" ] ; then
-			archdir="$MEDIA/$RELEASE/Tools/Boot/platform/$arch"
-			mkdir -p $archdir
-			ln -sf ../../../../../boot/sparc.miniroot \
-			    "$archdir/boot_archive"
-			cp "$MINIROOT/usr/platform/$arch/lib/fs/nfs/inetboot" \
-			    "$archdir"
-			cp "$MINIROOT/platform/$arch/wanboot" \
-			    "$archdir"
-			mkdir -p "$MEDIA/platform/$arch"
-			ln -sf ../../boot/sparc.miniroot \
-			    "$MEDIA/platform/$arch/boot_archive"
-			ln -sf ../../$RELEASE/Tools/Boot/platform/$arch/wanboot \
-			    "$MEDIA/platform/$arch/wanboot"
-		fi
-	done
-
-	# archive package databases to conserve memory
-	#
-	(
-		cd "$MINIROOT"
-		find tmp/root/var/sadm/install tmp/root/var/sadm/pkg -print | \
-		    cpio -ocmPuB 2> /dev/null | bzip2 > \
-		    "$MEDIA/$RELEASE/Tools/Boot/pkg_db.cpio.bz2"
-
-		cleanout_pkgdata
-	)
-
-	archive_lu "$MEDIA" "$MINIROOT"
-
-	archive_X "$MEDIA" "$MINIROOT"
-
-	# Take out the gnome and java parts of the installer from
-	# the miniroot. These are not required to boot the system
-	# and start the installers.
-
-	if [ -d "$MINIROOT/platform/i86pc" ] ; then
-		preload_Gnome "$MEDIA" "$MINIROOT"
-		archive_Gnome "$MEDIA" "$MINIROOT"
-		archive_JavaGUI "$MEDIA" "$MINIROOT"
-		archive_Misc "$MEDIA" "$MINIROOT"
-		archive_Perl "$MEDIA" "$MINIROOT"
-		pack "$MEDIA/boot/amd64/x86.miniroot"
-
-        	# Now that the 64-bit archives & miniroot have been created,
-        	# restore the files from archives and save the 64-bit
-        	# archives. Strip the 64-bit objects and create the
-		# 32-bit archives and miniroot
-
-		unpackmedia "$MEDIA" "$MINIROOT"
-		cleanout_pkgdata
-		mkdir -p "$MEDIA/$RELEASE/Tools/Boot/amd64"
-		for i in $ARCHIVES; do
-			mv "$MEDIA/$RELEASE/Tools/Boot/${i}.cpio.bz2" \
-				"$MEDIA/$RELEASE/Tools/Boot/amd64"
-		done
-		if [ -z "$STRIP_AMD64" ]; then
-			strip_amd64
-		fi
-
-		archive_X "$MEDIA" "$MINIROOT"
-		archive_Gnome "$MEDIA" "$MINIROOT"
-		archive_JavaGUI "$MEDIA" "$MINIROOT"
-		archive_Perl "$MEDIA" "$MINIROOT"
-		archive_Misc "$MEDIA" "$MINIROOT"
-	fi
-
-	# copy the install menu to menu.lst so we have a menu
-	# on the install media
-	#
-	if [ -f "$MINIROOT/boot/grub/install_menu" ] ; then
-		cp $MINIROOT/boot/grub/install_menu \
-		    $MEDIA/boot/grub/menu.lst
-	fi
-
-	#
-	# jumpstart utilities in usr/sbin/install.d
-	#
-	if [ -d "$MINIROOT/usr/sbin/install.d" ] ; then
-		(
-		cd ${MINIROOT}
-		find usr/sbin/install.d/chkprobe \
-		    -print | cpio -ocmPuB 2> /dev/null | bzip2 > \
-		    ${MEDIA}/${RELEASE}/Tools/Boot/usr_sbin_install_d.cpio.bz2
-		)
-	fi
-}
-
-unarchive_X()
-{
-	MEDIA="$1"
-	UNPACKED_ROOT="$2"
-
-	RELEASE=`/bin/ls -d "$MEDIA/Solaris_"*`
-	RELEASE=`basename "$RELEASE"`
-
-	CPIO_DIR="$MEDIA/$RELEASE/Tools/Boot"
-
-	# unpack X
-	#
-	(
-		cd "$UNPACKED_ROOT"
-		rm -rf usr/dt usr/openwin usr/X11
-		bzcat "$CPIO_DIR/X.cpio.bz2" | cpio -icdmu 2> /dev/null
-	)
-}
-
-unpackmedia()
-{
-	MEDIA="$1"
-	UNPACKED_ROOT="$2"
-
-	RELEASE=`/bin/ls -d "$MEDIA/Solaris_"*`
-	RELEASE=`basename "$RELEASE"`
-
-	unarchive_X "$MEDIA" "$UNPACKED_ROOT"
-
-	# unpack package databases
-	#
-	(
-		cd "$UNPACKED_ROOT"
-		bzcat "$MEDIA/$RELEASE/Tools/Boot/pkg_db.cpio.bz2" |
-		    cpio -icdmu 2> /dev/null
-
-		if [ -d "$MINIROOT/platform/i86pc" ] ; then
-
-			# unpack gnome, perl, java and misc
-			# Remove symlinks left from unpacking x86.miniroot
-			# so that unpacking subsequent archives will populate
-			# appropriately.
-			#
-			rm -rf usr/perl5
-			rm -rf usr/lib/install/data/wizards
-			rm -rf usr/lib/lp
-
-			# Gnome list saved off from packmedia
-			for i in `cat .tmp_proto/gnome_saved`
-			do
-				rm -rf $i
-			done
-			
-			bzcat "$MEDIA/$RELEASE/Tools/Boot/gnome.cpio.bz2" |
-			    cpio -icdmu 2>/dev/null
-			bzcat "$MEDIA/$RELEASE/Tools/Boot/javaui.cpio.bz2" |
-			    cpio -icdmu 2>/dev/null
-			bzcat "$MEDIA/$RELEASE/Tools/Boot/lpmisc.cpio.bz2" |
-			    cpio -icdmu 2>/dev/null
-			bzcat "$MEDIA/$RELEASE/Tools/Boot/perl.cpio.bz2" |
-			    cpio -icdmu 2>/dev/null
-		fi
-	)
-}
-
 do_unpack()
 {
 	(
@@ -883,14 +323,11 @@
 	UNPACKED_ROOT="$BASE/$UNPACKED_ROOT"
 fi
 
-
-MEDIA="$MR"
-
 trap cleanup EXIT
 
 # always unpack into a fresh root
 case $1 in
-	unpack|unpackmedia)
+	unpack)
 		rm -rf "$UNPACKED_ROOT"
 		mkdir -p "$UNPACKED_ROOT"
 		;;
@@ -898,24 +335,6 @@
 [ -d "$UNPACKED_ROOT" ] || usage
 
 case $1 in
-	packmedia)
-		packmedia "$MEDIA" "$UNPACKED_ROOT"
-		if [ -d "$UNPACKED_ROOT/kernel/drv/sparcv9" ] ; then
-			pack "$MEDIA/boot/sparc.miniroot"
-		else
-			pack "$MEDIA/boot/x86.miniroot"
-		fi
-
-		;;
-	unpackmedia)
-		if [ -f "$MEDIA/boot/sparc.miniroot" ] ; then
-			unpack "$MEDIA/boot/sparc.miniroot"
-		else
-			unpack "$MEDIA/boot/x86.miniroot"
-			unpack "$MEDIA/boot/amd64/x86.miniroot"
-		fi
-		unpackmedia "$MEDIA" "$UNPACKED_ROOT"
-		;;
 	pack)	pack "$MR"
 		;;
 	unpack)	unpack "$MR"
--- a/usr/src/cmd/itutools/Makefile	Mon May 14 12:05:00 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-include $(SRC)/Makefile.master
-include $(SRC)/cmd/Makefile.cmd
-
-
-.KEEP_STATE:
-.SUFFIXES: .ksh
-
-
-SCRIPTS  =	mkbootmedia.ksh
-SCRIPTS +=	updatemedia.ksh
-SCRIPTS +=	pkg2du.ksh
-SCRIPTS +=	itu.ksh
-ROOTUSR=	$(ROOT)/usr
-ROOTUSRBIN=	$(ROOTUSR)/bin
-
-POFILES=	$(SCRIPTS:%.ksh=%.po)
-POFILE=		ituutils.po
-PROGS=		$(SCRIPTS:%.ksh=%)
-XGETFLAGS=	-a
-
-all: $(PROGS) FRC
-
-clean: FRC
-	$(RM) $(PROGS) $(POFILE) $(POFILES)
-
-clobber: clean
-
-msg _msg: $(POFILE) FRC
-
-FRC:
-
-
-# Default rule for building ksh scripts.
-.ksh:
-	$(RM) $@
-	cat $< > $@
-	chmod +x $@
-
-# we use the $SRC/Makefile.master sed script to generate the messages catalogs
-$(POFILE): $(POFILES)
-	$(RM) $@
-	cat $(POFILES) > $@
-
-
-# installation rules
-$(ROOTUSR):
-	$(INS.dir)
-
-$(ROOTUSRBIN):	$(ROOTUSR)
-	$(INS.dir)
-
-$(ROOTUSRBIN)/%: %
-	$(INS.file)
-
-install: all \
-	$(ROOTUSRBIN)/itu \
-	$(ROOTUSRBIN)/mkbootmedia \
-	$(ROOTUSRBIN)/updatemedia \
-	$(ROOTUSRBIN)/pkg2du
-
-
-include ../Makefile.targ
--- a/usr/src/cmd/itutools/itu.ksh	Mon May 14 12:05:00 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1245 +0,0 @@
-#!/bin/ksh93 -p
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-#
-# itu - converts packages to Driver Update format and patches Solaris install
-#	media for Install Time Update (ITU).
-#
-
-readonly PROG=$0
-readonly ORIGPWD=$PWD
-
-# Must-have utilities
-readonly CPIO=/usr/bin/cpio
-readonly GZIP=/usr/bin/gzip
-readonly MKISOFS=/usr/bin/mkisofs
-readonly PATCHADD=/usr/sbin/patchadd
-readonly PKGTRANS=/usr/bin/pkgtrans
-readonly PKGADD=/usr/sbin/pkgadd
-readonly LOFIADM=/usr/sbin/lofiadm
-readonly MKDIR=/usr/bin/mkdir
-readonly RM=/usr/bin/rm
-readonly CP=/usr/bin/cp
-readonly HEAD=/usr/bin/head
-readonly SORT=/usr/bin/sort
-readonly MKBOOTMEDIA=/usr/bin/mkbootmedia
-readonly PKG2DU=/usr/bin/pkg2du
-readonly TOUCH=/usr/bin/touch
-readonly NAWK=/usr/bin/nawk
-readonly CHMOD=/usr/bin/chmod
-readonly GREP=/usr/bin/grep
-readonly LS=/usr/bin/ls
-readonly LN=/usr/bin/ln
-readonly SED=/usr/bin/sed
-readonly CAT=/usr/bin/cat
-readonly FIND=/usr/bin/find
-readonly UNAME=/usr/bin/uname
-readonly MACH=`$UNAME -p`
-
-ROOT_ARCHIVE=/usr/sbin/root_archive
-BOOTBLOCK=
-MINIROOT=
-# Relative to a Solaris media root.
-if [ "$MACH" = "sparc" ]; then
-	BOOTBLOCK=boot/hsfs.bootblock
-	MINIROOT=$MEDIA_ROOT/boot/sparc.miniroot
-else
-	# x86/x64
-	BOOTBLOCK=boot/grub/stage2_eltorito
-	MINIROOT=$MEDIA_ROOT/boot/x86.miniroot
-fi
-
-readonly TMP_DIR=${TMPDIR:-/tmp}/${PROG##*/}.$$
-readonly LOGFILE=${TMPDIR:-/tmp}/${PROG##*/}-log.$$
-
-# Paths we need.
-export PATH=/usr/bin:/usr/sbin:/sbin:/boot/solaris/bin:$PATH
-
-# for gettext
-TEXTDOMAIN=SUNW_OST_OSCMD
-export TEXTDOMAIN
-
-
-function cleanup
-{
-	$RM -rf "$TMP_DIR"
-}
-
-
-function usage_long
-{
-	usage_short
-	print -u2
-	usage_options
-}
-
-
-function usage_short
-{
-	gettext "Usage:\n"
-	gettext "${PROG##*/} makedu -r solaris_release [-v] [-f] [-d output_dir]\n        [-o iso_file] [-l iso_label] package [package ...]\n"
-	gettext "${PROG##*/} patchmedia -R media_root [-v] [-f]\n        [-o iso_file] [-l iso_label] pkg_or_patch [pkg_or_patch ...]\n"
-	gettext "${PROG##*/} makeiso -o iso_file [-v] [-f] [-l iso_label] media_root\n"
-}
-
-
-function usage_options {
-	gettext "Options:\n"
-	gettext "  -d output_dir\n        Directory where the Driver Update directory should be created.\n"
-	gettext "  -f\n        If output_dir/DU or iso_file already exists, remove it without\n        asking first.\n"
-	gettext "  -l iso_label\n        Label/volume name of the ISO image (if -o option is specified).\n"
-	gettext "  -o iso_file\n        Path of ISO image file to create. For
-	subcommands patchmedia and\n        makeiso this will be a bootable ISO image.\n        This option must be specified for subcommand makeiso.\n"
-	gettext "  -R media_root\n        Top-level directory of on-disk image of Solaris installation media.\n        This option must be specified for subcommand patchmedia.\n"
-	gettext "  -r solaris_release\n        Solaris release number for which the Driver Update is intended.\n        It takes the form of 5.10.\n        This option must be specified for subcommand makedu.\n"
-	gettext "  -v\n        Verbose. Multiple -v options increase verbosity.\n"
-
-	echo;
-}
-
-
-#
-# Process command line options.
-# Note: since $OPTIND is a local variable inside functions, upon return
-#	from this function global variable $MYOPTIND is set to this value.
-#
-function process_options # <arg> ...
-{
-	typeset opt optlist
-
-	case "$SUBCOMMAND" in
-	makedu)		optlist='d:fl:o:r:v' ;;
-	patchmedia)	optlist='fl:o:R:v' ;;
-	makeiso)	optlist='fl:o:v' ;;
-	esac
-
-	while getopts ":$optlist" opt
-	do
-		case $opt in
-		d)	DU_OUTDIR=$OPTARG
-			;;
-		f)	FORCE=1
-			;;
-		l)	ISOLABEL=$OPTARG
-			;;
-		o)	ISO=$OPTARG
-			if [ ! -z `echo $ISO | $GREP "^/tmp"` ]; then
-				gettext "ISO images will not be created on /tmp.\n"
-				gettext "Please choose a different output location.\n"
-			    exit 3
-			fi
-			;;
-		R)	MEDIA_ROOT=$OPTARG
-			;;
-		r)	RELEASE=$OPTARG
-			;;
-		v)	(( VERBOSE_LEVEL += 1 ))
-			VERBOSE_OPTS="${VERBOSE_OPTS:--}$opt" # collect options
-			;;
-		:)	gettext "Option -$OPTARG missing argument.\n"
-			usage_short
-			return 1
-			;;
-		*)	gettext "Option -$OPTARG invalid for $SUBCOMMAND.\n"
-			usage_short
-			return 1
-			;;
-		esac
-	done
-
-	MYOPTIND=$OPTIND
-	return 0
-}
-
-
-#
-# Check some prerequisites
-#
-function check_prereqs
-{
-	typeset utils f
-
-	# List of must-have utilities depends on subcommand.
-	case "$SUBCOMMAND" in
-	makedu)
-		set -A utils $GZIP ${ISO:+$MKISOFS} $PKGTRANS
-		;;
-	patchmedia)
-		set -A utils $CPIO $GZIP ${ISO:+$MKISOFS} $PATCHADD \
-			$ROOT_ARCHIVE
-		;;
-	makeiso)
-		set -A utils $MKISOFS
-		;;
-	esac
-
-	for f in "${utils[@]}"
-	do
-		if [[ ! -x "$f" ]]
-		then
-			gettext "Can't find required utility $f.\n"
-			return 1
-		fi
-	done
-
-	# Subcommand packmedia uses the "root_archive unpack_media" command
-	# which calls lofiadm -a, which requires write access as
-	# determined by /dev/lofictl.  See lofiadm(1m).
-	if [[ $SUBCOMMAND = patchmedia && ! -w /dev/lofictl ]]
-	then
-		gettext "You don't have enough privileges to run lofiadm -a.\n"
-		gettext "See lofiadm(1m) for more information.\n"
-		return 1
-	fi
-
-	return 0
-}
-
-
-#
-# Verifies the given packages and collects them in the PACKAGES array.
-#
-function collect_packages # <arg> ...
-{
-	typeset obj
-
-	for obj in "$@"
-	do
-		if [[ ! -e "$obj" ]]
-		then
-			gettext "Can't find package $obj.\n"
-			return 1
-		elif [[ ! -f "$obj/pkginfo" ]]
-		then
-			gettext "$obj is not a package.\n"
-			return 1
-		fi
-		PACKAGES[ ${#PACKAGES[*]} ]=$obj
-	done
-	return 0
-}
-
-
-#
-# Verifies the given packages and patches.  Packages are then collected in
-# the array PACKAGES.  Patches are stored in the PATCHES array.
-#
-function collect_packages_patches # <arg> ...
-{
-	typeset obj
-
-	for obj in "$@"
-	do
-		if [[ -f "$obj/patchinfo" ]]
-		then
-			# Collect patches.
-			PATCHES[ ${#PATCHES[*]} ]=$obj
-		elif [[ -f "$obj/pkginfo" ]]
-		then
-			# Collect packages.
-			PACKAGES[ ${#PACKAGES[*]} ]=$obj
-		elif [[ -e "$obj" ]]
-		then
-			gettext "$obj is not a package or patch.\n"
-			return 1
-		else
-			gettext "$obj does not exist.\n"
-			return 1
-		fi
-	done
-	return 0
-}
-
-
-#
-# Ask user whether to overwrite an object, unless -f option was given.
-#
-function is_overwrite
-{
-	typeset arg=$1
-	typeset -l ans
-
-	(( FORCE )) && return 0
-	while true
-	do
-		gettext "$arg already exists. Overwrite it? (y/n) "
-		read ans
-		case $ans in
-		y*|Y*) return 0 ;;		# go ahead, overwrite
-		n*|N*) return 1 ;;		# don't overwrite
-		esac
-	done
-}
-
-
-#
-# Check the format of the Solaris release number $RELEASE.
-# Also set $VERSION (for DU format) based on $RELEASE.
-#
-function check_release
-{
-	# Allow Major.Minor or Major.Minor.Micro format.
-	if [[ $RELEASE != +([0-9]).+([0-9])?(.+([0-9])) ]]
-	then
-		gettext "Invalid release number specified: $RELEASE.\n"
-		return 1
-	fi
-
-	# As defined by the ITU spec, a Solaris release number 5.x corresponds
-	# to version number 2x (e.g. 5.10 -> 210). Hopefully, by the time we
-	# do a 6.x Release we won't need ITUs any more.
-	VERSION=$(echo $RELEASE | $SED 's/5\./2/')
-}
-
-
-#
-# If an ISO file was specified, get realpath of its parent directory ($ISODIR).
-# If the ISO file already exists, ask user to overwrite it, unless -f option
-# was specified.
-#
-function check_iso
-{
-	if [[ "$ISO" = */* ]]
-	then
-		ISODIR=$(cd "${ISO%/*}" 2>/dev/null && pwd -P)
-		if (( $? ))
-		then
-			gettext "Can't access parent directory of ISO image.\n"
-			return 1
-		fi
-	else
-		ISODIR=$(pwd -P)
-	fi
-
-	if [[ -f "$ISO" ]]
-	then
-		is_overwrite "$ISO" || return 2
-		$RM -f "$ISO"
-	fi
-
-	return 0
-}
-
-
-#
-# If specified, check the Driver Update output directory $DU_OUTDIR (-d option).
-# Else set $DU_OUTDIR to a temporary directory.  Also if $DU_OUTDIR/DU
-# already exists, ask user whether to overwrite it, unless -f option was given.
-#
-function check_dudir
-{
-	typeset	realpath
-
-	if [[ -z "$DU_OUTDIR" ]]
-	then
-		DU_OUTDIR=$TMP_DIR/dudir
-		return 0
-	fi
-
-	# Verify user-specified DU output directory.
-	if [[ ! -d "$DU_OUTDIR" ]]
-	then
-		if [ `$MKDIR -p $DU_OUTDIR` ]; then
-			gettext "$DU_OUTDIR is not a directory.\n"
-			return 1
-		fi
-	elif [[ ! -w "$DU_OUTDIR" ]]
-	then
-		gettext "Directory $DU_OUTDIR is not writable.\n"
-		return 1
-	fi
-
-	# If an ISO image path is also specified, make sure it's not under
-	# $DU_OUTDIR since we might take the ISO image of $DU_OUTDIR.
-	if [[ -n "$ISODIR" ]]
-	then
-		realpath=$(cd "$DU_OUTDIR" 2>/dev/null && pwd -P)
-		if [[ "$ISODIR" = "$realpath"?(/*) ]]
-		then
-			gettext "ISO image must not be under Driver Update's output directory ($realpath).\n"
-			return 1
-		fi
-	fi
-
-	# If the DU directory already exists, ask user permission to
-	# remove it unless -f option was given.
-	if [[ -d "$DU_OUTDIR/DU" ]]
-	then
-		is_overwrite "$DU_OUTDIR/DU" || return 2
-		$RM -rf "$DU_OUTDIR/DU" || return 1
-	fi
-
-	return 0
-}
-
-
-#
-# Verify $MEDIA_ROOT is indeed a Solaris install media.
-#
-function check_media_root
-{
-	if [[ ! -d $(echo "$MEDIA_ROOT"/Solaris*/Tools/Boot) ]]
-	then
-		gettext "$MEDIA_ROOT is not a Solaris install media.\n"
-		return 1
-	fi
-	return 0
-}
-
-
-#
-# Verify there's a miniroot file under $MEDIA_ROOT.  Also set $MINIROOT
-# to the path of the miniroot.
-#
-function check_miniroot
-{
-	MINIROOT=$MEDIA_ROOT/boot/x86.miniroot
-	if [[ ! -f "$MINIROOT" ]]
-	then
-		return 0 
-	fi
-	MINIROOT=$MEDIA_ROOT/boot/sparc.miniroot
-	if [[ ! -f "$MINIROOT" ]]
-	then
-		return 0 
-	fi
-	gettext "Can't find $MEDIA_ROOT/boot/x86.miniroot or $MEDIA_ROOT/boot/sparc.miniroot.\n"
-	return 1 
-}
-
-
-#
-# Create a non-bootable ISO image of the given directory.
-#
-function create_nonboot_iso # <dir>
-{
-	typeset dir vflag i
-
-	if (( $# != 1 ))
-	then
-		gettext "create_nonboot_iso missing argument.\n"
-		return 1
-	fi
-	dir=$1
-
-	# Skip if no ISO image was specified.
-	[[ -z "$ISO" ]] && return 0
-
-	# Determine mkisofs' verbose flag depending on $VERBOSE_LEVEL.
-	case $VERBOSE_LEVEL in
-	0)	vflag=-quiet
-		;;
-	1)	vflag=				# mkisofs' default verboseness
-		;;
-	*)	vflag=
-		i=$VERBOSE_LEVEL
-		while ((i > 0))
-		do
-			vflag="-v $vflag"
-			(( i -= 1 ))
-		done
-		;;
-	esac
-
-	print "Creating ISO image ..."
-
-	# Note: the "-log-file >(cat -u >&2)" and "2>/dev/null" below is a
-	#	trick to filter out mkisofs's warning message about being
-	#	non-conforming to ISO-9660.
-	# We do some funky architecture-specific stuff here so that we can
-	# actually create a bootable media image for UltraSPARC systems
-
-	sparc_ISOARGS="-B ... -joliet-long -U"
-	i386_ISOARGS="-d -N -r -relaxed-filenames"
-	if [[ "$MACH" = "i386" ]]
-	then
-		ISOARGS=$i386_ISOARGS
-	else
-		ISOARGS=$sparc_ISOARGS
-	fi
-	
-	$MKISOFS -o "$ISO" \
-		-allow-leading-dots \
-		$ISOARGS \
-		-l -ldots \
-		-R -J \
-		-V "$ISOLABEL" \
-		$vflag \
-		-log-file >(cat -u >&2) \
-		"$dir" 2>/dev/null
-}
-
-
-#
-# Create a bootable Solaris ISO image of the given Solaris install directory.
-#
-function create_bootable_iso # <dir>
-{
-	typeset dir vflag saved i
-
-	if (( $# != 1 ))
-	then
-		gettext "create_bootable_iso missing argument.\n"
-		return 1
-	fi
-	dir=$1
-
-	# Skip if no ISO image was specified.
-	[[ -z "$ISO" ]] && return 0
-
-	# Determine mkisofs' verbose flag depending on $VERBOSE_LEVEL.
-	case $VERBOSE_LEVEL in
-	0)	vflag=-quiet
-		;;
-	1)	vflag=				# mkisofs' default verboseness
-		;;
-	*)	vflag=
-		i=$VERBOSE_LEVEL
-		while ((i > 0))
-		do
-			vflag="-v $vflag"
-			(( i -= 1 ))
-		done
-		;;
-	esac
-
-	# Verify the boot block exists under media root. If it does,	
-	# verify it's writable since it will be modified with some boot
-	# information by mkisofs' -boot-info-table option.
-	if [[ ! -f "$dir/$BOOTBLOCK" ]]
-	then
-		gettext "Can't find $dir/$BOOTBLOCK.\n"
-		return 1
-	elif [[ ! -w "$dir/$BOOTBLOCK" ]]	
-	then
-		gettext "$dir/$BOOTBLOCK is not writable.\n"	
-		return 1
-	fi
-
-	gettext "Creating bootable ISO image ..."
-
-	# Since mkisofs below will modify the file $BOOTBLOCK in-place, save
-	# a copy of it first.
-	saved=$TMP_DIR/${BOOTBLOCK##*/}
-	$CP -f "$dir/$BOOTBLOCK" "$saved" || return
-
-	# Note: the "-log-file >(cat -u >&2)" and "2>/dev/null" below is a
-	#	trick to filter out mkisofs's warning message about being
-	#	non-conforming to ISO-9660.
-	# We do some funky architecture-specific stuff here so that we can
-	# actually create a bootable media image for UltraSPARC systems
-	sparc_ISOARGS="-G $BOOTBLOCK -B ... -joliet-long -U"
-	i386_ISOARGS="-b boot/grub/stage2_eltorito -boot-info-table "
-	i386_ISOARGS="$i386_ISOARGS -boot-load-size 4 -c .catalog -d -N "
-	i386_ISOARGS="$i386_ISOARGS -no-emul-boot -r -relaxed-filenames"
-	if [[ "$MACH" = "i386" ]]
-	then
-		ISOARGS=$i386_ISOARGS
-	else
-		ISOARGS=$sparc_ISOARGS
-	fi
-
-	cd $dir
-	$MKISOFS -o "$ISO" \
-		-allow-leading-dots \
-		$ISOARGS \
-		-l -ldots \
-		-R -J \
-		-V "$ISOLABEL" \
-		$vflag \
-		-log-file >(cat -u >&2) \
-		"$dir" 2>/dev/null
-	i=$?
-
-	# Restore saved El Torito file
-	$CP -f "$saved" "$dir/$ELTORITO" 2>/dev/null
-
-	return $i
-}
-
-
-#
-# Create a Driver Update (DU) format directory from packages
-#
-function create_du
-{
-	typeset distdir tmpdudir pkgs obj statusfile
-
-	# Create DU directory first.
-	distdir=$DU_OUTDIR/DU/sol_$VERSION/$MACH
-	$MKDIR -p "$distdir/Tools" "$distdir/Product"
-
-	echo "start create DU with MACH $MACH"
-
-	# If we're running this script on sun4[vu], then create a symlink
-	# to the other UltraSPARC architecture
-	if [[ "$MACH" != "i386" ]]
-	then
-		cd $DU_OUTDIR/DU/sol_$VERSION
-		$LN -s sparc sun4v
-		$LN -s sparc sun4u
-	else
-		cd $DU_OUTDIR/DU/sol_$VERSION
-		$LN -s i386 i86pc
-	fi		
-
-	# Unfortunately pkgtrans insists that all packages must be in
-	# <device1> (see pkgtrans(1)).  The packages can't have any path
-	# components.  So we'll create a temporary directory first and then
-	# symlinks to the specified packages.  Then run pkgtrans with
-	# the temporary directory as <device1>.
-	tmpdudir=$TMP_DIR/create_du
-	$RM -rf "$tmpdudir"
-	$MKDIR -p "$tmpdudir"
-
-	for obj in "${PACKAGES[@]}"
-	do
-		# Get rid of trailing /'s, if any.
-		[[ "$obj" == */ ]] && obj=${obj%%+(/)}
-
-		# Make sure it's full pathname.
-		[[ "$obj" != /* ]] && obj=$ORIGPWD/$obj
-
-		ln -s "$obj" "$tmpdudir" || return
-
-		# Remember just the file component.
-		pkgs[ ${#pkgs[*]} ]=${obj##*/}
-	done
-
-	# Package up packages as compressed data stream.
-	statusfile=$TMP_DIR/.pkgtrans.status
-	(
-		# Use fd 9 for redirecting pkgtrans' "Transferring..."
-		# messages which normally go to stderr to current stdout
-		# (not the following pipeline's stdout).
-		exec 9>&1
-		{
-			$PKGTRANS -s "$tmpdudir" /dev/stdout "${pkgs[@]}" 2>&9
-			echo $? > $statusfile
-			$TOUCH $statusfile	# make sure file is created
-		} | $GZIP -9 > "$distdir/Product/pkgs.gz"
-	)
-
-	[[ -s $statusfile && $(<$statusfile) != 0 ]] && return 1
-
-	# Create admin file for pkgadd
-	$CAT > "$distdir/Tools/admin" <<"EOF"
-mail=
-instance=overwrite
-partial=nocheck
-runlevel=nocheck
-idepend=nocheck
-rdepend=nocheck
-space=nocheck
-setuid=nocheck
-conflict=nocheck
-action=nocheck
-EOF
-
-	# Create install.sh
-	$CAT > "$distdir/Tools/install.sh" <<"EOF"
-#!/sbin/sh
-# install.sh -R <basedir> - install packages to basedir
-basedir=/
-toolsdir=`dirname $0`
-tmpfile=/tmp/`basename $0`.$$
-gzip=/usr/bin/gzip
-while getopts "R:" arg
-do
-        case "$arg" in
-                R) basedir=$OPTARG;;
-        esac
-done
-
-# /etc/driver_aliases ,/etc/driver_classes
-# /etc/name_to_major /etc/minor_perm
-# The four file can't append due to ACL defect.
-# workaround this by mv and cp
-
-/usr/bin/touch /etc/driver_aliases
-if [ $? -ne 0 ] ; then
-        /bin/cp /etc/driver_aliases /tmp/driver_aliases
-        /bin/mv /etc/driver_aliases /tmp/driver_aliases.bak
-        /bin/mv /tmp/driver_aliases /etc
-fi
-/usr/bin/touch /etc/driver_classes
-if [ $? -ne 0 ] ; then
-        /bin/cp /etc/driver_classes /tmp/driver_classes
-        /bin/mv /etc/driver_classes /tmp/driver_classes.bak
-        /bin/mv /tmp/driver_classes /etc
-fi
-/usr/bin/touch /etc/name_to_major
-if [ $? -ne 0 ] ; then
-        /bin/cp /etc/name_to_major /tmp/name_to_major
-        /bin/mv /etc/name_to_major /tmp/name_to_major.bak
-        /bin/mv /tmp/name_to_major /etc
-fi
-/usr/bin/touch /etc/minor_perm
-if [ $? -ne 0 ] ; then
-        /bin/cp /etc/minor_perm /tmp/minor_perm
-        /bin/mv /etc/minor_perm /tmp/minor_perm.bak
-        /bin/mv /tmp/minor_perm /etc
-fi     
-
-# Make sure that we've got our own copy of /usr/bin/gzip
-# in the tools directory 
-
-if [ ! -f $gzip ] ; then
-        gzip=$toolsdir/gzip
-        /usr/bin/chmod a+x "$toolsdir/gzip" 2>/dev/null
-fi
-
-$gzip -c -d "$toolsdir/../Product/pkgs.gz" > $tmpfile &&
-	/usr/sbin/pkgadd -R "$basedir" -d "$tmpfile" -a "$toolsdir/admin" all
-status=$?
-rm -f "$tmpfile"
-exit $status
-EOF
-	$CHMOD a+rx "$distdir/Tools/install.sh"
-
-	$CP -f /usr/bin/gzip "$distdir/Tools" 2>/dev/null
-}
-
-
-#
-# Unpack the miniroot of a Solaris install media.
-#
-function unpack_media
-{
-	# Create temp directory to unpack the miniroot.
-	$MKDIR -p "$UNPACKED_ROOT"
-
-	# We need to use the unpackmedia option to correctly apply patches
-	gettext "Unpacking media ... "
-	$ROOT_ARCHIVE unpackmedia "$MEDIA_ROOT" "$UNPACKED_ROOT" > /dev/null 2>&1 
-	if [ $? != 0 ]; then
-		if [ -d $MEDIA_ROOT/Solaris_10 -a -d $MEDIA_ROOT/Solaris_11 ]; then
-			# we _do_ care, because we're not patching a Solaris
-			# update media instance
-			gettext "There was an error unpacking the media from $MEDIA_ROOT\n"
-			exit 1
-		fi
-	fi
-}
-
-
-#
-# Pack an unpacked miniroot onto a Solaris install media.
-#
-function repack_media
-{
-	gettext "Repacking media ..."
-
-	# We need to ensure that we're using the appropriate version
-	# of root_archive for the media that we're packing/unpacking.
-	# The onnv version of root_archive differs from the S10 version,
-	# and this will cause problems on re-packing. So we sneakily
-	# use the version that we've just unpacked
-	if [ -d $MEDIA_ROOT/Solaris_10 ]; then
-		ROOT_ARCHIVE=$UNPACKED_ROOT/boot/solaris/bin/root_archive
-	fi
-
-	$ROOT_ARCHIVE packmedia "$MEDIA_ROOT" "$UNPACKED_ROOT" > /dev/null 2>&1
-	if [ $? != 0 ]; then
-		if [ -d $MEDIA_ROOT/Solaris_10 -a -d $MEDIA_ROOT/Solaris_11 ]; then
-			# we _do_ care, because we're not patching a Solaris 
-			# update media instance
-			gettext "There was an error packing the media from $MEDIA_ROOT\n"
-			exit 1
-		fi
-	fi
-	gettext "Done.\n"
-}
-
-
-#
-# Add packages to a Solaris install media.  Also install these packages
-# onto the miniroot.
-#
-function add_pkgs
-{
-	typeset icmd statusfile i
-
-	(( ${#PACKAGES[*]} == 0 )) && return
-
-	statusfile=$TMP_DIR/.add_pkgs.status
-
-	DU_OUTDIR=$ITUDIR/$ITU_COUNTDIR
-	(( ITU_COUNTDIR += 1 ))
-	$MKDIR "$DU_OUTDIR" || return
-
-	#
-	# Add a Driver Update directory on the media
-	#
-	echo;
-	gettext "Adding package(s) to media root.\n"
-	create_du || return
-
-	#
-	# Using the Driver Update above install the packages onto the miniroot.
-	#
-	echo;
-	gettext "Installing package(s) onto miniroot.\n"
-	icmd=$DU_OUTDIR/DU/sol_$VERSION/$MACH/Tools/install.sh
-	if [[ ! -f "$icmd" ]]
-	then
-		# This shouldn't happen, but just in case.
-		gettext "Cannot find $icmd.\n"
-		return 1
-	fi
-	[[ ! -x "$icmd" ]] && chmod a+x "$icmd"
-
-	$RM -f "$statusfile"
-        {
-		"$icmd" -R "$UNPACKED_ROOT"
-		if (( i=$? ))
-		then
-			echo $i > "$statusfile"
-			$TOUCH "$statusfile"  # make sure file is created
-		fi
-        } 2>&1 | $NAWK -v logfile="$LOGFILE" -v vlevel=$VERBOSE_LEVEL '
-		# If not verbose, print certain lines from patchadd.
-		(vlevel == 0) && /^Installing/ {print}
-		(vlevel == 0) && /^Installation.*successful/ {print}
-
-		# If verbose, print every line to stderr.
-		(vlevel > 0) {print > "/dev/stderr"}
-
-		# Save every line to logfile.
-		{print >> logfile}
-	' || return
-	[[ -s "$statusfile" ]] && return $(<$statusfile)
-	return 0
-}
-
-
-#
-# Add patches to a Solaris install media.  Also patch the miniroot with
-# these patches
-#
-function add_patches
-{
-	typeset distdir tmpdir icmd obj patches statusfile
-
-	(( ${#PATCHES[*]} == 0 )) && return
-
-	tmpdir=$TMP_DIR/patches
-	statusfile=$TMP_DIR/.add_patches.status
-
-	$RM -rf "$tmpdir"
-
-	distdir=$ITUDIR/$ITU_COUNTDIR/DU/sol_$VERSION/$MACH
-	(( ITU_COUNTDIR += 1 ))
-
-	$MKDIR -p "$distdir/Tools" "$distdir/Product" "$tmpdir" || return
-
-	# If we're running this script on sun4[vu], then create a symlink
-	# to the other UltraSPARC architecture
-	if [[ "$MACH" != "i386" ]]
-	then
-		cd $ITUDIR/$ITU_COUNTDIR/DU/sol_$VERSION
-		$LN -s sparc sun4v
-		$LN -s sparc sun4u
-	else
-		cd $ITUDIR/$ITU_COUNTDIR/DU/sol_$VERSION
-		$LN -s i386 i86pc
-	fi	
-
-	#
-	# Add packages onto media root
-	#
-	echo;
-	gettext "Adding patch(es) to media root.\n"
-
-	# Symlink each patch in a temp dir so a single cpio/gzip can work.
-	for obj in "${PATCHES[@]}"
-	do
-		# Get rid of trailing /'s, if any.
-		[[ "$obj" == */ ]] && obj=${obj%%+(/)}
-
-		# Make sure it's a full pathname.
-		[[ "$obj" != /* ]] && obj=$ORIGPWD/$obj
-
-		$LN -s "$obj" "$tmpdir" || return
-
-		# Remember just the file component.
-		patches[ ${#patches[*]} ]=${obj##*/}
-	done
-
-	# Package up patches as compressed cpio archive.
-	$RM -f "$statusfile"
-	(
-		# Save current stdout as fd 8.  This doesn't point to the
-		# gzip pipeline below.
-		exec 8>&1
-
-		{
-			# Fd 9 is used later on for filtering out cpio's
-			# reporting total blocks to stderr but yet still
-			# print other error messages.  fd 9 refers to the
-			# pipeline to gzip.
-			exec 9>&1
-
-			cd "$tmpdir"
-			for obj in "${patches[@]}"
-			do
-				print -u8 "Transferring patch $obj."
-				$FIND "$obj/." -follow -print
-				if (( i=$? ))
-				then
-					echo $i > "$statusfile"
-					$TOUCH "$statusfile"
-					return $i
-				fi
-			done | $CPIO -oc 2>&1 >&9 | $GREP -v '^[0-9]* blocks' >&2
-		} | $GZIP -9 > "$distdir/Product/patches.gz"
-	) || return
-
-	[[ -s "$statusfile" ]] && return $(<$statusfile)
-
-	# Create install.sh
-	$CAT > "$distdir/Tools/install.sh" <<"EOF"
-#!/sbin/sh
-# install.sh -R <basedir> - install patches to basedir
-basedir=/
-toolsdir=`dirname $0`
-tmpdir=/tmp/`basename $0`.$$
-gzip=/usr/bin/gzip
-trap "/bin/rm -rf $tmpdir" 0
-while getopts "R:" arg
-do
-        case "$arg" in
-                R) basedir=$OPTARG;;
-        esac
-done
-/bin/mkdir -p "$tmpdir" || exit
-tmpfile=$tmpdir/patches
-patchdir=$tmpdir/patchdir
-/bin/mkdir "$patchdir" || exit
-
-# Make sure that we've got our own copy of /usr/bin/gzip
-# in the tools directory 
-
-if [ ! -f $gzip ] ; then
-        gzip=$toolsdir/gzip
-        /usr/bin/chmod a+x "$toolsdir/gzip" 2>/dev/null
-fi
-
-$gzip -c -d "$toolsdir/../Product/patches.gz" > $tmpfile || exit
-cd "$patchdir"
-/bin/cpio -idum < "$tmpfile" || exit
-patchadd -R "$basedir" -nu *
-EOF
-	$CHMOD a+rx "$distdir/Tools/install.sh"
-
-	$CP -f /usr/bin/gzip "$distdir/Tools" 2>/dev/null
-
-	#
-	# Patch the miniroot
-	#
-	echo;
-	gettext "Installing patch(es) onto miniroot.\n"
-	$RM -f "$statusfile"
-	{
-		$PATCHADD -udn -C "$UNPACKED_ROOT" "${PATCHES[@]}"
-		if (( i=$? ))
-		then
-			echo $i > "$statusfile"
-			$TOUCH "$statusfile" # make sure file is created
-		fi
-        } 2>&1 | $NAWK -v logfile="$LOGFILE" -v vlevel=$VERBOSE_LEVEL '
-		# If not verbose, print certain lines from patchadd.
-		(vlevel == 0) && /^Patch.*successful/ {print}
-
-		# If verbose, print every line to stderr.
-		(vlevel > 0) {print > "/dev/stderr"}
-
-		# Save every line to logfile.
-		{print >> logfile}
-	' || return
-
-	[[ -s "$statusfile" ]] && return $(<$statusfile)
-
-	# Remove patch log files to save space when miniroot is repacked.
-	$RM -rf "$UNPACKED_ROOT"/var/sadm/patch
-}
-
-
-#
-# Starting point for makedu subcommand:
-#
-#	Convert packages into Driver Update (DU) directory format.
-#
-function makedu # <arg> ...
-{
-	typeset i
-
-	process_options "$@" || return
-	shift 'MYOPTIND - 1'
-
-	if (( $# == 0 ))
-	then
-		gettext "Please specify one or more packages.\n"
-		usage_short
-		return 1
-	fi
-
-	# Release number must be specified.
-	if [[ -z "$RELEASE" ]]
-	then
-		gettext "Please specify Solaris release number (-r option).\n"
-		usage_short
-		return 1
-	fi
-	check_release || return
-
-	# Either -d or -o option, or both, must be specified.
-	if [[ -z "$DU_OUTDIR" && -z "$ISO" ]]
-	then
-		gettext "Please specify either -d or -o option (or both).\n"
-		usage_short
-		return 1
-	fi
-
-	if [[ -n "$ISO" ]]
-	then
-		check_iso || return
-		${ISOLABEL:=DU sol_$VERSION} 2>/dev/null 		# default ISO label
-	fi
-	check_dudir || return		# should be called after check_iso
-
-	# Rest of arguments must be packages.
-	collect_packages "$@" || return
-
-	check_prereqs || return
-
-	# Create DU and the (non-bootable) ISO image (if requested).
-	create_du && create_nonboot_iso "$DU_OUTDIR"
-	if (( i=$? ))
-	then
-		$RM -rf "$DU_OUTDIR/DU"
-		[[ -n "$ISO" ]] && rm -f "$ISO"
-	else
-		if [[ "$MACH" != "i386" ]]
-		then
-			echo "This DU must be written as either an ISO (hsfs)"
-			echo "or a *ufs* filesystem. DO NOT USE pcfs!"
-		fi
-	fi
-	return $i
-}
-
-
-#
-# Starting point for patchmedia subcommand:
-#
-#	Patch a Solaris install image with the given packages and patches.
-#
-function patchmedia # <arg> ...
-{
-	typeset soldir
-
-	process_options "$@" || return
-	shift 'MYOPTIND - 1'
-
-	if (( $# == 0 ))
-	then
-		gettext "Please specify one or more packages or patches.\n"
-		usage_short
-		return 1
-	fi
-
-	# -R option must be specified
-	if [[ -z "$MEDIA_ROOT" ]]
-	then
-		gettext "Please specify Solaris media root (-R option).\n"
-		usage_short
-		return 1
-	fi
-	check_media_root || return
-
-	# Get the Solaris directory under $MEDIA_ROOT.
-	soldir=$($LS -d $MEDIA_ROOT/Solaris* 2>/dev/null)
-	if [[ -z "$soldir" ]]
-	then
-		gettext "Can't find Solaris directory in $MEDIA_ROOT.\n"
-		return 1
-	fi
-
-	# Extract the Solaris release number from the Solaris_* directory.
-	RELEASE=5.${soldir##*Solaris_}
-	check_release || return
-
-	# If user specifies an ISO image to create.
-	if [[ -n "$ISO" ]]
-	then
-		check_iso || return
-		${ISOLABEL:=${soldir##*/}}		# default ISO label
-	fi
-
-	# Rest of arguments must be packages or patches.
-	collect_packages_patches "$@" || return
-
-	# Verify we have some important utilities we need.
-	check_prereqs || return
-
-	# Verify there's miniroot file in $MEDIA_ROOT.
-	check_miniroot || return
-
-	# Create the ITU directory on the media root, if necessary
-	ITUDIR=$MEDIA_ROOT/ITUs
-	$MKDIR -p "$ITUDIR" || return
-
-	# The ITU directory might contain multiple driver updates already,
-	# each in a separate numbered subdirectory.  So look for the
-	# subdirectory with the highest number and we'll add the packages
-	# and patches on the next one.
-	ITU_COUNTDIR=$($LS -d "$ITUDIR"/+([0-9]) 2>/dev/null |
-		$SED 's;.*/;;' | $SORT -rn | $HEAD -1)
-	if [[ $ITU_COUNTDIR == *( ) ]]	# ITU_COUNTDIR is a typeset -Zn var
-	then
-		ITU_COUNTDIR=0
-	else
-		(( ITU_COUNTDIR += 1 ))
-	fi
-
-	unpack_media || return
-	add_pkgs && add_patches
-	if (( status=$? )) && [[ -s "$LOGFILE" ]]
-	then
-		echo;
-		gettext "A package or patch installation has failed.\n"
-		gettext "Messages from pkgadd and patchadd have been saved in $LOGFILE\n"
-		return $status
-	else
-		rm -f "$LOGFILE"
-	fi
-	print
-	repack_media || return
-	create_bootable_iso "$MEDIA_ROOT"
-	gettext "$MEDIA_ROOT has been successfully patched\n"
-}
-
-
-#
-# Starting point for makeiso subcommand:
-#
-#	Create a bootable ISO image of a Solaris install image.
-#
-function makeiso # <arg> ..
-{
-	process_options "$@" || return
-	shift 'MYOPTIND - 1'
-
-	if (( $# == 0 ))
-	then
-		gettext "Please specify the Solaris media root.\n"
-		usage_short
-		return 1
-	elif (( $# > 1 ))
-	then
-		gettext "Too many arguments supplied.\n"
-		usage_short
-		return 1
-	fi
-	MEDIA_ROOT=$1
-	check_media_root || return
-
-	# ISO image must be specified.
-	if [[ -z "$ISO" ]]
-	then
-		gettext "Please specify ISO image file (-o option).\n"
-		usage_short
-		return 1
-	fi
-	check_iso || return
-
-	# If user doesn't specify ISO label, use the Solaris_* directory name
-	# under $MEDIA_ROOT.
-	if [[ -z "$ISOLABEL" ]]
-	then
-		ISOLABEL=$(echo "$MEDIA_ROOT"/Solaris*)
-		ISOLABEL=${ISOLABEL##*/}
-	fi
-
-	check_prereqs || return
-	create_bootable_iso "$MEDIA_ROOT"
-}
-
-
-#
-# Main
-#
-trap cleanup EXIT
-
-# Numbered subdirectories under ITU directory $ITUDIR.
-typeset -Z3 ITU_COUNTDIR=0
-
-# Where to unpack a miniroot.
-UNPACKED_ROOT=${TMP_DIR}/miniroot
-
-# Reset arrays.
-unset PACKAGES PATCHES
-
-DU_OUTDIR=
-FORCE=0
-ISO=
-ISOLABEL=
-MEDIA_ROOT=
-RELEASE=
-SUBCOMMAND=
-VERBOSE_LEVEL=0
-VERBOSE_OPTS=
-
-if (( $# == 0 ))
-then
-	usage_long
-	return 1
-fi
-typeset -l SUBCOMMAND=$1			# ignore case
-shift
-
-if [[ $SUBCOMMAND != @(makedu|patchmedia|makeiso) ]]
-then
-	# Be nice: allow some subcommands that cry out "help".
-	case "$SUBCOMMAND" in
-	*(-)help|*(-)usage|-h|-\?)
-		usage_long
-		return 0
-		;;
-	*)
-		gettext "Invalid subcommand: $SUBCOMMAND.\n"
-		usage_short
-		return 1
-		;;
-	esac
-fi
-
-$MKDIR -p "$TMP_DIR" || return
-$RM -f "$LOGFILE"
-
-# Run the subcommand.
-$SUBCOMMAND "$@"
--- a/usr/src/cmd/itutools/mkbootmedia.ksh	Mon May 14 12:05:00 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,192 +0,0 @@
-#!/bin/ksh93 -p
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-#
-# mkbootmedia - create bootable Solaris ISO image
-#
-
-readonly PROG=$0
-MKISOFS=/usr/bin/mkisofs
-ELTORITO=boot/grub/stage2_eltorito	# relative to $MEDIA_ROOT
-SPARCBOOT=boot/hsfs.bootblock
-CAT=/usr/bin/cat
-CP=/usr/bin/cp
-RM=/usr/bin/rm
-UNAME=/usr/bin/uname
-MACH=`$UNAME -p`
-BOOTBLOCK=
-GREP=/usr/bin/grep
-
-# for gettext
-TEXTDOMAIN=SUNW_OST_OSCMD
-export TEXTDOMAIN
-
-
-function usage
-{
-	gettext "Usage:\n${PROG##*/} [-v] [-l <label>] <media-root> <iso>\n"
-	gettext "Options:\n  -l <label>\n        Label/volume name of the ISO image.\n"
-	gettext "  -v\n        Verbose.  Multiple -v options increase verbosity.\n"
-	echo;
-}
-
-
-#
-# Main
-#
-LABEL=
-VERBOSITY=0
-
-while getopts ':l:v' opt
-do
-	case $opt in
-	l)	LABEL=$OPTARG
-		;;
-	v)	(( VERBOSITY += 1 ))
-		;;
-	:)	gettext "Option -$OPTARG missing argument.\n"
-		usage
-		exit 1
-		;;
-	*)	gettext "Option -$OPTARG invalid.\n"
-		usage
-		exit 2
-		;;
-	esac
-done
-shift 'OPTIND - 1'
-
-if (( $# != 2 ))
-then
-	usage
-	exit 1
-fi
-
-MEDIA_ROOT=$1
-ISOIMAGE=$2
-
-if [ ! -z `echo $ISOIMAGE | $GREP "^/tmp"` ]; then
-        gettext "ISO images will not be created on /tmp.\nPlease choose a different output location.\n"
-	exit 3
-fi
-
-# Verify $MEDIA_ROOT is a Solaris install media (Solaris 10 Update 1 or later)
-if [[ ! -d $(echo "$MEDIA_ROOT"/Solaris*/Tools/Boot) ]]; then
-	gettext "$MEDIA_ROOT is not Solaris install media.\n"
-	exit 1
-fi
-
-# If no label specified use the Solaris_* version under $MEDIA_ROOT
-if [[ -z "$LABEL" ]]; then
-	LABEL=$(echo "$MEDIA_ROOT"/Solaris*)
-	LABEL=${LABEL##*/}
-fi
-
-# If $ISOIMAGE exists, verify it's writable.
-if [[ -e "$ISOIMAGE" && ! -w "$ISOIMAGE" ]]; then
-	gettext "$ISOIMAGE exists but is not writable.\n"
-	exit 1
-fi
-
-# If we're on an x86/x64 system, we need to have the El Torito file
-# modified with some boot information (-boot-info-table option).
-# If the image isn't writable, we can't continue
-# UltraSPARC systems (sun4u, sun4v etc) don't use El Torito
-if [[ "$MACH" = "i386" && ! -w "$MEDIA_ROOT/$ELTORITO" ]]; then
-	gettext "$MEDIA_ROOT/$ELTORITO is not writable.\n"
-	exit 1
-fi
-
-# Check that we've got mkisofs installed 
-if [[ ! -f "$MKISOFS" || ! -x "$MKISOFS" ]]; then
-    gettext "Cannot find $f\n"
-    exit 1
-fi
-
-
-# Determine mkisofs' verbose flag depending on $VERBOSITY.
-case $VERBOSITY in
-0)	VERBOSE_FLAG=-quiet
-	;;
-1)	VERBOSE_FLAG=			# mkisofs' default verboseness
-	;;
-*)	VERBOSE_FLAG=
-	i=$VERBOSITY
-	while ((i > 0))
-	do
-		VERBOSE_FLAG="-v $VERBOSE_FLAG"
-		(( i -= 1 ))
-	done
-	;;
-esac
-
-# Since mkisofs below will modify the file $ELTORITO in-place, save a copy
-# of it first.  Use trap to restore it when this script exits (including
-# when user hits control-C).
-
-if [[ "$MACH" = "i386" ]]
-then
-	BOOTBLOCK=$MEDIA_ROOT/$ELTORITO
-	ELTORITO_SAVE=/tmp/${ELTORITO##*/}.$$
-	$CP "$MEDIA_ROOT/$ELTORITO" "$ELTORITO_SAVE" || exit 1
-	trap '"$CP" "$ELTORITO_SAVE" "$MEDIA_ROOT/$ELTORITO" 2>/dev/null;
-		"$RM" -f "$ELTORITO_SAVE"' EXIT
-else
-	# sun4u/sun4u1/sun4v et al
-	BOOTBLOCK=$MEDIA_ROOT/$SPARCBOOT
-	SPARCBOOT_SAVE=/tmp/hsfs.bootblock.$$
-	$CP "$MEDIA_ROOT/$SPARCBOOT" "$SPARCBOOT_SAVE" || exit 1
-	trap '"$CP" "$MEDIA_ROOT/$SPARCBOOT" "$SPARCBOOT_SAVE" 2>/dev/null;
-		"$RM" -f $SPARCBOOT_SAVE"' EXIT
-fi
-
-# Call mkisofs to do the actual work.
-# Note: the "-log-file >(cat -u >&2)" and "2>/dev/null" below is a trick
-#	to filter out mkisofs's warning message about being non-conforming
-#	to ISO-9660.
-# We do some funky architecture-specific stuff here so that we can
-# actually create a bootable media image for UltraSPARC systems
-
-sparc_ISOARGS="-G $BOOTBLOCK -B ... -joliet-long -R -U"
-i386_ISOARGS="-b boot/grub/stage2_eltorito -boot-info-table "
-i386_ISOARGS="$i386_ISOARGS -boot-load-size 4 -c .catalog -d -N "
-i386_ISOARGS="$i386_ISOARGS -no-emul-boot -r -relaxed-filenames"
-if [[ "$MACH" = "i386" ]]
-then
-	ISOARGS=$i386_ISOARGS
-else
-	ISOARGS=$sparc_ISOARGS
-fi
-
-$MKISOFS -o "$ISOIMAGE" \
-	-allow-leading-dots \
-	$ISOARGS \
-	-l -ldots \
-	-R -J \
-	-V "$ISOLABEL" \
-	$VERBOSE_FLAG \
-	-log-file >($CAT -u >&2) \
-	"$MEDIA_ROOT" 2>/dev/null
--- a/usr/src/cmd/itutools/pkg2du.ksh	Mon May 14 12:05:00 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,438 +0,0 @@
-#!/bin/ksh93 -p
-#
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-#
-# pkg2du - convert driver packages to Driver Update (DU) format
-#
-
-readonly PROG=$0
-readonly ORIGPWD=$PWD
-readonly TMP_DIR=${TMPDIR:-/tmp}/${PROG##*/}.$$
-
-# Must-have utilities
-readonly CPIO=/usr/bin/cpio
-readonly GZIP=/usr/bin/gzip
-readonly MKISOFS=/usr/bin/mkisofs
-readonly PATCHADD=/usr/sbin/patchadd
-readonly PKGTRANS=/usr/bin/pkgtrans
-readonly ROOT_ARCHIVE=/usr/sbin/root_archive
-readonly LOFIADM=/usr/sbin/lofiadm
-readonly MKDIR=/usr/bin/mkdir
-readonly RM=/usr/bin/rm
-readonly CP=/usr/bin/cp
-readonly HEAD=/usr/bin/head
-readonly SORT=/usr/bin/sort
-readonly MKBOOTMEDIA=/usr/bin/mkbootmedia
-readonly PKG2DU=/usr/bin/pkg2du
-readonly TOUCH=/usr/bin/touch
-readonly NAWK=/usr/bin/nawk
-readonly CHMOD=/usr/bin/chmod
-readonly GREP=/usr/bin/grep
-readonly LS=/usr/bin/ls
-readonly LN=/usr/bin/ln
-readonly SED=/usr/bin/sed
-readonly CAT=/usr/bin/cat
-readonly FIND=/usr/bin/find
-readonly UNAME=/usr/bin/uname
-readonly MACH=`$UNAME -p`
-
-# for gettext
-TEXTDOMAIN=SUNW_OST_OSCMD
-export TEXTDOMAIN
-
-
-function usage
-{
-	gettext "Usage:\n${PROG##*/} -r <release> [-f] [-v] [-d <dir>] [-o <iso>] [-l <label>]\n        <pkg> [<pkg> ...]\n"
-	gettext "Options:\n  -d <dir>\n        Directory where the Driver Update directory should be created.\n"
-	gettext "  -o <iso>\n        Create a Solaris ISO image of the Driver Update directory.\n"
-	gettext "  -f\n        If <dir>/DU or <iso> exists, remove it without asking first.\n"
-	gettext "  -l <label>\n        Label/volume name of the ISO image (if -o option is specified).\n"
-	gettext "  -r <release>\n        Solaris release number to use.  It takes the form of 5.10.\n        This option must be specified.\n"
-	gettext "  -v\n        Verbose.  Multiple -v options increase verbosity.\n"
-	echo;
-}
-
-
-function check_prereqs
-{
-	typeset f
-
-	# We must have these utilities.
-	for f in $GZIP ${ISO:+$MKISOFS} $PKGTRANS
-	do 
-		if [[ ! -x "$f" ]]
-		then
-			gettext "Cannot find required utilty $f"
-			exit 1
-		fi
-	done
-}
-
-
-function cleanup
-{
-	$RM -rf "$TMP_DIR"
-}
-
-
-function is_overwrite
-{
-	typeset arg=$1
-	typeset -l ans
-
-	[[ $FORCE == yes ]] && return 0
-
-	while true
-	do
-		gettext "$arg already exists. Overwrite it? (y/n) "
-		read ans
-		case $ans in
-		y*|Y*) return 0 ;;		# go ahead overwrite
-		n*|N*) return 1 ;;		# don't overwrite
-		esac
-	done
-	echo;
-}
-
-
-function collect_objs # <pkg> ...
-{
-	typeset obj fail=0
-
-	for obj
-	do
-		if [[ -f "$obj"/pkginfo ]]
-		then
-			PACKAGES[ ${#PACKAGES[*]} ]=$obj
-		else
-			gettext "$obj is not in package format\n"
-			(( fail += 1 ))
-		fi
-	done
-	(( fail )) && return 1
-	return 0
-}
-
-
-function mkdu
-{
-	typeset distdir tmpdudir pkgs obj statusfile
-
-	trap '/bin/rm -rf $statusfile $tmpdudir' EXIT
-
-	# Create DU directory first.
-	distdir=$ROOTDIR/DU/sol_$VERSION/$MACH
-	$MKDIR -p "$distdir/Tools" "$distdir/Product"
-
-	# to the other UltraSPARC architecture
-	if [[ "$MACH" != "i386" ]]
-	then
-		cd $ROOTDIR/DU/sol_$VERSION
-		$LN -s sparc sun4v
-		$LN -s sparc sun4u
-	else
-		cd $ROOTDIR/DU/sol_$VERSION
-		$LN -s i386 i86pc
-	fi	
-
-	# Unfortunately pkgtrans insists that all packages must be in
-	# <device1> (see pkgtrans(1)).  The packages can't have any path
-	# components.  So we'll create a temporary directory first and then
-	# symlinks to the specified packages.  Then run pkgtrans with
-	# the temporary directory as <device1>.
-	tmpdudir=$TMP_DIR/mkdu
-	$MKDIR -p "$tmpdudir"
-
-	for obj in "${PACKAGES[@]}"
-	do
-		# Get rid of trailing /'s, if any.
-		[[ "$obj" == */ ]] && obj=${obj%%+(/)}
-
-		# Make sure it's a full pathname.
-		[[ "$obj" != /* ]] && obj=$ORIGPWD/$obj
-
-		$LN -s "$obj" "$tmpdudir" || exit 1
-
-		# Remember just the file component.
-		pkgs[ ${#pkgs[*]} ]=${obj##*/}
-	done
-
-	# Package up packages as compressed data stream.
-	statusfile=$TMP_DIR/.pkgtrans.status
-	{
-		$PKGTRANS -s "$tmpdudir" /dev/stdout "${pkgs[@]}"
-		echo $? > $statusfile
-		$TOUCH $statusfile	# make sure file is created
-	} | $GZIP -9 > "$distdir/Product/pkgs.gz"
-
-	[[ -s $statusfile && $(<$statusfile) != 0 ]] && return 1
-
-	# Create admin file for pkgadd
-	$CAT > "$distdir/Tools/admin" <<"EOF"
-mail=
-instance=unique
-partial=nocheck
-runlevel=nocheck
-idepend=nocheck
-rdepend=nocheck
-space=nocheck
-setuid=nocheck
-conflict=nocheck
-action=nocheck
-EOF
-
-	# Create install.sh
-	$CAT > "$distdir/Tools/install.sh" <<"EOF"
-#!/sbin/sh
-# install.sh -R <basedir> - install packages to basedir
-basedir=/
-toolsdir=`dirname $0`
-tmpfile=/tmp/`basename $0`.$$
-while getopts "R:" arg
-do
-        case "$arg" in
-                R) basedir=$OPTARG;;
-        esac
-done
-/usr/bin/gzip -c -d "$toolsdir/../Product/pkgs.gz" > $tmpfile &&
-	/usr/sbin/pkgadd -R "$basedir" -d "$tmpfile" -a "$toolsdir/admin" all
-status=$?
-/bin/rm -f "$tmpfile"
-exit $status
-EOF
-	$CHMOD a+rx "$distdir/Tools/install.sh"
-}
-
-
-function mkiso
-{
-	typeset vflag
-
-	# Skip if no ISO image was specified.
-	[[ -z "$ISO" ]] && return 0
-
-	# Determine mkisofs' verbose flag depending on $VERBOSE_LEVEL.
-	case $VERBOSE_LEVEL in
-	0)	vflag=-quiet
-		;;
-	1)	vflag=				# mkisofs' default verboseness
-		;;
-	*)	vflag=
-		i=$VERBOSE_LEVEL
-		while ((i > 0))
-		do
-			vflag="-v $vflag"
-			(( i -= 1 ))
-		done
-		;;
-	esac
-
-	(( VERBOSE_LEVEL )) && gettext "Creating ISO image ..."
-
-	# Note: the "-log-file >(cat -u >&2)" and "2>/dev/null" below is a
-	#	trick to filter out mkisofs's warning message about being
-	#	non-conforming to ISO-9660.
-	# We do some funky architecture-specific stuff here so that we can
-	# actually create a bootable media image for UltraSPARC systems
-	
-	ISOARGS_sparc="-B ... -joliet-long -R -U"
-	ISOARGS_i386="-d -N -r -relaxed-filenames"	
-	if [[ "$MACH" = "i386" ]]
-	then
-		ISOARGS=$ISOARGS_i386
-	else
-		ISOARGS=$ISOARGS_sparc
-	fi
-
-	$MKISOFS -o "$ISO" \
-		-allow-leading-dots \
-		$ISOARGS \
-		-ldots -full-iso9660-filenames \
-		-R -J \
-		-V "$ISOLABEL" \
-		$vflag \
-		-log-file >($CAT -u >&2) \
-		"$ROOTDIR" 2>/dev/null
-}
-
-
-#
-# Main
-#
-trap cleanup EXIT
-
-FORCE=
-ISO=
-LABEL=
-RELEASE=
-ROOTDIR=
-VERBOSE_LEVEL=0
-
-while getopts ':d:fo:l:r:v' opt
-do
-	case $opt in
-	d)	ROOTDIR=$OPTARG
-		;;
-	f)	FORCE=yes
-		;;
-	o)	ISO=$OPTARG
-		if [ ! -z `echo $ISO | $GREP "^/tmp"` ]; then
-		        gettext "ISO images will not be created on /tmp.\n"
-			gettext "Please choose a different output location.\n"
-			exit 3
-		fi
-		;;
-	l)	LABEL=$OPTARG
-		;;
-	r)	RELEASE=$OPTARG
-		;;
-	v)	(( VERBOSE_LEVEL += 1 ))
-		;;
-	:)	gettext "Option -$OPTARG missing argument."
-		usage
-		exit 1
-		;;
-	*)	gettext "Option -$OPTARG invalid.\n"
-		usage
-		exit 2
-		;;
-	esac
-done
-shift 'OPTIND - 1'
-
-# Release number must be specified.
-if [[ -z "$RELEASE" ]]
-then
-	gettext "Solaris release number must be specified (-r option).\n"
-	usage
-	exit 1
-fi
-
-# Verify release number.  Allow major.minor or major.minor.micro format.
-if [[ $RELEASE != +([0-9]).+([0-9])?(.+([0-9])) ]]
-then
-	gettext "Invalid release number: $RELEASE\n"
-	exit 1
-fi
-VERSION=$(echo $RELEASE | $SED 's/5\./2/')
-
-# Either or both of -d or -o option must be specified.
-if [[ -z "$ROOTDIR" && -z "$ISO" ]]
-then
-	gettext "Either -d or -o option (or both) must be specified.\n"
-	usage
-	exit 1
-fi
-
-# There must be at least one package.
-if (( $# == 0 ))
-then
-	gettext "No package was specified.\n"
-	usage
-	exit 1
-fi
-
-# Check and collect packages
-unset PACKAGES
-collect_objs "$@" || exit 1
-
-# Default label for ISO image
-LABEL=${LABEL:-DU sol_$VERSION}
-
-check_prereqs		# must be called after $ISO is possibly set
-
-# If an ISO image was specified, check its parent directory and get its
-# full pathname.
-unset ISODIR
-if [[ -n "$ISO" ]]
-then
-	if [[ "$ISO" = */* ]]
-	then
-		ISODIR=$(cd "${ISO%/*}" 2>/dev/null && pwd -P)
-		if (( $? ))
-		then
-			gettext "Can't access parent directory of ISO image\n"
-			exit 1
-		fi
-	else
-		ISODIR=$(pwd -P)
-	fi
-fi
-
-# If user specified a media root directory, verify it exists, else use
-# a temporary directory.
-if [[ -n "$ROOTDIR" ]]
-then
-	$MKDIR -p "$ROOTDIR";
-	if [ $? != 0 ]; then
-		gettext "$ROOTDIR is not a directory.\n"
-		exit 1
-	elif [[ ! -w "$ROOTDIR" ]] then
-		gettext "Directory $ROOTDIR is not writable.\n"
-		exit 1
-	fi
-	# If an ISO image path is also specified, make sure it's not under
-	# $ROOTDIR since we're going to take the ISO image of $ROOTDIR.
-	if [[ -n "$ISODIR" ]]
-	then
-		realroot=$(cd "$ROOTDIR" 2>/dev/null && pwd -P)
-		if [[ "$ISODIR" = "$realroot"?(/*) ]]
-		then
-			gettext "ISO image must not be under Driver Update's parent directory ($realroot)\n"
-			exit 1
-		fi
-	fi
-else
-	ROOTDIR=$TMP_DIR/root
-fi
-
-# If DU directory already exists, ask user permission to remove it unless -f
-# option was specified.
-if [[ -d "$ROOTDIR/DU" ]]
-then
-	is_overwrite "$ROOTDIR/DU" || exit 0
-	$RM -rf "$ROOTDIR/DU"
-fi
-
-# If ISO image already exists, ask user permission to remove it unless -f
-# option was specified.
-if [[ -f "$ISO" ]]
-then
-	is_overwrite "$ISO" || exit 0
-	$RM -f "$ISO"
-fi
-
-# Create DU directory and the ISO image (if requested).
-mkdu && mkiso
-if (( $? ))
-then
-	$RM -rf "$ROOTDIR/DU"
-	[[ -n "$ISO" ]] && $RM -f "$ISO"
-	exit 1
-fi
-exit 0
--- a/usr/src/cmd/itutools/updatemedia.ksh	Mon May 14 12:05:00 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,478 +0,0 @@
-#!/bin/ksh93 -p
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-#
-# updatemedia - modify Solaris media with patches and packages
-#
-
-readonly PROG=$0
-readonly TMP_DIR=${TMPDIR:-/tmp}/${PROG##*/}.$$
-readonly LOGFILE=${TMPDIR:-/tmp}/${PROG##*/}-log.$$
-
-# Must-have utilities
-readonly CPIO=/bin/cpio
-readonly GZIP=/bin/gzip
-readonly MKISOFS=/usr/bin/mkisofs
-readonly PATCHADD=/usr/sbin/patchadd
-readonly LOFIADM=/usr/sbin/lofiadm
-readonly MKDIR=/usr/bin/mkdir
-readonly RM=/usr/bin/rm
-readonly CP=/usr/bin/cp
-readonly MKBOOTMEDIA=/usr/bin/mkbootmedia
-readonly PKG2DU=/usr/bin/pkg2du
-readonly TOUCH=/usr/bin/touch
-readonly NAWK=/usr/bin/nawk
-readonly CHMOD=/usr/bin/chmod
-readonly GREP=/usr/bin/grep
-readonly LS=/usr/bin/ls
-readonly LN=/usr/bin/ln
-readonly SED=/usr/bin/sed
-readonly CAT=/usr/bin/cat
-readonly FIND=/usr/bin/find
-readonly HEAD=/usr/bin/head
-readonly SORT=/usr/bin/sort
-readonly UNAME=/usr/bin/uname
-readonly MACH=`$UNAME -p`
-
-ROOT_ARCHIVE=/usr/sbin/root_archive
-# for gettext
-TEXTDOMAIN=SUNW_OST_OSCMD
-export TEXTDOMAIN
-
-
-function usage
-{
-	gettext "Usage:\n${PROG##*/} -d <media-root> [-v] [-l <label>] [-o <iso>]\n        <pkg_or_patch> [<pkg_or_patch> ...]\n"
-	gettext "Options:\n  -d <media-root>\n        Top-level directory of on-disk image of Solaris installation media.\n        This is option must be specified.\n"
-	gettext "  -l <label>\n        Label/volume name of the ISO image (if -o option is specified).\n"
-	gettext "  -o <iso>\n        Create a Solaris ISO image of <media-root>.\n"
-	gettext "  -v\n        Verbose.  Multiple -v options increase verbosity.\n"
-}
-
-
-function check_prereqs
-{
-	typeset f
-
-	# We must have these utilities.
-	for f in $CPIO $GZIP ${ISO:+$MKISOFS} $PATCHADD $ROOT_ARCHIVE
-	do 
-		if [[ ! -x "$f" ]]
-		then
-			gettext "Cannot find required utility $f\n"
-			exit 1
-		fi
-	done
-
-	# root_archive unpack_media calls lofiadm -a, which requires
-	# write access as determined by /dev/lofictl.  See lofiadm(1m).
-	if [[ ! -w /dev/lofictl ]]
-	then
-		gettext "You do not have enough privileges to run lofiadm -a).\nSee lofiadm(1m) for more information.\n"
-		exit 1
-	fi
-}
-
-
-function cleanup
-{
-	$RM -rf "$TMP_DIR"
-}
-
-
-function unpack_media
-{
-	# Create temp directory to unpack the miniroot.
-	$MKDIR -p "$UNPACKED_ROOT"
-
-	# We need to use the unpackmedia option to correctly apply patches
-	gettext "Unpacking media ..."
-	$ROOT_ARCHIVE unpackmedia "$MEDIA_ROOT" "$UNPACKED_ROOT" > /dev/null 2>&1 
-	if [ $? != 0 -a ! -d $MEDIA_ROOT/Solaris_10 ]; then
-		# we _do_ care, because we're not patching a Solaris 10
-		# update media instance
-		gettext "\nThere was an error unpacking the media from $MEDIA_ROOT\n"
-		exit 1
-	fi
-	echo;
-}
-
-
-function repack_media
-{
-	gettext "Repacking media ..."
-
-	# We need to ensure that we're using the appropriate version
-	# of root_archive for the media that we're packing/unpacking.
-	# The onnv version of root_archive differs from the S10 version,
-	# and this will cause problems on re-packing. So we sneakily
-	# use the version that we've just unpacked
-	if [ -d $MEDIA_ROOT/Solaris_10 ]; then
-		ROOT_ARCHIVE=$UNPACKED_ROOT/boot/solaris/bin/root_archive
-	fi
-
-	$ROOT_ARCHIVE packmedia "$MEDIA_ROOT" "$UNPACKED_ROOT" > /dev/null 2>&1
-	if [ $? != 0 -a ! -d $MEDIA_ROOT/Solaris_10 ]; then
-		# we _do_ care, because we're not patching a Solaris 10
-		# update media instance
-		gettext "\nThere was an error unpacking the media from $MEDIA_ROOT\n"
-		exit 1
-	fi
-	echo;
-}
-
-
-function mkiso
-{
-	typeset vflag
-
-	# Skip if no ISO image was specified.
-	[[ -z "$ISO" ]] && return 0
-
-	gettext "Creating ISO image ..."
-	$MKBOOTMEDIA $VERBOSE_OPTS -l "$ISOLABEL" "$MEDIA_ROOT" "$ISO"
-	echo;
-}
-
-
-function collect_objs # <pkg_or_patch> ...
-{
-	typeset obj fail=0
-
-	for obj
-	do
-		if [[ -f "$obj"/patchinfo ]]
-		then
-			PATCHES[ ${#PATCHES[*]} ]=$obj
-		elif [[ -f "$obj"/pkginfo ]]
-		then
-			PACKAGES[ ${#PACKAGES[*]} ]=$obj
-		else
-			gettext "$obj is not in package or patch format\n"
-			(( fail += 1 ))
-		fi
-	done
-	(( fail )) && return 1
-	return 0
-}
-
-
-function add_pkgs
-{
-	typeset dudir icmd statusfile
-
-	(( ${#PACKAGES[*]} == 0 )) && return
-
-	statusfile=$TMP_DIR/.add_pkgs.status
-
-	trap '$RM -f $statusfile' EXIT
-
-	dudir=$ITUDIR/$COUNTDIR
-	(( COUNTDIR += 1 ))
-	$MKDIR "$dudir" || return
-
-	# Add a Driver Update directory on the media
-	echo;
-	gettext "Adding package(s) to media root."
-	$PKG2DU -r "$RELEASE" -f -d "$dudir" $VERBOSE_OPTS \
-	    "${PACKAGES[@]}" || return
-
-	# Using the Driver Update above install the packages onto the miniroot.
-	echo;
-	gettext "Installing package(s) onto miniroot."
-	icmd=$dudir/DU/sol_$VERSION/$MACH/Tools/install.sh
-	if [[ ! -f "$icmd" ]]
-	then
-		# This shouldn't happen, but just in case.
-		gettext "Cannot find $icmd\n"
-		return 1
-	fi
-	[[ ! -x "$icmd" ]] && $CHMOD a+x "$icmd"
-
-	$RM -f "$statusfile"
-        {
-		"$icmd" -R "$UNPACKED_ROOT"
-		if (( i=$? ))
-		then
-			echo $i > "$statusfile"
-			$TOUCH "$statusfile"  # make sure file is created
-		fi
-        } 2>&1 | $NAWK -v logfile="$LOGFILE" '
-		# Print certain lines from $icmd, save all in logfile.
-		/^Installing/ {print}
-		/^Installation.*successful/ {print}
-		{print >> logfile}
-	' || return
-	[[ -s "$statusfile" ]] && return $(<$statusfile)
-	return 0
-}
-
-
-function add_patches
-{
-	typeset distdir tmpdir icmd obj patches statusfile
-
-	(( ${#PATCHES[*]} == 0 )) && return
-
-	tmpdir=$TMP_DIR/patches
-	statusfile=$TMP_DIR/.add_patches.status
-
-	trap '$RM -rf $tmpdir $statusfile' EXIT
-
-	distdir=$ITUDIR/$COUNTDIR/DU/sol_$VERSION/$MACH
-	(( COUNTDIR += 1 ))
-
-	$MKDIR -p "$distdir/Tools" "$distdir/Product" "$tmpdir" || return
-
-	# If we're running this script on sun4[vu], then create a symlink
-	# to the other UltraSPARC architecture
-	if [[ "$MACH" != "i386" ]]
-	then
-		cd $ITUDIR/$COUNTDIR/DU/sol_$VERSION/
-		$LN -s sparc sun4v
-		$LN -s sparc sun4u
-	else
-		cd $ITUDIR/$COUNTDIR/DU/sol_$VERSION/
-		$LN -s i386 i86pc
-	fi	
-
-	# Patch the miniroot
-	echo;
-	gettext "Installing patch(es) onto miniroot."
-	$RM -f "$statusfile"
-	{
-		$PATCHADD -udn -C "$UNPACKED_ROOT" "${PATCHES[@]}"
-		if (( i=$? ))
-		then
-			echo $i > "$statusfile"
-			$TOUCH "$statusfile" # make sure file is created
-		fi
-        } 2>&1 | $NAWK -v logfile="$LOGFILE" '
-		# Print certain lines from patchadd, save all in logfile.
-		/^Patch.*successful/ {print}
-		{print >> logfile}
-	' || return
-
-	[[ -s "$statusfile" ]] && return $(<$statusfile)
-
-	# Remove patch log files to save space when miniroot is repacked.
-	$RM -rf "$UNPACKED_ROOT"/var/sadm/patch
-
-	# Symlink each patch in a temp dir so a single cpio/gzip can work.
-	for obj in "${PATCHES[@]}"
-	do
-		# Get rid of trailing /'s, if any.
-		[[ "$obj" == */ ]] && obj=${obj%%+(/)}
-
-		# Make sure it's full pathname.
-		[[ "$obj" != /* ]] && obj=$ORIGPWD/$obj
-
-		$LN -s "$obj" "$tmpdir" || return
-
-		# Remember just the file component.
-		patches[ ${#patches[*]} ]=${obj##*/}
-	done
-
-	# Package up patches as compressed cpio archive.
-	echo;
-	gettext "Adding patch(es) to media root.\n"
-	$RM -f "$statusfile"
-	(
-		cd "$tmpdir"
-		# fd 9 is used later on for filtering out cpio's
-		# reporting total blocks to stderr but yet still
-		# print other error messages.
-		exec 9>&1
-		for obj in "${patches[@]}"
-		do
-			gettext "Transferring patch $obj\n"
-			$FIND "$obj/." -follow -print
-			if (( i=$? ))
-			then
-				echo $i > "$statusfile"
-				$TOUCH "$statusfile"
-				return $i
-			fi
-		done | $CPIO -oc 2>&1 >&9 | $GREP -v '^[0-9]* blocks' >&2
-	) | $GZIP -9 > "$distdir/Product/patches.gz" || return
-
-	[[ -s "$statusfile" ]] && return $(<$statusfile)
-
-	# Create install.sh
-	$CAT > "$distdir/Tools/install.sh" <<"EOF"
-#!/sbin/sh
-# install.sh -R <basedir> - install patches to basedir
-basedir=/
-toolsdir=`dirname $0`
-tmpdir=/tmp/`basename $0`.$$
-trap "/bin/rm -rf $tmpdir" 0
-while getopts "R:" arg
-do
-        case "$arg" in
-                R) basedir=$OPTARG;;
-        esac
-done
-/bin/mkdir -p "$tmpdir" || exit
-tmpfile=$tmpdir/patches
-patchdir=$tmpdir/patchdir
-/bin/mkdir "$patchdir" || exit
-/usr/bin/gzip -c -d "$toolsdir/../Product/patches.gz" > $tmpfile || exit
-cd "$patchdir"
-/bin/cpio -idum < "$tmpfile" || exit
-/usr/sbin/patchadd -R "$basedir" -nu *
-EOF
-	$CHMOD a+rx "$distdir/Tools/install.sh"
-
-}
-
-
-#
-# Main
-#
-trap cleanup EXIT
-
-ISO=
-ISOLABEL=
-MEDIA_ROOT=
-VERBOSE_LEVEL=0
-VERBOSE_OPTS=
-
-while getopts ':d:o:l:v' opt
-do
-	case $opt in
-	d)	MEDIA_ROOT=$OPTARG
-		;;
-	o)	ISO=$OPTARG
-		if [ ! -z `echo $ISO | $GREP "^/tmp"` ]; then
-		        gettext "ISO images will not be created on /tmp.\nPlease choose a different output location.\n"
-			exit 3
-		fi
-		;;
-	l)	ISOLABEL=$OPTARG
-		;;
-	v)	(( VERBOSE_LEVEL += 1 ))
-		VERBOSE_OPTS="${VERBOSE_OPTS:--}$opt"	# collect -v options
-		;;
-	:)	gettext "Option -$OPTARG missing argument.\n"
-		usage
-		exit 1
-		;;
-	*)	gettext "Option -$OPTARG is invalid.\n"
-		usage
-		exit 2
-		;;
-	esac
-done
-shift 'OPTIND - 1'
-
-unset PACKAGES PATCHES				# reset arrays
-collect_objs "$@"
-
-# If there are no packages or patches, then print info and we're done.
-if (( ${#PACKAGES[*]} == 0 && ${#PATCHES[*]} == 0 ))
-then
-	gettext "No valid package or patch was specified.\nPackages and patches must be unpacked.\n"
-	usage
-	exit 1
-fi
-
-# -d option must be specified
-if [[ -z "$MEDIA_ROOT" ]]
-then
-	gettext "No media root (-d option) was specified.\n"
-	usage
-	exit 1
-fi
-
-check_prereqs		# must be called after $ISO is possibly set
-
-# Verify it's a Solaris install media.
-SOLARIS_DIR=$($LS -d $MEDIA_ROOT/Solaris* 2>/dev/null)
-if [[ -z "$SOLARIS_DIR" || ! -d "$SOLARIS_DIR/Tools/Boot" ]]
-then
-	gettext "$MEDIA_ROOT is not valid Solaris install media.\n"
-	exit 1
-fi
-
-$MKDIR -p "$TMP_DIR" || exit 1
-
-# Extract the Solaris release number from the Solaris_* directory and the
-# corresponding version number.  As defined by the ITU spec, a Solaris release
-# number 5.x corresponds to version number 2x (e.g. 5.10 -> 210).
-RELEASE=5.${SOLARIS_DIR##*Solaris_}
-VERSION=$(echo $RELEASE | $SED 's/5\./2/')
-
-# If user didn't specify ISO label, use the Solaris_* dir as label.
-${ISOLABEL:=${SOLARIS_DIR##*/}} 2>/dev/null
-
-# Verify miniroot
-
-MINIROOT=
-# Relative to a Solaris media root.
-if [ "$MACH" = "sparc" ]; then
-	MINIROOT=$MEDIA_ROOT/boot/sparc.miniroot
-else
-	# x86/x64
-	MINIROOT=$MEDIA_ROOT/boot/x86.miniroot
-fi
-if [ ! -f $MINIROOT ]; then
-	gettext "No boot/x86.miniroot under media root.\n"
-	exit 1
-fi
-
-# Where to unpack the miniroot.
-UNPACKED_ROOT=${TMP_DIR}/miniroot
-
-# Create the ITU directory on the media, if necessary
-ITUDIR=$MEDIA_ROOT/ITUs
-$MKDIR -p "$ITUDIR" || exit 1
-
-# The ITU directory might contain multiple driver updates already, each in a
-# separate numbered subdirectory.  So look for the subdirectory with the
-# highest number and we'll add the packages and patches on the next one.
-typeset -Z3 COUNTDIR
-COUNTDIR=$($LS -d "$ITUDIR"/+([0-9]) 2>/dev/null | $SED 's;.*/;;' |
-		$SORT -rn | $HEAD -1)
-if [[ $COUNTDIR == *( ) ]]
-then
-	COUNTDIR=0
-else
-	(( COUNTDIR += 1 ))
-fi
-
-unpack_media || exit
-add_pkgs && add_patches
-if (( status=$? )) && [[ -s "$LOGFILE" ]]
-then
-	echo;
-	gettext "A package or patch installation has failed.\nMessages from pkgadd and patchadd have been saved in $LOGFILE\n"
-	exit $status
-else
-	$RM -f "$LOGFILE"
-fi
-print
-repack_media || exit
-mkiso
--- a/usr/src/man/man1m/Makefile	Mon May 14 12:05:00 2012 -0700
+++ b/usr/src/man/man1m/Makefile	Mon May 14 12:16:08 2012 -0700
@@ -11,7 +11,7 @@
 
 #
 # Copyright 2011, Richard Lowe
-# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2012 Nexenta Systems, Inc. All rights reserved.
 #
 
 include ../../Makefile.master
@@ -251,7 +251,6 @@
 	 	 	isns.1m			\
 	 	 	isnsadm.1m		\
 	 	 	itadm.1m		\
-	 	 	itu.1m			\
 	 	 	k5srvutil.1m		\
 	 	 	kadb.1m			\
 	 	 	kadmin.1m		\
@@ -320,7 +319,6 @@
 	 	 	metastat.1m		\
 	 	 	metasync.1m		\
 	 	 	metattach.1m		\
-	 	 	mkbootmedia.1m		\
 	 	 	mkdevalloc.1m		\
 	 	 	mkdevmaps.1m		\
 	 	 	mkfifo.1m		\
@@ -374,7 +372,6 @@
 	 	 	pbind.1m		\
 	 	 	picld.1m		\
 	 	 	ping.1m			\
-	 	 	pkg2du.1m		\
 	 	 	pkgadd.1m		\
 	 	 	pkgadm.1m		\
 	 	 	pkgask.1m		\
@@ -554,7 +551,6 @@
 	 	 	unshare_nfs.1m		\
 	 	 	update_drv.1m		\
 	 	 	updatehome.1m		\
-	 	 	updatemedia.1m		\
 	 	 	useradd.1m		\
 	 	 	userdel.1m		\
 	 	 	usermod.1m		\
--- a/usr/src/man/man1m/itu.1m	Mon May 14 12:05:00 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,321 +0,0 @@
-'\" te
-.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH ITU 1M "Sep 23, 2009"
-.SH NAME
-itu \- convert packages to Driver Update format and patch Solaris install media
-for Install Time Update
-.SH SYNOPSIS
-.LP
-.nf
-\fBitu makedu\fR \fB-r\fR \fIsolaris_release\fR [\fB-v\fR] [\fB-f\fR] [\fB-d\fR \fIoutput_dir\fR] [\fB-o\fR \fIiso_file\fR]
-     [\fB-l\fR \fIiso_label\fR] \fIpackage\fR [\fIpackage\fR...]
-.fi
-
-.LP
-.nf
-\fBitu updatemedia\fR \fB-R\fR \fImedia_root\fR [\fB-v\fR] [\fB-f\fR] [\fB-o\fR \fIiso_file\fR]
-     [\fB-l\fR \fIiso_label\fR] \fIpkg\fR [\fIpkg\fR...]
-.fi
-
-.LP
-.nf
-\fBitu makeiso\fR \fB-o\fR \fIiso_file\fR [\fB-v\fR] [\fB-l\fR \fIiso_label\fR] \fImedia_root\fR
-.fi
-
-.SH DESCRIPTION
-.sp
-.LP
-The \fBitu\fR utility converts driver packages to Driver Update (DU) format and
-patches a Solaris install media with driver packages for Install Time Update
-(ITU). \fBitu\fR has three subcommands: \fBmakedu\fR, \fBupdatemedia\fR and
-\fBmakeiso\fR.
-.SH OPTIONS
-.sp
-.LP
-The following options are supported:
-.sp
-.ne 2
-.na
-\fB\fB-d\fR \fIoutput_dir\fR\fR
-.ad
-.sp .6
-.RS 4n
-Directory where the Driver Update directory is to be created.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-f\fR\fR
-.ad
-.sp .6
-.RS 4n
-If \fIoutput_dir\fR/DU or \fIiso_file\fR already exists, remove it without
-asking first.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-l\fR \fIiso_label\fR\fR
-.ad
-.sp .6
-.RS 4n
-Label/volume name of the ISO image (if \fB-o\fR option is specified).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-o\fR \fIiso_file\fR\fR
-.ad
-.sp .6
-.RS 4n
-Path of the ISO image file to be created. For subcommands \fBupdatemedia\fR and
-\fBmakeiso\fR, it will be a bootable ISO image. This option must be specified
-for subcommand \fBmakeiso\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-R\fR \fImedia_root\fR\fR
-.ad
-.sp .6
-.RS 4n
-Top-level directory of on-disk image of Solaris installation media. This option
-must be specified for subcommand \fBupdatemedia\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-r\fR \fIsolaris_release\fR\fR
-.ad
-.sp .6
-.RS 4n
-Solaris release number for which the Driver Update is intended. It takes the
-form of the output of \fBuname\fR \fB-r\fR, for example, \fB5.10\fR. This
-option must be specified for subcommand \fBmakedu\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-v\fR\fR
-.ad
-.sp .6
-.RS 4n
-Verbose. Multiple \fB-v\fR options increase verbosity.
-.RE
-
-.SH SUB-COMMANDS
-.sp
-.LP
-The \fBitu\fR subcommands are described as follows.
-.SS "\fBmakedu\fR"
-.sp
-.LP
-The \fBmakedu\fR subcommand takes one or more driver packages as input and
-converts them to DU format. At the beginning of an interactive Solaris
-installation session, these driver updates can be applied to the running
-kernel, which will then also automatically apply them to the newly installed
-Solaris at the end of the installation process.
-.sp
-.LP
-The \fB-r\fR option is required to specify the Solaris release number for which
-the driver updates apply. The \fIsolaris_release\fR option argument takes the
-form \fBuname\fR \fB-r\fR output, for example, \fB5.10\fR or \fB5.11\fR.
-.sp
-.LP
-If the \fB-d\fR option is specified, the resulting DU directory tree is placed
-in the directory \fIoutput_dir\fR.
-.sp
-.LP
-If the \fB-o\fR option is specified, a (non-bootable) ISO image of the DU
-directory tree is written in the file \fIiso_file\fR. This ISO image can be
-burned onto a CD/DVD using \fBcdrw\fR(1) or \fBcdrecord(1)\fR (not a SunOS man
-page). See the "Examples" section below for an example of creating a DU on a
-floppy.
-.sp
-.LP
-At least one of \fB-d\fR and \fB-o\fR option must be specified. If both are
-specified, then both an ISO image and a directory tree are generated.
-.SS "\fBupdatemedia\fR"
-.sp
-.LP
-The \fBupdatemedia\fR subcommand takes a list of driver packages as input and
-applies them to the miniroot of a Solaris install media. It also places them in
-a subdirectory called \fBITUs\fR under the Solaris install media's top-level
-directory:
-.sp
-.in +2
-.nf
-\fImedia_root\fR/ITUs
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-When booting a system from the updated media, the  packages will be part of the
-booted Solaris image. They will also be applied to the target system being
-installed at the end of the installation process.
-.sp
-.LP
-The \fB-R\fR option must be entered on the command line to specify the Solaris
-install media. Note that the install media must be on a location that is
-writable by \fBitu\fR.
-.sp
-.LP
-If the \fB-o\fR option is specified, a bootable ISO image of the patched
-install media is also created in the file \fIiso_file\fR. The ISO image can
-then be burned onto a CD or DVD.
-.SS "\fBmakeiso\fR"
-.sp
-.LP
-The \fBmakeiso\fR subcommand runs \fBmkisofs(8)\fR to create a bootable Solaris
-ISO image of the Solaris install media \fImedia_root\fR and writes it to the
-file \fIiso_file\fR. The ISO image file can then be burned onto a CD or DVD
-with utilities such as \fBcdrw\fR(1) or \fBcdrecord(1)\fR. (Note that
-\fBmkisofs(8)\fR and \fBcdrecord(1)\fR are not SunOS man pages.)
-.LP
-Caution -
-.sp
-.RS 2
-The Solaris install media \fImedia-root\fR must contain the file
-\fBboot/grub/stage2_eltorito\fR, which will be written to the media boot
-sectors. This file will be modified with some boot information, thus it has to
-be writable. If necessary, first save a copy, prior to running this subcommand.
-.RE
-.SH OPERANDS
-.sp
-.LP
-The following operands are supported:
-.sp
-.ne 2
-.na
-\fB\fIpackage\fR [\fIpackage\fR...]\fR
-.ad
-.sp .6
-.RS 4n
-One or more driver packages.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIpkg\fR [\fIpkg\fR...]\fR
-.ad
-.sp .6
-.RS 4n
-One or more packages.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fImedia_root\fR\fR
-.ad
-.sp .6
-.RS 4n
-The top-level directory of a Solaris install media.
-.RE
-
-.SH EXAMPLES
-.LP
-\fBExample 1 \fRCreating a DU CD/DVD
-.sp
-.LP
-The following commands create a Driver Update CD/DVD containing the packages
-\fBSAMPLEpkg1\fR and \fBSAMPLEpkg2\fR.
-
-.sp
-.in +2
-.nf
-# \fBitu makedu -r 5.10 -o my.iso SAMPLEpkg1 SAMPLEpkg2\fR
-# \fBcdrw -i my.iso\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 2 \fRCreating a DU Floppy
-.sp
-.LP
-The following commands create a Driver Update floppy containing the driver
-package \fBMYdriver\fR.
-
-.sp
-.in +2
-.nf
-# \fBrmformat -F quick /dev/rdiskette\fR
-# \fBmkfs -F pcfs /dev/rdiskette\fR
-# \fBmount -F pcfs /dev/diskette /mnt\fR
-# \fB/usr/bin/itu makedu -r 5.10 -d /mnt /export/MYdriver\fR
-# \fBumount /mnt\fR
-# \fBdd if=/dev/rdiskette of=floppy.dd\fR
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-The \fBitu\fR command above creates the DU directly onto the floppy mounted on
-\fB/mnt\fR. The \fBdd\fR invocation stores an image of the floppy in the file
-\fBfloppy.dd\fR. This is useful for distributing a DU floppy in file form. From
-the file, the floppy can then be recreated as follows:
-
-.sp
-.in +2
-.nf
-# \fBdd if=floppy.dd of=/dev/rdiskette\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 3 \fRCreating a Bootable ISO Image
-.sp
-.LP
-The following commands create the bootable ISO image \fBmydvd.iso\fR of the
-Solaris install image \fB/export/solaris-10u1\fR with ISO label
-"\fBSpecial-S10\fR".
-
-.sp
-.in +2
-.nf
-# \fB/usr/bin/itu makeiso -o mydvd.iso -l "Special-S10" \e
-     /export/solaris-10u1\fR
-# \fBcdrw -i mydvd.iso\fR
-.fi
-.in -2
-.sp
-
-.SH ATTRIBUTES
-.sp
-.LP
-See \fBattributes\fR(5) for descriptions of the following attributes:
-.sp
-
-.sp
-.TS
-box;
-c | c
-l | l .
-ATTRIBUTE TYPE	ATTRIBUTE VALUE
-_
-Interface Stability	Committed
-.TE
-
-.SH SEE ALSO
-.sp
-.LP
-\fBcdrw\fR(1), \fBpkgadd\fR(1M), \fBattributes\fR(5)
-.sp
-.LP
-\fBmkisofs(8)\fR, (\fB/usr/share/man/man8/mkisofs.8\fR), in the
-\fBSUNWfsman\fR package (not a SunOS man page)
--- a/usr/src/man/man1m/mkbootmedia.1m	Mon May 14 12:05:00 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-'\" te
-.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH MKBOOTMEDIA 1M "Sep 23, 2009"
-.SH NAME
-mkbootmedia \- create bootable Solaris ISO image
-.SH SYNOPSIS
-.LP
-.nf
-\fB/usr/bin/mkbootmedia\fR \fB-v\fR [\fB-l\fR \fIlabel\fR] \fImedia-root\fR \fIiso\fR
-.fi
-
-.SH DESCRIPTION
-.sp
-.LP
-The \fBmkbootmedia\fR utility takes \fImedia-root\fR (the root of an on-disk
-Solaris install media) as input and creates a bootable Solaris ISO image in the
-file \fIiso\fR, using \fBmkisofs(8)\fR. The file can then be burned onto a
-CD/DVD with utilities such as \fBcdrw\fR(1) or \fBcdrecord(1)\fR. (Neither
-\fBmkisofs(8)\fR nor \fBcdrecord(1)\fR are SunOS man pages.)
-.LP
-Caution -
-.sp
-.RS 2
-The directory tree \fImedia-root\fR must contain the file
-\fBboot/grub/stage2_eltorito\fR, which will be written to the media boot
-sectors. This file will be modified with some boot information, thus it must be
-writable. If necessary, first save a copy prior to running this utility.
-.RE
-.SH OPTIONS
-.sp
-.LP
-The following options are supported:
-.sp
-.ne 2
-.na
-\fB\fB-l\fR \fIlabel\fR\fR
-.ad
-.sp .6
-.RS 4n
-Sets \fIlabel\fR as the label/volume name of the ISO image.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-v\fR\fR
-.ad
-.sp .6
-.RS 4n
-Verbose. Multiple \fB-v\fR options increase verbosity.
-.RE
-
-.SH OPERANDS
-.sp
-.LP
-The following operands are supported:
-.sp
-.ne 2
-.na
-\fB\fImedia-root\fR\fR
-.ad
-.sp .6
-.RS 4n
-Top-level directory of an on-disk Solaris install media.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIiso\fR\fR
-.ad
-.sp .6
-.RS 4n
-Name of the output file which will contain the resulting ISO image.
-.RE
-
-.SH EXAMPLES
-.LP
-\fBExample 1 \fRCreating an ISO Image and Burning a CD/DVD
-.sp
-.LP
-The following commands create an ISO image from the content of \fBs10u1\fR and
-burn the image to a CD/DVD.
-
-.sp
-.in +2
-.nf
-# \fB/usr/bin/mkbootmedia s10u1 s10u1.iso\fR
-# \fB/usr/bin/cdrw -i s10u1.iso\fR
-.fi
-.in -2
-.sp
-
-.SH ATTRIBUTES
-.sp
-.LP
-See \fBattributes\fR(5) for descriptions of the following attributes:
-.sp
-
-.sp
-.TS
-box;
-c | c
-l | l .
-ATTRIBUTE TYPE	ATTRIBUTE VALUE
-_
-Interface Stability	Committed
-.TE
-
-.SH SEE ALSO
-.sp
-.LP
-\fBcdrw\fR(1), \fBattributes\fR(5)
-.sp
-.LP
-\fBmkisofs(8)\fR, (\fB/usr/share/man/man8/mkisofs.8\fR), in the
-\fBSUNWfsman\fR package (not a SunOS man page)
--- a/usr/src/man/man1m/pkg2du.1m	Mon May 14 12:05:00 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-'\" te
-.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH PKG2DU 1M "Sep 23, 2009"
-.SH NAME
-pkg2du \- convert driver packages to Driver Update format
-.SH SYNOPSIS
-.LP
-.nf
-\fB/usr/bin/pkg2du\fR [\fB-f\fR] [\fB-v\fR] [\fB-d\fR \fIdir\fR] [\fB-o\fR \fIiso\fR] [\fB-l\fR \fIlabel\fR]
-     [\fB-r\fR \fIrelease\fR] \fIpkg\fR [\fIpkg\fR ...]
-.fi
-
-.SH DESCRIPTION
-.sp
-.LP
-The \fB/usr/bin/pkg2du\fR utility takes one or more packages as input and
-converts them to Driver Update (DU) format. If the \fB-d\fR option is
-specified, the resulting DU directory tree is placed in the directory
-\fIdir\fR. If the \fB-o\fR option is specified, a Solaris ISO image of the DU
-directory tree is written in the file \fIiso\fR. The ISO image can be burned
-onto CD/DVD using \fBcdrw\fR(1) or \fBcdrecord(1)\fR (not a SunOS man page) and
-used during Solaris installation.
-.sp
-.LP
-At least one of the \fB-d\fR and \fB-o\fR options must be specified. If both
-are specified, then both an ISO image and a directory tree are generated.
-.SH OPTIONS
-.sp
-.LP
-The following options are supported:
-.sp
-.ne 2
-.na
-\fB\fB-d\fR \fIdir\fR\fR
-.ad
-.sp .6
-.RS 4n
-Directory where the DU directory should be created.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-o\fR \fIiso\fR\fR
-.ad
-.sp .6
-.RS 4n
-Create a Solaris ISO image of the DU directory.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-f\fR\fR
-.ad
-.sp .6
-.RS 4n
-If \fB\fIdir\fR/DU\fR or \fIiso\fR exists, remove it without asking first.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-l\fR \fIlabel\fR\fR
-.ad
-.sp .6
-.RS 4n
-Label/volume name of the ISO image (if \fB-o\fR option is specified).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-r\fR \fIrelease\fR\fR
-.ad
-.sp .6
-.RS 4n
-Solaris release number to use. It takes the form of the return from \fBuname\fR
-\fB-r\fR command, for example, \fB5.10\fR. If unspecified, the release number
-of the currently running Solaris is used.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-v\fR\fR
-.ad
-.sp .6
-.RS 4n
-Verbose. Multiple \fB-v\fR options increase verbosity.
-.RE
-
-.SH OPERANDS
-.sp
-.LP
-The following operands are supported:
-.sp
-.ne 2
-.na
-\fB\fIpkg\fR [\fIpkg\fR...]\fR
-.ad
-.sp .6
-.RS 4n
-One or more packages to be converted to DU format.
-.RE
-
-.SH EXAMPLES
-.LP
-\fBExample 1 \fRCreating a DU CD/DVD
-.sp
-.LP
-The following commands create a DU CD or DVD containing packages \fBSUNWfoo\fR
-and \fBSUNWbar\fR.
-
-.sp
-.in +2
-.nf
-# \fB/usr/bin/pkg2du -r 5.10 -o my.iso SUNWfoo SUNWbar\fR
-# \fB/usr/bin/cdrw -i my.iso\fR
-.fi
-.in -2
-.sp
-
-.SH ATTRIBUTES
-.sp
-.LP
-See \fBattributes\fR(5) for descriptions of the following attributes:
-.sp
-
-.sp
-.TS
-box;
-c | c
-l | l .
-ATTRIBUTE TYPE	ATTRIBUTE VALUE
-_
-Interface Stability	Committed
-.TE
-
-.SH SEE ALSO
-.sp
-.LP
-\fBcdrw\fR(1), \fBmkbootmedia\fR(1M), \fBattributes\fR(5)
-.sp
-.LP
-\fBmkisofs(8)\fR, (\fB/usr/share/man/man8/mkisofs.8\fR), in the
-\fBSUNWfsman\fR package (not a SunOS man page)
--- a/usr/src/man/man1m/root_archive.1m	Mon May 14 12:05:00 2012 -0700
+++ b/usr/src/man/man1m/root_archive.1m	Mon May 14 12:16:08 2012 -0700
@@ -3,6 +3,7 @@
 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
 .\"  See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the
 .\" fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
+.\" Copyright 2012 Nexenta Systems, Inc. All rights reserved.
 .TH ROOT_ARCHIVE 1M "Sep 9, 2009"
 .SH NAME
 root_archive \- manage bootable miniroot archives
@@ -17,35 +18,16 @@
 \fB/boot/solaris/bin/root_archive\fR unpack \fIarchive\fR \fIroot\fR
 .fi
 
-.LP
-.nf
-\fB/boot/solaris/bin/root_archive\fR packmedia \fIsolaris_image\fR \fIroot\fR
-.fi
-
-.LP
-.nf
-\fB/boot/solaris/bin/root_archive\fR unpackmedia \fIsolaris_image\fR \fIroot\fR
-.fi
-
 .SH DESCRIPTION
 .sp
 .LP
-The \fBroot_archive\fR utility is used to manipulate boot archives and the
-bootable miniroot(s) in a Solaris install image. The utility can pack and
-unpack boot archives and image miniroots. Both \fBufs\fR and \fBhsfs\fR
+The \fBroot_archive\fR utility is used to manipulate boot archives. 
+The utility can pack and unpack boot archives and image miniroots. Both \fBufs\fR and \fBhsfs\fR
 (\fBiso9660\fR) format archives can be unpacked, although only \fBufs\fR format
 is generated when packing.
 .sp
 .LP
-For normal, boot-related system administration, \fBbootadm\fR(1M) is
-recommended. \fBroot_archive\fR's primary purpose is to enable OEMs to add or
-update a driver or other component on the Solaris install media.
-.sp
-.LP
-A miniroot and a boot archive is closely associated with the release it is
-intended to boot. To ensure that the tools and system services used to
-construct the miniroot match, miniroot manipulation must be performed only on a
-system running the same release for which the miniroot is intended to install.
+For normal, boot-related system administration, \fBbootadm\fR(1M) is recommended.
 .SH SUBCOMMANDS
 .sp
 .LP
@@ -65,79 +47,11 @@
 \fB\fBunpack\fR \fIarchive\fR \fIroot\fR\fR
 .ad
 .sp .6
-.RS 4n
+.RS 21n
 Unpack the contents of the boot archive named \fIarchive\fR to the directory
 named \fIroot\fR.
 .RE
 
-.sp
-.ne 2
-.na
-\fB\fBpackmedia\fR \fIsolaris_image\fR \fIroot\fR\fR
-.ad
-.sp .6
-.RS 4n
-Create and pack the miniroot(s) in \fIsolaris_image\fR from the contents of the
-directory named \fIroot\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBunpackmedia\fR \fIsolaris_image\fR \fIroot\fR\fR
-.ad
-.sp .6
-.RS 4n
-Unpack the contents of the miniroot(s) in \fIsolaris_image\fR to the directory
-named \fIroot\fR.
-.RE
-
-.sp
-.LP
-The contents of a miniroot are constructed to need the requirements of the
-release. When unpacking a miniroot, all the contents of the miniroot(s) are
-unpacked. When packing a miniroot, the source directory must contain all the
-necessary components with which to construct a miniroot. In general, this can
-only be achieved by first unpacking an existing miniroot.
-.SH EXAMPLES
-.LP
-\fBExample 1 \fRUnpacking the Miniroots in a Solaris x86 Install Image
-.sp
-.LP
-The following command unpacks the miniroots in a Solaris image to the root
-directory in \fB/export/release/latest\fR.
-
-.sp
-.in +2
-.nf
-# \fBroot_archive unpackmedia \e\fR
-\fB/export/nv/solarisdvd.nvx_dvd/latest /export/release/latest/root\fR
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-In the preceding, \fB/export/nv/solarisdvd.nvx_dvd/latest\fR represents a path
-to a Solaris x86 install image and \fB/export/release/latest/root\fR is a
-directory that will be purged or created, as necessary.
-
-.LP
-\fBExample 2 \fRPacking the Miniroots in a Solaris x86 Install Image
-.sp
-.LP
-The following command creates and packs the miniroot(s) in a Solaris image from
-the contents of the directory \fB/export/release/latest/root\fR.
-
-.sp
-.in +2
-.nf
-# \fBroot_archive packmedia \e\fR
-\fB/export/nv/solarisdvd.nvx_dvd/latest /export/release/latest/root\fR
-.fi
-.in -2
-.sp
-
 .SH EXIT STATUS
 .sp
 .LP
--- a/usr/src/man/man1m/updatemedia.1m	Mon May 14 12:05:00 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-'\" te
-.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH UPDATEMEDIA 1M "Sep 23, 2009"
-.SH NAME
-updatemedia \- modify Solaris media with patches and packages
-.SH SYNOPSIS
-.LP
-.nf
-\fB/usr/bin/updatemedia\fR  \fB-d\fR \fImedia-root\fR [\fB-v\fR] [\fB-o\fR \fIiso\fR] [\fB-l\fR \fIlabel\fR]
-     \fIpkg_or_patch\fR [\fIpkg_or_patch\fR ...]
-.fi
-
-.SH DESCRIPTION
-.sp
-.LP
-The \fBupdatemedia\fR utility takes a list of patches and packages as input and
-updates the install miniroot in \fImedia-root\fR (the root directory of an
-on-disk image of a Solaris installation media) to include the specified patches
-and packages. These patches and packages are also placed in a subdirectory
-called \fBDU\fR under the Solaris install image. For example:
-.sp
-.in +2
-.nf
-\fImedia-root\fR/Solaris_10/DU
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-When booting a system from the updated media, the patches and packages will be
-part of the booted Solaris image. They will also be applied to the target
-system being installed at the end of the installation process.
-.sp
-.LP
-If \fB-o\fR is specified, a bootable ISO image is created in the file
-\fBmedia.iso\fR that contains the Solaris install media. The ISO image can then
-be burned onto a CD/DVD with utilities such as \fBcdrw\fR(1) or
-\fBcdrecord(1)\fR. (The latter is not a SunOS man page.)
-.SH OPTIONS
-.sp
-.LP
-The following options are supported:
-.sp
-.ne 2
-.na
-\fB\fB-d\fR \fImedia-root\fR\fR
-.ad
-.sp .6
-.RS 4n
-Top-level directory of on-disk image of Solaris installation media. This is
-option must be specified.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-o\fR \fIiso\fR\fR
-.ad
-.sp .6
-.RS 4n
-Create a Solaris ISO image of \fImedia-root\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-l\fR \fIlabel\fR\fR
-.ad
-.sp .6
-.RS 4n
-Label/volume name of the ISO image (if \fB-o\fR option is specified). If
-\fB-o\fR is not specified, the name of Solaris directory under
-\fImedia-root\fR, for example, \fBSolaris_10\fR, will be used.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-v\fR\fR
-.ad
-.sp .6
-.RS 4n
-Verbose. Multiple \fB-v\fR options increase verbosity.
-.RE
-
-.SH OPERANDS
-.sp
-.LP
-The following operands are supported:
-.sp
-.ne 2
-.na
-\fB\fIpkg_or_patch\fR [\fIpkg_or_patch\fR ...]\fR
-.ad
-.sp .6
-.RS 4n
-One or more patches or packages (you can have both patches and packages in a
-single command) with which the Solaris installation media \fImedia-root\fR will
-be updated.
-.RE
-
-.SH EXAMPLES
-.LP
-\fBExample 1 \fRUpdating a Solaris Install Image with Patch and Package
-.sp
-.LP
-The following command updates the Solaris install image in \fBs10u1\fR by
-adding patch \fB123456-07\fR and package \fBSUNWfoo\fR.
-
-.sp
-.in +2
-.nf
-# \fB/usr/bin/updatemedia -d s10u1 SUNWfoo 123456-07\fR
-.fi
-.in -2
-.sp
-
-.SH ATTRIBUTES
-.sp
-.LP
-See \fBattributes\fR(5) for descriptions of the following attributes:
-.sp
-
-.sp
-.TS
-box;
-c | c
-l | l .
-ATTRIBUTE TYPE	ATTRIBUTE VALUE
-_
-Interface Stability	Committed
-.TE
-
-.SH SEE ALSO
-.sp
-.LP
-\fBcdrw\fR(1), \fBmkbootmedia\fR(1M), \fBattributes\fR(5)
-.sp
-.LP
-\fBmkisofs(8)\fR, (\fB/usr/share/man/man8/mkisofs.8\fR), in the
-\fBSUNWfsman\fR package (not a SunOS man page)
--- a/usr/src/pkg/manifests/SUNWcs.man1m.inc	Mon May 14 12:05:00 2012 -0700
+++ b/usr/src/pkg/manifests/SUNWcs.man1m.inc	Mon May 14 12:16:08 2012 -0700
@@ -10,6 +10,7 @@
 #
 
 # Copyright 2011, Richard Lowe
+# Copyright 2012 Nexenta Systems, Inc. All rights reserved.
 
 file path=usr/share/man/man1m/6to4relay.1m
 file path=usr/share/man/man1m/Intro.1m
@@ -138,7 +139,6 @@
 file path=usr/share/man/man1m/ipsecalgs.1m
 file path=usr/share/man/man1m/ipsecconf.1m
 file path=usr/share/man/man1m/ipseckey.1m
-file path=usr/share/man/man1m/itu.1m
 file path=usr/share/man/man1m/keyserv.1m
 file path=usr/share/man/man1m/killall.1m
 file path=usr/share/man/man1m/ksslcfg.1m
@@ -155,7 +155,6 @@
 file path=usr/share/man/man1m/logins.1m
 file path=usr/share/man/man1m/mail.local.1m
 file path=usr/share/man/man1m/makedbm.1m
-file path=usr/share/man/man1m/mkbootmedia.1m
 file path=usr/share/man/man1m/mkdevalloc.1m
 file path=usr/share/man/man1m/mkdevmaps.1m
 file path=usr/share/man/man1m/mkfile.1m
@@ -186,7 +185,6 @@
 file path=usr/share/man/man1m/nwamd.1m
 file path=usr/share/man/man1m/passmgmt.1m
 file path=usr/share/man/man1m/pbind.1m
-file path=usr/share/man/man1m/pkg2du.1m
 file path=usr/share/man/man1m/pmadm.1m
 file path=usr/share/man/man1m/ports.1m
 file path=usr/share/man/man1m/poweroff.1m
@@ -278,7 +276,6 @@
 file path=usr/share/man/man1m/unshare_nfs.1m
 file path=usr/share/man/man1m/unshareall.1m
 file path=usr/share/man/man1m/update_drv.1m
-file path=usr/share/man/man1m/updatemedia.1m
 file path=usr/share/man/man1m/useradd.1m
 file path=usr/share/man/man1m/userdel.1m
 file path=usr/share/man/man1m/usermod.1m
--- a/usr/src/pkg/manifests/SUNWcs.mf	Mon May 14 12:05:00 2012 -0700
+++ b/usr/src/pkg/manifests/SUNWcs.mf	Mon May 14 12:16:08 2012 -0700
@@ -21,7 +21,7 @@
 
 #
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
-# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2012 Nexenta Systems, Inc. All rights reserved.
 #
 
 <include SUNWcs.man1.inc>
@@ -785,7 +785,6 @@
 file path=usr/bin/iostat mode=0555
 file path=usr/bin/isainfo mode=0555
 file path=usr/bin/isalist mode=0555
-file path=usr/bin/itu mode=0555
 file path=usr/bin/kbd mode=0555
 file path=usr/bin/keylogin mode=0555
 file path=usr/bin/keylogout mode=0555
@@ -805,7 +804,6 @@
 file path=usr/bin/mailx group=mail mode=2511
 file path=usr/bin/makedev mode=0555
 file path=usr/bin/mesg mode=0555
-file path=usr/bin/mkbootmedia mode=0555
 file path=usr/bin/mkdir mode=0555
 file path=usr/bin/mkpwdict mode=0555
 file path=usr/bin/mktemp mode=0555
@@ -824,7 +822,6 @@
 file path=usr/bin/pfexec mode=0555
 file path=usr/bin/pg mode=0555
 file path=usr/bin/pgrep mode=0555
-file path=usr/bin/pkg2du mode=0555
 file path=usr/bin/pktool mode=0555
 file path=usr/bin/pr mode=0555
 file path=usr/bin/printf mode=0555
@@ -863,7 +860,6 @@
 file path=usr/bin/true mode=0555
 file path=usr/bin/tty mode=0555
 file path=usr/bin/tzselect mode=0555
-file path=usr/bin/updatemedia mode=0555
 file path=usr/bin/userattr mode=0555
 file path=usr/bin/vmstat mode=0555
 file path=usr/bin/which mode=0555