5787 microroot name shouldn't be ISA specific
authorSue Sohn <Susan.Sohn@Sun.COM>
Thu, 15 Jan 2009 15:04:15 -0700
changeset 412 3e8e42610970
parent 411 e2496cbb7052
child 413 9489650a020c
5787 microroot name shouldn't be ISA specific 5789 Sticky bit on bootroot file
usr/src/cmd/distro_const/DC_defs.py
usr/src/cmd/distro_const/auto_install/Makefile
usr/src/cmd/distro_const/auto_install/ai_post_bootroot_archive
usr/src/cmd/distro_const/auto_install/ai_x86_image.xml
usr/src/cmd/distro_const/docs/manifestfile.html
usr/src/cmd/distro_const/slim_cd/all_lang_slim_cd_x86.xml
usr/src/cmd/distro_const/slim_cd/slim_cd_x86.xml
usr/src/cmd/distro_const/utils/bootroot_archive.py
usr/src/cmd/distro_const/utils/grub_setup.py
usr/src/cmd/installadm/docs/scenario.html
usr/src/cmd/installadm/installadm-common.sh
usr/src/cmd/installadm/installadm.c
usr/src/cmd/installadm/installadm.h
usr/src/cmd/installadm/setup-sparc.sh
usr/src/cmd/slim-install/listcd/listcd.c
usr/src/lib/libict_pymod/ict.py
usr/src/lib/libtransfer/transfer_mod.py
usr/src/pkgdefs/SUNWdistro-const/prototype_com
--- a/usr/src/cmd/distro_const/DC_defs.py	Thu Jan 15 10:50:18 2009 -0800
+++ b/usr/src/cmd/distro_const/DC_defs.py	Thu Jan 15 15:04:15 2009 -0700
@@ -135,8 +135,7 @@
 LOGS = "/logs"
 
 # boot root definitions
-BR_SPARC_FILENAME = "/boot/sparc.microroot"
-BR_X86_FILENAME = "/boot/x86.microroot"
+BR_FILENAME = "/boot/boot_archive"
 DC_LOGGER_NAME="dc_logger"
 
 # error codes
--- a/usr/src/cmd/distro_const/auto_install/Makefile	Thu Jan 15 10:50:18 2009 -0800
+++ b/usr/src/cmd/distro_const/auto_install/Makefile	Thu Jan 15 15:04:15 2009 -0700
@@ -36,7 +36,6 @@
 			ai_sparc_image.xml \
 			ai_bootroot_configure \
 			ai_post_bootroot_configure \
-			ai_post_bootroot_archive \
 			ai_post_bootroot_pkg_image_mod
 		
 ROOT_AUTOINSTALL_FILES=	$(AUTOINSTALL_FILES:%=$(ROOTDC_AI)/%)
