4293 x86.microroot seems larger than it needs to be
authorKaren Tung <Karen.Tung@Sun.COM>
Sun, 02 Nov 2008 00:14:18 -0700
changeset 333 50e5672aba74
parent 332 9d076128dd86
child 334 50ca93e75c8f
4293 x86.microroot seems larger than it needs to be
usr/src/cmd/distro_const/auto_install/ai_x86_image.xml
usr/src/cmd/distro_const/slim_cd/all_lang_slim_cd.xml
usr/src/cmd/distro_const/slim_cd/slim_cd.xml
usr/src/cmd/distro_const/utils/bootroot_configure
usr/src/cmd/distro_const/utils/pre_bootroot_pkg_image_mod
--- a/usr/src/cmd/distro_const/auto_install/ai_x86_image.xml	Sat Nov 01 16:10:45 2008 -0600
+++ b/usr/src/cmd/distro_const/auto_install/ai_x86_image.xml	Sun Nov 02 00:14:18 2008 -0700
@@ -502,8 +502,7 @@
 			<base_include type="file">usr/share/lib/xml/dtd/service_bundle.dtd.1</base_include>
 			<base_include type="file">var/sadm/install/admin/default</base_include>
 			<base_include type="file">var/sadm/system/admin/default_java</base_include>
-			<base_include type="file">var/sadm/README</base_include>
-			<base_include type="file">var/adm/spellhist</base_include>
+			<base_include type="file">var/sadm/install/contents</base_include>
 			<base_include type="file">var/adm/utmpx</base_include>
 			<base_include type="file">var/adm/wtmpx</base_include>
 			<base_include type="file">var/adm/aculog</base_include>
@@ -526,12 +525,12 @@
 			<base_include type="dir">sbin</base_include>
 			<base_include type="dir">dev</base_include>
 			<base_include type="dir">devices</base_include>
-			<base_include type="dir">opt</base_include>
 			<base_include type="dir">root</base_include>
 			<base_include type="dir">jack</base_include>
 			<base_include type="dir">var/svc/manifest</base_include>
 			<base_include type="dir">var/svc/profile</base_include>
 			<base_include type="dir">var/pkg/catalog</base_include>
+			<base_include type="file">var/pkg/cfg_cache</base_include>
 			<base_include type="dir">etc</base_include>
 			<base_exclude type="dir">etc/gconf</base_exclude>
 			<base_exclude type="dir">etc/brltty</base_exclude>
@@ -560,6 +559,11 @@
 			     This argslist is a whitespace-separated list of double
 			     quoted strings. -->
 			<finalizer>
+				<script name="/usr/share/distro_const/pre_bootroot_pkg_image_mod">
+					<checkpoint
+						name="im-mod"
+						message="Image area modifications"/>
+				</script>
 				<script name="/usr/share/distro_const/bootroot_initialize.py">
 					<checkpoint
 						name="br-init"
--- a/usr/src/cmd/distro_const/slim_cd/all_lang_slim_cd.xml	Sat Nov 01 16:10:45 2008 -0600
+++ b/usr/src/cmd/distro_const/slim_cd/all_lang_slim_cd.xml	Sun Nov 02 00:14:18 2008 -0700
@@ -175,8 +175,7 @@
 			<base_include type="file">usr/share/lib/xml/dtd/service_bundle.dtd.1</base_include>
 			<base_include type="file">var/sadm/install/admin/default</base_include>
 			<base_include type="file">var/sadm/system/admin/default_java</base_include>
-			<base_include type="file">var/sadm/README</base_include>
-			<base_include type="file">var/adm/spellhist</base_include>
+			<base_include type="file">var/sadm/install/contents</base_include>
 			<base_include type="file">var/adm/utmpx</base_include>
 			<base_include type="file">var/adm/wtmpx</base_include>
 			<base_include type="file">var/adm/aculog</base_include>
@@ -200,12 +199,12 @@
 			<base_include type="dir">dev</base_include>
 			<base_include type="dir">devices</base_include>
 			<base_include type="dir">usr/lib/devfsadm/linkmod</base_include>
-			<base_include type="dir">opt</base_include>
 			<base_include type="dir">root</base_include>
 			<base_include type="dir">jack</base_include>
 			<base_include type="dir">var/svc/manifest</base_include>
 			<base_include type="dir">var/svc/profile</base_include>
 			<base_include type="dir">var/pkg/catalog</base_include>
+			<base_include type="file">var/pkg/cfg_cache</base_include>
 			<base_include type="dir">etc</base_include>
 			<base_exclude type="dir">etc/gconf</base_exclude>
 			<base_exclude type="dir">etc/brltty</base_exclude>
@@ -249,6 +248,11 @@
 				This argslist is a whitespace-separated list of double
 				quoted strings. -->
 			<finalizer>
+				<script name="/usr/share/distro_const/pre_bootroot_pkg_image_mod">
+					<checkpoint
+						name="im-mod"
+						message="Image area modifications"/>
+				</script>
 				<script name="/usr/share/distro_const/slim_cd/slimcd_pre_bootroot_pkg_image_mod">
 					<checkpoint
 						name="slim-im-mod"
