--- a/usr/src/Targetdirs Fri May 28 15:29:23 2010 -0600
+++ b/usr/src/Targetdirs Mon May 31 15:43:45 2010 -0700
@@ -57,6 +57,7 @@
/usr/bin \
/usr/include \
/usr/lib \
+ /usr/lib/install \
/usr/lib/installadm \
/usr/lib/locale \
/usr/lib/locale/C \
--- a/usr/src/cmd/Makefile.cmd Fri May 28 15:29:23 2010 -0600
+++ b/usr/src/cmd/Makefile.cmd Mon May 31 15:43:45 2010 -0700
@@ -39,6 +39,7 @@
ROOTMANSYSINS = $(ROOTMANSYS)/install
ROOTPROFATTR = $(ROOT)/etc/security/prof_attr.d
ROOTUSRLIBINSTALLADM = $(ROOT)/usr/lib/installadm
+ROOTUSRLIBINSTALL = $(ROOT)/usr/lib/install
ROOTVARSADM = $(ROOT)/var/sadm
ROOTVARINSTADM = $(ROOT)/var/installadm
ROOTVARAIWEB = $(ROOT)/var/installadm/ai-webserver
@@ -51,6 +52,8 @@
ROOTSBINFILES = $(FILES:%=$(ROOTSBIN)/%)
+ROOTUSRLIBINSTALLFILES = $(FILES:%=$(ROOTUSRLIBINSTALL)/%)
+
ROOTEXECATTRFILES = $(EXECATTRFILES:exec_attr.%=$(ROOTEXECATTR)/%)
ROOTPROFATTRFILES = $(PROFATTRFILES:prof_attr.%=$(ROOTPROFATTR)/%)
--- a/usr/src/cmd/Makefile.targ Fri May 28 15:29:23 2010 -0600
+++ b/usr/src/cmd/Makefile.targ Mon May 31 15:43:45 2010 -0700
@@ -165,6 +165,9 @@
$(ROOTUSRLIBINSTALLADM)/%: %
$(INS.file)
+$(ROOTUSRLIBINSTALL)/%: %
+ $(INS.file)
+
$(ROOTVARSADM)/%: %
$(INS.file)
--- a/usr/src/cmd/distro_const/auto_install/ai_sparc_image.xml Fri May 28 15:29:23 2010 -0600
+++ b/usr/src/cmd/distro_const/auto_install/ai_sparc_image.xml Mon May 31 15:43:45 2010 -0700
@@ -626,9 +626,7 @@
<base_include type="dir">etc</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</base_include>
<base_include type="dir">var/sadm</base_include>
- <base_include type="file" fiocompress="false">var/pkg/cfg_cache</base_include>
<base_include type="file" fiocompress="false">etc/svc/repository.db</base_include>
<base_include type="file" fiocompress="false">etc/dev/.devfsadm_dev.lock</base_include>
<base_include type="file" fiocompress="false">etc/name_to_major</base_include>
--- a/usr/src/cmd/distro_const/auto_install/ai_x86_image.xml Fri May 28 15:29:23 2010 -0600
+++ b/usr/src/cmd/distro_const/auto_install/ai_x86_image.xml Mon May 31 15:43:45 2010 -0700
@@ -694,11 +694,7 @@
<base_include type="dir">etc</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</base_include>
<base_include type="dir">var/sadm</base_include>
-
- <base_exclude type="dir">var/pkg/pkg</base_exclude>
- <base_exclude type="dir">var/pkg/history</base_exclude>
<base_exclude type="dir">var/sadm/pkg</base_exclude>
</boot_archive_contents>
</img_params>
--- a/usr/src/cmd/distro_const/slim_cd/all_lang_slim_cd_x86.xml Fri May 28 15:29:23 2010 -0600
+++ b/usr/src/cmd/distro_const/slim_cd/all_lang_slim_cd_x86.xml Mon May 31 15:43:45 2010 -0700
@@ -479,15 +479,12 @@
<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</base_include>
<base_include type="dir">var/sadm</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>
<base_exclude type="dir">etc/gtk-2.0</base_exclude>
<base_exclude type="dir">etc/notices</base_exclude>
- <base_exclude type="dir">var/pkg/pkg</base_exclude>
- <base_exclude type="dir">var/pkg/history</base_exclude>
<base_exclude type="dir">var/sadm/pkg</base_exclude>
</boot_archive_contents>
</img_params>
--- a/usr/src/cmd/distro_const/slim_cd/slim_cd_x86.xml Fri May 28 15:29:23 2010 -0600
+++ b/usr/src/cmd/distro_const/slim_cd/slim_cd_x86.xml Mon May 31 15:43:45 2010 -0700
@@ -474,15 +474,12 @@
<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</base_include>
<base_include type="dir">var/sadm</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>
<base_exclude type="dir">etc/gtk-2.0</base_exclude>
<base_exclude type="dir">etc/notices</base_exclude>
- <base_exclude type="dir">var/pkg/pkg</base_exclude>
- <base_exclude type="dir">var/pkg/history</base_exclude>
<base_exclude type="dir">var/sadm/pkg</base_exclude>
</boot_archive_contents>
</img_params>
--- a/usr/src/cmd/distro_const/text_install/text_mode_sparc.xml Fri May 28 15:29:23 2010 -0600
+++ b/usr/src/cmd/distro_const/text_install/text_mode_sparc.xml Mon May 31 15:43:45 2010 -0700
@@ -166,10 +166,6 @@
<profile path="/var/svc/profile/ns_files.xml"
use_build_sys_file="false"/>
</smf_service_profile>
- <!--
- Needed so pkgadd will run for Driver Update.
- -->
- <size_pad_mb>5</size_pad_mb>
</boot_archive>
</output_image>
</distro_constr_params>
@@ -790,9 +786,7 @@
<base_include type="dir">etc</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</base_include>
<base_include type="dir">var/sadm</base_include>
- <base_include type="file" fiocompress="false">var/pkg/cfg_cache</base_include>
<base_include type="file" fiocompress="false">etc/svc/repository.db</base_include>
<base_include type="file" fiocompress="false">etc/dev/.devfsadm_dev.lock</base_include>
<base_include type="file" fiocompress="false">etc/name_to_major</base_include>
--- a/usr/src/cmd/distro_const/text_install/text_mode_x86.xml Fri May 28 15:29:23 2010 -0600
+++ b/usr/src/cmd/distro_const/text_install/text_mode_x86.xml Mon May 31 15:43:45 2010 -0700
@@ -180,10 +180,6 @@
<profile path="/var/svc/profile/ns_files.xml"
use_build_sys_file="false"/>
</smf_service_profile>
- <!--
- Needed so pkgadd will run for Driver Update.
- -->
- <size_pad_mb>5</size_pad_mb>
</boot_archive>
</output_image>
</distro_constr_params>
@@ -795,15 +791,12 @@
<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</base_include>
<base_include type="dir">var/sadm</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>
<base_exclude type="dir">etc/gtk-2.0</base_exclude>
<base_exclude type="dir">etc/notices</base_exclude>
- <base_exclude type="dir">var/pkg/pkg</base_exclude>
- <base_exclude type="dir">var/pkg/history</base_exclude>
<base_exclude type="dir">var/sadm/pkg</base_exclude>
</boot_archive_contents>
</img_params>
--- a/usr/src/cmd/slim-install/Makefile Fri May 28 15:29:23 2010 -0600
+++ b/usr/src/cmd/slim-install/Makefile Mon May 31 15:43:45 2010 -0700
@@ -19,13 +19,13 @@
# CDDL HEADER END
#
#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
include $(SRC)/Makefile.master
-SUBDIRS= config finish license listusb listcd svc trace user/jack
+SUBDIRS= config finish license listusb listcd svc trace user/jack \
+ var_pkg_move
.PARALLEL:
--- a/usr/src/cmd/slim-install/svc/Makefile Fri May 28 15:29:23 2010 -0600
+++ b/usr/src/cmd/slim-install/svc/Makefile Mon May 31 15:43:45 2010 -0700
@@ -22,7 +22,7 @@
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
-SYSMANIFESTSRC= live-sysidtool.xml live-io-tracing.xml live-var-pkg-move.xml
+SYSMANIFESTSRC= live-sysidtool.xml live-io-tracing.xml
SYSFSMANIFESTSRC= live-root-fs.xml live-usr-fs.xml \
live-root-fs-minimal.xml
@@ -30,8 +30,7 @@
A11YMANIFESTSRC= live-a11y.xml
SVCMETHODSRC= media-fs-root live-fs-root-minimal \
- live-sysidtool-system live-io-tracing live-a11y \
- net-fs-root live-var-pkg-move
+ live-sysidtool-system live-io-tracing live-a11y net-fs-root
SVCSHARESRC= live_fs_include.sh
--- a/usr/src/cmd/slim-install/svc/live-var-pkg-move Fri May 28 15:29:23 2010 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-#!/sbin/sh
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (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 (c) 2010, Oracle and/or its affiliates. All rights reserved.
-
-# Copy /var/pkg to /tmp, to allow pkg(5) utilities to expand catalogs without
-# running out of boot_archive space. Copy symlinks as symlinks.
-# Free unneeded space used in boot_archive.
-
-# Copy the /var/pkg directory to /tmp/pkg.
-
-. /lib/svc/share/smf_include.sh
-
-OLD_DIR=/var/pkg
-NEW_DIR=/tmp/pkg
-
-cd $OLD_DIR
-if [ $PWD != $OLD_DIR ] ; then
- echo "Error finding $OLD_DIR" > /dev/msglog
-
- exit $SMF_EXIT_ERR_FATAL
-fi
-
-mkdir $NEW_DIR
-if [ $? -ne 0 ] ; then
- echo "Error creating $NEW_DIR" > /dev/msglog
-
- exit $SMF_EXIT_ERR_FATAL
-fi
-
-find . -depth -print | cpio -pdum $NEW_DIR
-if [ $? -ne 0 ] ; then
- echo "Error copying $OLD_DIR contents to $NEW_DIR" > /dev/msglog
-
- exit $SMF_EXIT_ERR_FATAL
-fi
-
-cd /
-rm -rf $OLD_DIR
-if [ $? -ne 0 ] ; then
- echo "Error removing original $OLD_DIR tree" > /dev/msglog
-
- exit $SMF_EXIT_ERR_FATAL
-fi
-
-ln -s $NEW_DIR $OLD_DIR
-if [ $? -ne 0 ] ; then
- echo "Error making symlink from $OLD_DIR to $NEW_DIR" > /dev/msglog
-
- exit $SMF_EXIT_ERR_FATAL
-fi
-
-exit $SMF_EXIT_OK
--- a/usr/src/cmd/slim-install/svc/live-var-pkg-move.xml Fri May 28 15:29:23 2010 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
-<!--
- Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
-
- CDDL HEADER START
-
- The contents of this file are subject to the terms of the
- Common Development and Distribution License, Version 1.0 only
- (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
--->
-
-<service_bundle type='manifest' name='live-var-pkg-move'>
-
-<service
- name='system/live-var-pkg-move'
- type='service'
- version='1'>
-
- <create_default_instance enabled='true' />
-
- <!--
- We depend on filesystem/minimal so that /tmp is available.
- -->
- <dependency name='fs'
- grouping='require_all'
- restart_on='none'
- type='service'>
- <service_fmri
- value='svc:/system/filesystem/minimal:default' />
- </dependency>
-
- <dependent
- name='lvpm-system-install-setup'
- grouping='require_all'
- restart_on='none'>
- <service_fmri value='svc:/system/install-setup' />
- </dependent>
-
- <dependent
- name='lvpm-system-console-login'
- grouping='require_all'
- restart_on='none'>
- <service_fmri value='svc:/system/console-login' />
- </dependent>
-
- <exec_method
- type='method'
- name='start'
- exec='/lib/svc/method/live-var-pkg-move'
- timeout_seconds='60' />
-
- <exec_method
- type='method'
- name='stop'
- exec=':true'
- timeout_seconds='0' />
-
- <property_group name='startd' type='framework'>
- <propval name='duration' type='astring' value='transient' />
- </property_group>
-
- <stability value='Unstable' />
-
- <template>
- <common_name>
- <loctext xml:lang='C'>
- Move /var/pkg contents to /tmp/pkg
- </loctext>
- </common_name>
- <description>
- <loctext xml:lang='C'>
- Intended for live images, this service moves
- /var/pkg to /tmp/pkg to allow for pkg catalog
- expansion.
- </loctext>
- </description>
- </template>
-</service>
-
-</service_bundle>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/slim-install/var_pkg_move/Makefile Mon May 31 15:43:45 2010 -0700
@@ -0,0 +1,39 @@
+#
+# 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 (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+FILES= live_img_pkg5_prep
+
+include $(SRC)/cmd/Makefile.cmd
+
+FILEMODE= 555
+
+all: $(FILES)
+
+install: all $(ROOTUSRLIBINSTALL) $(ROOTUSRLIBINSTALLFILES)
+
+clobber clean:
+
+$(FILES):
+
+include $(SRC)/cmd/Makefile.targ
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/slim-install/var_pkg_move/live_img_pkg5_prep Mon May 31 15:43:45 2010 -0700
@@ -0,0 +1,86 @@
+#!/bin/ksh93
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (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 (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# Copy /var/pkg to /tmp if booted off a ramdisk
+# Needed by pkg utility so it can expand its bookkeeping files in swap space.
+#
+
+builtin mkdir
+builtin mv
+builtin rm
+
+function err_handler {
+ print -u2 "$THISFILE: Error moving $VARPKG to tmpfs filesystem"
+ trap - ERR
+ if [ -d $VARPKG.$$ ] ; then
+ /sbin/umount $VARPKG >/dev/null 2>&1
+ rmdir $VARPKG >/dev/null 2>&1
+ mv $VARPKG.$$ $VARPKG
+ fi
+ exit 1
+}
+
+THISFILE=$0 # Save for error message
+TMPDIR=/tmp # cpio uses tmpdir; let it use swap
+trap err_handler ERR # Catch errors
+
+# Default ROOT_PATH to / if not specified as arg 1
+ROOT_PATH=${1:-/}
+
+# Act only if the root is a ramdisk
+# Check if mnttab has a line with "ramdisk" in $1 and a single / in $2
+mnt_pnt=$(/usr/bin/nawk \
+ '$1 ~ /ramdisk/ {if ($2 ~ /^\/$/) print $2}' /etc/mnttab)
+if [[ "$mnt_pnt" == "$ROOT_PATH" ]]; then
+
+ # The object of our obsessions...
+ VARPKG=/var/pkg
+
+ # If /var/pkg has already been moved to tmpfs, we're already done.
+ # If second token in mnttab line is $VARPKG, dump third token (fs type)
+ varpkg_fstype=$(/usr/bin/nawk \
+ '{if ($2 == ARGV[2]) print $3}' /etc/mnttab $VARPKG)
+ if [[ "$varpkg_fstype" == "tmpfs" ]] ; then
+ exit 0
+ fi
+
+ # if /var/pkg is a directory (and not just a link), do the move
+ if [[ -d $VARPKG && ! -L $VARPKG ]] ; then
+ mv $VARPKG $VARPKG.$$
+ mkdir $VARPKG
+ /sbin/mount -F tmpfs swap $VARPKG
+ (cd $VARPKG.$$ ; \
+ /usr/bin/find . -depth -print | \
+ /usr/bin/cpio -pdumL $VARPKG)
+ rm -rf $VARPKG.$$
+ else
+ print -u2 "$0: $VARPKG is not a proper directory"
+ err_handler
+ fi
+fi
+
+exit 0
--- a/usr/src/pkg/manifests/SUNWslim-utils.mf Fri May 28 15:29:23 2010 -0600
+++ b/usr/src/pkg/manifests/SUNWslim-utils.mf Mon May 31 15:43:45 2010 -0700
@@ -45,6 +45,8 @@
dir path=mnt/misc group=sys
dir path=sbin group=sys
dir path=usr group=sys
+dir path=usr/lib
+dir path=usr/lib/install
dir path=usr/sbin
dir path=usr/share group=sys
dir path=var group=sys
@@ -70,13 +72,13 @@
file path=lib/svc/method/live-fs-root-minimal mode=0555
file path=lib/svc/method/live-io-tracing mode=0555
file path=lib/svc/method/live-sysidtool-system mode=0555
-file path=lib/svc/method/live-var-pkg-move mode=0555
file path=lib/svc/method/media-fs-root mode=0555
file path=lib/svc/method/net-fs-root mode=0555
file path=lib/svc/share/live_fs_include.sh mode=0444
file path=sbin/listcd mode=0555
file path=sbin/listusb mode=0555
file path=sbin/mkmenu mode=0555 variant.arch=i386
+file path=usr/lib/install/live_img_pkg5_prep mode=0555
file path=usr/sbin/iotrace
file path=usr/sbin/set_lang mode=0555
file path=var/svc/manifest/system/filesystem/live-root-fs-minimal.xml mode=0444 group=sys
@@ -85,7 +87,6 @@
file path=var/svc/manifest/system/live-a11y.xml mode=0444 group=sys
file path=var/svc/manifest/system/live-io-tracing.xml mode=0444 group=sys
file path=var/svc/manifest/system/live-sysidtool.xml mode=0444 group=sys
-file path=var/svc/manifest/system/live-var-pkg-move.xml mode=0444 group=sys
license cr_Sun license=cr_Sun
license lic_CDDL license=lic_CDDL
user username=jack uid=65432 group=staff gcos-field="Default User" home-dir=/jack \
--- a/usr/src/pkgdefs/SUNWslim-utils/prototype_com Fri May 28 15:29:23 2010 -0600
+++ b/usr/src/pkgdefs/SUNWslim-utils/prototype_com Mon May 31 15:43:45 2010 -0700
@@ -33,10 +33,12 @@
d none .cdrom 755 root sys
d none usr 755 root sys
+d none usr/lib 755 root bin
+d none usr/lib/install 755 root bin
+f none usr/lib/install/live_img_pkg5_prep 755 root bin
d none usr/sbin 755 root bin
f none usr/sbin/iotrace 755 root bin
f none usr/sbin/set_lang 555 root bin
-d none usr/share 755 root sys
d none sbin 755 root sys
f none sbin/listusb 555 root bin
f none sbin/listcd 555 root bin
@@ -66,7 +68,6 @@
f none lib/svc/method/live-fs-root-minimal 555 root bin
f none lib/svc/method/live-io-tracing 555 root bin
f none lib/svc/method/live-sysidtool-system 555 root bin
-f none lib/svc/method/live-var-pkg-move 555 root bin
f none lib/svc/method/media-fs-root 555 root bin
f none lib/svc/method/net-fs-root 555 root bin
d none mnt 755 root sys
@@ -80,7 +81,6 @@
f none var/svc/manifest/system/live-a11y.xml 444 root sys
f none var/svc/manifest/system/live-io-tracing.xml 444 root sys
f none var/svc/manifest/system/live-sysidtool.xml 444 root sys
-f none var/svc/manifest/system/live-var-pkg-move.xml 444 root sys
f none var/svc/manifest/system/filesystem/live-root-fs.xml 444 root sys
f none var/svc/manifest/system/filesystem/live-root-fs-minimal.xml 444 root sys
f none var/svc/manifest/system/filesystem/live-usr-fs.xml 444 root sys