--- a/usr/src/cmd/distro_const/auto_install/ai_post_bootroot_archive	Thu Jan 15 10:50:18 2009 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-#!/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.
-#
-
-# =============================================================================
-# =============================================================================
-# ai_post_bootroot_archive
-#
-# bootroot modifications specific for automated install, to be made 
-# after the bootroot archive is built
-# =============================================================================
-# =============================================================================
-
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-# Main
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-# Perform special bootroot customization for automated installer images.
-# 
-# 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: Although finalizer scripts receive at least the five args above, this
-# script uses only PKG_IMG_PATH.
-#
-# Note: This assumes pkg_image area is intact.
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-# Verify argument count
-if [ $# != 5 ] ; then
-	print -u2 "$0: Requires 5 args:"
-	print -u2 "    Reader socket, pkg_image mntpt, tmp dir,"
-	print -u2 "    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
-
-# Set the sticky bit on the microroot
-if [ -f ${PKG_IMG_PATH}/boot/x86.microroot ] ; then
-	/usr/bin/chmod +t ${PKG_IMG_PATH}/boot/x86.microroot
-	exit 0
-fi
-
-exit 1
--- a/usr/src/cmd/distro_const/auto_install/ai_x86_image.xml	Thu Jan 15 10:50:18 2009 -0800
+++ b/usr/src/cmd/distro_const/auto_install/ai_x86_image.xml	Thu Jan 15 15:04:15 2009 -0700
@@ -631,11 +631,6 @@
 						name="br-arch"
 						message="Boot root archiving"/>
 				</script>
-				<script name="/usr/share/distro_const/auto_install/ai_post_bootroot_archive">
-					<checkpoint
-						name="ai-post-br-arch"
-						message="Auto Install post boot root archiving"/>
-				</script>
 				<script name="/usr/share/distro_const/auto_install/ai_post_bootroot_pkg_image_mod">
 					<checkpoint
 						name="ai-post-mod"
--- a/usr/src/cmd/distro_const/docs/manifestfile.html	Thu Jan 15 10:50:18 2009 -0800
+++ b/usr/src/cmd/distro_const/docs/manifestfile.html	Thu Jan 15 15:04:15 2009 -0700
@@ -266,7 +266,7 @@
     &lt;line>
 kernel$ /platform/i86pc/kernel/$ISADIR/unix -B assistive_tech=magnifier
 &lt;/line>
-&lt;line>module /boot/x86.microroot&lt;/line>
+&lt;line>module /boot/boot_archive&lt;/line>
 &lt;/entry>
 
     &lt;entry>
@@ -275,7 +275,7 @@
     &lt;line>
 kernel$ /platform/i86pc/kernel/$ISADIR/unix -B assistive_tech=reader
 &lt;/line>
-&lt;line>module /boot/x86.microroot&lt;/line>
+&lt;line>module /boot/boot_archive&lt;/line>
 &lt;/entry>
 &lt;/grub_menu_modifications>
 
--- a/usr/src/cmd/distro_const/slim_cd/all_lang_slim_cd_x86.xml	Thu Jan 15 10:50:18 2009 -0800
+++ b/usr/src/cmd/distro_const/slim_cd/all_lang_slim_cd_x86.xml	Thu Jan 15 15:04:15 2009 -0700
@@ -164,12 +164,12 @@
 			<entry>
 				<title_suffix>with magnifier</title_suffix>
 				<line>kernel$ /platform/i86pc/kernel/$ISADIR/unix -B assistive_tech=magnifier</line>
-				<line>module /boot/x86.microroot</line>
+				<line>module /boot/boot_archive</line>
 			</entry>
 			<entry>
 				<title_suffix>with screen reader</title_suffix>
 				<line>kernel$ /platform/i86pc/kernel/$ISADIR/unix -B assistive_tech=reader</line>
-				<line>module /boot/x86.microroot</line>
+				<line>module /boot/boot_archive</line>
 			</entry>
 		</grub_menu_modifications>
 		<!--
--- a/usr/src/cmd/distro_const/slim_cd/slim_cd_x86.xml	Thu Jan 15 10:50:18 2009 -0800
+++ b/usr/src/cmd/distro_const/slim_cd/slim_cd_x86.xml	Thu Jan 15 15:04:15 2009 -0700
@@ -164,12 +164,12 @@
 			<entry>
 				<title_suffix>with magnifier</title_suffix>
 				<line>kernel$ /platform/i86pc/kernel/$ISADIR/unix -B assistive_tech=magnifier</line>
-				<line>module /boot/x86.microroot</line>
+				<line>module /boot/boot_archive</line>
 			</entry>
 			<entry>
 				<title_suffix>with screen reader</title_suffix>
 				<line>kernel$ /platform/i86pc/kernel/$ISADIR/unix -B assistive_tech=reader</line>
-				<line>module /boot/x86.microroot</line>
+				<line>module /boot/boot_archive</line>
 			</entry>
 		</grub_menu_modifications>
 		<!--
--- a/usr/src/cmd/distro_const/utils/bootroot_archive.py	Thu Jan 15 10:50:18 2009 -0800
+++ b/usr/src/cmd/distro_const/utils/bootroot_archive.py	Thu Jan 15 15:04:15 2009 -0700
@@ -44,8 +44,7 @@
 from osol_install.distro_const.DC_defs import BOOT_ROOT_COMPRESSION_LEVEL
 from osol_install.distro_const.DC_defs import BOOT_ROOT_COMPRESSION_TYPE
 from osol_install.distro_const.DC_defs import BOOT_ROOT_SIZE_PAD
-from osol_install.distro_const.DC_defs import BR_X86_FILENAME
-from osol_install.distro_const.DC_defs import BR_SPARC_FILENAME
+from osol_install.distro_const.DC_defs import BR_FILENAME
 from osol_install.distro_const.DC_defs import \
     BOOT_ROOT_CONTENTS_BASE_INCLUDE_NOCOMPRESS
 
@@ -247,11 +246,7 @@
 # Destination and name of bootroot file.
 is_sparc = (platform.platform().find('sparc') >= 0)
 
-if is_sparc:
-	BR_ARCHFILE = PKG_IMG_MNT_PT + BR_SPARC_FILENAME
-else:
-	BR_ARCHFILE = PKG_IMG_MNT_PT + BR_X86_FILENAME
-
+BR_ARCHFILE = PKG_IMG_MNT_PT + BR_FILENAME
 
 # Location of the lofi file mountpoint, known only to this file.
 BR_LOFI_MNT_PT = TMP_DIR + "/br_lofimnt"
@@ -351,7 +346,7 @@
 	
 	# Install the boot blocks. This only is done on a sparc image.
 	cmd = PKG_IMG_MNT_PT + LOFIADM + " " + PKG_IMG_MNT_PT + \
-	    BR_SPARC_FILENAME + " | " + PKG_IMG_MNT_PT + SED + " s/lofi/rlofi/"
+	    BR_FILENAME + " | " + PKG_IMG_MNT_PT + SED + " s/lofi/rlofi/"
 	try:
 		phys_dev = Popen(cmd, shell=True,
 		    stdout=PIPE).communicate()[0]
--- a/usr/src/cmd/distro_const/utils/grub_setup.py	Thu Jan 15 10:50:18 2009 -0800
+++ b/usr/src/cmd/distro_const/utils/grub_setup.py	Thu Jan 15 15:04:15 2009 -0700
@@ -19,7 +19,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -140,19 +140,19 @@
 entry = []
 entry.append("title " + release)
 entry.append("\tkernel$ /platform/i86pc/kernel/$ISADIR/unix")
-entry.append("\tmodule /boot/x86.microroot")
+entry.append("\tmodule /boot/boot_archive")
 entries.append(entry)
 
 entry = []
 entry.append("title " + release + " VESA driver")
 entry.append("\tkernel$ /platform/i86pc/kernel/$ISADIR/unix -B livemode=vesa")
-entry.append("\tmodule /boot/x86.microroot")
+entry.append("\tmodule /boot/boot_archive")
 entries.append(entry)
 
 entry = []
 entry.append("title " + release + " text console")
 entry.append("\tkernel$ /platform/i86pc/kernel/$ISADIR/unix -B livemode=text")
-entry.append("\tmodule /boot/x86.microroot")
+entry.append("\tmodule /boot/boot_archive")
 entries.append(entry)
 
 entry = []
--- a/usr/src/cmd/installadm/docs/scenario.html	Thu Jan 15 10:50:18 2009 -0800
+++ b/usr/src/cmd/installadm/docs/scenario.html	Thu Jan 15 15:04:15 2009 -0700
@@ -177,7 +177,7 @@
 install_media=http://135.134.0.0.:5555:/export/opensolaris/myimage,install_boot=
 http://135.134.0.0.:555:/export/opensolaris/myimage/boot,
 install_service=myservice,livemode=text
-        module /I86PC.OpenSolaris-1/x86.microroot</pre>
+        module /I86PC.OpenSolaris-1/boot_archive</pre>
          </div>
       </td>
    </tr>
--- a/usr/src/cmd/installadm/installadm-common.sh	Thu Jan 15 10:50:18 2009 -0800
+++ b/usr/src/cmd/installadm/installadm-common.sh	Thu Jan 15 15:04:15 2009 -0700
@@ -89,12 +89,12 @@
 get_image_type()
 {
 	image_path=$1
-	if [ -f ${image_path}/boot/sparc.microroot ]; then
+	if [ -d ${image_path}/platform/sun4v ]; then
 		image_type="${SPARC_IMAGE}"
-	elif [ -f ${image_path}/boot/x86.microroot ]; then
+	elif [ -d ${image_path}/platform/i86pc ]; then
 		image_type="${X86_IMAGE}"
 	else 
-		echo "Missing microroot file, invalid OpenSolaris install image"
+		echo "Unable to determine OpenSolaris install image type"
 		exit 1
 	fi
 	echo "$image_type"
@@ -163,7 +163,7 @@
 #
 # Purpose : Create the menu.lst file so that the x86 client can get the
 #	    information about the netimage and download the necessary files.
-#	    It also adds location of the kernel, microroot and other options.
+#	    It also adds location of the kernel, boot_archive and other options.
 #
 # Arguments : 
 #	None, but it is expected that:
@@ -199,7 +199,7 @@
 	printf "${SERVICE_NAME}"  >> ${tmpmenu}
 
 	printf ",livemode=text\n" >> ${tmpmenu}
-	printf "\tmodule /${BootLofs}/x86.microroot\n" >> ${tmpmenu}
+	printf "\tmodule /${BootLofs}/boot_archive\n" >> ${tmpmenu}
 
         mv ${tmpmenu} ${Menufile}
 
--- a/usr/src/cmd/installadm/installadm.c	Thu Jan 15 10:50:18 2009 -0800
+++ b/usr/src/cmd/installadm/installadm.c	Thu Jan 15 15:04:15 2009 -0700
@@ -216,6 +216,7 @@
 	char		*target_directory = NULL;
 
 	struct stat	stat_buf;
+	struct stat 	sb;
 	char		cmd[MAXPATHLEN];
 	char		mpath[MAXPATHLEN];
 	char		bfile[MAXPATHLEN];
@@ -363,17 +364,18 @@
 	}
 
 	/*
-	 * Check whether image is sparc or x86
+	 * Check whether image is sparc or x86 by checking existence
+	 * of key directories
 	 */
 	(void) snprintf(mpath, sizeof (mpath), "%s/%s", target_directory,
-			"boot/sparc.microroot");
-	if (access(mpath, F_OK) == 0) {
+			"platform/sun4v");
+	if ((stat(mpath, &sb) == 0) && S_ISDIR(sb.st_mode)) {
 		have_sparc = B_TRUE;
 	} else {
 		(void) snprintf(mpath, sizeof (mpath), "%s/%s",
-			target_directory, "boot/x86.microroot");
-		if (access(mpath, F_OK) != 0) {
-			(void) fprintf(stderr, MSG_MISSING_MICROROOT_ERR);
+			target_directory, "platform/i86pc");
+		if (stat(mpath, &sb) || !S_ISDIR(sb.st_mode)) {
+			(void) fprintf(stderr, MSG_UNABLE_TO_DETERMINE_ARCH);
 			return (INSTALLADM_FAILURE);
 		}
 	}
--- a/usr/src/cmd/installadm/installadm.h	Thu Jan 15 10:50:18 2009 -0800
+++ b/usr/src/cmd/installadm/installadm.h	Thu Jan 15 15:04:15 2009 -0700
@@ -112,8 +112,8 @@
 	"Cannot access directory %s, error = %d.\n")
 #define	MSG_CREATE_IMAGE_ERR	INSTALLADMSTR(\
 	"Create image failed.\n")
