Mercurial > illumos > illumos-gate
annotate usr/src/lib/brand/solaris10/zone/s10_boot.ksh @ 12016:0248e987199b
PSARC 2009/306 Brussels II - ipadm and libipadm
PSARC 2010/080 Brussels II addendum
6827318 Brussels Phase II aka ipadm(1m)
6731945 need BSD getifaddrs() API
6909065 explicitly disallow non-contiguous netmasks in the next minor release
6853922 ifconfig dumps core when ether address is non-hexadecimal.
6815806 ipReasmTimeout value should be variable
6567083 nd_getset has some dead and confusing code.
6884466 remove unused tcp/sctp ndd tunables
6928813 Comments at odds with default value of tcp_time_wait_interval
6236982 ifconfig usesrc lets adapter use itself as source address
6936855 modifying the ip6_strict_src_multihoming to non-zero value will unbind V4 IREs
author | Girish Moodalbail <Girish.Moodalbail@Sun.COM> |
---|---|
date | Fri, 26 Mar 2010 17:53:11 -0400 |
parents | b4d868bae9bd |
children | 5259ac7d9677 |
rev | line source |
---|---|
7933
6a8cc62fe2a1
6409860 sn1 brand should use elfexec()
Edward Pilatowicz <Edward.Pilatowicz@Sun.COM>
parents:
2754
diff
changeset
|
1 #!/bin/ksh -p |
2712 | 2 # |
3 # CDDL HEADER START | |
4 # | |
5 # The contents of this file are subject to the terms of the | |
6 # Common Development and Distribution License (the "License"). | |
7 # You may not use this file except in compliance with the License. | |
8 # | |
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | |
10 # or http://www.opensolaris.org/os/licensing. | |
11 # See the License for the specific language governing permissions | |
12 # and limitations under the License. | |
10840
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
13 # |
2712 | 14 # When distributing Covered Code, include this CDDL HEADER in each |
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE. | |
16 # If applicable, add the following below this CDDL HEADER, with the | |
17 # fields enclosed by brackets "[]" replaced with your own identifying | |
18 # information: Portions Copyright [yyyy] [name of copyright owner] | |
10840
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
19 # |
2712 | 20 # CDDL HEADER END |
21 # | |
22 # | |
12016
0248e987199b
PSARC 2009/306 Brussels II - ipadm and libipadm
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents:
11358
diff
changeset
|
23 # Copyright 2010 Sun Microsystems, Inc. All rights reserved. |
2712 | 24 # Use is subject to license terms. |
25 # | |
10840
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
26 # s10 boot script. |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
27 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
28 # The arguments to this script are the zone name and the zonepath. |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
29 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
30 |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
31 . /usr/lib/brand/solaris10/common.ksh |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
32 |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
33 ZONENAME=$1 |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
34 ZONEPATH=$2 |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
35 ZONEROOT=$ZONEPATH/root |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
36 |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
37 arch=`uname -p` |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
38 if [ "$arch" = "i386" ]; then |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
39 ARCH32=i86 |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
40 ARCH64=amd64 |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
41 elif [ "$arch" = "sparc" ]; then |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
42 # 32-bit SPARC not supported! |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
43 ARCH32= |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
44 ARCH64=sparcv9 |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
45 else |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
46 echo "Unsupported architecture: $arch" |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
47 exit 2 |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
48 fi |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
49 |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
50 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
51 # Run the s10_support boot hook. |
2712 | 52 # |
10840
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
53 /usr/lib/brand/solaris10/s10_support boot $ZONENAME |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
54 if (( $? != 0 )) ; then |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
55 exit 1 |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
56 fi |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
57 |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
58 BRANDDIR=/.SUNWnative/usr/lib/brand/solaris10; |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
59 FILEDIR=$BRANDDIR/files; |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
60 EXIT_CODE=1 |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
61 |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
62 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
63 # Replace the specified file in the booting zone with a wrapper script that |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
64 # invokes s10_isaexec_wrapper. This is a convenience function that reduces |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
65 # clutter and code duplication. |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
66 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
67 # Parameters: |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
68 # $1 The full path of the file to replace (e.g., /sbin/ifconfig) |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
69 # $2 The access mode of the replacement file in hex (e.g., 0555) |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
70 # $3 The name of the replacement file's owner (e.g., root:bin) |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
71 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
72 # NOTE: The checks performed in the 'if' statement below are not generic: they |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
73 # depend on the success of the zone filesystem structure validation performed |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
74 # above to ensure that intermediate directories exist and aren't symlinks. |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
75 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
76 replace_with_native() { |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
77 path_dname=$ZONEROOT/`dirname $1` |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
78 if [ ! -h $path_dname -a -d $path_dname ]; then |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
79 safe_replace $ZONEROOT/$1 $BRANDDIR/s10_isaexec_wrapper $2 $3 \ |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
80 remove |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
81 fi |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
82 } |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
83 |
11358
b4d868bae9bd
6911381 solaris 10 branded zones should use native class-specific binaries
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10840
diff
changeset
|
84 wrap_with_native() { |
b4d868bae9bd
6911381 solaris 10 branded zones should use native class-specific binaries
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10840
diff
changeset
|
85 safe_wrap $ZONEROOT/$1 $BRANDDIR/s10_isaexec_wrapper $2 $3 |
b4d868bae9bd
6911381 solaris 10 branded zones should use native class-specific binaries
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10840
diff
changeset
|
86 } |
b4d868bae9bd
6911381 solaris 10 branded zones should use native class-specific binaries
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10840
diff
changeset
|
87 |
10840
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
88 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
89 # Before we boot we validate and fix, if necessary, the required files within |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
90 # the zone. These modifications can be lost if a patch is applied within the |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
91 # zone, so we validate and fix the zone every time it boots. |
2712 | 92 # |
93 | |
10840
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
94 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
95 # BINARY REPLACEMENT |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
96 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
97 # This section of the boot script is responsible for replacing Solaris 10 |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
98 # binaries within the booting zone with Nevada binaries. This is a two-step |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
99 # process: First, the directory structure of the zone is validated to ensure |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
100 # that binary replacement will proceed safely. Second, Solaris 10 binaries |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
101 # are replaced with Nevada binaries. |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
102 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
103 # Here's an example. Suppose that you want to replace /usr/bin/zcat with the |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
104 # Nevada /usr/bin/zcat binary. Then you should do the following: |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
105 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
106 # 1. Go to the section below labeled "STEP ONE" and add the following |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
107 # two lines: |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
108 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
109 # safe_dir /usr |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
110 # safe_dir /usr/bin |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
111 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
112 # These lines ensure that both /usr and /usr/bin are directories |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
113 # within the booting zone that can be safely accessed by the global |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
114 # zone. |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
115 # 2. Go to the section below labeled "STEP TWO" and add the following |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
116 # line: |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
117 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
118 # replace_with_native /usr/bin/zcat 0555 root:bin |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
119 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
120 # Details about the binary replacement procedure can be found in the Solaris 10 |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
121 # Containers Developer Guide. |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
122 # |
2712 | 123 |
10840
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
124 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
125 # STEP ONE |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
126 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
127 # Validate that the zone filesystem looks like we expect it to. |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
128 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
129 safe_dir /usr |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
130 safe_dir /usr/lib |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
131 safe_dir /usr/bin |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
132 safe_dir /usr/sbin |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
133 safe_dir /sbin |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
134 |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
135 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
136 # STEP TWO |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
137 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
138 # Replace Solaris 10 binaries with Nevada binaries. |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
139 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
140 |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
141 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
142 # Replace various network-related programs with native wrappers. |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
143 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
144 replace_with_native /sbin/ifconfig 0555 root:bin |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
145 |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
146 # |
12016
0248e987199b
PSARC 2009/306 Brussels II - ipadm and libipadm
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents:
11358
diff
changeset
|
147 # PSARC 2009/306 removed the ND_SET/ND_GET ioctl's for modifying |
0248e987199b
PSARC 2009/306 Brussels II - ipadm and libipadm
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents:
11358
diff
changeset
|
148 # IP/TCP/UDP/SCTP/ICMP tunables. If S10 ndd(1M) is used within an |
0248e987199b
PSARC 2009/306 Brussels II - ipadm and libipadm
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents:
11358
diff
changeset
|
149 # S10 container, the kernel will return EINVAL. So we need this. |
0248e987199b
PSARC 2009/306 Brussels II - ipadm and libipadm
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents:
11358
diff
changeset
|
150 # |
0248e987199b
PSARC 2009/306 Brussels II - ipadm and libipadm
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents:
11358
diff
changeset
|
151 replace_with_native /usr/sbin/ndd 0555 root:bin |
0248e987199b
PSARC 2009/306 Brussels II - ipadm and libipadm
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents:
11358
diff
changeset
|
152 |
0248e987199b
PSARC 2009/306 Brussels II - ipadm and libipadm
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents:
11358
diff
changeset
|
153 # |
10840
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
154 # Replace automount and automountd with native wrappers. |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
155 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
156 if [ ! -h $ZONEROOT/usr/lib/fs/autofs -a -d $ZONEROOT/usr/lib/fs/autofs ]; then |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
157 safe_replace $ZONEROOT/usr/lib/fs/autofs/automount \ |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
158 $BRANDDIR/s10_automount 0555 root:bin remove |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
159 fi |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
160 if [ ! -h $ZONEROOT/usr/lib/autofs -a -d $ZONEROOT/usr/lib/autofs ]; then |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
161 safe_replace $ZONEROOT/usr/lib/autofs/automountd \ |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
162 $BRANDDIR/s10_automountd 0555 root:bin remove |
2712 | 163 fi |
164 | |
10840
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
165 # |
11358
b4d868bae9bd
6911381 solaris 10 branded zones should use native class-specific binaries
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10840
diff
changeset
|
166 # The class-specific dispadmin(1M) and priocntl(1) binaries must be native |
b4d868bae9bd
6911381 solaris 10 branded zones should use native class-specific binaries
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10840
diff
changeset
|
167 # wrappers, and we must have all of the ones the native zone does. This |
b4d868bae9bd
6911381 solaris 10 branded zones should use native class-specific binaries
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10840
diff
changeset
|
168 # allows new scheduling classes to appear without causing dispadmin and |
b4d868bae9bd
6911381 solaris 10 branded zones should use native class-specific binaries
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10840
diff
changeset
|
169 # priocntl to be unhappy. |
b4d868bae9bd
6911381 solaris 10 branded zones should use native class-specific binaries
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10840
diff
changeset
|
170 # |
b4d868bae9bd
6911381 solaris 10 branded zones should use native class-specific binaries
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10840
diff
changeset
|
171 rm -rf $ZONEROOT/usr/lib/class |
b4d868bae9bd
6911381 solaris 10 branded zones should use native class-specific binaries
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10840
diff
changeset
|
172 mkdir $ZONEROOT/usr/lib/class || exit 1 |
b4d868bae9bd
6911381 solaris 10 branded zones should use native class-specific binaries
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10840
diff
changeset
|
173 |
b4d868bae9bd
6911381 solaris 10 branded zones should use native class-specific binaries
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10840
diff
changeset
|
174 find /usr/lib/class -type d -o -type f | while read x; do |
b4d868bae9bd
6911381 solaris 10 branded zones should use native class-specific binaries
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10840
diff
changeset
|
175 [ -d $x ] && mkdir -p -m 755 $ZONEROOT$x |
b4d868bae9bd
6911381 solaris 10 branded zones should use native class-specific binaries
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10840
diff
changeset
|
176 [ -f $x ] && wrap_with_native $x 0555 root:bin |
b4d868bae9bd
6911381 solaris 10 branded zones should use native class-specific binaries
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10840
diff
changeset
|
177 done |
b4d868bae9bd
6911381 solaris 10 branded zones should use native class-specific binaries
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10840
diff
changeset
|
178 |
b4d868bae9bd
6911381 solaris 10 branded zones should use native class-specific binaries
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10840
diff
changeset
|
179 # |
10840
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
180 # END OF STEP TWO |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
181 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
182 |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
183 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
184 # Replace add_drv and rem_drv with /usr/bin/true so that pkgs/patches which |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
185 # install or remove drivers will work. NOTE: add_drv and rem_drv are hard |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
186 # linked to isaexec so we want to remove the current executable and |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
187 # then copy true so that we don't clobber isaexec. |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
188 # |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
189 filename=$ZONEROOT/usr/sbin/add_drv |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
190 [ ! -f $filename.pre_p2v ] && safe_backup $filename $filename.pre_p2v |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
191 rm -f $filename |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
192 safe_copy $ZONEROOT/usr/bin/true $filename |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
193 |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
194 filename=$ZONEROOT/usr/sbin/rem_drv |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
195 [ ! -f $filename.pre_p2v ] && safe_backup $filename $filename.pre_p2v |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
196 rm -f $filename |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
197 safe_copy $ZONEROOT/usr/bin/true $filename |
7df556caf412
PSARC 2009/253 S10C
Gerald Jelinek <Gerald.Jelinek@Sun.COM>
parents:
7933
diff
changeset
|
198 |
2712 | 199 exit 0 |