src/brand/pkgcreatezone
author Dan Price <dp@eng.sun.com>
Wed, 31 Oct 2007 14:55:25 -0700
changeset 188 a0989804cd9d
parent 168 bbeeeaf343c0
child 206 a617b308b931
permissions -rwxr-xr-x
Update brand installer to go to pkg.opensolaris.org by default
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
97
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
     1
#!/bin/ksh -p
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
     2
#
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
     3
# CDDL HEADER START
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
     4
#
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
     5
# The contents of this file are subject to the terms of the
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
     6
# Common Development and Distribution License (the "License").
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
     7
# You may not use this file except in compliance with the License.
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
     8
#
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
     9
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    10
# or http://www.opensolaris.org/os/licensing.
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    11
# See the License for the specific language governing permissions
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    12
# and limitations under the License.
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    13
#
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    14
# When distributing Covered Code, include this CDDL HEADER in each
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    15
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    16
# If applicable, add the following below this CDDL HEADER, with the
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    17
# fields enclosed by brackets "[]" replaced with your own identifying
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    18
# information: Portions Copyright [yyyy] [name of copyright owner]
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    19
#
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    20
# CDDL HEADER END
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    21
#
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    22
#
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    23
# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    24
# Use is subject to license terms.
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    25
#
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    26
168
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    27
ZONE_SUBPROC_OK=0
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    28
ZONE_SUBPROC_USAGE=253
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    29
ZONE_SUBPROC_NOTCOMPLETE=254
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    30
ZONE_SUBPROC_FATAL=255
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    31
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    32
f_img=$(gettext "failed to create image")
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    33
f_pkg=$(gettext "failed to install package")
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    34
f_interrupted=$(gettext "Installation cancelled due to interrupt.")
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    35
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    36
m_image=$(gettext     "      Image: Preparing at %s ...")
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    37
m_catalog=$(gettext   "    Catalog: Retrieving from %s ...")
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    38
m_core=$(gettext      " Installing: Core Packages ...")
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    39
m_coreu=$(gettext     " Installing: Core Utilities ...")
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    40
m_pkg=$(gettext       " Installing: pkg(5) Utilities ...")
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    41
m_diag=$(gettext      " Installing: Diagnostic Tools ...")
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    42
m_shells=$(gettext    " Installing: Shells ...")
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    43
m_ns=$(gettext        " Installing: Name Services ...")
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    44
m_man=$(gettext       " Installing: man(1) Command ...")
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    45
m_smf=$(gettext	      "Postinstall: Copying SMF seed repository ...")
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    46
m_mannote=$(gettext   "       Note: Man pages can be obtained by installing SUNWman")
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    47
m_complete=$(gettext  "       Done: Installation completed in %s seconds.")
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    48
m_postnote=$(gettext  " Next Steps: Boot the zone, then log into the zone console")
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    49
m_postnote2=$(gettext "             (zlogin -C) to complete the configuration process")
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    50
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    51
m_done=$(gettext      " done.")
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    52
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    53
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    54
fail_incomplete() {
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    55
	print -u2 "$1"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    56
	exit $ZONE_SUBPROC_NOTCOMPLETE
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    57
}
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    58
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    59
fail_fatal() {
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    60
	print -u2 "$1"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    61
	exit $ZONE_SUBPROC_FATAL
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    62
}
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    63
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    64
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    65
fail_usage() {
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    66
	print "Usage: $0 [-h] [-a <authority>]"
97
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    67
	exit $ZONE_SUBPROC_USAGE
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    68
}
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    69
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    70
trap_cleanup() {
168
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    71
	print "$f_interrupted"
97
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    72
	exit $int_code
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    73
}
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    74
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    75
int_code=$ZONE_SUBPROC_NOTCOMPLETE
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    76
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    77
trap trap_cleanup INT
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    78
188
a0989804cd9d Update brand installer to go to pkg.opensolaris.org by default
Dan Price <dp@eng.sun.com>
parents: 168
diff changeset
    79
authority="opensolaris.org=http://pkg.opensolaris.org"
168
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    80
zonename=""
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    81
zonepath=""
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    82
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    83
# Setup i18n output
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    84
TEXTDOMAIN="SUNW_OST_OSCMD"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    85
export TEXTDOMAIN
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    86
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    87
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    88
while getopts "a:z:R:h" opt; do
97
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    89
	case $opt in
168
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    90
		h)	fail_usage ;;
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    91
		R)	zonepath="$OPTARG" ;;
97
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    92
		z)	zonename="$OPTARG" ;;
168
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    93
		a)	authority="$OPTARG" ;;
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    94
		*)	fail_usage ;;
97
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    95
	esac
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    96
done
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    97
shift $((OPTIND-1))
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
    98
168
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
    99
if [[ -z $zonepath || -z $zonename ]]; then
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   100
	print -u2 "Brand error: No zone path or name"
97
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
   101
	exit $ZONE_SUBPROC_USAGE
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
   102
fi
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
   103