-#define	MSG_MISSING_MICROROOT_ERR	INSTALLADMSTR(\
-	"Missing microroot file, invalid OpenSolaris install image.\n")
+#define	MSG_UNABLE_TO_DETERMINE_ARCH	INSTALLADMSTR(\
+	"Unable to determine OpenSolaris install image type.\n")
 #define	MSG_REGISTER_SERVICE_FAIL	INSTALLADMSTR(\
 	"Failed to register Install Service %s.\n")
 #define	MSG_LIST_SERVICE_FAIL	INSTALLADMSTR(\
--- a/usr/src/cmd/installadm/setup-sparc.sh	Thu Jan 15 10:50:18 2009 -0800
+++ b/usr/src/cmd/installadm/setup-sparc.sh	Thu Jan 15 15:04:15 2009 -0700
@@ -88,7 +88,7 @@
 	printf "${CGIBIN_WANBOOTCGI}\n" >> ${tmpconf}
 
 	printf "root_file=" >> ${tmpconf}
-	printf "${image_path}/boot/sparc.microroot\n" >> ${tmpconf}
+	printf "${image_path}/boot/boot_archive\n" >> ${tmpconf}
 
 	printf "boot_file=" >> ${tmpconf}
 	printf "${image_path}/platform/${pgrp}/wanboot\n" >> ${tmpconf}