--- a/usr/src/cmd/distro_const/slim_cd/slim_cd.xml	Sat Nov 01 16:10:45 2008 -0600
+++ b/usr/src/cmd/distro_const/slim_cd/slim_cd.xml	Sun Nov 02 00:14:18 2008 -0700
@@ -174,8 +174,7 @@
 			<base_include type="file">usr/share/lib/xml/dtd/service_bundle.dtd.1</base_include>
 			<base_include type="file">var/sadm/install/admin/default</base_include>
 			<base_include type="file">var/sadm/system/admin/default_java</base_include>
-			<base_include type="file">var/sadm/README</base_include>
-			<base_include type="file">var/adm/spellhist</base_include>
+			<base_include type="file">var/sadm/install/contents</base_include>
 			<base_include type="file">var/adm/utmpx</base_include>
 			<base_include type="file">var/adm/wtmpx</base_include>
 			<base_include type="file">var/adm/aculog</base_include>
@@ -199,12 +198,12 @@
 			<base_include type="dir">dev</base_include>
 			<base_include type="dir">devices</base_include>
 			<base_include type="dir">usr/lib/devfsadm/linkmod</base_include>
-			<base_include type="dir">opt</base_include>
 			<base_include type="dir">root</base_include>
 			<base_include type="dir">jack</base_include>
 			<base_include type="dir">var/svc/manifest</base_include>
 			<base_include type="dir">var/svc/profile</base_include>
 			<base_include type="dir">var/pkg/catalog</base_include>
+			<base_include type="file">var/pkg/cfg_cache</base_include>
 			<base_include type="dir">etc</base_include>
 			<base_exclude type="dir">etc/gconf</base_exclude>
 			<base_exclude type="dir">etc/brltty</base_exclude>
@@ -248,6 +247,11 @@
 				This argslist is a whitespace-separated list of double
 				quoted strings. -->
 			<finalizer>
+				<script name="/usr/share/distro_const/pre_bootroot_pkg_image_mod">
+					<checkpoint
+						name="im-mod"
+						message="Image area modifications"/>
+				</script>
 				<script name="/usr/share/distro_const/slim_cd/slimcd_pre_bootroot_pkg_image_mod">
 					<checkpoint
 						name="slim-im-mod"
--- a/usr/src/cmd/distro_const/utils/bootroot_configure	Sat Nov 01 16:10:45 2008 -0600
+++ b/usr/src/cmd/distro_const/utils/bootroot_configure	Sun Nov 02 00:14:18 2008 -0700
@@ -262,6 +262,9 @@
 $MKDIR .cdrom
 $CHMOD 0755 .cdrom
 
+# create a symlink in the bootroot to the opt directory in the misc archive
+$LN -s /mnt/misc/opt opt
+
 #
 # Additional /var /etc setup. A bunch of files in /var and /etc
 # are left out of the ramdisk otherwise they will increase ramdisk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/distro_const/utils/pre_bootroot_pkg_image_mod	Sun Nov 02 00:14:18 2008 -0700
@@ -0,0 +1,84 @@
+#!/bin/ksh
+#
+# 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.
+#
+
+# =============================================================================
+# =============================================================================
+# pre_bootroot_pkg_image_mod
+#
+# Customizations to the package image area before bootroot construction begins.
+# =============================================================================
+# =============================================================================
+
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# Main
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# Customizations to the package image area before bootroot construction begins.
+# This script must be called after the package image area is populated.
+# 
+# Args:
+#   MFEST_SOCKET: Socket needed to get manifest data via ManifestRead object
+#	(not used)
+#
+#   PKG_IMG_PATH: Package image area
+#
+#   TMP_DIR: Temporary directory to contain the bootroot file (not used)
+#
+#   BR_BUILD: Area where bootroot is put together (not used)
+#
+#   MEDIA_DIR: Area where the media is put (not used)
+#
+# Note: Finalizer scripts are called with at least these five args.  However,
+# only the PKG_IMG_PATH arg is actually used by this script.
+
+# Note: This assumes a populated pkg_image area exists at the location
+#		${PKG_IMG_PATH}.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+RM=/bin/rm
+
+if [ "$#" != "5" ] ; then
+	print -u2 "Usage: $0: pre_bootroot_pkg_image_mod: Requires 5 args:"
+	print -u2 "    Reader socket, pkg_image area, tmp_dir, " \
+	    "bootroot build area, media area"
+	exit 1
+fi
+
+PKG_IMG_PATH=$2
+if [ ! -d $PKG_IMG_PATH ] ; then
+	print -u2 "$0: Image package area $PKG_IMG_PATH is not valid"
+	exit 1
+fi
+
+#
+# Remove the var/pkg/catalog/catalog.pkl file from the IPS data directory.
+# This file is big, and it is not really needed.  pkg(5) will re-created
+# if it is needed.
+#
+${RM} -f $PKG_IMG_PATH/var/pkg/catalog/catalog.pkl
+
+exit 0