168
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   104
zoneroot=$zonepath/root
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   105
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   106
printf "\n$m_image" $zoneroot/root
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   107
pkg image-create -z -F -a "$authority" $zoneroot || fail_fatal $f_img
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   108
printf "$m_done\n"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   109
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   110
PKG_IMAGE="$zoneroot"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   111
export PKG_IMAGE
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   112
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   113
printf "$m_catalog" "$authority"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   114
pkg refresh || fail_fatal "$f_refresh"
98
2ac7781efe22 Package up the packaging system.
Danek Duvall <danek.duvall@sun.com>
parents: 97
diff changeset
   115
if [[ $? -ne 0 ]]; then
2ac7781efe22 Package up the packaging system.
Danek Duvall <danek.duvall@sun.com>
parents: 97
diff changeset
   116
	print "Failed to retrieve catalog"
2ac7781efe22 Package up the packaging system.
Danek Duvall <danek.duvall@sun.com>
parents: 97
diff changeset
   117
	exit 1
2ac7781efe22 Package up the packaging system.
Danek Duvall <danek.duvall@sun.com>
parents: 97
diff changeset
   118
fi
168
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   119
printf "$m_done\n"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   120
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   121
printf "$m_core"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   122
pkg install SUNWcsd || fail_incomplete "$f_pkg"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   123
pkg install SUNWcs SUNWcsl || fail_incomplete "$f_pkg"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   124
printf "$m_done\n"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   125
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   126
printf "$m_coreu"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   127
pkg install SUNWesu SUNWadmr SUNWadmap SUNWbzip SUNWgzip || fail_incomplete "$f_pkg"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   128
printf "$m_done\n"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   129
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   130
#
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   131
# Workaround: in our test repo, SUNWipkg has no dependencies
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   132
# so we must supply it python.
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   133
#
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   134
printf "$m_pkg"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   135
pkg install SUNWPython SUNWipkg || fail_incomplete "$f_pkg"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   136
printf "$m_done\n"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   137
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   138
#
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   139
# Get some diagnostic tools, truss, dtrace, etc.
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   140
#
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   141
printf "$m_diag"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   142
pkg install SUNWtoo SUNWdtrc SUNWrcmdc SUNWbip || fail_incomplete "$f_pkg"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   143
printf "$m_done\n"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   144
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   145
#
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   146
# Get some sensible shells
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   147
#
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   148
printf "$m_shells"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   149
pkg install SUNWbash SUNWzsh SUNWtcsh || fail_incomplete "$f_pkg"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   150
printf "$m_done\n"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   151
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   152
#
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   153
# Get some name services.
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   154
#
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   155
printf "$m_ns"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   156
pkg install SUNWyp SUNWlldap || fail_incomplete "$f_pkg"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   157
printf "$m_done\n"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   158
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   159
#
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   160
# Get man(1) but not the man pages
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   161
#
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   162
printf "$m_man"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   163
pkg install SUNWdoc || fail_incomplete "$f_pkg"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   164
printf "$m_done\n"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   165
print "$m_mannote\n"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   166
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   167
# XXX leaving this out for now.  Reconsider later.
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   168
#
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   169
# Core X and GNOME -- I add these because it's easy to overlook that
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   170
# you need fonts, and the result is that fontconfig dumps core a lot.
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   171
#
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   172
#printf $m_corex
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   173
#pkg install SUNWfontconfig FSWxorg-fonts || fail_incomplete "$f_pkg"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   174
#pkg install SUNWxorg-client-programs SUNWgnome-fonts || fail_incomplete "$f_pkg"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   175
#pkg install SUNWgnome-base-libs SUNWgnome-panel || fail_incomplete "$f_pkg"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   176
##
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   177
## workaround for lack of xterm, and add GDM since it's nice to have it.
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   178
##
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   179
#pkg install SUNWgnome-terminal || fail_incomplete "$f_pkg"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   180
#pkg install SUNWgnome-display-mgr || fail_incomplete "$f_pkg"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   181
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   182
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   183
#print "Setting up SMF profile links"
97
9a488b15900f Introduce a branded zone as a testing aid
Danek Duvall <danek.duvall@sun.com>
parents:
diff changeset
   184
# This was formerly done in SUNWcsr/postinstall
168
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   185
printf "$m_smf"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   186
ln -s ns_files.xml $zoneroot/var/svc/profile/name_service.xml
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   187
ln -s generic_limited_net.xml $zoneroot/var/svc/profile/generic.xml
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   188
ln -s inetd_generic.xml $zoneroot/var/svc/profile/inetd_services.xml
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   189
ln -s platform_none.xml $zoneroot/var/svc/profile/platform.xml
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   190
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   191
## This was formerly done in i.manifest
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   192
cp $zoneroot/lib/svc/seed/nonglobal.db $zoneroot/etc/svc/repository.db
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   193
printf "$m_done\n"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   194
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   195
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   196
#
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   197
# Make sure sysidtools run
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   198
#
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   199
touch $zoneroot/etc/.UNCONFIGURED
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   200
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   201
printf "$m_complete\n\n" ${SECONDS}
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   202
printf "$m_postnote\n"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   203
printf "$m_postnote2\n"
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   204
bbeeeaf343c0 16 Improve ipkg brand installer
Dan Price <dp@eng.sun.com>
parents: 111
diff changeset
   205
exit $ZONE_SUBPROC_OK