--- a/usr/src/cmd/slim-install/listcd/listcd.c	Thu Jan 15 10:50:18 2009 -0800
+++ b/usr/src/cmd/slim-install/listcd/listcd.c	Thu Jan 15 15:04:15 2009 -0700
@@ -20,12 +20,12 @@
  */
 
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
 /*
- * Live CD's microroot contains a minimal set of utilities under /usr and
+ * Live CD's boot_archive contains a minimal set of utilities under /usr and
  * devfsadm isn't there. The smf service live-fs-root bootstaps the process
  * by locating the CDROM device and mounting the compressed /usr and /opt
  * to provide a fully functioning system. To mount these file systems the
--- a/usr/src/lib/libict_pymod/ict.py	Thu Jan 15 10:50:18 2009 -0800
+++ b/usr/src/lib/libict_pymod/ict.py	Thu Jan 15 15:04:15 2009 -0700
@@ -1607,9 +1607,9 @@
                 delete all matching pathnames from the alternate root that
                 are symbolic links.
                 This process is required because of the way the LiveCD env
-                is constructed. Some of the entries in the microroot are
+                is constructed. Some of the entries in the boot_archive are
                 symbolic links to files mounted off a compressed lofi file.
-                This is done to drastically reduce space usage by the microroot.
+                This is done to drastically reduce space usage by the boot_archive.
 		TM 3G
 		side effect: current directory changed to BASEDIR
 		returns 0 if all processing completed successfully, error code if any problems
@@ -1663,7 +1663,7 @@
 		# Cleanup the files and directories that were copied into
 		# the BASEDIR directory that are not needed by the installed OS.
 		file_cleanup_list = [
-		    "/boot/x86.microroot",
+		    "/boot/boot_archive",
 		    "/.livecd",
 		    "/.volumeid",
 		    "/boot/grub/menu.lst",
--- a/usr/src/lib/libtransfer/transfer_mod.py	Thu Jan 15 10:50:18 2009 -0800
+++ b/usr/src/lib/libtransfer/transfer_mod.py	Thu Jan 15 15:04:15 2009 -0700
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Slim Install Transfer Module
@@ -296,10 +296,10 @@
                 delete all matching pathnames from the alternate root that
                 are symbolic links.
                 This process is required because of the way the LiveCD env
-                is constructed. Some of the entries in the microroot are
+                is constructed. Some of the entries in the boot_archive are
                 symbolic links to files mounted off a compressed lofi file.
                 This is done to drastically reduce space usage by the
-                microroot.
+                boot_archive.
 		"""
                 self.dbg_msg("File list for clobber: " + flist_file)
                 fh = open(flist_file, 'r')
--- a/usr/src/pkgdefs/SUNWdistro-const/prototype_com	Thu Jan 15 10:50:18 2009 -0800
+++ b/usr/src/pkgdefs/SUNWdistro-const/prototype_com	Thu Jan 15 15:04:15 2009 -0700
@@ -113,7 +113,6 @@
 f none usr/share/distro_const/auto_install/ai_sparc_image.xml 0444 root sys
 f none usr/share/distro_const/auto_install/ai_bootroot_configure 0555 root bin
 f none usr/share/distro_const/auto_install/ai_post_bootroot_configure 0555 root bin
-f none usr/share/distro_const/auto_install/ai_post_bootroot_archive 0555 root bin
 f none usr/share/distro_const/auto_install/ai_post_bootroot_pkg_image_mod 0555 root bin
 
 #