author | masputra |
Sat, 22 Oct 2005 22:50:14 -0700 | |
changeset 741 | 40027a3621ac |
parent 693 | 1c08294a694e |
child 744 | a5be23ccdb68 |
permissions | -rw-r--r-- |
0 | 1 |
#!/bin/ksh |
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, Version 1.0 only |
|
7 |
# (the "License"). You may not use this file except in compliance |
|
8 |
# with the License. |
|
9 |
# |
|
10 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
11 |
# or http://www.opensolaris.org/os/licensing. |
|
12 |
# See the License for the specific language governing permissions |
|
13 |
# and limitations under the License. |
|
14 |
# |
|
15 |
# When distributing Covered Code, include this CDDL HEADER in each |
|
16 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
17 |
# If applicable, add the following below this CDDL HEADER, with the |
|
18 |
# fields enclosed by brackets "[]" replaced with your own identifying |
|
19 |
# information: Portions Copyright [yyyy] [name of copyright owner] |
|
20 |
# |
|
21 |
# CDDL HEADER END |
|
22 |
# |
|
132 | 23 |
|
0 | 24 |
# |
25 |
# Copyright 2005 Sun Microsystems, Inc. All rights reserved. |
|
26 |
# Use is subject to license terms. |
|
27 |
# |
|
28 |
# ident "%Z%%M% %I% %E% SMI" |
|
29 |
# |
|
30 |
# Upgrade a machine from a cpio archive area in about 5 minutes. |
|
31 |
# By Roger Faulkner and Jeff Bonwick, April 1993. |
|
32 |
# (bfu == Bonwick/Faulkner Upgrade, a.k.a. Blindingly Fast Upgrade) |
|
33 |
# |
|
34 |
# Usage: bfu [-f] <archive_dir> [root-dir] # for normal machines |
|
35 |
# bfu -c [-f] <archive_dir> <exec-dir> # for diskless clients |
|
36 |
# |
|
37 |
# The -f flag is to override the built-in safety check which requires |
|
38 |
# that the starting-point OS be a least a certain revision. |
|
39 |
# |
|
40 |
# You have to be super-user. It's safest to run this from the |
|
41 |
# system console, although I've run it under OW and even via |
|
42 |
# remote login with no problems. |
|
43 |
# |
|
44 |
# You will have to reboot the system when the upgrade is complete. |
|
45 |
# |
|
46 |
# You should add any administrative files you care about to this list. |
|
47 |
# Warning: there had better be no leading '/' on any of these filenames. |
|
48 |
||
49 |
# |
|
50 |
# The CDPATH variable causes ksh's `cd' builtin to emit messages to stdout |
|
51 |
# under certain circumstances, which can really screw things up; unset it. |
|
52 |
# |
|
53 |
unset CDPATH |
|
54 |
||
55 |
export LC_ALL="C" |
|
56 |
||
57 |
if [ -z "$GATEPATH" ]; then |
|
58 |
GATEPATH=/ws/onnv-gate |
|
59 |
test -d $GATEPATH || GATEPATH=/net/onnv.eng/export/gate |
|
60 |
fi |
|
61 |
if [ -z "$ARCHIVEPATH" ]; then |
|
62 |
ARCHIVEPATH=/ws/onnv-gate |
|
63 |
test -d $ARCHIVEPATH || ARCHIVEPATH=/net/onnv.eng/export |
|
64 |
fi |
|
65 |
export GATE=${GATEPATH} |
|
66 |
export ARCHIVE=${ARCHIVEPATH} |
|
67 |
||
68 |
# |
|
69 |
# NOTE: Entries in *_files must expand to either the exact files required, |
|
70 |
# or to directories that will be scoured for files. Any directories |
|
71 |
# (and subdirectories) resulting from a wildcard expansion will be |
|
72 |
# fully recursed by BFU's searching for files. (E.g. /etc/inet/* will |
|
73 |
# include all files in any of its directories, as well as any files in |
|
74 |
# /etc/inet/ itself. |
|
75 |
# |
|
76 |
# First list: files to be saved in global and non-global zones. |
|
77 |
# |
|
78 |
all_zones_files=" |
|
79 |
etc/.login |
|
80 |
etc/acct/holidays |
|
81 |
etc/acctadm.conf |
|
82 |
etc/aggregation.conf |
|
83 |
etc/auto_* |
|
84 |
etc/cron.d/at.deny |
|
85 |
etc/cron.d/cron.deny |
|
86 |
etc/crypto/pkcs11.conf |
|
305 | 87 |
etc/datalink.conf |
0 | 88 |
etc/default/* |
89 |
etc/dfs/dfstab |
|
90 |
etc/dumpdates |
|
91 |
etc/ftpd/* |
|
92 |
etc/ftpusers |
|
93 |
etc/group |
|
94 |
etc/gss/gsscred.conf |
|
95 |
etc/gss/mech |
|
96 |
etc/gss/qop |
|
97 |
etc/inet/* |
|
98 |
etc/init.d/* |
|
99 |
etc/inittab |
|
100 |
etc/krb5/kadm5.acl |
|
101 |
etc/krb5/kdc.conf |
|
102 |
etc/krb5/kpropd.acl |
|
103 |
etc/krb5/krb5.conf |
|
104 |
etc/krb5/warn.conf |
|
105 |
etc/logadm.conf |
|
106 |
etc/logindevperm |
|
107 |
etc/lp/Systems |
|
108 |
etc/mail/*.cf |
|
109 |
etc/mail/*.hf |
|
110 |
etc/mail/*.rc |
|
111 |
etc/mail/aliases |
|
112 |
etc/mail/helpfile |
|
113 |
etc/mail/local-host-names |
|
114 |
etc/mail/trusted-users |
|
115 |
etc/net/*/services |
|
116 |
etc/netconfig |
|
117 |
etc/nfs/nfslog.conf |
|
118 |
etc/nfssec.conf |
|
119 |
etc/nscd.conf |
|
120 |
etc/nsswitch.* |
|
121 |
etc/pam.conf |
|
122 |
etc/passwd |
|
123 |
etc/policy.conf |
|
124 |
etc/printers.conf |
|
125 |
etc/profile |
|
126 |
etc/project |
|
127 |
etc/publickey |
|
128 |
etc/remote |
|
129 |
etc/named.conf |
|
130 |
etc/resolv.conf |
|
131 |
etc/rmmount.conf |
|
132 |
etc/rpc |
|
133 |
etc/rpld.conf |
|
134 |
etc/saf/_sactab |
|
135 |
etc/saf/_sysconfig |
|
136 |
etc/saf/zsmon/_pmtab |
|
137 |
etc/security/*_attr |
|
138 |
etc/security/audit_* |
|
139 |
etc/security/crypt.conf |
|
140 |
etc/security/policy.conf |
|
141 |
etc/sfw/openssl/openssl.cnf |
|
142 |
etc/shadow |
|
143 |
etc/skel/.profile |
|
144 |
etc/skel/local.* |
|
145 |
etc/smartcard/.keys |
|
146 |
etc/smartcard/desktop.properties |
|
147 |
etc/smartcard/ocf.classpath |
|
148 |
etc/smartcard/opencard.properties |
|
149 |
etc/ssh/ssh_config |
|
150 |
etc/ssh/sshd_config |
|
151 |
etc/syslog.conf |
|
152 |
etc/ttydefs |
|
153 |
etc/ttysrch |
|
154 |
etc/user_attr |
|
155 |
etc/uucp/[A-Z]* |
|
156 |
etc/vfstab |
|
157 |
etc/vold.conf |
|
158 |
var/spool/cron/crontabs/* |
|
159 |
var/yp/Makefile |
|
160 |
var/yp/aliases |
|
161 |
var/yp/nicknames |
|
162 |
" |
|
163 |
||
164 |
# |
|
165 |
# Second list: files to be saved in the global zone only. |
|
166 |
# |
|
167 |
global_zone_only_files=" |
|
168 |
boot/grub/menu.lst |
|
169 |
boot/solaris/bootenv.rc |
|
170 |
boot/solaris/devicedb/master |
|
171 |
boot/solaris/filelist.ramdisk |
|
172 |
etc/bootrc |
|
173 |
etc/crypto/kcf.conf |
|
174 |
etc/devlink.tab |
|
175 |
etc/driver_aliases |
|
176 |
etc/driver_classes |
|
177 |
etc/ipf/ipf.conf |
|
178 |
etc/ipf/pfil.ap |
|
179 |
etc/iu.ap |
|
180 |
etc/lvm/devpath |
|
181 |
etc/lvm/lock |
|
182 |
etc/lvm/md.cf |
|
183 |
etc/lvm/md.ctlrmap |
|
184 |
etc/lvm/md.tab |
|
185 |
etc/lvm/mddb.cf |
|
186 |
etc/lvm/runtime.cf |
|
187 |
etc/mach |
|
188 |
etc/minor_perm |
|
189 |
etc/name_to_major |
|
190 |
etc/name_to_sysnum |
|
191 |
etc/nca/* |
|
192 |
etc/openwin/server/etc/OWconfig |
|
193 |
etc/path_to_inst |
|
194 |
etc/power.conf |
|
195 |
etc/ppp/chap-secrets |
|
196 |
etc/ppp/options |
|
197 |
etc/ppp/pap-secrets |
|
198 |
etc/security/device_policy |
|
199 |
etc/security/extra_privs |
|
200 |
etc/system |
|
201 |
etc/zones/index |
|
202 |
kernel/drv/elxl.conf |
|
203 |
kernel/drv/md.conf |
|
204 |
kernel/drv/options.conf |
|
205 |
kernel/drv/ra.conf |
|
206 |
kernel/drv/scsa2usb.conf |
|
207 |
kernel/drv/scsi_vhci.conf |
|
208 |
kernel/drv/sd.conf |
|
209 |
platform/*/kernel/drv/*ppm.conf |
|
210 |
platform/i86pc/kernel/drv/aha.conf |
|
211 |
platform/i86pc/kernel/drv/asy.conf |
|
212 |
platform/sun4u/boot.conf |
|
213 |
" |
|
214 |
||
215 |
# |
|
216 |
# Third list: files extracted from generic.root but which belong in the global |
|
217 |
# zone only: they are superfluous (and some even harmful) in local zones. |
|
218 |
# |
|
219 |
# (note: as /etc/init.d scripts are converted to smf(5) "Greenline" services, |
|
220 |
# they (and their /etc/rc?.d hardlinks) should be removed from this list when |
|
221 |
# they are added to smf_obsolete_rc_files, below) |
|
222 |
# |
|
223 |
superfluous_local_zone_files=" |
|
224 |
dev/dsk |
|
225 |
dev/fd |
|
226 |
dev/pts |
|
227 |
dev/rdsk |
|
228 |
dev/rmt |
|
229 |
dev/sad |
|
230 |
dev/stderr |
|
231 |
dev/stdin |
|
232 |
dev/stdout |
|
233 |
dev/swap |
|
234 |
dev/term |
|
235 |
devices |
|
236 |
etc/dacf.conf |
|
237 |
etc/dat |
|
238 |
etc/default/dhcpagent |
|
239 |
etc/default/inetinit |
|
240 |
etc/default/ipsec |
|
241 |
etc/default/metassist.xml |
|
242 |
etc/default/mpathd |
|
243 |
etc/default/power |
|
244 |
etc/flash/postdeployment/svm.cleanup |
|
245 |
etc/flash/predeployment/svm.save |
|
246 |
etc/fm |
|
247 |
etc/inet/datemsk.ndpd |
|
248 |
etc/inet/ike |
|
249 |
etc/inet/ipqosconf.1.sample |
|
250 |
etc/inet/ipqosconf.2.sample |
|
251 |
etc/inet/ipqosconf.3.sample |
|
252 |
etc/inet/ipsecalgs |
|
253 |
etc/inet/ipsecinit.sample |
|
254 |
etc/inet/mipagent.conf-sample |
|
255 |
etc/inet/mipagent.conf.fa-sample |
|
256 |
etc/inet/mipagent.conf.ha-sample |
|
257 |
etc/inet/secret |
|
258 |
etc/inet/sock2path |
|
259 |
etc/init.d/audit |
|
260 |
etc/init.d/devlinks |
|
261 |
etc/init.d/dodatadm.udaplt |
|
262 |
etc/init.d/drvconfig |
|
263 |
etc/init.d/flashprom |
|
264 |
etc/init.d/llc2 |
|
265 |
etc/init.d/mipagent |
|
266 |
etc/init.d/ncakmod |
|
267 |
etc/init.d/ncalogd |
|
268 |
etc/init.d/pcmcia |
|
269 |
etc/init.d/pppd |
|
270 |
etc/init.d/sckm |
|
271 |
etc/init.d/wrsmcfg |
|
272 |
etc/ipf |
|
273 |
etc/llc2 |
|
274 |
etc/lvm |
|
275 |
etc/nca |
|
276 |
etc/openwin |
|
277 |
etc/ppp |
|
278 |
etc/rc0.d/K06mipagent |
|
279 |
etc/rc0.d/K33audit |
|
280 |
etc/rc0.d/K34ncalogd |
|
281 |
etc/rc0.d/K42sckm |
|
282 |
etc/rc0.d/K50pppd |
|
283 |
etc/rc0.d/K52llc2 |
|
284 |
etc/rc1.d/K06mipagent |
|
285 |
etc/rc1.d/K33audit |
|
286 |
etc/rc1.d/K34ncalogd |
|
287 |
etc/rc1.d/K40sf880dr |
|
288 |
etc/rc1.d/K42sckm |
|
289 |
etc/rc1.d/K50pppd |
|
290 |
etc/rc1.d/K52llc2 |
|
291 |
etc/rc2.d/K06mipagent |
|
292 |
etc/rc2.d/S40llc2 |
|
293 |
etc/rc2.d/S42ncakmod |
|
294 |
etc/rc2.d/S47pppd |
|
295 |
etc/rc2.d/S70sckm |
|
296 |
etc/rc2.d/S75flashprom |
|
297 |
etc/rc2.d/S81dodatadm.udaplt |
|
298 |
etc/rc2.d/S94ncalogd |
|
299 |
etc/rc2.d/S98efcode |
|
300 |
etc/rc2.d/S99audit |
|
301 |
etc/rc3.d/S80mipagent |
|
302 |
etc/rcS.d/K06mipagent |
|
303 |
etc/rcS.d/K34ncalogd |
|
304 |
etc/rcS.d/K42sckm |
|
305 |
etc/rcS.d/K44wrsmcfg |
|
306 |
etc/rcS.d/K50pppd |
|
307 |
etc/rcS.d/K52llc2 |
|
308 |
etc/rcS.d/S29wrsmcfg |
|
309 |
etc/rcm |
|
310 |
etc/snmp/conf/mipagent.acl |
|
311 |
etc/snmp/conf/mipagent.reg |
|
312 |
etc/sock2path |
|
313 |
etc/usb |
|
314 |
etc/wrsm |
|
315 |
etc/zones |
|
316 |
kernel |
|
172
3f157d3c7622
PSARC/2004/199 intrd: Dynamic Interrupt Distribution
esolom
parents:
132
diff
changeset
|
317 |
lib/svc/method/svc-intrd |
0 | 318 |
var/adm/pool |
319 |
var/fm |
|
320 |
var/log/pool |
|
305 | 321 |
var/svc/manifest/network/aggregation.xml |
322 |
var/svc/manifest/network/datalink-init.xml |
|
323 |
var/svc/manifest/network/datalink.xml |
|
0 | 324 |
var/svc/manifest/network/ipfilter.xml |
325 |
var/svc/manifest/network/pfil.xml |
|
326 |
var/svc/manifest/platform |
|
327 |
var/svc/manifest/system/cvc.xml |
|
328 |
var/svc/manifest/system/dumpadm.xml |
|
329 |
var/svc/manifest/system/fmd.xml |
|
172
3f157d3c7622
PSARC/2004/199 intrd: Dynamic Interrupt Distribution
esolom
parents:
132
diff
changeset
|
330 |
var/svc/manifest/system/intrd.xml |
0 | 331 |
var/svc/manifest/system/mdmonitor.xml |
332 |
var/svc/manifest/system/metainit.xml |
|
333 |
var/svc/manifest/system/picl.xml |
|
334 |
var/svc/manifest/system/power.xml |
|
335 |
var/svc/manifest/system/sysevent.xml |
|
336 |
var/svc/manifest/system/zones.xml |
|
337 |
" |
|
338 |
||
339 |
# |
|
340 |
# files to be preserved, ie unconditionally restored to "child" versions |
|
341 |
# |
|
342 |
preserve_files=" |
|
222 | 343 |
kernel/misc/amd64/sysinit |
0 | 344 |
kernel/misc/sysinit |
345 |
var/adm/aculog |
|
346 |
var/adm/spellhist |
|
347 |
var/adm/utmpx |
|
348 |
var/adm/wtmpx |
|
349 |
var/log/authlog |
|
350 |
var/log/syslog |
|
351 |
var/saf/zsmon/log |
|
352 |
" |
|
353 |
||
354 |
||
355 |
realmode_files=" |
|
356 |
boot/solaris/bootenv.rc |
|
357 |
boot/solaris/devicedb/master |
|
358 |
" |
|
359 |
||
360 |
local_zone_info_file=/tmp/local_zone_info.$$ |
|
361 |
rm -f $local_zone_info_file |
|
362 |
||
363 |
fail() { |
|
364 |
print "$*" >& 2 |
|
365 |
print "bfu aborting" >& 2 |
|
366 |
rm -f $local_zone_info_file |
|
367 |
prun 1 |
|
368 |
exit 1 |
|
369 |
} |
|
370 |
||
371 |
filelist() { |
|
372 |
files="$all_zones_files $preserve_files" |
|
373 |
if [ $1 = "global" ]; then |
|
374 |
files="$global_zone_only_files $files" |
|
375 |
fi |
|
376 |
find $files -depth -type f ! -name core -print 2>/dev/null | sort -u || { |
|
377 |
# |
|
378 |
# Force cpio to return non-zero by printing an error message |
|
379 |
# to stdout that it won't be able to lstat(). |
|
380 |
# |
|
381 |
echo 'filelist: sort failed' |
|
382 |
fail "sort failed" |
|
383 |
} |
|
384 |
} |
|
385 |
||
386 |
realmode_filelist() { |
|
387 |
find $realmode_files -depth -type f ! -name core -print 2>/dev/null | sort |
|
388 |
} |
|
389 |
||
390 |
smf_inetd_conversions=" |
|
391 |
100134 |
|
392 |
100150 |
|
393 |
100155 |
|
394 |
100229 |
|
395 |
100230 |
|
396 |
100234 |
|
397 |
100242 |
|
398 |
100422 |
|
399 |
chargen |
|
400 |
comsat |
|
401 |
daytime |
|
402 |
discard |
|
403 |
echo |
|
404 |
eklogin |
|
405 |
exec |
|
406 |
finger |
|
407 |
ftp |
|
408 |
gssd |
|
409 |
klogin |
|
410 |
krb5_prop |
|
411 |
kshell |
|
412 |
ktkt_warnd |
|
413 |
login |
|
414 |
metad |
|
415 |
metamedd |
|
416 |
metamhd |
|
417 |
name |
|
418 |
ocfserv |
|
419 |
printer |
|
420 |
rexd |
|
421 |
rquotad |
|
422 |
rstatd |
|
423 |
rusersd |
|
424 |
shell |
|
425 |
smserverd |
|
426 |
sprayd |
|
427 |
sun-dr |
|
428 |
talk |
|
429 |
telnet |
|
430 |
time |
|
431 |
uucp |
|
432 |
walld |
|
433 |
" |
|
434 |
||
305 | 435 |
enable_next_boot () { |
436 |
if [ -x /tmp/bfubin/svccfg ]; then |
|
437 |
svcadm disable -t $1 |
|
438 |
[ $? = 0 ] || echo "warning: unable to temporarily disable $1" |
|
439 |
svccfg -s $1 setprop general/enabled = true |
|
440 |
[ $? = 0 ] || echo "warning: unable to enable $1 for next boot" |
|
441 |
fi |
|
442 |
} |
|
443 |
||
0 | 444 |
smf_inetd_disable() { |
445 |
inetconf=$rootprefix/etc/inet/inetd.conf |
|
446 |
inettmp=/tmp/inetd.tmp.$$ |
|
447 |
||
448 |
sed "$(for i in $smf_inetd_conversions; do |
|
449 |
echo "s:^[ ]*$i[ /]:#SMFbfu# &:" |
|
450 |
done)" $inetconf > $inettmp && ! cmp -s $inettmp $inetconf && |
|
451 |
cp $inettmp $inetconf |
|
452 |
||
453 |
rm -f -- $inettmp |
|
454 |
} |
|
455 |
||
456 |
smf_inetd_reenable() { |
|
457 |
inetconf=$rootprefix/etc/inet/inetd.conf |
|
458 |
inettmp=/tmp/inetd.tmp.$$ |
|
459 |
||
460 |
sed 's/^#SMFbfu# //' $inetconf > $inettmp && cp $inettmp $inetconf |
|
461 |
||
462 |
rm -f -- $inettmp |
|
463 |
} |
|
464 |
||
465 |
smf_tftp_reinstall() { |
|
466 |
inetconf=$rootprefix/etc/inet/inetd.conf |
|
467 |
inettmp=/tmp/inetd.tmp.$$ |
|
468 |
||
469 |
if grep '^#SMFbfu# tftp' $inetconf >/dev/null ; then |
|
470 |
# BFU previously commented out, put it back in place |
|
471 |
sed 's/^#SMFbfu# tftp/tftp/' $inetconf > $inettmp && |
|
472 |
cp $inettmp $inetconf |
|
473 |
elif ! grep '^[# ]*tftp' $inetconf >/dev/null; then |
|
474 |
# No entry, append to end |
|
475 |
cat >>$inetconf <<EOF |
|
476 |
# TFTPD - tftp server (primarily used for booting) |
|
477 |
#tftp dgram udp6 wait root /usr/sbin/in.tftpd in.tftpd -s /tftpboot |
|
478 |
EOF |
|
479 |
fi |
|
480 |
||
481 |
rm -f -- $inettmp |
|
482 |
} |
|
483 |
||
484 |
inetd_conf_svm_hack() { |
|
485 |
# Since inetd.conf is updated by SUNWmdr's postinstall script, |
|
486 |
# we will update the actual inetd.conf here to reflect the postinstall |
|
487 |
# changes. |
|
488 |
||
489 |
inetconf=$rootprefix/etc/inet/inetd.conf |
|
490 |
inettmp=/tmp/inetd.tmp.$$ |
|
491 |
inetnew=/tmp/inetd.new.$$ |
|
492 |
||
493 |
# |
|
494 |
# only change inetd.conf if the rpc.metad entry is out of date |
|
495 |
# |
|
496 |
||
497 |
if ! grep "^[# ]*100229/1-2" $inetconf > /dev/null ; then |
|
498 |
||
499 |
# Grab existing rpc entries for rpc.metad |
|
500 |
# and convert spaces to tabs within the rpc entry, as well as |
|
501 |
# the transport method; |
|
502 |
# or add a new entry in case there was none. |
|
503 |
if grep "^[# ]*100229/1" $inetconf > /dev/null ; then |
|
504 |
grep "^# METAD - SLVM metadb" $inetconf > $inettmp |
|
505 |
grep "^[# ]*100229/1" $inetconf | \ |
|
506 |
sed -e 's/[ ][ ]*/ /g' \ |
|
507 |
-e 's?100229/1?100229/1-2?' >> $inettmp |
|
508 |
else |
|
509 |
echo '# METAD - SVM metadb Daemon' > $inettmp |
|
510 |
echo "100229/1-2\ttli\trpc/tcp\twait\troot\t/usr/sbin/rpc.metad\trpc.metad" >> $inettmp |
|
511 |
fi |
|
512 |
||
513 |
grep -v '^# METAD - SLVM metadb' $inetconf | \ |
|
514 |
grep -v '^[# ]*100229/1' > $inetnew |
|
515 |
cat $inettmp >> $inetnew |
|
516 |
||
517 |
if ! diff $inetnew $inetconf > /dev/null ; then |
|
518 |
print "Updating inet.conf metad entry ... \c" |
|
519 |
if cp $inetnew $inetconf ; then |
|
520 |
print "done." |
|
521 |
else |
|
522 |
print "failed." |
|
523 |
fi |
|
524 |
fi |
|
525 |
rm -f $inettmp $inetnew |
|
526 |
fi |
|
527 |
||
528 |
# |
|
529 |
# only change inetd.conf if the rpc.mdcommd entry is out of date |
|
530 |
# |
|
531 |
||
532 |
if ! grep "^[# ]*100422/1" $inetconf > /dev/null ; then |
|
533 |
||
534 |
# Grab existing rpc entries for rpc.mdcommd |
|
535 |
# and convert spaces to tabs within the rpc entry, |
|
536 |
# or add a new entry in case there was none. |
|
537 |
if grep "^[# ]*100422/1" $inetconf > /dev/null ; then |
|
538 |
grep "^# MDMN_COMMD - SVM Multi node" $inetconf > $inettmp |
|
539 |
grep "^[# ]*100422/1" $inetconf | \ |
|
540 |
sed -e 's/[ ][ ]*/ /g' >> $inettmp |
|
541 |
else |
|
542 |
echo '# MDMN_COMMD - SVM Multi node communication daemon' >$inettmp |
|
543 |
echo '100422/1\ttli\trpc/tcp\twait\troot\t/usr/sbin/rpc.mdcommd\trpc.mdcommd' >> $inettmp |
|
544 |
fi |
|
545 |
||
546 |
grep -v '^# MDMN_COMMD - SVM Multi node' $inetconf | \ |
|
547 |
grep -v '^[# ]*100422/1' > $inetnew |
|
548 |
cat $inettmp >> $inetnew |
|
549 |
||
550 |
if ! diff $inetnew $inetconf > /dev/null ; then |
|
551 |
print "Updating inetd.conf rpc.mdcommd entry ... \c" |
|
552 |
if cp $inetnew $inetconf; then |
|
553 |
print "done." |
|
554 |
else |
|
555 |
print "failed." |
|
556 |
fi |
|
557 |
fi |
|
558 |
||
559 |
rm -f $inettmp $inetnew |
|
560 |
fi |
|
561 |
} |
|
562 |
||
563 |
update_policy_conf() { |
|
564 |
# update /etc/security/policy.conf with the default |
|
565 |
# Solaris crypt(3c) policy. |
|
566 |
||
567 |
dest=$rootprefix/etc/security/policy.conf |
|
568 |
||
569 |
grep 'CRYPT_' $dest > /dev/null 2>&1 |
|
570 |
if [ $? = 1 ] ; then |
|
571 |
print "Updating entries for crypt(3c), see policy.conf(4)" |
|
572 |
cat >> $dest <<EOM |
|
573 |
||
574 |
# crypt(3c) Algorithms Configuration |
|
575 |
# |
|
576 |
# CRYPT_ALGORITHMS_ALLOW specifies the algorithms that are allowed to |
|
577 |
# be used for new passwords. This is enforced only in crypt_gensalt(3c). |
|
578 |
# |
|
579 |
CRYPT_ALGORITHMS_ALLOW=1,2a,md5 |
|
580 |
||
581 |
# To deprecate use of the traditional unix algorithm, uncomment below |
|
582 |
# and change CRYPT_DEFAULT= to another algorithm. For example, |
|
583 |
# CRYPT_DEFAULT=1 for BSD/Linux MD5. |
|
584 |
# |
|
585 |
#CRYPT_ALGORITHMS_DEPRECATE=__unix__ |
|
586 |
||
587 |
# The Solaris default is the traditional UNIX algorithm. This is not |
|
588 |
# listed in crypt.conf(4) since it is internal to libc. The reserved |
|
589 |
# name __unix__ is used to refer to it. |
|
590 |
# |
|
591 |
CRYPT_DEFAULT=__unix__ |
|
592 |
EOM |
|
593 |
fi |
|
594 |
grep PRIV_ $dest >/dev/null 2>&1 |
|
595 |
if [ $? = 1 ]; then |
|
596 |
echo "Updating entries for privileges(5)," \ |
|
597 |
"see policy.conf(4) for details." |
|
598 |
cat >> $dest <<EOM |
|
599 |
# |
|
600 |
# These settings determine the default privileges users have. If not set, |
|
601 |
# the default privileges are taken from the inherited set. |
|
602 |
# There are two different settings; PRIV_DEFAULT determines the default |
|
603 |
# set on login; PRIV_LIMIT defines the Limit set on login. |
|
604 |
# Individual users can have privileges assigned or taken away through |
|
605 |
# user_attr. Privileges can also be assigned to profiles in which case |
|
606 |
# the users with those profiles can use those privileges through pfexec(1m). |
|
607 |
# For maximum future compatibility, the specifications should |
|
608 |
# always include "basic" or "all"; privileges should then be removed using |
|
609 |
# the negation. E.g., PRIV_LIMIT=all,!sys_linkdir takes away only the |
|
610 |
# sys_linkdir privilege, regardless of future additional privileges. |
|
611 |
# Similarly, PRIV_DEFAULT=basic,!file_link_any takes away only the |
|
612 |
# file_link_any privilege from the basic privilege set; only that notation |
|
613 |
# is immune from a future addition of currently unprivileged operations to |
|
614 |
# the basic privilege set. |
|
615 |
# NOTE: removing privileges from the the Limit set requires EXTREME care |
|
616 |
# as any set-uid root program may suddenly fail because it lacks certain |
|
617 |
# privilege(s). |
|
618 |
# |
|
619 |
#PRIV_DEFAULT=basic |
|
620 |
#PRIV_LIMIT=all |
|
621 |
EOM |
|
622 |
fi |
|
623 |
||
624 |
} |
|
625 |
||
626 |
# |
|
627 |
# Cleanup nfsmapid configuration before extracting |
|
628 |
# root bits. Remove if they exist: |
|
629 |
# nfsmapid entry in inetd.conf |
|
630 |
# nfsmapid entry in /etc/net/ti*/services |
|
631 |
# |
|
632 |
# Going forward neither should exist, but no harm if services entry exists |
|
633 |
# Going way backwards (pre-04/28/2004), inetd.conf must exist but will |
|
634 |
# be a conflict that should be merged in |
|
635 |
# |
|
636 |
nfsmapid_cfg() { |
|
637 |
inetdconf=$rootprefix/etc/inet/inetd.conf |
|
638 |
tmpinetcf=/tmp/inetd.conf.$$ |
|
639 |
cp -pf ${inetdconf} ${tmpinetcf} |
|
640 |
cat /dev/null > ${inetdconf} 2>&1 |
|
641 |
sed -e "/^#[# ]*NFSv4/d" \ |
|
642 |
-e "/^[# ]*100166\/1/d" \ |
|
643 |
${tmpinetcf} > ${inetdconf} 2>&1 |
|
644 |
rm -f ${tmpinetcf} |
|
645 |
||
646 |
tmpservices=/tmp/services.$$ |
|
647 |
||
648 |
services=$rootprefix/etc/net/ticotsord/services |
|
649 |
cp -pf ${services} ${tmpservices} |
|
650 |
cat /dev/null > ${services} 2>&1 |
|
651 |
sed -e "/^[# ]*nfsmapid/d" \ |
|
652 |
${tmpservices} > ${services} 2>&1 |
|
653 |
rm -f ${tmpservices} |
|
654 |
||
655 |
services=$rootprefix/etc/net/ticots/services |
|
656 |
cp -pf ${services} ${tmpservices} |
|
657 |
cat /dev/null > ${services} 2>&1 |
|
658 |
sed -e "/^[# ]*nfsmapid/d" \ |
|
659 |
${tmpservices} > ${services} 2>&1 |
|
660 |
rm -f ${tmpservices} |
|
661 |
||
662 |
services=$rootprefix/etc/net/ticlts/services |
|
663 |
cp -pf ${services} ${tmpservices} |
|
664 |
cat /dev/null > ${services} 2>&1 |
|
665 |
sed -e "/^[# ]*nfsmapid/d" \ |
|
666 |
${tmpservices} > ${services} 2>&1 |
|
667 |
rm -f ${tmpservices} |
|
668 |
} |
|
669 |
||
670 |
# Define global variables |
|
671 |
# |
|
672 |
CALL_DEVID_DESTROY="" |
|
673 |
# |
|
674 |
# List of SDS commands that must be deleted. |
|
675 |
# |
|
676 |
SDSCMDLIST=" |
|
677 |
growfs |
|
678 |
metaclear |
|
679 |
metadb |
|
680 |
metadetach |
|
681 |
metahs |
|
682 |
metainit |
|
683 |
metaoffline |
|
684 |
metaonline |
|
685 |
metaparam |
|
686 |
metarename |
|
687 |
metareplace |
|
688 |
metaroot |
|
689 |
metaset |
|
690 |
metastat |
|
691 |
metasync |
|
692 |
metattach |
|
693 |
rpc.metad |
|
694 |
rpc.metamhd |
|
695 |
" |
|
696 |
# |
|
697 |
# List of SDS configuration files that must be deleted. |
|
698 |
# |
|
699 |
SDSCONFIGLIST=" |
|
700 |
lock |
|
701 |
md.cf |
|
702 |
mddb.cf |
|
703 |
md.tab |
|
704 |
devpath |
|
705 |
md.ctlrmap |
|
706 |
" |
|
707 |
# |
|
708 |
# List of rc scripts that must be deleted. |
|
709 |
# |
|
710 |
RCLIST=" |
|
711 |
etc/init.d/SUNWmd.init |
|
712 |
etc/init.d/SUNWmd.sync |
|
713 |
etc/init.d/lvm.init |
|
714 |
etc/init.d/lvm.sync |
|
715 |
etc/rcS.d/S35SUNWmd.init |
|
716 |
etc/rcS.d/S35lvm.init |
|
717 |
etc/rc2.d/S95SUNWmd.sync |
|
718 |
etc/rc2.d/S95lvm.sync |
|
719 |
etc/rcS.d/S35slvm.init |
|
720 |
etc/rc2.d/S95slvm.sync |
|
721 |
etc/init.d/slvm.init |
|
722 |
etc/init.d/slvm.sync |
|
723 |
etc/init.d/init.mdlogd |
|
724 |
etc/rc3.d/S25mdlogd |
|
725 |
" |
|
726 |
# |
|
727 |
# List of flashprom-related files that must be deleted. |
|
728 |
# |
|
729 |
FLASHPROMLIST=" |
|
730 |
etc/rc2.d/S75flashprom |
|
731 |
etc/init.d/flashprom |
|
732 |
usr/platform/SUNW,Ultra-2/lib/flash-update.sh |
|
733 |
usr/platform/SUNW,Ultra-4/lib/flash-update.sh |
|
734 |
usr/platform/SUNW,Ultra-Enterprise/lib/flash-update.sh |
|
735 |
usr/platform/sun4u/doc/flashupdate.txt |
|
736 |
usr/platform/sun4u/lib/flash-update.sh |
|
737 |
usr/platform/sun4u/lib/prom/SUNW,Ultra-2 |
|
738 |
usr/platform/sun4u/lib/prom/SUNW,Ultra-4 |
|
739 |
usr/platform/sun4u/lib/prom/SUNW,Ultra-Enterprise |
|
740 |
" |
|
741 |
||
742 |
# |
|
743 |
# delete the entries associated with bootlist from /etc/system |
|
744 |
# |
|
745 |
||
746 |
delete_system_bootlist() { |
|
747 |
sed -e /"Begin MDD database info"/,/"End MDD database info"/d \ |
|
748 |
< ${SYSTEM_FILE} > /tmp/system.$$ |
|
749 |
cp /tmp/system.$$ ${SYSTEM_FILE} || \ |
|
750 |
echo "copy error: /tmp/system.$$ to ${SYSTEM_FILE}" |
|
751 |
} |
|
752 |
||
753 |
# |
|
754 |
# Add entries in md.conf for bootlist |
|
755 |
# |
|
756 |
||
757 |
fix_mdconf() { |
|
758 |
cp ${mdconf} /tmp/md.conf.$$ |
|
759 |
echo >> /tmp/md.conf.$$ |
|
760 |
echo "# Begin MDD database info (do not edit)" >> /tmp/md.conf.$$ |
|
761 |
sed -e 's/^set md://' -e 's/$/;/' ${SYSTEM_FILE} | \ |
|
762 |
grep mddb_bootlist >> /tmp/md.conf.$$ |
|
763 |
echo "# End MDD database info (do not edit)" >> /tmp/md.conf.$$ |
|
764 |
cp /tmp/md.conf.$$ ${mdconf} || \ |
|
765 |
echo "copy error: /tmp/md.conf.$$ to ${mdconf}" |
|
766 |
} |
|
767 |
||
768 |
# |
|
769 |
# add_devid_destroy(filename) |
|
770 |
# returns contents in filename |
|
771 |
# md_devid_destroy property is required when upgrading |
|
772 |
# from pre SVM to SVM releases or when the device ID returned from |
|
773 |
# the driver changes. |
|
774 |
# It is specifically placed between |
|
775 |
# # Begin MDD database info and # End MDD database info because |
|
776 |
# on the subsequent reboot, this line will be removed automatically when |
|
777 |
# metadevadm is run in rc2.d. |
|
778 |
# |
|
779 |
add_devid_destroy() { |
|
780 |
cat $1 | awk '{ |
|
781 |
if ( $2 == "End" && $4 == "database") { |
|
782 |
print "md_devid_destroy=1;" |
|
783 |
} |
|
784 |
print $0 |
|
785 |
}' >> /tmp/t$$ |
|
786 |
mv /tmp/t$$ $1 |
|
787 |
} |
|
788 |
||
789 |
# |
|
790 |
# smf(5) "Greenline" doesn't install the init.d or rc*.d scripts for |
|
791 |
# converted services. Clean up previous scripts for such services. |
|
792 |
# |
|
793 |
smf_obsolete_rc_files=" |
|
794 |
etc/init.d/ANNOUNCE |
|
795 |
etc/init.d/MOUNTFSYS |
|
796 |
etc/init.d/RMTMPFILES |
|
797 |
etc/init.d/audit |
|
798 |
etc/init.d/autofs |
|
799 |
etc/init.d/coreadm |
|
800 |
etc/init.d/cron |
|
801 |
etc/init.d/cryptosvc |
|
802 |
etc/init.d/cvc |
|
803 |
etc/init.d/devfsadm |
|
804 |
etc/init.d/dhcp |
|
805 |
etc/init.d/dhcpagent |
|
806 |
etc/init.d/domainname |
|
807 |
etc/init.d/efcode |
|
808 |
etc/init.d/inetd |
|
809 |
etc/init.d/inetinit |
|
810 |
etc/init.d/inetsvc |
|
811 |
etc/init.d/initboot |
|
812 |
etc/init.d/ipfboot |
|
813 |
etc/init.d/kdc |
|
814 |
etc/init.d/kdc.master |
|
815 |
etc/init.d/keymap |
|
816 |
etc/init.d/ldap.client |
|
817 |
etc/init.d/libc.mount |
|
818 |
etc/init.d/network |
|
819 |
etc/init.d/nfs.client |
|
820 |
etc/init.d/nodename |
|
821 |
etc/init.d/nscd |
|
822 |
etc/init.d/perf |
|
823 |
etc/init.d/pfil |
|
824 |
etc/init.d/picld |
|
825 |
etc/init.d/power |
|
826 |
etc/init.d/rcapd |
|
827 |
etc/init.d/rootusr |
|
828 |
etc/init.d/rpc |
|
829 |
etc/init.d/savecore |
|
830 |
etc/init.d/sf880dr |
|
831 |
etc/init.d/slpd |
|
832 |
etc/init.d/sshd |
|
833 |
etc/init.d/standardmounts |
|
834 |
etc/init.d/svm.init |
|
835 |
etc/init.d/svm.sync |
|
836 |
etc/init.d/sysid.net |
|
837 |
etc/init.d/sysid.sys |
|
838 |
etc/init.d/syslog |
|
839 |
etc/init.d/utmpd |
|
840 |
etc/init.d/xntpd |
|
841 |
etc/init.d/zones |
|
842 |
etc/rc0.d/K00ANNOUNCE |
|
843 |
etc/rc0.d/K01zones |
|
844 |
etc/rc0.d/K03sshd |
|
196 | 845 |
etc/rc0.d/K05volmgt |
0 | 846 |
etc/rc0.d/K10rcapd |
847 |
etc/rc0.d/K21dhcp |
|
848 |
etc/rc0.d/K28kdc |
|
849 |
etc/rc0.d/K28kdc.master |
|
850 |
etc/rc0.d/K28nfs.server |
|
851 |
etc/rc0.d/K32cryptosvc |
|
852 |
etc/rc0.d/K33audit |
|
853 |
etc/rc0.d/K33efcode |
|
854 |
etc/rc0.d/K34svm.sync |
|
855 |
etc/rc0.d/K36sendmail |
|
856 |
etc/rc0.d/K36utmpd |
|
857 |
etc/rc0.d/K37power |
|
858 |
etc/rc0.d/K40cron |
|
859 |
etc/rc0.d/K40inetd |
|
860 |
etc/rc0.d/K40nscd |
|
861 |
etc/rc0.d/K40sf880dr |
|
862 |
etc/rc0.d/K40slpd |
|
863 |
etc/rc0.d/K40syslog |
|
864 |
etc/rc0.d/K40xntpd |
|
865 |
etc/rc0.d/K41autofs |
|
866 |
etc/rc0.d/K41ldap.client |
|
867 |
etc/rc0.d/K41nfs.client |
|
868 |
etc/rc0.d/K41rpc |
|
869 |
etc/rc0.d/K43inet |
|
870 |
etc/rc0.d/K68picld |
|
871 |
etc/rc0.d/K83devfsadm |
|
872 |
etc/rc0.d/K90dhcpagent |
|
873 |
etc/rc1.d/K00ANNOUNCE |
|
874 |
etc/rc1.d/K01zones |
|
875 |
etc/rc1.d/K03sshd |
|
196 | 876 |
etc/rc1.d/K05volmgt |
0 | 877 |
etc/rc1.d/K10rcapd |
878 |
etc/rc1.d/K21dhcp |
|
879 |
etc/rc1.d/K28kdc |
|
880 |
etc/rc1.d/K28kdc.master |
|
881 |
etc/rc1.d/K28nfs.server |
|
882 |
etc/rc1.d/K33audit |
|
883 |
etc/rc1.d/K33efcode |
|
884 |
etc/rc1.d/K34svm.sync |
|
885 |
etc/rc1.d/K36sendmail |
|
886 |
etc/rc1.d/K36utmpd |
|
887 |
etc/rc1.d/K37power |
|
888 |
etc/rc1.d/K40cron |
|
889 |
etc/rc1.d/K40inetd |
|
890 |
etc/rc1.d/K40nscd |
|
891 |
etc/rc1.d/K40sf880dr |
|
892 |
etc/rc1.d/K40slpd |
|
893 |
etc/rc1.d/K40syslog |
|
894 |
etc/rc1.d/K40xntpd |
|
895 |
etc/rc1.d/K41autofs |
|
896 |
etc/rc1.d/K41ldap.client |
|
897 |
etc/rc1.d/K41rpc |
|
898 |
etc/rc1.d/K43inet |
|
899 |
etc/rc1.d/K99libc.mount |
|
900 |
etc/rc1.d/S01MOUNTFSYS |
|
901 |
etc/rc2.d/K01zones |
|
902 |
etc/rc2.d/K03sshd |
|
196 | 903 |
etc/rc2.d/K05volmgt |
0 | 904 |
etc/rc2.d/K21dhcp |
905 |
etc/rc2.d/K28kdc |
|
906 |
etc/rc2.d/K28kdc.master |
|
907 |
etc/rc2.d/K28nfs.server |
|
908 |
etc/rc2.d/S01MOUNTFSYS |
|
909 |
etc/rc2.d/S05RMTMPFILES |
|
910 |
etc/rc2.d/S21perf |
|
911 |
etc/rc2.d/S30sysid.net |
|
912 |
etc/rc2.d/S65ipfboot |
|
913 |
etc/rc2.d/S69domainname |
|
914 |
etc/rc2.d/S69inet |
|
915 |
etc/rc2.d/S71ldap.client |
|
916 |
etc/rc2.d/S71rpc |
|
917 |
etc/rc2.d/S71sysid.sys |
|
918 |
etc/rc2.d/S72inetsvc |
|
919 |
etc/rc2.d/S72slpd |
|
920 |
etc/rc2.d/S73nfs.client |
|
921 |
etc/rc2.d/S74autofs |
|
922 |
etc/rc2.d/S74syslog |
|
923 |
etc/rc2.d/S74xntpd |
|
924 |
etc/rc2.d/S75cron |
|
925 |
etc/rc2.d/S75savecore |
|
926 |
etc/rc2.d/S76nscd |
|
927 |
etc/rc2.d/S77inetd |
|
928 |
etc/rc2.d/S77sf880dr |
|
929 |
etc/rc2.d/S85power |
|
930 |
etc/rc2.d/S88sendmail |
|
931 |
etc/rc2.d/S88utmpd |
|
932 |
etc/rc2.d/S95svm.sync |
|
933 |
etc/rc2.d/S98efcode |
|
934 |
etc/rc2.d/S98libc.mount |
|
935 |
etc/rc2.d/S99audit |
|
936 |
etc/rc2.d/S99rcapd |
|
937 |
etc/rc3.d/S13kdc.master |
|
938 |
etc/rc3.d/S14kdc |
|
939 |
etc/rc3.d/S15nfs.server |
|
940 |
etc/rc3.d/S34dhcp |
|
196 | 941 |
etc/rc3.d/S81volmgt |
0 | 942 |
etc/rc3.d/S89sshd |
943 |
etc/rc3.d/S99zones |
|
944 |
etc/rcS.d/K01zones |
|
945 |
etc/rcS.d/K03sshd |
|
196 | 946 |
etc/rcS.d/K05volmgt |
0 | 947 |
etc/rcS.d/K10rcapd |
948 |
etc/rcS.d/K21dhcp |
|
949 |
etc/rcS.d/K28kdc |
|
950 |
etc/rcS.d/K28kdc.master |
|
951 |
etc/rcS.d/K28nfs.server |
|
952 |
etc/rcS.d/K33audit |
|
953 |
etc/rcS.d/K33efcode |
|
954 |
etc/rcS.d/K34svm.sync |
|
955 |
etc/rcS.d/K36sendmail |
|
956 |
etc/rcS.d/K36utmpd |
|
957 |
etc/rcS.d/K37power |
|
958 |
etc/rcS.d/K40cron |
|
959 |
etc/rcS.d/K40inetd |
|
960 |
etc/rcS.d/K40nscd |
|
961 |
etc/rcS.d/K40sf880dr |
|
962 |
etc/rcS.d/K40slpd |
|
963 |
etc/rcS.d/K40syslog |
|
964 |
etc/rcS.d/K40xntpd |
|
965 |
etc/rcS.d/K41autofs |
|
966 |
etc/rcS.d/K41ldap.client |
|
967 |
etc/rcS.d/K41rpc |
|
968 |
etc/rcS.d/K43inet |
|
969 |
etc/rcS.d/K99libc.mount |
|
970 |
etc/rcS.d/S10cvc |
|
971 |
etc/rcS.d/S10pfil |
|
972 |
etc/rcS.d/S28network.sh |
|
973 |
etc/rcS.d/S29nodename.sh |
|
974 |
etc/rcS.d/S30rootusr.sh |
|
975 |
etc/rcS.d/S33keymap.sh |
|
976 |
etc/rcS.d/S35svm.init |
|
977 |
etc/rcS.d/S40standardmounts.sh |
|
978 |
etc/rcS.d/S42coreadm |
|
979 |
etc/rcS.d/S45initboot |
|
980 |
etc/rcS.d/S50devfsadm |
|
981 |
etc/rcS.d/S72cryptosvc |
|
982 |
etc/rcS.d/S95picld |
|
983 |
" |
|
984 |
||
985 |
# Obsolete smf manifests |
|
986 |
smf_obsolete_manifests=" |
|
987 |
var/svc/manifest/network/tftp.xml |
|
988 |
var/svc/manifest/network/lp.xml |
|
989 |
" |
|
990 |
||
991 |
# smf services whose manifests have been renamed |
|
992 |
smf_renamed_manifests=" |
|
993 |
var/svc/manifest/milestone/name-service.xml |
|
25 | 994 |
var/svc/manifest/system/filesystem/boot-archive.xml |
0 | 995 |
" |
996 |
||
997 |
# Obsolete smf methods |
|
998 |
smf_obsolete_methods=" |
|
999 |
lib/svc/method/print-server |
|
1000 |
" |
|
1001 |
||
1002 |
smf_cleanup () { |
|
1003 |
( |
|
1004 |
cd $root; |
|
1005 |
print "Removing obsolete rc.d scripts ... \c" |
|
1006 |
rm -f $smf_obsolete_rc_files |
|
1007 |
print "done." |
|
1008 |
) |
|
1009 |
} |
|
1010 |
||
1011 |
smf_new_profiles () { |
|
1012 |
[[ "$bfu_isa" = "sparc" ]] || return 0 |
|
1013 |
||
1014 |
[[ -x /tmp/bfubin/svccfg ]] || return 0 |
|
1015 |
||
1016 |
print "Clearing platform profile hash ..." |
|
1017 |
||
1018 |
# platform_SUNW,Sun-Fire.xml (and other new and |
|
1019 |
# corrected platforms) were delivered in Build 68. |
|
1020 |
if [ ! -f \ |
|
1021 |
$rootprefix/var/svc/profile/platform_SUNW,Sun-Fire.xml \ |
|
1022 |
]; then |
|
1023 |
for pfx in " " "v"; do |
|
1024 |
for plname in \ |
|
1025 |
none \ |
|
1026 |
SUNW_Sun_Fire_880 \ |
|
1027 |
SUNW_Sun_Fire_V890 \ |
|
1028 |
SUNW_Sun_Fire_15000 \ |
|
1029 |
SUNW_UltraEnterprise_10000; do |
|
1030 |
svccfg -f - <<EOF |
|
1031 |
select smf/manifest |
|
1032 |
delpg ${pfx}ar_svc_profile_platform_${plname}_xml |
|
1033 |
exit |
|
1034 |
EOF |
|
1035 |
done |
|
1036 |
done |
|
1037 |
fi |
|
1038 |
} |
|
1039 |
||
1040 |
smf_handle_new_services () { |
|
1041 |
# |
|
1042 |
# Detect, prior to extraction the arrival of new, |
|
1043 |
# default-enabled-in-profile services. If so, add a command |
|
1044 |
# such that they are enabled. |
|
1045 |
# |
|
1046 |
if [ ! -f $rootprefix/var/svc/profile/system/sac.xml ]; then |
|
1047 |
echo /usr/sbin/svcadm enable system/sac >> \ |
|
1048 |
$rootprefix/var/svc/profile/upgrade |
|
1049 |
fi |
|
172
3f157d3c7622
PSARC/2004/199 intrd: Dynamic Interrupt Distribution
esolom
parents:
132
diff
changeset
|
1050 |
if [[ $zone = global && |
3f157d3c7622
PSARC/2004/199 intrd: Dynamic Interrupt Distribution
esolom
parents:
132
diff
changeset
|
1051 |
! -f $rootprefix/var/svc/manifest/system/intrd.xml ]]; then |
3f157d3c7622
PSARC/2004/199 intrd: Dynamic Interrupt Distribution
esolom
parents:
132
diff
changeset
|
1052 |
echo /usr/sbin/svcadm enable system/intrd >> \ |
3f157d3c7622
PSARC/2004/199 intrd: Dynamic Interrupt Distribution
esolom
parents:
132
diff
changeset
|
1053 |
$rootprefix/var/svc/profile/upgrade |
3f157d3c7622
PSARC/2004/199 intrd: Dynamic Interrupt Distribution
esolom
parents:
132
diff
changeset
|
1054 |
fi |
196 | 1055 |
if [[ $zone = global && |
1056 |
! -f $rootprefix/var/svc/profile/system/filesystem/volfs.xml ]]; then |
|
1057 |
echo /usr/sbin/svcadm enable system/filesystem/volfs >> \ |
|
1058 |
$rootprefix/var/svc/profile/upgrade |
|
1059 |
fi |
|
0 | 1060 |
} |
1061 |
||
1062 |
smf_copy_manifest() { |
|
1063 |
mfstbase=`basename $1` |
|
1064 |
mymfs=$rootprefix/var/svc/manifest/$2/$mfstbase |
|
1065 |
if [[ ! -f $mymfs ]] || ! cmp -s $manifest_src/$1 $mymfs ; then |
|
1066 |
cp $manifest_src/$1 $mymfs || |
|
1067 |
echo "bfu: could not copy $manifest_src/$1" |
|
1068 |
fi |
|
1069 |
} |
|
1070 |
||
1071 |
smf_copy_method() { |
|
1072 |
cp $manifest_src/$1 $rootprefix/lib/svc/method || |
|
1073 |
echo "bfu: could not copy $manifest_src/$1" |
|
1074 |
} |
|
1075 |
||
1076 |
smf_cleanup_initd() { |
|
1077 |
rm -f $rootprefix/etc/rc?.d/[SK]??$1 |
|
1078 |
} |
|
1079 |
||
1080 |
smf_delete_manifest() { |
|
1081 |
( |
|
1082 |
mfst=$1 |
|
1083 |
cd $root |
|
1084 |
[ -f $mfst ] || return; |
|
1085 |
if [ -r /etc/svc/volatile/repository_door ]; then |
|
1086 |
ENTITIES=`/tmp/bfubin/svccfg inventory $mfst` |
|
1087 |
for fmri in $ENTITIES; do |
|
1088 |
/tmp/bfubin/svccfg delete -f $fmri |
|
1089 |
done |
|
1090 |
fi |
|
1091 |
rm $mfst |
|
1092 |
) |
|
1093 |
} |
|
1094 |
||
1095 |
smf_delete_methods() { |
|
1096 |
( |
|
1097 |
cd $root; |
|
1098 |
rm -f $smf_obsolete_methods |
|
1099 |
) |
|
1100 |
} |
|
1101 |
||
1102 |
smf_delete_renamed_manifests() { |
|
1103 |
( |
|
1104 |
cd $root; |
|
1105 |
rm -f $smf_renamed_manifests |
|
1106 |
) |
|
1107 |
} |
|
1108 |
||
305 | 1109 |
smf_gldv3_manifests=" |
1110 |
var/svc/manifest/network/aggregation.xml |
|
1111 |
var/svc/manifest/network/datalink.xml |
|
1112 |
var/svc/manifest/network/datalink-init.xml |
|
1113 |
" |
|
1114 |
smf_gldv3_methods=" |
|
1115 |
lib/svc/method/aggregation |
|
1116 |
lib/svc/method/datalink |
|
1117 |
lib/svc/method/datalink-init |
|
1118 |
" |
|
1119 |
smf_cleanup_gldv3() { |
|
1120 |
( |
|
1121 |
for f in $smf_gldv3_manifests; do |
|
1122 |
smf_delete_manifest $f |
|
1123 |
done |
|
1124 |
cd $root; |
|
1125 |
rm -f $smf_gldv3_methods |
|
1126 |
) |
|
1127 |
} |
|
1128 |
||
0 | 1129 |
old_mfst_dir="var/svc/manifest.orig" |
1130 |
new_mfst_dir="var/svc/manifest" |
|
1131 |
||
1132 |
smf_enable() { |
|
1133 |
echo "svcadm enable $*" >> $rootprefix/var/svc/profile/upgrade |
|
1134 |
} |
|
1135 |
||
1136 |
smf_check_repository() { |
|
1137 |
repository=etc/svc/repository.db |
|
1138 |
[[ -f $rootprefix/$repository ]] || return |
|
1139 |
||
1140 |
print -n "$rootprefix/$repository: " >&2 |
|
1141 |
||
1142 |
sqlite="${SQLITEBIN-$GATE/public/bin/$bfu_isa/sqlite}" |
|
1143 |
[[ -x $sqlite ]] || sqlite=/lib/svc/bin/sqlite |
|
1144 |
if [[ ! -x $sqlite ]]; then |
|
1145 |
echo "no sqlite binary: skipped integrity check" >&2 |
|
1146 |
return |
|
1147 |
fi |
|
1148 |
||
1149 |
rm -f /tmp/bfurepo.db; |
|
1150 |
cp $rootprefix/$repository /tmp/bfurepo.db |
|
1151 |
bad_errors=`echo "PRAGMA integrity_check;" | |
|
1152 |
$sqlite /tmp/bfurepo.db 2>&1 | grep -v '^ok$'` |
|
1153 |
if [[ $? -eq 0 ]]; then |
|
1154 |
echo "integrity check failed:" >&2 |
|
1155 |
echo "$bad_errors" >&2 |
|
1156 |
echo >&2 |
|
1157 |
if [[ $force_override = no ]]; then |
|
1158 |
cat >&2 <<EOF |
|
1159 |
Reseed the repository (see http://greenline.eng/quickstart.shtml#newrep) |
|
1160 |
before BFUing (or use the -f flag to force BFU to continue). Re-seeding |
|
1161 |
will lose all smf(5) customizations. |
|
1162 |
EOF |
|
1163 |
echo >&2 |
|
1164 |
exit 2; |
|
1165 |
else |
|
1166 |
echo "driving on anyway" >&2 |
|
1167 |
fi |
|
1168 |
else |
|
1169 |
echo "passed integrity check" >&2; |
|
1170 |
fi |
|
1171 |
} |
|
1172 |
||
1173 |
smf_bkbfu_warning() { |
|
1174 |
print "" |
|
1175 |
print "*************************************************************" |
|
1176 |
print " WARNING: BFU'ing $1 backwards across 5090532." |
|
1177 |
print " Fixes have been made but the services cannot be refreshed" |
|
1178 |
print " on the $1's inactive repository. Next boot for the" |
|
1179 |
print " $1 will probably result in maintenance mode due to" |
|
1180 |
print " dependency cycles. If so, at the $1's console, run:" |
|
1181 |
print "" |
|
1182 |
print " /usr/sbin/svcadm refresh system/sysidtool:system" |
|
1183 |
print " /usr/sbin/svcadm refresh system/sysidtool:net" |
|
1184 |
print " /usr/sbin/svcadm clear milestone/single-user" |
|
1185 |
print " /usr/sbin/svcadm clear system/sysidtool:system" |
|
1186 |
print " /usr/sbin/svcadm clear system/sysidtool:net" |
|
1187 |
print "" |
|
1188 |
print " to resolve." |
|
1189 |
print " To avoid these problems, reseed the zone's repository." |
|
1190 |
print " See http://greenline.eng/quickstart.shtml#newrep ." |
|
1191 |
print " Note: Re-seeding will lose all smf(5) customization." |
|
1192 |
print "*************************************************************" |
|
1193 |
print "" |
|
1194 |
} |
|
1195 |
||
1196 |
smf_is_sysconfig() { |
|
1197 |
# |
|
1198 |
# Return success if going to post-5090532, i.e. post-sysconfig bits |
|
1199 |
# |
|
1200 |
# By now, we're going to post-smf bits - so multi-user.xml must |
|
1201 |
# exist (since it was introduced by first SMF putback). |
|
1202 |
# |
|
1203 |
# Function return status is return status of last command executed. |
|
1204 |
# So, no need to check return status from grep below. |
|
1205 |
||
1206 |
grep sysconfig $rootprefix/var/svc/manifest/milestone/multi-user.xml \ |
|
1207 |
>/dev/null 2>&1 |
|
1208 |
} |
|
1209 |
||
1210 |
smf_bkbfu_past_sysconfig() { |
|
1211 |
# |
|
1212 |
# Check if bfu'ing back from post-5090532 to pre-5090532 bits. |
|
1213 |
# |
|
1214 |
if [[ -f $rootprefix/var/svc/manifest/milestone/sysconfig.xml ]] && |
|
1215 |
! smf_is_sysconfig ; then |
|
1216 |
return 0 |
|
1217 |
fi |
|
1218 |
return 1 |
|
1219 |
} |
|
1220 |
||
1221 |
smf_bkbfu_repair_sysconfig() { |
|
1222 |
# |
|
1223 |
# Perform the necessary corrections when bfu'ing backwards |
|
1224 |
# from post-5090532 to pre-5090532 bits. |
|
1225 |
# |
|
1226 |
# Get the pre-5090532 non-ON manifests, and issue minimal fixes |
|
1227 |
# to the repository, to enable re-boot. |
|
1228 |
# |
|
1229 |
smf_copy_manifest pre-5090532/sysidtool.xml system |
|
1230 |
if [[ $zone = global && $karch = i86pc ]]; then |
|
1231 |
smf_copy_manifest pre-5090532/kdmconfig.xml platform/i86pc |
|
1232 |
fi |
|
1233 |
# |
|
1234 |
# Now, remove sysidtool:{system, net}'s dependency on |
|
1235 |
# single-user and filesystem-local. |
|
1236 |
# |
|
1237 |
# If $rootprefix is not empty, this could be the global zone, |
|
1238 |
# with an alternate root BFU, or a non-global zone. For either |
|
1239 |
# case, the repository to be updated is not the live one: use |
|
1240 |
# SVCCFG_REPOSITORY to point to the repository to be updated. |
|
1241 |
# |
|
1242 |
# Note that in the alternate-root case, doing this seems better |
|
1243 |
# than forcing the user to re-seed, or to dis-allow it. The |
|
1244 |
# issue of svccfg and the repository not matching seems remote, |
|
1245 |
# given that from initial SMF integration (on10_64) to on10_74, |
|
1246 |
# there was no mismatch. In the remote possibility that there is a |
|
1247 |
# mis-match (in the future) causing these calls to be suspect, |
|
1248 |
# the user is already being advised, via the warning message, to |
|
1249 |
# reseed the repository in case of trouble. If a mis-match is ever |
|
1250 |
# introduced, code such as this would have to be fixed, so this |
|
1251 |
# aspect of the warning is useful only during the interim period. |
|
1252 |
# |
|
1253 |
# NOTE that this is not an issue for non-global zones' |
|
1254 |
# repositories - they couldn't be out-of-sync with |
|
1255 |
# /tmp/bfubin/svccfg. |
|
1256 |
# |
|
1257 |
if [[ -n $rootprefix ]]; then |
|
1258 |
export SVCCFG_REPOSITORY=$rootprefix/etc/svc/repository.db |
|
1259 |
if [[ $zone = global ]]; then |
|
1260 |
smf_bkbfu_warning "alternate root" |
|
1261 |
else |
|
1262 |
smf_bkbfu_warning "zone" |
|
1263 |
fi |
|
1264 |
fi |
|
1265 |
# |
|
1266 |
# Using the newer "-s" option to svccfg in the following is OK |
|
1267 |
# since its introduction preceded 5090532 (and this routine wouldn't |
|
1268 |
# be called unless the machine is running post-5090532 bits). |
|
1269 |
# |
|
1270 |
/tmp/bfubin/svccfg -s system/sysidtool:net delpg single-user |
|
1271 |
/tmp/bfubin/svccfg -s system/sysidtool:system delpg single-user |
|
1272 |
/tmp/bfubin/svccfg -s system/sysidtool:net delpg filesystem_local |
|
1273 |
/tmp/bfubin/svccfg -s system/sysidtool:system delpg filesystem_local |
|
1274 |
||
1275 |
# |
|
1276 |
# On a live system, issue the refresh; For alternate root or non-global |
|
1277 |
# zone, the user was asked to issue the refreshes and "clear"s in the |
|
1278 |
# message above after a post-bfu reboot. |
|
1279 |
# |
|
1280 |
if [[ -z $rootprefix ]]; then |
|
1281 |
/tmp/bfubin/svcadm refresh system/sysidtool:system \ |
|
1282 |
system/sysidtool:net |
|
1283 |
fi |
|
1284 |
||
1285 |
# |
|
1286 |
# Now, reset SVCCFG_REPOSITORY, if it was set |
|
1287 |
# |
|
1288 |
[[ -n $rootprefix ]] && unset SVCCFG_REPOSITORY |
|
1289 |
||
1290 |
# |
|
1291 |
# Remove the sysconfig.xml manifest when going back. So backward |
|
1292 |
# bfu check continues to work, and all manifests are correct. |
|
1293 |
# |
|
1294 |
cat >> $rootprefix/var/svc/profile/upgrade <<-EOF |
|
1295 |
rm -f /var/svc/manifest/milestone/sysconfig.xml |
|
1296 |
EOF |
|
1297 |
} |
|
1298 |
||
1299 |
smf_apply_conf () { |
|
1300 |
# |
|
1301 |
# Go thru the original manifests and move any that were unchanged |
|
1302 |
# (or are not system-provided) back to their proper location. This |
|
1303 |
# will avoid superfluous re-import on reboot, as the inode and mtime |
|
1304 |
# are both part of the hash. |
|
1305 |
# |
|
1306 |
if [ -d $rootprefix/$old_mfst_dir ]; then |
|
1307 |
for f in `cd $rootprefix/$old_mfst_dir ; find . -type f` |
|
1308 |
do |
|
1309 |
old=$rootprefix/$old_mfst_dir/$f |
|
1310 |
new=$rootprefix/$new_mfst_dir/$f |
|
1311 |
if [ ! -f $new ]; then |
|
1312 |
mkdir -m 0755 -p `dirname $new` |
|
1313 |
mv $old $new |
|
1314 |
continue |
|
1315 |
fi |
|
1316 |
cmp -s $old $new && mv $old $new |
|
1317 |
done |
|
1318 |
rm -rf $rootprefix/$old_mfst_dir |
|
1319 |
fi |
|
1320 |
||
1321 |
if [ -f $rootprefix/etc/init.d/inetd ]; then |
|
1322 |
# |
|
1323 |
# BFUing to non-SMF system -- undo our previous changes, |
|
1324 |
# run an old hack, and skip the remainder of this function. |
|
1325 |
# |
|
1326 |
smf_inetd_reenable |
|
1327 |
smf_tftp_reinstall |
|
1328 |
||
1329 |
# Update inetd.conf only if we find rpc.metad file. |
|
1330 |
[ -f $usr/sbin/rpc.metad ] && |
|
1331 |
inetd_conf_svm_hack |
|
1332 |
||
1333 |
return |
|
1334 |
fi |
|
1335 |
||
1336 |
# |
|
1337 |
# At this point, the archive in question is a SMF version. If |
|
1338 |
# the smf(5) repository does not yet exist, create it by copying |
|
1339 |
# the appropriate seed repository. Since updating of non-global |
|
1340 |
# zones only occurs when the live system is bfu'ed, the |
|
1341 |
# appropriate seed is guaranteed to exist under the /lib |
|
1342 |
# directory. |
|
1343 |
# |
|
1344 |
repository=$rootprefix/etc/svc/repository.db |
|
1345 |
if [ ! -f $repository ]; then |
|
1346 |
print "Initializing service configuration repository ..." |
|
1347 |
if [ $zone = global ]; then |
|
1348 |
cp $rootprefix/lib/svc/seed/global.db $repository |
|
1349 |
else |
|
1350 |
cp /lib/svc/seed/nonglobal.db $repository |
|
1351 |
fi |
|
1352 |
chmod 0600 $repository |
|
1353 |
chown root:sys $repository |
|
1354 |
fi |
|
1355 |
||
1356 |
print "Removing obsolete smf services ..." |
|
1357 |
for f in $smf_obsolete_manifests; do |
|
1358 |
smf_delete_manifest $f |
|
1359 |
done |
|
1360 |
smf_delete_methods |
|
1361 |
smf_delete_renamed_manifests |
|
305 | 1362 |
if [ $need_datalink = no ]; then |
1363 |
smf_cleanup_gldv3 |
|
1364 |
fi |
|
0 | 1365 |
|
1366 |
print "Disabling unneeded inetd.conf entries ..." |
|
1367 |
smf_inetd_disable |
|
1368 |
smf_tftp_reinstall |
|
1369 |
||
1370 |
print "Connecting platform and name service profiles ..." |
|
1371 |
||
1372 |
rm -f $rootprefix/var/svc/profile/name_service.xml |
|
1373 |
||
1374 |
grep ldap $rootprefix/etc/nsswitch.conf >/dev/null 2>&1 |
|
1375 |
is_ldap=$? |
|
1376 |
grep nisplus $rootprefix/etc/nsswitch.conf >/dev/null 2>&1 |
|
1377 |
is_nisplus=$? |
|
1378 |
grep nis $rootprefix/etc/nsswitch.conf >/dev/null 2>&1 |
|
1379 |
is_nis=$? |
|
1380 |
||
1381 |
if [ $is_ldap = 0 ]; then |
|
1382 |
ns_profile=ns_ldap.xml |
|
1383 |
elif [ $is_nisplus = 0 ]; then |
|
1384 |
ns_profile=ns_nisplus.xml |
|
1385 |
elif [ $is_nis = 0 ]; then |
|
1386 |
ns_profile=ns_nis.xml |
|
1387 |
else |
|
1388 |
ns_profile=ns_files.xml |
|
1389 |
fi |
|
1390 |
||
1391 |
ln -s $ns_profile $rootprefix/var/svc/profile/name_service.xml |
|
1392 |
||
1393 |
rm -f $rootprefix/var/svc/profile/inetd_services.xml |
|
1394 |
ln -s inetd_upgrade.xml $rootprefix/var/svc/profile/inetd_services.xml |
|
1395 |
||
1396 |
print "Marking converted services as enabled ..." |
|
1397 |
||
1398 |
[ -f $rootprefix/etc/resolv.conf ] && smf_enable network/dns/client |
|
1399 |
[ -f $rootprefix/etc/rcap.conf ] && smf_enable system/rcap |
|
1400 |
[ -f $rootprefix/etc/inet/dhcpsvc.conf ] && \ |
|
1401 |
smf_enable network/dhcp-server |
|
1402 |
||
1403 |
if [ $zone = global ]; then |
|
1404 |
if [ -f $rootprefix/etc/dfs/dfstab ] && |
|
1405 |
grep '^[ ]*[^# ]' $rootprefix/etc/dfs/dfstab \ |
|
1406 |
> /dev/null; then |
|
1407 |
smf_enable network/nfs/server |
|
1408 |
fi |
|
1409 |
else |
|
1410 |
echo "/usr/sbin/svcadm disable network/nfs/server" >> \ |
|
1411 |
$rootprefix/var/svc/profile/upgrade |
|
1412 |
fi |
|
1413 |
||
1414 |
[ -f $rootprefix/etc/inet/ntp.conf ] && smf_enable network/ntp |
|
1415 |
||
1416 |
||
1417 |
domainname=`cat $rootprefix/etc/defaultdomain 2>/dev/null` |
|
1418 |
if [ ! -z "$domainname" -a -d $rootprefix/var/yp/$domainname ]; then |
|
1419 |
smf_enable network/nis/server |
|
1420 |
||
1421 |
# Determining whether we're a NIS master requires |
|
1422 |
# looking through the maps. |
|
1423 |
cat >>$rootprefix/var/svc/profile/upgrade <<\_EOF |
|
1424 |
# Determine whether we are a YP master. |
|
1425 |
domain=`/usr/bin/domainname` |
|
1426 |
hostname=`uname -n | cut -d. -f1 | tr '[A-Z]' '[a-z]'` |
|
1427 |
||
1428 |
if [ -x /usr/sbin/makedbm ]; then |
|
1429 |
if [ -f /var/yp/NISLDAPmapping ]; then |
|
1430 |
master=`/usr/sbin/makedbm -u /var/yp/\$domain/LDAP_passwd.byname | grep YP_MASTER_NAME | nawk '{ print $2 }'` |
|
1431 |
else |
|
1432 |
master=`/usr/sbin/makedbm -u /var/yp/\$domain/passwd.byname | grep YP_MASTER_NAME | nawk '{ print $2 }'` |
|
1433 |
fi |
|
1434 |
fi |
|
1435 |
||
1436 |
# If we are the master server, enable appropriate services. |
|
1437 |
if [ "$master" = "$hostname" -a "$YP_SERVER" = "TRUE" ]; then |
|
1438 |
/usr/sbin/svcadm enable network/nis/xfr |
|
1439 |
/usr/sbin/svcadm enable network/nis/passwd |
|
1440 |
||
1441 |
if [ ! -f /var/yp/NISLDAPmapping ]; then |
|
1442 |
[ -f /var/yp/updaters ] && \ |
|
1443 |
/usr/svc/svcadm enable network/nis/update |
|
1444 |
fi |
|
1445 |
fi |
|
1446 |
_EOF |
|
1447 |
fi |
|
1448 |
||
1449 |
# Check if mddbs don't exist on the image. If so, disable SVM services. |
|
1450 |
MDDB_STATUS=1 |
|
1451 |
if [ -f $rootprefix/kernel/drv/md.conf ]; then |
|
1452 |
sed -e 's/#.*$//' $rootprefix/kernel/drv/md.conf | \ |
|
1453 |
egrep '^[ ]*mddb_bootlist' >/dev/null 2>&1 |
|
1454 |
MDDB_STATUS=$? |
|
1455 |
fi |
|
1456 |
||
1457 |
if [ $MDDB_STATUS -ne 0 ]; then |
|
1458 |
for svc in metainit mdmonitor; do |
|
1459 |
echo "/usr/sbin/svcadm disable system/$svc:default" >> \ |
|
1460 |
$rootprefix/var/svc/profile/upgrade |
|
1461 |
done |
|
1462 |
||
1463 |
for svc in meta mdcomm metamed metamh; do |
|
1464 |
echo "/usr/sbin/svcadm disable network/rpc/$svc:default" \ |
|
1465 |
>> $rootprefix/var/svc/profile/upgrade |
|
1466 |
done |
|
1467 |
fi |
|
1468 |
||
1469 |
# Workaround inetd's handling of "tcp6/udp6" when no IPv6 interfaces |
|
1470 |
# are configured. |
|
1471 |
for svc in meta mdcomm metamed metamh; do |
|
1472 |
echo "/usr/sbin/inetadm -m network/rpc/$svc:default proto=tcp" \ |
|
1473 |
">/dev/null 2>&1" >> $rootprefix/var/svc/profile/upgrade |
|
1474 |
done |
|
1475 |
||
1476 |
manifest_src=${MANIFEST_SRC-$GATE/public/smf} |
|
1477 |
[[ -d $manifest_src ]] || |
|
1478 |
manifest_src=/net/onnv.eng/export/gate/public/smf |
|
1479 |
[[ -d $manifest_src ]] || manifest_src=/net/greenline.eng/meta0/smf |
|
1480 |
||
1481 |
if smf_bkbfu_past_sysconfig ; then |
|
1482 |
echo "BFU'ing backwards across 5090532! Now repairing..." |
|
1483 |
smf_bkbfu_repair_sysconfig |
|
1484 |
fi |
|
1485 |
||
1486 |
# |
|
1487 |
# If bfu'ing milestone/sysconfig bits or onwards, update the |
|
1488 |
# corresponding non-ON manifests - sysidtool and kdmconfig. |
|
1489 |
# |
|
1490 |
sysidmfst=$rootprefix/var/svc/manifest/system/sysidtool.xml |
|
1491 |
kdmmfst=$rootprefix/var/svc/manifest/platform/i86pc/kdmconfig.xml |
|
1492 |
if smf_is_sysconfig ; then |
|
1493 |
if [[ ! -f $sysidmfst ]]; then |
|
1494 |
# |
|
1495 |
# if WOS build on machine is pre-greenline, and |
|
1496 |
# we're bfu'ing to the sysconfig bits. |
|
1497 |
# |
|
1498 |
smf_copy_manifest post-5090532/sysidtool.xml system |
|
1499 |
if [[ $zone = global ]]; then |
|
1500 |
smf_copy_method sysidtool-net |
|
1501 |
smf_copy_method sysidtool-system |
|
1502 |
fi |
|
1503 |
echo "Converted system/sysidtool (post-5090532)" |
|
1504 |
else |
|
1505 |
# |
|
1506 |
# If sysidtool.xml already exists, update it |
|
1507 |
# if necessary. Future updates of sysidtool.xml |
|
1508 |
# must occur in the dir: $manifest_src/post-5090532 |
|
1509 |
# |
|
1510 |
smf_copy_manifest post-5090532/sysidtool.xml system |
|
1511 |
fi |
|
1512 |
if [[ $zone = global && $karch = i86pc ]]; then |
|
1513 |
if [[ ! -f $kdmmfst ]]; then |
|
1514 |
# |
|
1515 |
# if WOS build on machine is pre-greenline, and |
|
1516 |
# we're bfu'ing to the sysconfig bits. |
|
1517 |
# |
|
1518 |
smf_copy_manifest post-5090532/kdmconfig.xml \ |
|
1519 |
platform/i86pc |
|
1520 |
smf_copy_method svc-kdmconfig |
|
1521 |
smf_cleanup_initd kdmconfig |
|
1522 |
echo "Converted platform/i86pc/kdmconfig" |
|
1523 |
echo "(post-5090532)" |
|
1524 |
else |
|
1525 |
# |
|
1526 |
# If kdmconfig.xml already exists, update |
|
1527 |
# it if necessary. Future updates of |
|
1528 |
# kdmconfig.xml must occur in the dir: |
|
1529 |
# $manifest_src/post-5090532 |
|
1530 |
# |
|
1531 |
smf_copy_manifest post-5090532/kdmconfig.xml \ |
|
1532 |
platform/i86pc |
|
1533 |
fi |
|
1534 |
fi |
|
1535 |
else |
|
1536 |
if [[ ! -f $sysidmfst ]]; then |
|
1537 |
smf_copy_manifest pre-5090532/sysidtool.xml system |
|
1538 |
if [[ $zone = global ]]; then |
|
1539 |
smf_copy_method sysidtool-net |
|
1540 |
smf_copy_method sysidtool-system |
|
1541 |
fi |
|
1542 |
echo "Converted system/sysidtool" |
|
1543 |
fi |
|
1544 |
if [[ $zone = global && $karch = i86pc && ! -f $kdmmfst ]]; |
|
1545 |
then |
|
1546 |
smf_copy_manifest pre-5090532/kdmconfig.xml \ |
|
1547 |
platform/i86pc |
|
1548 |
smf_copy_method svc-kdmconfig |
|
1549 |
smf_cleanup_initd kdmconfig |
|
1550 |
echo "Converted platform/i86pc/kdmconfig" |
|
1551 |
fi |
|
1552 |
fi |
|
1553 |
||
1554 |
# If we've still got the old dtlogin manifest delivered by earlier |
|
1555 |
# versions of bfu, delete it, as it was broken and should have |
|
1556 |
# never been delivered. A new version delivered by the CDE |
|
1557 |
# consolidation should be left alone. |
|
1558 |
if [[ -f $rootprefix/var/svc/manifest/application/dtlogin.xml && |
|
1559 |
`grep -c GLXXX \ |
|
1560 |
$rootprefix/var/svc/manifest/application/dtlogin.xml` -gt 0 && |
|
1561 |
-x /tmp/bfubin/svccfg ]]; then |
|
1562 |
||
1563 |
# Delete the obsolete manifest. |
|
1564 |
rm -f $rootprefix/var/svc/manifest/application/dtlogin.xml |
|
1565 |
||
1566 |
# Delete the service from repository, then use dtconfig -e to |
|
1567 |
# revert to whatever the WOS bits are using if dtlogin was |
|
1568 |
# enabled. |
|
1569 |
cat >> $rootprefix/var/svc/profile/upgrade <<-EOFA |
|
1570 |
if /usr/bin/svcprop -q application/cde-login; then |
|
1571 |
if [ \`/usr/bin/svcprop -p general/enabled \ |
|
1572 |
application/cde-login:default\` = "true" ]; then |
|
1573 |
do_dtconfig=1; |
|
1574 |
else |
|
1575 |
do_dtconfig=0; |
|
1576 |
fi |
|
1577 |
||
1578 |
/usr/sbin/svccfg delete -f application/cde-login |
|
1579 |
type instance_refresh 2>&1 > /dev/null |
|
1580 |
if [ \$? = 0 ]; then |
|
1581 |
instance_refresh system/console-login |
|
1582 |
else |
|
1583 |
/usr/sbin/svcadm refresh system/console-login |
|
1584 |
fi |
|
1585 |
||
1586 |
if [ \$do_dtconfig -eq 1 -a -x /usr/dt/bin/dtconfig ]; then |
|
1587 |
/usr/dt/bin/dtconfig -e |
|
1588 |
fi |
|
1589 |
fi |
|
1590 |
EOFA |
|
1591 |
fi |
|
1592 |
||
1593 |
||
1594 |
# Enable the inetd-upgrade service to convert any changes to inetd.conf |
|
1595 |
smf_enable network/inetd-upgrade |
|
1596 |
||
1597 |
# If global zone, and bfu'ing from smf, and the inetd-upgrade |
|
1598 |
# service has an obsolete dependency, then add a clear of inetd |
|
1599 |
# and inetd-upgrade to the upgrade file as either may drop into |
|
1600 |
# maintenance due to a dependency loop resulting from the new |
|
1601 |
# inetd manifest |
|
1602 |
if [[ $zone = global && -x /tmp/bfubin/svccfg ]]; then |
|
1603 |
/tmp/bfubin/svcprop -q -p network/entities network/inetd-upgrade |
|
1604 |
if [[ $? = 0 ]]; then |
|
1605 |
echo "/usr/sbin/svcadm clear network/inetd" >> \ |
|
1606 |
$rootprefix/var/svc/profile/upgrade |
|
1607 |
echo "/usr/sbin/svcadm clear network/inetd-upgrade" >> \ |
|
1608 |
$rootprefix/var/svc/profile/upgrade |
|
1609 |
fi |
|
1610 |
fi |
|
1611 |
||
1612 |
# If we're in the global zone, and using an alternate root, see if |
|
1613 |
# we are in an smf root. If so, import pfil and name-service-cache. |
|
1614 |
# If we're not bfu'ing an alternate root, and we're post-smf, |
|
1615 |
# import pfil and name-service-cache. This is to get pfil and |
|
1616 |
# name-service-cache(with correct dependencies) in the repository |
|
1617 |
# before reboot. If we're bfu'ing from pre-smf, this isn't an |
|
1618 |
# issue, as pfil is in the seed repository, and name-service-cache |
|
1619 |
# will be installed with correct dependencies. |
|
1620 |
if [[ $zone = global && |
|
1621 |
-f $rootprefix/var/svc/manifest/network/pfil.xml ]]; then |
|
1622 |
if [[ -n $rootprefix ]]; then |
|
1623 |
if [ -x /usr/sbin/svccfg ]; then |
|
1624 |
SVCCFG_REPOSITORY=$rootprefix/etc/svc/repository.db |
|
1625 |
/usr/sbin/svccfg import \ |
|
1626 |
$rootprefix/var/svc/manifest/network/pfil.xml |
|
1627 |
/usr/sbin/svccfg import \ |
|
1628 |
$rootprefix/var/svc/manifest/system/name-service-cache.xml |
|
1629 |
else |
|
1630 |
echo "Warning: This system does not have SMF, so I" |
|
1631 |
echo "cannot ensure the pre-import of pfil and" |
|
1632 |
echo "name-service-cache. If ipfilter or name-service-" |
|
1633 |
echo "cache do not work, reboot your alternate root to" |
|
1634 |
echo "fix it." |
|
1635 |
fi |
|
1636 |
elif [ -x /tmp/bfubin/svccfg ]; then |
|
1637 |
/tmp/bfubin/svccfg import \ |
|
1638 |
/var/svc/manifest/network/pfil.xml |
|
1639 |
/tmp/bfubin/svccfg import \ |
|
1640 |
/var/svc/manifest/system/name-service-cache.xml |
|
1641 |
fi |
|
1642 |
fi |
|
1643 |
||
1644 |
# Remove pfil from the non-global repository. |
|
1645 |
if [[ $zone != global ]]; then |
|
1646 |
cat >> $rootprefix/var/svc/profile/upgrade << EOF |
|
1647 |
svcprop -q -p start/exec network/pfil |
|
1648 |
if [[ \$? = 0 ]]; then |
|
1649 |
/usr/sbin/svccfg delete -f network/pfil |
|
1650 |
fi |
|
1651 |
EOF |
|
1652 |
fi |
|
1653 |
||
305 | 1654 |
# If we're in the global zone, and using an alternate root, see if |
1655 |
# we are in an smf root. If so, import datalink and aggregation svcs. |
|
1656 |
# If we're not bfu'ing an alternate root, and we're post-smf, |
|
1657 |
# import datalink and aggregation. This is to get them |
|
1658 |
# in the repository before reboot. If we're bfu'ing from pre-smf, |
|
1659 |
# this isn't an issue, as they are in the seed repository. |
|
1660 |
if [[ $zone = global && |
|
1661 |
-f $rootprefix/var/svc/manifest/network/datalink.xml ]]; then |
|
1662 |
if [[ -n $rootprefix ]]; then |
|
1663 |
if [ -x /usr/sbin/svccfg ]; then |
|
1664 |
SVCCFG_REPOSITORY=$rootprefix/etc/svc/repository.db |
|
1665 |
sed -e "s/enabled='true'/enabled='false'/" \ |
|
1666 |
$rootprefix/var/svc/manifest/network/aggregation.xml \ |
|
1667 |
| svccfg import - |
|
1668 |
sed -e "s/enabled='true'/enabled='false'/" \ |
|
1669 |
$rootprefix/var/svc/manifest/network/datalink.xml \ |
|
1670 |
| svccfg import - |
|
1671 |
sed -e "s/enabled='true'/enabled='false'/" \ |
|
1672 |
$rootprefix/var/svc/manifest/network/datalink-init.xml \ |
|
1673 |
| svccfg import - |
|
1674 |
else |
|
1675 |
echo "Warning: This system does not have SMF, so I" |
|
1676 |
echo "cannot ensure the pre-import of datalink and" |
|
1677 |
echo "network aggregation. If they do not work" |
|
1678 |
echo "reboot your alternate root to fix it." |
|
1679 |
fi |
|
1680 |
elif [ -x /tmp/bfubin/svccfg ]; then |
|
1681 |
sed -e "s/enabled='true'/enabled='false'/" \ |
|
1682 |
/var/svc/manifest/network/aggregation.xml | \ |
|
1683 |
svccfg import - |
|
1684 |
sed -e "s/enabled='true'/enabled='false'/" \ |
|
1685 |
/var/svc/manifest/network/datalink.xml | \ |
|
1686 |
svccfg import - |
|
1687 |
sed -e "s/enabled='true'/enabled='false'/" \ |
|
1688 |
/var/svc/manifest/network/datalink-init.xml | \ |
|
1689 |
svccfg import - |
|
1690 |
fi |
|
1691 |
||
1692 |
# |
|
1693 |
# Make sure the services are enabled after reboot. |
|
1694 |
# |
|
1695 |
enable_next_boot svc:/network/aggregation:default |
|
1696 |
enable_next_boot svc:/network/datalink:default |
|
1697 |
enable_next_boot svc:/network/datalink-init:default |
|
1698 |
fi |
|
1699 |
||
0 | 1700 |
# Enable new NFS status and nlockmgr services if client is enabled |
1701 |
cat >> $rootprefix/var/svc/profile/upgrade <<-EOF |
|
1702 |
cl="svc:/network/nfs/client:default" |
|
1703 |
if [ \`/usr/bin/svcprop -p general/enabled \$cl\` = "true" ]; then |
|
1704 |
/usr/sbin/svcadm enable svc:/network/nfs/status:default |
|
1705 |
/usr/sbin/svcadm enable svc:/network/nfs/nlockmgr:default |
|
1706 |
fi |
|
1707 |
||
1708 |
EOF |
|
1709 |
||
1710 |
kpmani="$rootprefix/var/svc/manifest/network/security/krb5_prop.xml" |
|
1711 |
if grep svc-kdc.slave $kpmani > /dev/null 2>&1; then |
|
1712 |
cat >> $rootprefix/var/svc/profile/upgrade <<EOF |
|
1713 |
# We are deleting and reimporting kpropd's manifest, because we |
|
1714 |
# need to change the restarter. |
|
1715 |
kpfmri="svc:/network/security/krb5_prop" |
|
1716 |
kkfmri="svc:/network/security/krb5kdc:default" |
|
1717 |
lkpmani="/var/svc/manifest/network/security/krb5_prop.xml" |
|
1718 |
restarter=\`svcprop -c -p general/restarter \$kpfmri 2>&1\` |
|
1719 |
case \$restarter in |
|
1720 |
*network/inetd:default) |
|
1721 |
kken=\`svcprop -c -p general/enabled \$kkfmri\` |
|
1722 |
svccfg delete -f \$kpfmri |
|
1723 |
svccfg import \$lkpmani |
|
1724 |
# Enable kpropd if krb5kdc is enabled, since |
|
1725 |
# krb5kdc would have run kpropd |
|
1726 |
if [ \$kken = "true" ]; then |
|
1727 |
svcadm enable \$kpfmri |
|
1728 |
fi |
|
1729 |
;; |
|
1730 |
esac |
|
1731 |
EOF |
|
1732 |
fi |
|
1733 |
||
1734 |
# Enable print server if there are local queues |
|
1735 |
queues=`echo $rootprefix/etc/lp/printers/*/configuration` |
|
1736 |
if [ "$queues" != "$rootprefix/etc/lp/printers/*/configuration" ]; then |
|
1737 |
smf_enable application/print/server |
|
1738 |
fi |
|
1739 |
||
1740 |
# Enable rarpd and bootparamd if they would have been running pre-SMF |
|
1741 |
if [ -d $rootprefix/tftpboot ] || [ -d $rootprefix/rplboot ]; then |
|
1742 |
smf_enable network/rarp |
|
1743 |
smf_enable network/rpc/bootparams |
|
1744 |
fi |
|
1745 |
||
1746 |
# To handle the transition from pre-smf ipfilter to smf-aware ipfilter, |
|
1747 |
# check if ipfilter had been enabled with at least one rule, and if so |
|
1748 |
# enable the smf instance. |
|
1749 |
if grep '^[ \t]*[^# \t]' $rootprefix/etc/ipf/ipf.conf >/dev/null 2>&1 && |
|
1750 |
[[ $zone = global ]]; then |
|
1751 |
smf_enable network/ipfilter |
|
1752 |
fi |
|
1753 |
||
1754 |
touch $rootprefix/var/svc/profile/.upgrade_prophist |
|
1755 |
||
1756 |
} |
|
1757 |
||
1758 |
EXTRACT_LOG=/tmp/bfu-extract-log.$$ |
|
1759 |
||
1760 |
rm -f $EXTRACT_LOG |
|
1761 |
||
1762 |
extraction_error() { |
|
1763 |
echo error $* >> $EXTRACT_LOG |
|
1764 |
} |
|
1765 |
||
1766 |
# |
|
1767 |
# Make a local copy of bfu in /tmp and execute that instead. |
|
1768 |
# This makes us immune to loss of networking and/or changes |
|
1769 |
# to the original copy that might occur during execution. |
|
1770 |
# |
|
1771 |
cd . |
|
1772 |
abspath=`[[ $0 = /* ]] && print $0 || print $PWD/$0` |
|
1773 |
if [[ $abspath != /tmp/* ]]; then |
|
1774 |
localpath=/tmp/bfu.$$ |
|
1775 |
print "Copying $abspath to $localpath" |
|
1776 |
cp $abspath $localpath |
|
1777 |
chmod +x $localpath |
|
1778 |
print "Executing $localpath $*\n" |
|
1779 |
exec $localpath $* |
|
1780 |
fi |
|
1781 |
||
1782 |
export PATH=/usr/bin:/usr/sbin:/sbin |
|
1783 |
||
1784 |
usage() { |
|
1785 |
echo "Usage:" |
|
1786 |
echo " bfu [-fh] <archive_dir> [root-dir]" |
|
1787 |
echo "\tUpdate a single machine by loading archives on root-dir." |
|
1788 |
echo "\troot-dir defaults to / (a live bfu).\n" |
|
1789 |
echo " bfu -c [-fh] <archive_dir> <exec-dir>" |
|
1790 |
echo "\tUpdate all diskless clients by loading archives on each client" |
|
1791 |
echo "\tthat mounts exec-dir as /usr. <exec-dir> must start with" |
|
1792 |
echo "\t/export/exec and each client's root must be in /export/root.\n" |
|
1793 |
echo "\t-f force bfu to continue even if it doesn't seem safe" |
|
1794 |
fail "\t-h|-help print this usage message and exit\n" |
|
1795 |
} |
|
1796 |
||
1797 |
diskless=no |
|
1798 |
force_override=no |
|
1799 |
while [ $# -gt 0 ]; do |
|
1800 |
case $1 in |
|
1801 |
-c) diskless=yes;; |
|
1802 |
-f) force_override=yes;; |
|
1803 |
-h|-help) usage;; |
|
1804 |
*) break;; |
|
1805 |
esac |
|
1806 |
shift |
|
1807 |
done |
|
1808 |
||
1809 |
boot_is_pcfs=no |
|
1810 |
have_realmode=no |
|
1811 |
multiboot_archives=no |
|
1812 |
dca_to_multi=no |
|
1813 |
is_pcfs_boot=no |
|
305 | 1814 |
need_datalink=no |
0 | 1815 |
|
1816 |
test $# -ge 1 || usage |
|
1817 |
||
1818 |
if [ -x /usr/bin/ppriv ]; then |
|
1819 |
# We prefer to use ppriv, as it is a more accurate test, and also |
|
1820 |
# has the benefit of preventing use from within a local zone. |
|
1821 |
ppriv $$ | grep -w "E: all" > /dev/null 2>&1 || \ |
|
1822 |
fail "bfu requires all privileges" |
|
1823 |
else |
|
1824 |
# Fall back to old id check if system does not yet have ppriv. |
|
1825 |
uid=`id | nawk '{print $1}'` |
|
1826 |
[ "$uid" = "uid=0(root)" ] || \ |
|
1827 |
fail "You must be super-user to run this script." |
|
1828 |
fi |
|
1829 |
||
1830 |
bfu_isa=`uname -p` |
|
1831 |
target_isa=$bfu_isa |
|
1832 |
karch=`uname -m` |
|
1833 |
plat=`uname -i` |
|
1834 |
||
1835 |
cpiodir=$1 |
|
1836 |
||
1837 |
local_zone_info_file=/tmp/local_zone_info.$$ |
|
1838 |
||
1839 |
if [ "$cpiodir" = again ]; then |
|
1840 |
cpiodir=`nawk '/^bfu.ed from / { print $3; exit }' /etc/motd` |
|
1841 |
fi |
|
1842 |
||
1843 |
[[ "$cpiodir" = */* ]] || cpiodir=$ARCHIVE/archives/$target_isa/$1 |
|
1844 |
||
1845 |
[[ "$cpiodir" = /* ]] || fail "archive-dir must be an absolute path" |
|
1846 |
||
1847 |
cd $cpiodir |
|
1848 |
case `echo generic.root*` in |
|
1849 |
generic.root) ZFIX=""; ZCAT="cat";; |
|
1850 |
generic.root.gz) ZFIX=".gz"; ZCAT="gzip -d -c";; |
|
1851 |
generic.root.Z) ZFIX=".Z"; ZCAT="zcat";; |
|
1852 |
*) fail "generic.root missing or in unknown compression format";; |
|
1853 |
esac |
|
1854 |
||
1855 |
if [ $diskless = no ]; then |
|
1856 |
root=${2:-/} |
|
1857 |
[[ "$root" = /* ]] || fail "root-dir must be an absolute path" |
|
1858 |
usrroot=$root |
|
1859 |
usr=${usrroot%/}/usr |
|
1860 |
rootlist=$root |
|
1861 |
||
1862 |
[[ -f $root/etc/system ]] || \ |
|
1863 |
fail "$root/etc/system not found; local zone target not allowed" |
|
1864 |
||
1865 |
# Make sure we extract the sun4u-us3 libc_psr.so.1 |
|
1866 |
if [ -d $root/platform/sun4u -a \ |
|
1867 |
! -d $root/platform/sun4u-us3 ] |
|
1868 |
then |
|
1869 |
mkdir $root/platform/sun4u-us3 |
|
1870 |
chmod 755 $root/platform/sun4u-us3 |
|
1871 |
chown root $root/platform/sun4u-us3 |
|
1872 |
chgrp sys $root/platform/sun4u-us3 |
|
1873 |
fi |
|
1874 |
||
1875 |
if [ $karch != $plat -a -f ${cpiodir}/${plat}.usr$ZFIX ]; then |
|
1876 |
usrarchs="$karch $plat" |
|
1877 |
else |
|
1878 |
usrarchs="$karch" |
|
1879 |
fi |
|
1880 |
if [ $karch != $plat -a -f ${cpiodir}/${plat}.root$ZFIX ]; then |
|
1881 |
rootarchs="$karch $plat" |
|
1882 |
else |
|
1883 |
rootarchs="$karch" |
|
1884 |
fi |
|
1885 |
||
1886 |
if [ -h ${root}/platform/${plat} ]; then |
|
1887 |
rm -f ${root}/platform/${plat} |
|
1888 |
fi |
|
1889 |
if [ -h ${usr}/platform/${plat} ]; then |
|
1890 |
rm -f ${usr}/platform/${plat} |
|
1891 |
fi |
|
1892 |
||
1893 |
if [ $plat != $karch -a -f ${cpiodir}/${plat}.root$ZFIX \ |
|
1894 |
-a -f ${cpiodir}/${plat}.usr$ZFIX ] |
|
1895 |
then |
|
1896 |
cd $cpiodir |
|
1897 |
# |
|
1898 |
# Look through all the archives we build and match |
|
1899 |
# the names of built archives with the names of |
|
1900 |
# directories installed on this machine. We assume |
|
1901 |
# here that we can get the names of all architectures |
|
1902 |
# by pattern matching the names of .root archives - so |
|
1903 |
# if we ever had a case where we had only a .usr archive |
|
1904 |
# we wouldn't find that archive. |
|
1905 |
# |
|
1906 |
for i in *.root* |
|
1907 |
do |
|
1908 |
platname=${i%.root*} |
|
1909 |
if [ -z "${platname}" -o ${platname} = $karch -o \ |
|
1910 |
$platname = generic -o ${platname} = $plat ]; then |
|
1911 |
continue; |
|
1912 |
fi |
|
1913 |
if [ -d ${root}/platform/${platname} -o \ |
|
1914 |
-h ${root}/platform/${platname} ]; then |
|
1915 |
rootarchs="${rootarchs} ${platname}" |
|
1916 |
fi |
|
1917 |
if [ -d ${usr}/platform/${platname} -o \ |
|
1918 |
-h ${usr}/platform/${platname} ]; then |
|
1919 |
usrarchs="${usrarchs} ${platname}" |
|
1920 |
fi |
|
1921 |
if [ -h ${root}/platform/${platname} ]; then |
|
1922 |
rm -f ${root}/platform/${platname} |
|
1923 |
fi |
|
1924 |
if [ -h ${usr}/platform/${platname} ]; then |
|
1925 |
rm -f ${usr}/platform/${platname} |
|
1926 |
fi |
|
1927 |
done |
|
1928 |
fi |
|
1929 |
rootslice=`df -k $root | nawk 'NR > 1 { print $1 }' | sed s/dsk/rdsk/` |
|
1930 |
print "Loading $cpiodir on $root" |
|
1931 |
else |
|
1932 |
usrroot=$2 |
|
1933 |
usr=$2/usr |
|
1934 |
[[ "$usr" = /export/exec/* ]] || fail "exec-dir $usrroot sounds bogus" |
|
1935 |
case $2 in |
|
1936 |
*sparc*) |
|
1937 |
target_isa=sparc ;; |
|
1938 |
*i386*) |
|
1939 |
target_isa=i386 ;; |
|
1940 |
esac |
|
1941 |
cd $cpiodir |
|
1942 |
test -f generic.root$ZFIX || fail "$cpiodir/generic.root$ZFIX missing" |
|
1943 |
allarchs=$(echo $(ls *.root$ZFIX | grep -v generic.root$ZFIX | \ |
|
1944 |
sed -e 's/.root.*//')) |
|
1945 |
# XXX Pick karch as last available root arch |
|
1946 |
karch=${allarchs##* } |
|
1947 |
# XXX Pick plat as first available root arch |
|
1948 |
plat=${allarchs%% *} |
|
1949 |
rootlist="" |
|
1950 |
for root in /export/root/* |
|
1951 |
do |
|
1952 |
test -f $root/etc/vfstab && |
|
1953 |
egrep -s $usrroot $root/etc/vfstab && |
|
1954 |
rootlist="$rootlist $root" |
|
1955 |
done |
|
1956 |
test -n "$rootlist" || fail "no clients to upgrade" |
|
1957 |
print "Loading $cpiodir usr archives on:\n\t$usr\n" |
|
1958 |
print "Loading $cpiodir root archives on:" |
|
1959 |
for root in $rootlist |
|
1960 |
do |
|
1961 |
print "\t$root" |
|
1962 |
done |
|
1963 |
fi |
|
1964 |
||
1965 |
nss_lib="$usr/lib/mps/libnss3.so" |
|
1966 |
nss_lib64="$usr/lib/mps/64/libnss3.so" |
|
1967 |
valid_rpath="\$ORIGIN:/usr/lib/mps/secv1:/usr/lib/mps" |
|
1968 |
rpath_msg="(RPATH from file ${nss_lib})" |
|
1969 |
if [ ! -x /usr/bin/ldd ]; then |
|
1970 |
if [ "$force_override" = yes ]; then |
|
1971 |
echo "/usr/bin/ldd is missing but -f is set; continuing." |
|
1972 |
else |
|
1973 |
echo "/usr/bin/ldd is missing." |
|
1974 |
fail "Install the SUNWtoo package." |
|
1975 |
fi |
|
1976 |
fi |
|
1977 |
nss_rpath=`ldd -s $nss_lib | grep "$rpath_msg" | head -1 | cut -d'=' -f2 | \ |
|
1978 |
awk '{print $1}'` |
|
1979 |
update_script="/ws/onnv-gate/public/bin/update_nsspkgs" |
|
1980 |
if [ $valid_rpath != "$nss_rpath" ]; then |
|
1981 |
if [ "$force_override" = yes ]; then |
|
1982 |
echo "$nss_lib is not valid but -f is set; continuing." |
|
1983 |
else |
|
1984 |
echo "$nss_lib is not valid." |
|
1985 |
fail "Run $update_script to update the SUNWtls package." |
|
1986 |
fi |
|
1987 |
fi |
|
1988 |
if [ $target_isa = i386 -a ! -f $nss_lib64 ]; then |
|
1989 |
echo "$nss_lib64 does not exist." |
|
1990 |
fail "Run $update_script to update the NSS packages." |
|
1991 |
fi |
|
1992 |
||
1993 |
update_script="/ws/onnv-gate/public/bin/migrate_bind9" |
|
1994 |
if [[ ! -f $usr/lib/dns/libdns.so ]] && ! $ZCAT $cpiodir/generic.usr$ZFIX | \ |
|
1995 |
cpio -it 2>/dev/null | egrep -s '^usr/sbin/ndc' ; then |
|
1996 |
if [ "$force_override" = yes ]; then |
|
1997 |
echo "BIND 9 has not been installed, but -f is set; continuing." |
|
1998 |
else |
|
1999 |
echo "BIND 8 has been removed from ON; BIND 9 is available from SFW." |
|
2000 |
fail "Run $update_script to migrate to BIND 9." |
|
2001 |
fi |
|
2002 |
fi |
|
2003 |
||
2004 |
update_script="/ws/onnv-gate/public/bin/update_ce" |
|
741
40027a3621ac
PSARC 2005/082 Yosemite: UDP Performance Enhancement
masputra
parents:
693
diff
changeset
|
2005 |
if ifconfig -a | egrep '^ce' >/dev/null 2>/dev/null; then |
40027a3621ac
PSARC 2005/082 Yosemite: UDP Performance Enhancement
masputra
parents:
693
diff
changeset
|
2006 |
# CE version 1.148 or later is required |
0 | 2007 |
cever=`modinfo | grep 'CE Ethernet' | sed 's/.*v1\.//' | tr -d ')' | \ |
741
40027a3621ac
PSARC 2005/082 Yosemite: UDP Performance Enhancement
masputra
parents:
693
diff
changeset
|
2008 |
nawk '{ if ($1 < 148) print "BAD"; else print $1 }'` |
0 | 2009 |
if [ "$cever" = "BAD" ]; then |
2010 |
fail "You must run $update_script to upgrade your ce driver." |
|
2011 |
fi |
|
2012 |
fi |
|
2013 |
||
2014 |
if [[ $target_isa = i386 && -f $cpiodir/i86pc.root$ZFIX ]] && \ |
|
2015 |
$ZCAT $cpiodir/i86pc.root$ZFIX | cpio -it 2>/dev/null | \ |
|
2016 |
grep multiboot >/dev/null 2>&1 ; then |
|
2017 |
multiboot_archives=yes |
|
2018 |
prtconf -v | grep biosdev >/dev/null 2>&1 |
|
2019 |
if [ $? -ne 0 ]; then |
|
2020 |
echo "biosdev cannot be run on this machine." |
|
2021 |
echo "Transitioning from classic to multiboot requires a" |
|
2022 |
echo "bootconf which is compatible with biosdev." |
|
2023 |
echo "bfu to onnv_12 first, then to a build with multiboot." |
|
2024 |
fail "" |
|
2025 |
fi |
|
2026 |
fi |
|
2027 |
||
305 | 2028 |
if $ZCAT $cpiodir/generic.root$ZFIX | cpio -it 2>/dev/null | \ |
2029 |
grep datalink.conf > /dev/null 2>&1 ; then |
|
2030 |
need_datalink=yes |
|
2031 |
fi |
|
2032 |
||
0 | 2033 |
time_ref=/tmp/bfu.time_ref.$$ |
2034 |
rm -f $time_ref |
|
2035 |
touch $time_ref || fail "$time_ref: Unable to create time reference." |
|
2036 |
time_ref_seconds=$SECONDS |
|
2037 |
||
2038 |
print "\nCreating bfu execution environment ..." |
|
2039 |
||
2040 |
# |
|
2041 |
# Save off a few critical libraries and commands, so that bfu will |
|
2042 |
# continue to function properly even in the face of major |
|
2043 |
# kernel/library/command incompatibilities during a live upgrade. |
|
2044 |
# |
|
2045 |
bfucmd=" |
|
2046 |
/usr/sbin/add_drv |
|
2047 |
/usr/bin/awk |
|
2048 |
/usr/bin/cat |
|
2049 |
/usr/bin/chgrp |
|
2050 |
/usr/bin/chmod |
|
2051 |
/usr/bin/chown |
|
2052 |
/usr/bin/cmp |
|
2053 |
/usr/bin/cp |
|
2054 |
/usr/bin/cpio |
|
2055 |
/usr/bin/csh |
|
2056 |
/usr/bin/cut |
|
2057 |
/usr/bin/date |
|
2058 |
/usr/bin/dd |
|
2059 |
/usr/bin/df |
|
2060 |
/usr/bin/diff |
|
2061 |
/usr/bin/du |
|
2062 |
/usr/bin/echo |
|
2063 |
/usr/bin/ed |
|
2064 |
/usr/bin/egrep |
|
2065 |
/usr/bin/env |
|
2066 |
/usr/bin/ex |
|
2067 |
/usr/bin/expr |
|
2068 |
/usr/bin/false |
|
2069 |
/usr/bin/fgrep |
|
2070 |
/usr/bin/file |
|
2071 |
/usr/bin/find |
|
2072 |
/usr/bin/gettext |
|
2073 |
/usr/bin/grep |
|
2074 |
/usr/bin/head |
|
2075 |
/usr/bin/id |
|
2076 |
/usr/bin/ksh |
|
2077 |
/usr/bin/line |
|
2078 |
/usr/bin/ln |
|
2079 |
/usr/sbin/lofiadm |
|
2080 |
/usr/bin/ls |
|
2081 |
/usr/bin/mkdir |
|
2082 |
/usr/sbin/mkfile |
|
2083 |
/usr/sbin/mkfs |
|
2084 |
/usr/sbin/mknod |
|
2085 |
/usr/bin/mktemp |
|
2086 |
/usr/bin/more |
|
2087 |
/usr/sbin/mount |
|
2088 |
/usr/bin/mv |
|
2089 |
/usr/bin/nawk |
|
2090 |
/usr/bin/pgrep |
|
2091 |
/usr/sbin/newfs |
|
2092 |
/usr/bin/pkginfo |
|
2093 |
/usr/bin/pkill |
|
2094 |
/usr/bin/printf |
|
2095 |
/usr/sbin/prtconf |
|
2096 |
/usr/bin/prun |
|
2097 |
/usr/bin/ps |
|
2098 |
/usr/bin/pstop |
|
2099 |
/usr/bin/ptree |
|
2100 |
/usr/bin/rm |
|
2101 |
/usr/bin/rmdir |
|
2102 |
/usr/bin/sed |
|
2103 |
/usr/bin/sh |
|
2104 |
/usr/bin/sleep |
|
2105 |
/usr/bin/sort |
|
2106 |
/usr/bin/strings |
|
2107 |
/usr/bin/stty |
|
2108 |
/usr/bin/su |
|
2109 |
/usr/bin/sum |
|
2110 |
/usr/bin/tail |
|
2111 |
/usr/bin/tee |
|
2112 |
/usr/bin/touch |
|
2113 |
/usr/bin/tr |
|
2114 |
/usr/bin/true |
|
2115 |
/usr/bin/truss |
|
2116 |
/usr/bin/tty |
|
2117 |
/usr/sbin/uadmin |
|
2118 |
/usr/sbin/umount |
|
2119 |
/usr/bin/uname |
|
2120 |
/usr/bin/uniq |
|
2121 |
/usr/bin/uptime |
|
2122 |
/usr/bin/vi |
|
2123 |
/usr/bin/w |
|
2124 |
/usr/bin/wc |
|
2125 |
/usr/bin/xargs |
|
2126 |
/usr/bin/zcat |
|
2127 |
/usr/sbin/chroot |
|
2128 |
/usr/sbin/halt |
|
2129 |
/usr/sbin/lockfs |
|
2130 |
/usr/sbin/mknod |
|
2131 |
/usr/sbin/pkgrm |
|
2132 |
/usr/sbin/reboot |
|
2133 |
/usr/sbin/sync |
|
2134 |
/usr/sbin/tar |
|
2135 |
/usr/sbin/uadmin |
|
2136 |
/usr/sbin/wall |
|
2137 |
${FASTFS-$GATE/public/bin/$bfu_isa/fastfs} |
|
2138 |
${GZIPBIN-$GATE/public/bin/$bfu_isa/gzip} |
|
2139 |
" |
|
2140 |
||
2141 |
rm -rf /tmp/bfubin |
|
2142 |
mkdir /tmp/bfubin |
|
2143 |
set $bfucmd |
|
2144 |
isalist=`isalist` |
|
2145 |
while [ $# -gt 0 ] |
|
2146 |
do |
|
2147 |
dir=${1%/*} |
|
2148 |
cmd=${1##*/} |
|
2149 |
cd $dir |
|
2150 |
isacmd=`(find $isalist -name $cmd 2>/dev/null; echo $cmd) | head -1` |
|
2151 |
cp $dir/$isacmd /tmp/bfubin || fail "cannot copy $dir/$isacmd" |
|
2152 |
shift |
|
2153 |
done |
|
2154 |
||
2155 |
# |
|
2156 |
# Optional commands. We warn, but do not abort, if we are crossing a |
|
2157 |
# feature boundary (where a command is not present in the parent). |
|
2158 |
# Clauses requiring these commands must explicitly test for their |
|
2159 |
# presence in /tmp/bfubin. |
|
2160 |
# |
|
2161 |
bfuoptcmd=" |
|
2162 |
/sbin/biosdev |
|
2163 |
/sbin/bootadm |
|
2164 |
/sbin/installgrub |
|
2165 |
/usr/sbin/fdisk |
|
2166 |
/usr/sbin/metastat |
|
2167 |
/usr/bin/mkisofs |
|
2168 |
/usr/sbin/svcadm |
|
2169 |
/usr/sbin/svccfg |
|
2170 |
/usr/bin/svcprop |
|
2171 |
" |
|
2172 |
||
2173 |
set $bfuoptcmd |
|
2174 |
isalist=`isalist` |
|
2175 |
while [ $# -gt 0 ] |
|
2176 |
do |
|
2177 |
dir=${1%/*} |
|
2178 |
cmd=${1##*/} |
|
2179 |
cd $dir |
|
2180 |
isacmd=`(find $isalist -name $cmd 2>/dev/null; echo $cmd) | head -1` |
|
2181 |
cp $dir/$isacmd /tmp/bfubin 2>/dev/null |
|
2182 |
shift |
|
2183 |
done |
|
2184 |
||
2185 |
# |
|
2186 |
# set up installgrub and friends if transitioning to multiboot |
|
2187 |
# do this now so ldd can determine library dependencies |
|
2188 |
# |
|
2189 |
MULTIBOOT_BIN_DIR=${MULTIBOOT_BIN_DIR:=${GATE}/public/multiboot} |
|
2190 |
||
2191 |
multiboot_cmds=" |
|
2192 |
/sbin/biosdev |
|
2193 |
/sbin/installgrub |
|
2194 |
/sbin/bootadm |
|
2195 |
" |
|
2196 |
copying_mboot_cmds=no |
|
2197 |
if [ $multiboot_archives = yes ]; then |
|
2198 |
for cmd in $multiboot_cmds |
|
2199 |
do |
|
2200 |
if [ -f $cmd ]; then |
|
2201 |
cp $cmd /tmp/bfubin |
|
2202 |
else |
|
2203 |
file=`basename $cmd` |
|
2204 |
if [ ! -d $MULTIBOOT_BIN_DIR ]; then |
|
2205 |
echo "$MULTIBOOT_BIN_DIR: not found" |
|
2206 |
elif [ ! -f $MULTIBOOT_BIN_DIR/$file ]; then |
|
2207 |
echo "$MULTIBOOT_BIN_DIR/$file: not found" |
|
2208 |
fi |
|
2209 |
if [ $copying_mboot_cmds = no ]; then |
|
2210 |
echo "installing files from $MULTIBOOT_BIN_DIR" |
|
2211 |
copying_mboot_cmds=yes |
|
2212 |
fi |
|
2213 |
cp $MULTIBOOT_BIN_DIR/$file /tmp/bfubin |
|
2214 |
fi |
|
2215 |
||
2216 |
done |
|
2217 |
fi |
|
2218 |
||
2219 |
# |
|
2220 |
# If available, use ldd to determine which libraries bfu depends on. |
|
2221 |
# Otherwise, just make an educated guess. |
|
2222 |
# |
|
2223 |
if [ -x /usr/bin/ldd ]; then |
|
2224 |
bfulib="`ldd /tmp/bfubin/* | nawk '$3 ~ /lib/ { print $3 }' | sort -u`" |
|
2225 |
else |
|
2226 |
bfulib=" |
|
2227 |
/lib/libc.so.1 |
|
2228 |
/lib/libm.so.2 |
|
2229 |
/lib/libdoor.so.1 |
|
2230 |
/lib/libm.so.2 |
|
2231 |
/lib/libmd5.so.1 |
|
2232 |
/lib/libnvpair.so.1 |
|
2233 |
/lib/libscf.so.1 |
|
2234 |
/lib/libuutil.so.1 |
|
2235 |
/usr/lib/libbsm.so.1 |
|
2236 |
/usr/lib/libc2.so |
|
2237 |
/usr/lib/libdl.so.1 |
|
2238 |
/usr/lib/libelf.so.1 |
|
2239 |
/usr/lib/libkstat.so.1 |
|
2240 |
/usr/lib/libmapmalloc.so.1 |
|
2241 |
/usr/lib/libmp.so.1 |
|
2242 |
/usr/lib/libnsl.so.1 |
|
2243 |
/usr/lib/libpam.so.1 |
|
2244 |
/usr/lib/libsec.so.1 |
|
2245 |
/usr/lib/libsocket.so.1 |
|
2246 |
/usr/lib/libtecla.so.1 |
|
2247 |
" |
|
2248 |
fi |
|
2249 |
||
2250 |
# add dlopen()'ed stuff |
|
2251 |
bfulib=" |
|
2252 |
$bfulib |
|
2253 |
/lib/ld.so.1 |
|
2254 |
/usr/lib/nss_* |
|
2255 |
" |
|
2256 |
||
598
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
2257 |
# add libc_psr.so.1, if available and not empty |
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
2258 |
if [ -s /platform/`uname -i`/lib/libc_psr.so.1 ]; then |
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
2259 |
bfulib=" |
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
2260 |
$bfulib |
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
2261 |
/platform/`uname -i`/lib/libc_psr.so.1 |
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
2262 |
" |
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
2263 |
fi |
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
2264 |
|
0 | 2265 |
rm -rf /tmp/bfulib /tmp/bl |
2266 |
mkdir /tmp/bfulib /tmp/bl |
|
2267 |
||
2268 |
# |
|
2269 |
# Create 64 bit directory structure and determine 64 bit arch name. |
|
2270 |
# |
|
2271 |
if [ -h /usr/lib/64 ] |
|
2272 |
then |
|
2273 |
link=`ls -dl /usr/lib/64 | awk '{print $NF}'` |
|
2274 |
ln -s $link /tmp/bfulib/64 |
|
2275 |
ln -s $link /tmp/bl/64 |
|
2276 |
mkdir /tmp/bfulib/$link /tmp/bl/$link |
|
2277 |
bfulib="$bfulib /usr/lib/64/nss_*" |
|
2278 |
# |
|
2279 |
# Copy libraries to proper directories |
|
2280 |
# |
|
2281 |
for lib in $bfulib |
|
2282 |
do |
|
2283 |
case $lib in |
|
2284 |
*/64/* | */$link/*) |
|
2285 |
cp $lib /tmp/bfulib/64;; |
|
2286 |
*) |
|
2287 |
cp $lib /tmp/bfulib;; |
|
2288 |
esac |
|
2289 |
done |
|
2290 |
# |
|
2291 |
# Private 64 bit runtime linker. |
|
2292 |
# |
|
2293 |
cp /lib/64/ld.so.1 /tmp/bfulib/64/bf.1 |
|
2294 |
cp /lib/64/ld.so.1 /tmp/bl/64/bf.1 |
|
2295 |
else |
|
2296 |
cp $bfulib /tmp/bfulib |
|
2297 |
fi |
|
2298 |
cp /lib/ld.so.1 /tmp/bfulib/bf.1 # bfu's private runtime linker |
|
2299 |
cp /lib/ld.so.1 /tmp/bl/bf.1 |
|
2300 |
||
2301 |
${BFULD-$GATE/public/bin/$bfu_isa/bfuld} /tmp/bfubin/* || fail "bfuld failed" |
|
2302 |
||
2303 |
# |
|
2304 |
# Scripts needed by BFU. These must be modified to use the interpreters in |
|
2305 |
# /tmp/bfubin. The interpreters in /usr/bin may not be compatible with the |
|
2306 |
# libraries in the archives being extracted. |
|
2307 |
# |
|
2308 |
# |
|
2309 |
bfuscr=" |
|
2310 |
/usr/bin/basename |
|
2311 |
/usr/bin/dirname |
|
2312 |
${ACR-${GATE}/public/bin/acr} |
|
2313 |
" |
|
2314 |
||
2315 |
for x in $bfuscr |
|
2316 |
do |
|
2317 |
sed -e 's/\/usr\/bin\//\/tmp\/bfubin\//g' \ |
|
2318 |
-e 's/\/bin\//\/tmp\/bfubin\//g' < $x > /tmp/bfubin/`basename $x` |
|
2319 |
chmod +x /tmp/bfubin/`basename $x` |
|
2320 |
done |
|
2321 |
||
2322 |
# |
|
2323 |
# scripts used together with multiboot |
|
2324 |
# |
|
2325 |
multiboot_scr=" |
|
2326 |
/boot/solaris/bin/create_ramdisk |
|
2327 |
/boot/solaris/bin/create_diskmap |
|
2328 |
/boot/solaris/bin/root_archive |
|
2329 |
" |
|
2330 |
||
2331 |
if [ $multiboot_archives = yes ]; then |
|
2332 |
for cmd in $multiboot_scr |
|
2333 |
do |
|
2334 |
if [ -f $cmd ]; then |
|
2335 |
cp $cmd /tmp/bfubin |
|
2336 |
else |
|
2337 |
if [ ! -d $MULTIBOOT_BIN_DIR ]; then |
|
2338 |
echo "$MULTIBOOT_BIN_DIR: not found" |
|
2339 |
fail "" |
|
2340 |
fi |
|
2341 |
||
2342 |
file=`basename $cmd` |
|
2343 |
if [ ! -f $MULTIBOOT_BIN_DIR/$file ]; then |
|
2344 |
echo "$MULTIBOOT_BIN_DIR/$file: not found" |
|
2345 |
fail "" |
|
2346 |
fi |
|
2347 |
echo "copying $file from $MULTIBOOT_BIN_DIR" |
|
2348 |
cp $MULTIBOOT_BIN_DIR/$file /tmp/bfubin |
|
2349 |
fi |
|
2350 |
||
2351 |
file=`basename $cmd` |
|
2352 |
mv /tmp/bfubin/${file} /tmp/bfubin/${file}- |
|
2353 |
sed 's/\/usr\/bin\//\/tmp\/bfubin\//g' \ |
|
2354 |
< /tmp/bfubin/${file}- > /tmp/bfubin/${file} |
|
2355 |
chmod +x /tmp/bfubin/${file} |
|
2356 |
done |
|
2357 |
fi |
|
2358 |
||
305 | 2359 |
create_datalink_conf() |
2360 |
{ |
|
2361 |
# /etc/datalink.conf needs to be populated. |
|
2362 |
drivers="bge xge" |
|
2363 |
conf=$rootprefix/etc/datalink.conf |
|
2364 |
||
2365 |
if [ ! -f $conf ]; then |
|
2366 |
# nothing to do if we bfu'ed from an archive that doesn't |
|
2367 |
# provide /etc/datalink.conf |
|
2368 |
return |
|
2369 |
fi |
|
2370 |
||
2371 |
ls -1 $rootprefix/etc | egrep -e '^hostname.|^hostname6.|^dhcp.' | \ |
|
2372 |
cut -d . -f2 | sort -u > /tmp/ifnames.$$ |
|
2373 |
||
2374 |
for driver in $drivers |
|
2375 |
do |
|
2376 |
grep $driver /tmp/ifnames.$$ | \ |
|
2377 |
while read ifname |
|
2378 |
do |
|
2379 |
devnum=`echo $ifname | sed "s/$driver//g"` |
|
2380 |
if [ "$driver$devnum" != $ifname -o \ |
|
2381 |
-n "`echo $devnum | tr -d '[0-9]'`" ]; then |
|
2382 |
echo "skipping invalid interface $ifname" |
|
2383 |
continue |
|
2384 |
fi |
|
2385 |
||
2386 |
vid=`expr $devnum / 1000` |
|
2387 |
inst=`expr $devnum % 1000` |
|
2388 |
||
2389 |
awk '{ print $1 }' $conf | grep $ifname > /dev/null |
|
2390 |
if [ $? -ne 0 ]; then |
|
2391 |
# An entry for that interface does not exist |
|
2392 |
printf \ |
|
2393 |
"$ifname\t$driver$inst\t0\t$vid\n" \ |
|
2394 |
>> $conf |
|
2395 |
fi |
|
2396 |
done |
|
2397 |
done |
|
2398 |
||
2399 |
rm -f /tmp/ifnames.$$ |
|
2400 |
} |
|
2401 |
||
0 | 2402 |
remove_initd_links() |
2403 |
{ |
|
2404 |
# If we're delivering a new version of an existing /etc/init.d script, |
|
2405 |
# remove all hard links to the existing file in /etc/rc?.d whose |
|
2406 |
# names begin with [SK][0-9][0-9]. Additionally, in case an S or K |
|
2407 |
# file was previously delivered as a symbolic link or the hard link |
|
2408 |
# was broken, remove any file in /etc/rc?.d whose name is |
|
2409 |
# [SK][0-9][0-9] followed by the basename of the file we're going |
|
2410 |
# to update in /etc/init.d. |
|
2411 |
||
2412 |
print "Removing init.d links ... \c" |
|
2413 |
scripts=`$ZCAT $cpiodir/generic.root$ZFIX | |
|
2414 |
cpio -it 2>/dev/null | grep '^etc/init\.d/'` |
|
2415 |
if [ -n "$scripts" ]; then |
|
2416 |
inodes=`ls -li $scripts 2>/dev/null | \ |
|
2417 |
nawk '{ print "-inum " $1 " -o " }'` |
|
2418 |
names=`ls -1 $scripts 2>/dev/null | \ |
|
2419 |
nawk -F/ '{ print "-name [SK][0-9][0-9]" $NF }'` |
|
2420 |
find etc/rc?.d \( $inodes $names \) -print | xargs rm -f |
|
2421 |
fi |
|
2422 |
print "done." |
|
2423 |
} |
|
2424 |
||
2425 |
# |
|
2426 |
# Remove the old 5.005_03 version of perl. |
|
2427 |
# |
|
2428 |
remove_perl_500503() |
|
2429 |
{ |
|
2430 |
# Packages to remove. |
|
2431 |
typeset -r perl_pkgs='SUNWopl5m SUNWopl5p SUNWopl5u' |
|
2432 |
typeset -r pkgroot=${rootprefix:+-R $rootprefix} |
|
2433 |
typeset pkg |
|
2434 |
||
2435 |
# |
|
2436 |
# First, attempt to remove the packages cleanly if possible. |
|
2437 |
# |
|
2438 |
printf 'Removing perl 5.005_03 packages' |
|
2439 |
for pkg in $perl_pkgs |
|
2440 |
do |
|
2441 |
if pkginfo $pkgroot -q $pkg; then |
|
2442 |
printf ' %s' $pkg |
|
2443 |
pkgrm $pkgroot -n $pkg >/dev/null 2>&1 |
|
2444 |
fi |
|
2445 |
done |
|
2446 |
printf '\n' |
|
2447 |
||
2448 |
# |
|
2449 |
# In case that didn't work, do it manually. |
|
2450 |
# |
|
2451 |
printf 'Removing perl 5.005_03 from %s/var/sadm/install/contents' \ |
|
2452 |
$rootprefix |
|
2453 |
for pkg in $PKGS |
|
2454 |
do |
|
2455 |
printf ' %s' $pkg |
|
2456 |
if [ -d $rootprefix/var/sadm/pkg/$pkg ]; then |
|
2457 |
rm -rf $rootprefix/var/sadm/pkg/$pkg |
|
2458 |
grep -vw $pkg $rootprefix/var/sadm/install/contents > \ |
|
2459 |
/tmp/contents.$$ |
|
2460 |
cp /tmp/contents.$$ /var/sadm/install/contents.$$ |
|
2461 |
rm /tmp/contents.$$ |
|
2462 |
fi |
|
2463 |
done |
|
2464 |
printf '\n' |
|
2465 |
||
2466 |
# |
|
2467 |
# Remove any remaining 5.005_03 files, |
|
2468 |
# |
|
2469 |
printf 'Removing perl 5.005_03 from %s/perl5\n' $usr |
|
2470 |
||
2471 |
# Directories. |
|
2472 |
rm -rf $usr/perl5/5.00503 |
|
2473 |
rm -rf $usr/perl5/site_perl/5.005 |
|
2474 |
} |
|
2475 |
||
2476 |
# |
|
2477 |
# Remove BIND 8 named server/tools packages |
|
2478 |
# |
|
2479 |
remove_eof_bind8() |
|
2480 |
{ |
|
2481 |
# Packages to remove |
|
2482 |
typeset -r bind8_pkg='SUNWinamd' |
|
2483 |
typeset -r pkgroot=${rootprefix:+-R $rootprefix} |
|
2484 |
typeset pkg |
|
2485 |
||
2486 |
printf 'Removing BIND 8 named server/tools... ' |
|
2487 |
||
2488 |
# |
|
2489 |
# We cann't pkgrm SUNWinamd at this time as the BIND 9 binaries are |
|
2490 |
# already in /usr/sbin. |
|
2491 |
# Remove BIND 8 packages from $rootprefix/var/sadm/install/contents |
|
2492 |
# |
|
2493 |
for pkg in $bind8_pkgs |
|
2494 |
do |
|
2495 |
if [ -d $rootprefix/var/sadm/pkg/$pkg ]; then |
|
2496 |
rm -rf $rootprefix/var/sadm/pkg/$pkg |
|
2497 |
grep -vw $pkg $rootprefix/var/sadm/install/contents > \ |
|
2498 |
/tmp/contents.$$ |
|
2499 |
cp /tmp/contents.$$ /var/sadm/install/contents.$$ |
|
2500 |
rm /tmp/contents.$$ |
|
2501 |
fi |
|
2502 |
done |
|
2503 |
||
2504 |
# |
|
2505 |
# Cleanup any BIND 8 specific files, symlinks. |
|
2506 |
# |
|
2507 |
||
2508 |
# files and symlinks. |
|
2509 |
rm -f $usr/sbin/named-xfer |
|
2510 |
rm -f $usr/lib/nslookup.help |
|
2511 |
rm -f $usr/sbin/dnskeygen |
|
2512 |
rm -f $usr/sbin/named-bootconf |
|
2513 |
rm -f $usr/sbin/nstest |
|
2514 |
rm -rf $rootprefix/var/run/ndc.d |
|
2515 |
printf 'done.\n' |
|
2516 |
} |
|
2517 |
||
2518 |
# |
|
2519 |
# Remove the 5.8.3 version of perl. |
|
2520 |
# |
|
2521 |
remove_perl_583() |
|
2522 |
{ |
|
2523 |
# |
|
2524 |
# Copy perl 5.8.3 into the new 5.8.4 locations. This will preserve |
|
2525 |
# any add-on modules that might have been installed, and any 5.8.3 |
|
2526 |
# core files that get copied over will be replaced by the new 5.8.4 |
|
2527 |
# versions when the cpio archives are subsequently extracted. |
|
2528 |
# |
|
2529 |
printf 'Preserving user-installed perl modules...\n' |
|
2530 |
mkdir -p $usr/perl5/5.8.4 |
|
2531 |
cp -rp $usr/perl5/5.8.3/* \ |
|
2532 |
$usr/perl5/5.8.4 |
|
2533 |
mkdir -p $usr/perl5/site_perl/5.8.4 |
|
2534 |
cp -rp $usr/perl5/site_perl/5.8.3/* \ |
|
2535 |
$usr/perl5/site_perl/5.8.4 |
|
2536 |
mkdir -p $usr/perl5/vendor_perl/5.8.4 |
|
2537 |
cp -rp $usr/perl5/vendor_perl/5.8.3/* \ |
|
2538 |
$usr/perl5/vendor_perl/5.8.4 |
|
2539 |
||
2540 |
# |
|
2541 |
# Update the #! lines in any scripts in /usr/perl5/5.8.4/bin to refer |
|
2542 |
# to 5.8.4 instead of 5.8.3. Take care to edit only scripts. |
|
2543 |
# |
|
2544 |
typeset bindir="$usr/perl5/5.8.4/bin" |
|
2545 |
typeset script |
|
2546 |
for script in $(ls $bindir); do |
|
2547 |
script="$bindir/$script" |
|
2548 |
if [[ $script = "$usr/perl5/5.8.4/bin/perl5.8.3" ]]; then |
|
2549 |
rm -f $script |
|
2550 |
elif file $script | \ |
|
2551 |
egrep -s 'executable .*perl .*script'; then |
|
2552 |
sed -e \ |
|
2553 |
's!/usr/perl5/5.8.3/bin/perl!/usr/perl5/5.8.4/bin/perl!g' \ |
|
2554 |
< $script > $script.tmp |
|
2555 |
mv -f $script.tmp $script |
|
2556 |
fi |
|
2557 |
done |
|
2558 |
||
2559 |
# |
|
2560 |
# Packages to remove. |
|
2561 |
# |
|
2562 |
typeset -r perl_pkgs='SUNWperl583man SUNWperl583usr SUNWperl583root' |
|
2563 |
typeset -r pkgroot=${rootprefix:+-R $rootprefix} |
|
2564 |
||
2565 |
# |
|
2566 |
# First, attempt to remove the packages cleanly if possible. |
|
2567 |
# |
|
2568 |
typeset pkg |
|
2569 |
printf 'Removing perl 5.8.3 packages' |
|
2570 |
for pkg in $perl_pkgs |
|
2571 |
do |
|
2572 |
if pkginfo $pkgroot -q $pkg; then |
|
2573 |
printf ' %s' $pkg |
|
2574 |
pkgrm $pkgroot -n $pkg >/dev/null 2>&1 |
|
2575 |
fi |
|
2576 |
done |
|
2577 |
printf '\n' |
|
2578 |
||
2579 |
# |
|
2580 |
# In case that didn't work, do it manually. |
|
2581 |
# |
|
2582 |
printf 'Removing perl 5.8.3 from %s/var/sadm/install/contents' \ |
|
2583 |
$rootprefix |
|
2584 |
for pkg in $PKGS |
|
2585 |
do |
|
2586 |
printf ' %s' $pkg |
|
2587 |
if [ -d $rootprefix/var/sadm/pkg/$pkg ]; then |
|
2588 |
rm -rf $rootprefix/var/sadm/pkg/$pkg |
|
2589 |
grep -vw $pkg $rootprefix/var/sadm/install/contents > \ |
|
2590 |
/tmp/contents.$$ |
|
2591 |
cp /tmp/contents.$$ /var/sadm/install/contents.$$ |
|
2592 |
rm /tmp/contents.$$ |
|
2593 |
fi |
|
2594 |
done |
|
2595 |
printf '\n' |
|
2596 |
||
2597 |
# |
|
2598 |
# Remove any remaining 5.8.3 files, |
|
2599 |
# and fix up the symlinks if necessary. |
|
2600 |
# |
|
2601 |
printf 'Removing perl 5.8.3 from %s/perl5\n' $usr |
|
2602 |
||
2603 |
# Directories. |
|
2604 |
rm -rf $usr/perl5/5.8.3 |
|
2605 |
rm -rf $usr/perl5/site_perl/5.8.3 |
|
2606 |
rm -rf $usr/perl5/vendor_perl/5.8.3 |
|
2607 |
||
2608 |
# bin symlink. |
|
2609 |
rm -f $usr/perl5/bin |
|
2610 |
ln -s ./5.8.4/bin $usr/perl5/bin |
|
2611 |
||
2612 |
# pod symlink. |
|
2613 |
rm -f $usr/perl5/pod |
|
2614 |
ln -s ./5.8.4/lib/pod $usr/perl5/pod |
|
2615 |
||
2616 |
# |
|
2617 |
# man symlink. In earlier S10 builds the man symlink mistakenly points |
|
2618 |
# to the 5.6.1 manpages, instead of 5.8.3. Fix to point to 5.8.4. |
|
2619 |
# |
|
2620 |
rm -f $usr/perl5/man |
|
2621 |
ln -s ./5.8.4/man $usr/perl5/man |
|
2622 |
||
2623 |
# Symlink /bin/perl to 5.8.4. |
|
2624 |
rm -f $usr/bin/perl |
|
2625 |
ln -s ../perl5/5.8.4/bin/perl $usr/bin/perl |
|
2626 |
} |
|
2627 |
||
2628 |
# |
|
2629 |
# Remove FNS/XFN packages |
|
2630 |
# |
|
2631 |
remove_eof_fns() |
|
2632 |
{ |
|
2633 |
# Packages to remove |
|
2634 |
typeset -r fns_pkgs='SUNWfnx5x SUNWfnsx5 SUNWfnsx SUNWfns' |
|
2635 |
typeset -r pkgroot=${rootprefix:+-R $rootprefix} |
|
2636 |
typeset pkg |
|
2637 |
||
2638 |
printf 'Removing FNS/XFN ... ' |
|
2639 |
||
2640 |
# |
|
2641 |
# First, attempt to remove the packages cleanly if possible. |
|
2642 |
# |
|
2643 |
for pkg in $fns_pkgs |
|
2644 |
do |
|
2645 |
if pkginfo $pkgroot -q $pkg; then |
|
2646 |
printf ' %s' $pkg |
|
2647 |
pkgrm $pkgroot -n $pkg >/dev/null 2>&1 |
|
2648 |
fi |
|
2649 |
done |
|
2650 |
printf '\n' |
|
2651 |
||
2652 |
# |
|
2653 |
# In case that didn't work, do it manually. |
|
2654 |
# Remove FNS/XFN from $rootprefix/var/sadm/install/contents |
|
2655 |
# |
|
2656 |
for pkg in $fns_pkgs |
|
2657 |
do |
|
2658 |
if [ -d $rootprefix/var/sadm/pkg/$pkg ]; then |
|
2659 |
rm -rf $rootprefix/var/sadm/pkg/$pkg |
|
2660 |
grep -vw $pkg $rootprefix/var/sadm/install/contents > \ |
|
2661 |
/tmp/contents.$$ |
|
2662 |
cp /tmp/contents.$$ $rootprefix/var/sadm/install/contents.$$ |
|
2663 |
rm /tmp/contents.$$ |
|
2664 |
fi |
|
2665 |
done |
|
2666 |
||
2667 |
# |
|
2668 |
# Cleanup if any remaining FNS/XFN files, symlinks, and directories. |
|
2669 |
# |
|
2670 |
||
2671 |
# directories. |
|
2672 |
rm -rf $rootprefix/etc/fn |
|
2673 |
rm -rf $usr/include/xfn |
|
2674 |
rm -rf $usr/lib/fn |
|
2675 |
rm -rf $rootprefix/var/fn |
|
2676 |
||
2677 |
# files and symlinks. |
|
2678 |
rm -f $rootprefix/etc/fn.conf |
|
2679 |
rm -f $usr/bin/fnattr |
|
2680 |
rm -f $usr/bin/fnbind |
|
2681 |
rm -f $usr/bin/fncreate_printer |
|
2682 |
rm -f $usr/bin/fnlist |
|
2683 |
rm -f $usr/bin/fnlookup |
|
2684 |
rm -f $usr/bin/fnrename |
|
2685 |
rm -f $usr/bin/fnsearch |
|
2686 |
rm -f $usr/bin/fnunbind |
|
2687 |
rm -f $usr/sbin/fncheck |
|
2688 |
rm -f $usr/sbin/fncopy |
|
2689 |
rm -f $usr/sbin/fncreate |
|
2690 |
rm -f $usr/sbin/fncreate_fs |
|
2691 |
rm -f $usr/sbin/fndestroy |
|
2692 |
rm -f $usr/sbin/fnselect |
|
2693 |
rm -f $usr/sbin/fnsypd |
|
2694 |
rm -f $usr/lib/libfn_p.so |
|
2695 |
rm -f $usr/lib/libfn_p.so.1 |
|
2696 |
rm -f $usr/lib/libfn_spf.so |
|
2697 |
rm -f $usr/lib/libfn_spf.so.1 |
|
2698 |
rm -f $usr/lib/libxfn.so |
|
2699 |
rm -f $usr/lib/libxfn.so.1 |
|
2700 |
rm -f $usr/lib/libxfn.so.2 |
|
2701 |
rm -f $usr/lib/sparcv9/libfn_p.so |
|
2702 |
rm -f $usr/lib/sparcv9/libfn_p.so.1 |
|
2703 |
rm -f $usr/lib/sparcv9/libfn_spf.so |
|
2704 |
rm -f $usr/lib/sparcv9/libfn_spf.so.1 |
|
2705 |
rm -f $usr/lib/sparcv9/libxfn.so |
|
2706 |
rm -f $usr/lib/sparcv9/libxfn.so.1 |
|
2707 |
rm -f $usr/lib/sparcv9/libxfn.so.2 |
|
2708 |
} |
|
2709 |
||
2710 |
remove_properties() { |
|
2711 |
||
2712 |
# |
|
2713 |
# Remove obsolete smartii setprop from bootenv.rc |
|
2714 |
# |
|
2715 |
srcbootenvrc=$root/boot/solaris/bootenv.rc |
|
2716 |
tmpbootenvrc=/tmp/tmp.bootenvrc.$$ |
|
2717 |
||
2718 |
# Don't touch bootenv.rc unless it contains obsolete property |
|
2719 |
egrep -s 'target-driver-for-smartii' $srcbootenvrc 2>/dev/null |
|
2720 |
res=$? |
|
2721 |
if [ -f $srcbootenvrc -a $res -eq 0 ]; then |
|
2722 |
egrep -v "target-driver-for-smartii"\ |
|
2723 |
$srcbootenvrc > $tmpbootenvrc 2>/dev/null |
|
2724 |
cp $tmpbootenvrc $srcbootenvrc |
|
2725 |
fi |
|
2726 |
rm -f $tmpbootenvrc |
|
2727 |
} |
|
2728 |
||
2729 |
enable_crypto_unlimited() |
|
2730 |
{ |
|
2731 |
# This is a "copy" of the SUNWcry* postinstall scripts. |
|
2732 |
# We enable the encryption kit aes256, arcfour2048, and blowfish448 modules. |
|
2733 |
# This is needed to ensure bfu users continue to have the full strength of |
|
2734 |
# cryptographic algorithms they use. |
|
2735 |
||
2736 |
print "Simulating SUNWcry* installation...\c" |
|
2737 |
kcfconf=$rootprefix/etc/crypto/kcf.conf |
|
2738 |
||
2739 |
cp $kcfconf ${kcfconf}.tmp |
|
2740 |
||
2741 |
sed -e 's/^aes:/aes256:/' -e 's/^blowfish:/blowfish448:/' -e \ |
|
2742 |
's/^arcfour:/arcfour2048:/'\ |
|
2743 |
$kcfconf > ${kcfconf}.tmp |
|
2744 |
||
2745 |
mv -f ${kcfconf}.tmp $kcfconf |
|
2746 |
||
2747 |
# Since we do that for the kernel we do it for userland as well. |
|
2748 |
||
2749 |
# "Clone" the policy for pkcs11_softtoken to the encryption kit version |
|
2750 |
# and "disable" pkcs11_softoken. |
|
2751 |
||
2752 |
pkcs11conf=$rootprefix/etc/crypto/pkcs11.conf |
|
2753 |
||
2754 |
cp $pkcs11conf ${pkcs11conf}.tmp |
|
2755 |
||
2756 |
sed 's/pkcs11_softtoken\.so/pkcs11_softtoken_extra.so/' \ |
|
2757 |
$pkcs11conf > ${pkcs11conf}.tmp |
|
2758 |
||
2759 |
mv -f ${pkcs11conf}.tmp $pkcs11conf |
|
2760 |
print "\n" |
|
2761 |
||
2762 |
} |
|
2763 |
||
2764 |
# |
|
2765 |
# Add metaslot configuration to pkcs11.conf if it doesn't already exist |
|
2766 |
# |
|
2767 |
enable_crypto_metaslot() |
|
2768 |
{ |
|
2769 |
pkcs11conf=$rootprefix/etc/crypto/pkcs11.conf |
|
2770 |
egrep '^metaslot' ${pkcs11conf} > /dev/null 2>& 1 |
|
2771 |
if [ $? != 0 ] ; then |
|
2772 |
print "Adding cryptographic framework's meta slot feature" |
|
2773 |
cp $pkcs11conf ${pkcs11conf}.tmp |
|
2774 |
export metaslot_config=\ |
|
2775 |
"metaslot:metaslot_status=enabled;metaslot_auto_key_migrate=enabled;"\ |
|
2776 |
"metaslot_token=Sun Software PKCS#11 softtoken;"\ |
|
2777 |
"metaslot_slot=Sun Crypto Softtoken" |
|
2778 |
nawk '/^# End SUNWcsr/ \ |
|
2779 |
{ print ENVIRON["metaslot_config"] } \ |
|
2780 |
{ print } \ |
|
2781 |
' ${pkcs11conf} > ${pkcs11conf}.tmp |
|
2782 |
mv -f ${pkcs11conf}.tmp $pkcs11conf |
|
2783 |
print "\n" |
|
2784 |
fi |
|
2785 |
} |
|
2786 |
||
2787 |
cleanup_kerberos_mechanisms() |
|
2788 |
{ |
|
2789 |
# |
|
2790 |
# This checks to see if the old 'gl' and 'do' directories |
|
2791 |
# for the Kerberos GSS-API mechanisms can be deleted. |
|
2792 |
# If the mechanism exists in /usr/lib/gss, then the old |
|
2793 |
# subdirs may be deleted. |
|
2794 |
# |
|
2795 |
print "Cleaning up old Kerberos GSS-API mechanisms...\c" |
|
2796 |
||
2797 |
kerneldir=kernel/misc/kgss |
|
2798 |
kerneldir_sparc=kernel/misc/kgss/sparcv9 |
|
2799 |
||
2800 |
newmech=no; |
|
2801 |
if [ -f $usr/lib/gss/mech_krb5.so.1 ]; then |
|
2802 |
# |
|
2803 |
# There is a mech in the "new" location, so |
|
2804 |
# the old stuff can be deleted. |
|
2805 |
# |
|
2806 |
if [ -d $usr/lib/gss/gl ]; then |
|
2807 |
rm -rf $usr/lib/gss/gl |
|
2808 |
fi |
|
2809 |
if [ -d $usr/lib/gss/do ]; then |
|
2810 |
rm -rf $usr/lib/gss/do |
|
2811 |
fi |
|
2812 |
newmech=yes; |
|
2813 |
fi |
|
2814 |
if [ -f $usr/lib/sparcv9/gss/mech_krb5.so.1 ]; then |
|
2815 |
if [ -d $usr/lib/sparcv9/gss/gl ]; then |
|
2816 |
rm -rf $usr/lib/sparcv9/gss/gl |
|
2817 |
fi |
|
2818 |
if [ -d $usr/lib/sparcv9/gss/do ]; then |
|
2819 |
rm -rf $usr/lib/sparcv9/gss/do |
|
2820 |
fi |
|
2821 |
fi |
|
2822 |
# |
|
2823 |
# Cleanup kernel mechanisms from default location |
|
2824 |
# |
|
2825 |
if [ -f $rootprefix/$kerneldir/kmech_krb5 ]; then |
|
2826 |
if [ -f $rootprefix/$kerneldir/gl_kmech_krb5 ]; then |
|
2827 |
rm -f $rootprefix/$kerneldir/gl_kmech_krb5 |
|
2828 |
fi |
|
2829 |
if [ -f $rootprefix/$kerneldir/do_kmech_krb5 ]; then |
|
2830 |
rm -f $rootprefix/$kerneldir/do_kmech_krb5 |
|
2831 |
fi |
|
2832 |
fi |
|
2833 |
# |
|
2834 |
# For SPARC, cleanup from 2 locations. |
|
2835 |
# |
|
2836 |
# 1. /kernel/misc/kgss/sparcv9 |
|
2837 |
# |
|
2838 |
if [ -f $rootprefix/$kerneldir_sparc/kmech_krb5 ]; then |
|
2839 |
if [ -f $rootprefix/$kerneldir_sparc/gl_kmech_krb5 ]; then |
|
2840 |
rm -f $rootprefix/$kerneldir_sparc/gl_kmech_krb5 |
|
2841 |
fi |
|
2842 |
if [ -f $rootprefix/$kerneldir_sparc/do_kmech_krb5 ]; then |
|
2843 |
rm -f $rootprefix/$kerneldir_sparc/do_kmech_krb5 |
|
2844 |
fi |
|
2845 |
fi |
|
2846 |
# |
|
2847 |
# 2. /platform/sun4u/kernel/misc/kgss/sparcv9 |
|
2848 |
# |
|
2849 |
kerneldir_sparc=platform/$karch/$kerneldir_sparc |
|
2850 |
if [ -f $rootprefix/$kerneldir_sparc/kmech_krb5 ]; then |
|
2851 |
if [ -f $rootprefix/$kerneldir_sparc/gl_kmech_krb5 ]; then |
|
2852 |
rm -f $rootprefix/$kerneldir_sparc/gl_kmech_krb5 |
|
2853 |
fi |
|
2854 |
if [ -f $rootprefix/$kerneldir_sparc/do_kmech_krb5 ]; then |
|
2855 |
rm -f $rootprefix/$kerneldir_sparc/do_kmech_krb5 |
|
2856 |
fi |
|
2857 |
fi |
|
2858 |
# |
|
2859 |
# Make sure the GSS mechanism configuration file is correct |
|
2860 |
# |
|
2861 |
if [ "$newmech" = "yes" ]; then |
|
2862 |
gssmechconf=$rootprefix/etc/gss/mech |
|
2863 |
||
2864 |
sed -e 's/gl\/mech_krb5\.so/mech_krb5\.so/' \ |
|
2865 |
-e 's/do\/mech_krb5\.so/mech_krb5\.so/' \ |
|
2866 |
-e 's/gl_kmech_krb5/kmech_krb5/' \ |
|
2867 |
-e 's/do_kmech_krb5/kmech_krb5/'\ |
|
2868 |
$gssmechconf > ${gssmechconf}.tmp |
|
2869 |
||
2870 |
if [ $? -eq 0 ]; then |
|
2871 |
mv -f ${gssmechconf}.tmp $gssmechconf |
|
2872 |
else |
|
2873 |
echo "WARNING: update of $gssmechconf failed." |
|
2874 |
return 1 |
|
2875 |
fi |
|
2876 |
fi |
|
2877 |
print "\n" |
|
2878 |
} |
|
2879 |
||
2880 |
mpxiodisableno='^[ ]*mpxio-disable[ ]*=[ ]*"no"[ ]*;' |
|
2881 |
mpxiodisableyes='^[ ]*mpxio-disable[ ]*=[ ]*"yes"[ ]*;' |
|
2882 |
||
2883 |
# |
|
2884 |
# disable mpxio on fp(7D) ports using fp.conf |
|
2885 |
# |
|
2886 |
disable_mpxio_using_fpconf() |
|
2887 |
{ |
|
2888 |
conffile=$rootprefix/kernel/drv/fp.conf |
|
2889 |
test -f $conffile || return |
|
2890 |
egrep -s "$mpxiodisableyes" $conffile && return |
|
2891 |
||
2892 |
print "To preserve device names, disabled mpxio on fp(7D) ports by" |
|
2893 |
||
2894 |
if egrep -s "$mpxiodisableno" $conffile; then |
|
2895 |
tmpfile=/tmp/fp.conf.$$ |
|
2896 |
sed "s/$mpxiodisableno/mpxio-disable=\"yes\";/" $conffile \ |
|
2897 |
> $tmpfile |
|
2898 |
cp $tmpfile $conffile |
|
2899 |
rm -f $tmpfile |
|
2900 |
print "changing the value of mpxio-disable to \"yes\" in" \ |
|
2901 |
"$conffile" |
|
2902 |
else |
|
2903 |
echo 'mpxio-disable="yes";' >> $conffile |
|
2904 |
print "adding mpxio-disable=\"yes\" entry to $conffile" |
|
2905 |
fi |
|
2906 |
} |
|
2907 |
||
2908 |
# |
|
2909 |
# enable mpxio in scsi_vhci |
|
2910 |
# |
|
2911 |
enable_mpxio_using_scsivhciconf() |
|
2912 |
{ |
|
2913 |
# |
|
2914 |
# depending on whether the bfu restored the child's or parent's version |
|
2915 |
# of scsi_vhci.conf file, we may already have the file with the change |
|
2916 |
# we need in place. So make the change only if necessary. |
|
2917 |
# |
|
2918 |
||
2919 |
conffile=$rootprefix/kernel/drv/scsi_vhci.conf |
|
2920 |
egrep -s "$mpxiodisableno" $conffile && return |
|
2921 |
||
2922 |
print "To preserve device names, restored your current mpxio" \ |
|
2923 |
"configuration by" |
|
2924 |
||
2925 |
if egrep -s "$mpxiodisableyes" $conffile; then |
|
2926 |
tmpfile=/tmp/scsi_vhci.conf.$$ |
|
2927 |
sed "s/$mpxiodisableyes/mpxio-disable=\"no\";/" $conffile \ |
|
2928 |
> $tmpfile |
|
2929 |
cp $tmpfile $conffile |
|
2930 |
rm -f $tmpfile |
|
2931 |
print "changing the value of mpxio-disable to \"no\" in" \ |
|
2932 |
"$conffile" |
|
2933 |
else |
|
2934 |
echo 'mpxio-disable="no";' >> $conffile |
|
2935 |
print "adding mpxio-disable=\"no\" entry to $conffile" |
|
2936 |
fi |
|
2937 |
} |
|
2938 |
||
2939 |
# |
|
2940 |
# restore the pre-bfu MPxIO on/off setting to the post-bfued configuration |
|
2941 |
# |
|
2942 |
fixup_mpxio() |
|
2943 |
{ |
|
2944 |
conffile=$rootprefix/kernel/drv/scsi_vhci.conf |
|
2945 |
parentconffile=$rootprefix/bfu.parent/kernel/drv/scsi_vhci.conf |
|
2946 |
childconffile=$rootprefix/bfu.child/kernel/drv/scsi_vhci.conf |
|
2947 |
ancestorconffile=$rootprefix/bfu.ancestor/kernel/drv/scsi_vhci.conf |
|
2948 |
||
2949 |
# if scsi_vhci.conf doesn't exist return |
|
2950 |
test -f $conffile || return |
|
2951 |
||
2952 |
# |
|
2953 |
# Determine the mpxio setting in the child. If the system was bfued |
|
2954 |
# before and running with mpxio on by deafult bits, can't rely on the |
|
2955 |
# mpxio-disable entry in the child's scsi_vhci.conf file as it may |
|
2956 |
# contain stale left over entries. |
|
2957 |
# |
|
2958 |
mpxio_child=1 |
|
2959 |
if [ -f $ancestorconffile ]; then |
|
2960 |
if egrep -s "$mpxiodisableyes" $ancestorconffile; then |
|
2961 |
# |
|
2962 |
# prior to the bfu the system was running with |
|
2963 |
# mpxio off by default bits. |
|
2964 |
# |
|
2965 |
mpxio_child=0 |
|
2966 |
egrep -s "$mpxiodisableno" $childconffile && \ |
|
2967 |
mpxio_child=1 |
|
2968 |
fi |
|
2969 |
else |
|
2970 |
egrep -s "$mpxiodisableyes" $childconffile && mpxio_child=0 |
|
2971 |
fi |
|
2972 |
||
2973 |
if egrep -s "$mpxiodisableyes" $parentconffile; then |
|
2974 |
# these bits require explicit enabling of mpxio at in scsi_vhci |
|
2975 |
if [ $mpxio_child -eq 1 ]; then |
|
2976 |
egrep -s "$mpxiodisableyes" \ |
|
2977 |
$rootprefix/kernel/drv/fp.conf || \ |
|
2978 |
enable_mpxio_using_scsivhciconf |
|
2979 |
fi |
|
2980 |
else |
|
2981 |
# |
|
2982 |
# these bits have mpxio enabled by default in scsi_vhci. |
|
2983 |
# if mpxio is disabled in the child, disable mpxio on all |
|
2984 |
# fp(7D) ports using fp.conf. |
|
2985 |
# |
|
2986 |
[ $mpxio_child -eq 0 ] && disable_mpxio_using_fpconf |
|
2987 |
fi |
|
2988 |
} |
|
2989 |
||
2990 |
||
2991 |
# |
|
2992 |
# Check to see if root in $1 has a mounted boot, and that |
|
2993 |
# it's mounted at the right place for bfu to handle it. |
|
2994 |
# |
|
2995 |
# Returns 0 (true) if bfu can handle the upgrade; fails if not |
|
2996 |
# |
|
2997 |
||
2998 |
boot_is_upgradeable() |
|
2999 |
{ |
|
3000 |
ROOT=$1 |
|
3001 |
if [ "$ROOT" = "/" ] ; then ROOT=""; fi |
|
3002 |
||
3003 |
BOOTPARTDEV="$(grep -s -v '^#' ${ROOT}/etc/vfstab | \ |
|
3004 |
grep "[ ]/boot[ ]*pcfs[ ]" | \ |
|
3005 |
awk '{print $1}')" |
|
3006 |
||
3007 |
# find out if, and where, boot is mounted |
|
3008 |
||
3009 |
if [ -n "$BOOTPARTDEV" ] ; then |
|
3010 |
if [ -n "$ROOT" ] ; then |
|
3011 |
||
3012 |
BOOTMNT=$(mount | grep "$BOOTPARTDEV" | \ |
|
3013 |
awk '{print $1}') |
|
3014 |
else |
|
3015 |
BOOTMNT="/boot" |
|
3016 |
fi |
|
3017 |
if [ "$BOOTMNT" != ${ROOT}/boot ] ; then |
|
3018 |
cat << BOOTMOUNTERR |
|
3019 |
||
3020 |
${ROOT} refers to an x86 boot partition, but it's not mounted |
|
3021 |
at ${ROOT}/boot. |
|
3022 |
||
3023 |
BOOTMOUNTERR |
|
3024 |
fail "Mount ${ROOT}s bootpart at ${ROOT}/boot.\n\n" |
|
3025 |
fi |
|
3026 |
fi |
|
3027 |
||
3028 |
return 0 |
|
3029 |
} |
|
3030 |
||
3031 |
# update the realmode boot programs at $1 (root) |
|
3032 |
# from classic boot psm/stand/bootblks/ufs/i386/installboot.sh |
|
3033 |
||
3034 |
install_boot_i386() |
|
3035 |
{ |
|
3036 |
PBOOT=$1 |
|
3037 |
BOOTBLK=$2 |
|
3038 |
DEVICE=$3 |
|
3039 |
if [ ! -f $PBOOT ]; then |
|
3040 |
echo "$PBOOT: File not found" |
|
3041 |
return 1 |
|
3042 |
fi |
|
3043 |
if [ ! -f $BOOTBLK ]; then |
|
3044 |
echo "$BOOTBLK: File not found" |
|
3045 |
return 1 |
|
3046 |
fi |
|
3047 |
if [ ! -c $DEVICE ]; then |
|
3048 |
echo "$DEVICE: Not a character device" |
|
3049 |
return 1 |
|
3050 |
fi |
|
3051 |
if [ ! -w $DEVICE ]; then |
|
3052 |
echo "$DEVICE: Not writeable" |
|
3053 |
return 1 |
|
3054 |
fi |
|
3055 |
||
3056 |
# pboot at block 0, label at blocks 1 and 2, bootblk from block 3 on |
|
3057 |
dd if=$PBOOT of=$DEVICE bs=1b count=1 conv=sync >/dev/null 2>&1 |
|
3058 |
||
3059 |
dd if=$BOOTBLK of=$DEVICE bs=1b oseek=3 conv=sync >/dev/null 2>&1 |
|
3060 |
||
3061 |
return 0 |
|
3062 |
} |
|
3063 |
||
3064 |
update_realmode_booters() |
|
3065 |
{ |
|
3066 |
ROOT=$1 |
|
3067 |
||
3068 |
TMPDIR=/tmp/rmupdate.$$ |
|
3069 |
trap "rm -rf $TMPDIR" EXIT |
|
3070 |
||
3071 |
# go get new versions of boot files into TMPDIR |
|
3072 |
||
3073 |
OLD_PWD=$(pwd) |
|
3074 |
mkdir $TMPDIR |
|
3075 |
cd $TMPDIR |
|
3076 |
||
3077 |
# i86pc.boot archive |
|
3078 |
REQFILES="boot/mdboot boot/strap.com" |
|
3079 |
$ZCAT $cpiodir/i86pc.boot$ZFIX | cpio -id $REQFILES 2>/dev/null |
|
3080 |
mv $REQFILES $TMPDIR |
|
3081 |
||
3082 |
# i86pc.usr archive |
|
3083 |
REQFILES="usr/platform/i86pc/lib/fs/ufs/pboot" |
|
3084 |
REQFILES="$REQFILES usr/platform/i86pc/lib/fs/ufs/bootblk" |
|
3085 |
$ZCAT $cpiodir/i86pc.usr$ZFIX | cpio -id $REQFILES 2>/dev/null |
|
3086 |
mv $REQFILES $TMPDIR |
|
3087 |
||
3088 |
cd $OLD_PWD |
|
3089 |
||
3090 |
grep -s -v '^#' ${ROOT}/etc/vfstab | \ |
|
3091 |
grep "[ ]/boot[ ]*pcfs[ ]" >/dev/null |
|
3092 |
||
3093 |
if [ $? -eq 0 ] ; then |
|
3094 |
echo 'Updating /boot on x86 boot partition.' |
|
3095 |
||
3096 |
REQFILES="mdboot strap.com" |
|
3097 |
for f in ${REQFILES}; do |
|
3098 |
if [ ! -f ${TMPDIR}/$f ]; then |
|
3099 |
fail "Missing $f, aborting." |
|
3100 |
fi |
|
3101 |
done |
|
3102 |
||
3103 |
MDBOOT=${TMPDIR}/mdboot |
|
3104 |
STRAP=${TMPDIR}/strap.com |
|
3105 |
||
3106 |
LUBIN=/usr/lib/lu |
|
3107 |
TMP_FDFILE1=${TMPDIR}/fdfile1.$$ |
|
3108 |
LOGFILE=${TMPDIR}/mkfs.log.$$ |
|
3109 |
DDCOPY=${TMPDIR}/.dd_x86_boot_copy |
|
3110 |
||
3111 |
DISKID="$(grep -s -v '^#' ${ROOT}/etc/vfstab | \ |
|
3112 |
grep "[ ]/boot[ ]*pcfs[ ]" |\ |
|
3113 |
awk '{print $1}' | sed -e 's:p0\:boot::g')" |
|
3114 |
||
3115 |
DISKID="$(basename ${DISKID})" |
|
3116 |
||
3117 |
# Obtain the disk table; it will look something like the following: |
|
3118 |
# |
|
3119 |
# * Id Act Bhead Bsect Bcyl Ehead Esect Ecyl Rsect Numsect |
|
3120 |
# 130 128 27 28 0 242 9 553 1728 8897472 |
|
3121 |
# |
|
3122 |
# Delete all blank lines, and all lines that begin with *, |
|
3123 |
# leaving only actual fdisk entries that we can scan |
|
3124 |
# looking for the X86BOOT partition |
|
3125 |
||
3126 |
fdisk -W - /dev/rdsk/${DISKID}p0 | \ |
|
3127 |
grep -v '^*' | grep -v '^$' > ${TMP_FDFILE1} |
|
3128 |
||
3129 |
num=1 |
|
3130 |
||
3131 |
while read id act bhead bcyl ehead ecyl rsect numsect |
|
3132 |
do |
|
3133 |
# Ignore entry if not X86 /boot partition |
|
3134 |
# ID '190' is the X86BOOT partition (see man fdisk(1M)) |
|
3135 |
||
3136 |
if [ $id -ne "190" ] ; then |
|
3137 |
num=$(expr $num + 1) |
|
3138 |
continue |
|
3139 |
fi |
|
3140 |
||
3141 |
# Found X86 boot partition - save contents to $DDCOPY |
|
3142 |
BOOTPART=/dev/rdsk/${DISKID}p${num} |
|
3143 |
echo "Boot device is <${BOOTPART}>" |
|
3144 |
||
3145 |
ERRMSG="$(dd if=${BOOTPART} of=${DDCOPY} 2>&1)" |
|
3146 |
if [ $? -ne 0 ] ; then |
|
3147 |
[ -n "${ERRMSG}" ] && echo "${ERRMSG}" |
|
3148 |
fail "Unable to save copy of <${BOOTPART}>." |
|
3149 |
fi |
|
3150 |
||
3151 |
# mount copy of old /boot partition |
|
3152 |
LOBOOTDEV=$(lofiadm -a ${DDCOPY} 2>&1) |
|
3153 |
if [ $? -ne 0 ] ; then |
|
3154 |
[ -n "${LOBOOTDEV}" ] && echo "${LOBOOTDEV}" |
|
3155 |
fail "Unable to make lo-device <${DDCOPY}>" |
|
3156 |
fi |
|
3157 |
SOURCE_BOOT_DEV="${TMPDIR}/tmpbootdev.$$" |
|
3158 |
mkdir ${SOURCE_BOOT_DEV} |
|
3159 |
ERRMSG=$(mount -F pcfs ${LOBOOTDEV} \ |
|
3160 |
${SOURCE_BOOT_DEV}) |
|
3161 |
if [ $? -ne 0 ] ; then |
|
3162 |
[ -n "${ERRMSG}" ] && echo "${ERRMSG}" |
|
3163 |
fail "Unable to mount lo-device <${LOBOOTDEV}>." |
|
3164 |
fi |
|
3165 |
||
3166 |
# recreate existing boot partition with updated |
|
3167 |
# boot files |
|
3168 |
||
3169 |
# umount ${ROOT}'s /boot if mounted |
|
3170 |
||
3171 |
BOOTMOUNTPT=$(mount | grep ${DISKID}p0:boot 2>&1 | \ |
|
3172 |
awk '{print $1;}') |
|
3173 |
||
3174 |
if [ -n "${BOOTMOUNTPT}" ] ; then |
|
3175 |
echo "unmounting /dev/dsk/${DISKID}p0:boot" |
|
3176 |
ERRMSG=$(umount \ |
|
3177 |
/dev/dsk/${DISKID}p0:boot 2>&1) |
|
3178 |
if [ $? -ne 0 ] ; then |
|
3179 |
[ -n "${ERRMSG}" ] && echo "${ERRMSG}" |
|
3180 |
fail "Unable to umount X86 boot device." |
|
3181 |
fi |
|
3182 |
fi |
|
3183 |
||
3184 |
echo "Making new pcfs file system on ${DISKID}" |
|
3185 |
||
3186 |
echo y | /usr/lib/fs/pcfs/mkfs -F pcfs \ |
|
3187 |
-o S,s,B=$MDBOOT,b=BOOT,i=$STRAP \ |
|
3188 |
/dev/rdsk/${DISKID}p0:boot >> ${LOGFILE} 2>&1 |
|
3189 |
if [ $? -ne 0 ] ; then |
|
3190 |
echo "Unable to make pcfs:" |
|
3191 |
cat ${LOGFILE} |
|
3192 |
fail "" |
|
3193 |
fi |
|
3194 |
||
3195 |
echo "Copying x86 boot partition contents back\c" |
|
3196 |
echo " to new /boot fs." |
|
3197 |
||
3198 |
OLD_PWD=$(pwd) |
|
3199 |
||
3200 |
echo "Remounting freshened /boot partition" |
|
3201 |
||
3202 |
if [ -z "${BOOTMOUNTPT}" ] ; then |
|
3203 |
# boot ptn wasn't mounted |
|
3204 |
BOOTMOUNT="/tmp/bootpart" |
|
3205 |
mkdir ${BOOTMOUNT} |
|
3206 |
else |
|
3207 |
BOOTMOUNT=${BOOTMOUNTPT} |
|
3208 |
fi |
|
3209 |
||
3210 |
ERRMSG=$(mount -F pcfs \ |
|
3211 |
/dev/dsk/${DISKID}p0:boot ${BOOTMOUNT} 2>&1) |
|
3212 |
||
3213 |
if [ $? -ne 0 ] ; then |
|
3214 |
[ -n "${ERRMSG}" ] && echo "${ERRMSG}" |
|
3215 |
fail "Unable to mount X86 boot device." |
|
3216 |
fi |
|
3217 |
||
3218 |
# copy old /boot contents |
|
3219 |
cd ${SOURCE_BOOT_DEV} |
|
3220 |
find . -mount \! -type s -print | \ |
|
3221 |
cpio -pcdum ${BOOTMOUNT} 2>&1 | \ |
|
3222 |
${LUBIN}/lustripcpioerr |
|
3223 |
||
3224 |
if [ $? -ne 0 ] ; then |
|
3225 |
fail "Unable to copy boot partition contents." |
|
3226 |
fi |
|
3227 |
||
3228 |
cd ${OLD_PWD} |
|
3229 |
||
3230 |
# unmount and rm our boot mount, if we created it |
|
3231 |
if [ -z "${BOOTMOUNTPT}" ] ; then |
|
3232 |
ERRMSG=$(umount ${BOOTMOUNT} 2>&1) |
|
3233 |
if [ $? -ne 0 ] ; then |
|
3234 |
[ -n "${ERRMSG}" ] && echo "${ERRMSG}" |
|
3235 |
fail "Unable to umount <$BOOTMOUNT>." |
|
3236 |
fi |
|
3237 |
rm -rf ${BOOTMOUNT} |
|
3238 |
fi |
|
3239 |
||
3240 |
# unmount, un-lofi, and rm SOURCE_BOOT_DEV |
|
3241 |
||
3242 |
ERRMSG=$(umount ${SOURCE_BOOT_DEV} 2>&1) |
|
3243 |
if [ $? -ne 0 ] ; then |
|
3244 |
[ -n "${ERRMSG}" ] && echo "${ERRMSG}" |
|
3245 |
fail "Cannot umount lo-device <${LOBOOTDEV}>." |
|
3246 |
fi |
|
3247 |
||
3248 |
ERRMSG=$(lofiadm -d ${DDCOPY} 2>&1) |
|
3249 |
if [ $? -ne 0 ] ; then |
|
3250 |
[ -n "${ERRMSG}" ] && echo "${ERRMSG}" |
|
3251 |
fail "Cannot remove lo-device <${LOBOOTDEV}>." |
|
3252 |
fi |
|
3253 |
||
3254 |
rm -rf ${SOURCE_BOOT_DEV} |
|
3255 |
||
3256 |
done < ${TMP_FDFILE1} |
|
3257 |
rm ${TMP_FDFILE1} ${LOGFILE} ${DDCOPY} |
|
3258 |
||
3259 |
else |
|
3260 |
||
3261 |
# non boot-partition: use installboot to get pboot and bootblk |
|
3262 |
echo "Updating /boot on Solaris partition." |
|
3263 |
||
3264 |
if [ -z "${ROOT}" ] ; then SEARCH="/"; else SEARCH="${ROOT}"; fi |
|
3265 |
||
3266 |
ROOTRAWDEV=$(mount | grep "^${SEARCH} on " | \ |
|
3267 |
awk '{print $3}' | sed 's;/dsk;/rdsk;') |
|
3268 |
||
3269 |
if [ -z "${ROOTRAWDEV}" ] ; then |
|
3270 |
[ -n "${ROOTRAWDEV}" && echo "${ROOTRAWDEV}" ] |
|
3271 |
fail "${SEARCH} must be a mounted filesystem" |
|
3272 |
fi |
|
3273 |
||
3274 |
echo "Updating Solaris partition ${ROOTRAWDEV} with installboot" |
|
3275 |
REQFILES="pboot bootblk" |
|
3276 |
for f in ${REQFILES}; do |
|
3277 |
if [ ! -f ${TMPDIR}/$f ]; then |
|
3278 |
fail "Missing $f, aborting." |
|
3279 |
fi |
|
3280 |
done |
|
3281 |
PBOOT=${TMPDIR}/pboot |
|
3282 |
BOOTBLK=${TMPDIR}/bootblk |
|
3283 |
install_boot_i386 $PBOOT $BOOTBLK ${ROOTRAWDEV} |
|
3284 |
if [ $? -ne 0 ] ; then |
|
3285 |
fail "Unable to installboot to <${ROOTRAWDEV}>." |
|
3286 |
fi |
|
3287 |
fi |
|
3288 |
} |
|
3289 |
||
3290 |
print "Verifying archives ..." |
|
3291 |
||
3292 |
for a in generic $allarchs $rootarchs |
|
3293 |
do |
|
3294 |
test -r $cpiodir/$a.root$ZFIX || |
|
3295 |
fail "bfu archive $cpiodir/$a.root$ZFIX missing" |
|
3296 |
done |
|
3297 |
||
3298 |
if [ ! -r $cpiodir/generic.lib$ZFIX -o ! -r $cpiodir/generic.kernel$ZFIX -o \ |
|
3299 |
! -r $cpiodir/generic.sbin$ZFIX ]; then |
|
3300 |
old_style_archives="true" |
|
3301 |
$ZCAT $cpiodir/generic.root$ZFIX | cpio -it 2>/dev/null | \ |
|
3302 |
egrep -s '^etc/zones' && \ |
|
3303 |
fail "bfu archive $cpiodir/generic.{kernel,lib,sbin}$ZFIX" \ |
|
3304 |
"missing;\npossible mkbfu version mismatch: pre-zones" \ |
|
3305 |
"style archives with zones files." |
|
3306 |
fi |
|
3307 |
||
3308 |
for a in generic $allarchs $usrarchs |
|
3309 |
do |
|
3310 |
test -r $cpiodir/$a.usr$ZFIX || |
|
3311 |
fail "bfu archive $cpiodir/$a.usr$ZFIX missing" |
|
3312 |
done |
|
3313 |
||
3314 |
for root in $rootlist |
|
3315 |
do |
|
3316 |
cd $root || fail "Cannot cd $root" |
|
3317 |
prologue=${root%/}/bfu.prologue |
|
3318 |
if [ -f $prologue ]; then |
|
3319 |
print "Executing $prologue" |
|
3320 |
$prologue || fail "$prologue failed with code $?" |
|
3321 |
fi |
|
3322 |
done |
|
3323 |
||
3324 |
print "Performing basic sanity checks ..." |
|
3325 |
||
3326 |
for dir in $usr $rootlist |
|
3327 |
do |
|
3328 |
test -d $dir || fail "$dir does not exist" |
|
3329 |
test -w $dir || fail "$dir is not writable" |
|
3330 |
cd $dir || fail "Cannot cd $dir" |
|
3331 |
done |
|
3332 |
||
3333 |
RM_32BIT_KERNEL=0; |
|
3334 |
if [ "$karch" = "sun4u" ] && |
|
3335 |
($ZCAT $cpiodir/sun4u.root$ZFIX | cpio -itv 2>&1 | |
|
3336 |
grep "^l.*platform/sun4u/kernel/unix -> sparcv9/unix$" > /dev/null); |
|
3337 |
then |
|
3338 |
RM_32BIT_KERNEL=1; |
|
3339 |
if [ "$force_override" = "no" ] && |
|
3340 |
(prtconf -F 2>&1 | egrep '(cgthree|bwtwo)' > /dev/null); |
|
3341 |
then |
|
3342 |
print "\n\nERROR: You are upgrading to a 64-bit-only OS. " \ |
|
3343 |
"Your frame buffer does not have a 64-bit driver and " \ |
|
3344 |
"will not work after reboot. To proceed you must run " \ |
|
3345 |
"bfu with the -f flag."; |
|
3346 |
exit; |
|
3347 |
fi; |
|
3348 |
fi; |
|
3349 |
||
3350 |
if [ $plat = "SUNW,Ultra-1" ] && [ ! -f $cpiodir/SUNW,Ultra-1.root$ZFIX ] && |
|
3351 |
[ "$force_override" = "no" ]; |
|
3352 |
then |
|
3353 |
print "\nERROR: These archives do not have Ultra-1 platform support." \ |
|
3354 |
"\nProceeding with this BFU may render this machine unbootable." \ |
|
3355 |
"\nTo proceed anyway, you must run bfu with the -f flag.\n"; |
|
3356 |
exit; |
|
3357 |
fi; |
|
3358 |
||
3359 |
for root in $rootlist |
|
3360 |
do |
|
3361 |
rootprefix=${root%/} |
|
3362 |
smf_check_repository |
|
3363 |
done |
|
3364 |
||
3365 |
MINIMUM_OS_REV=9 |
|
3366 |
||
3367 |
# |
|
3368 |
# Perform additional sanity checks if we are upgrading the live system. |
|
3369 |
# |
|
3370 |
if [ "$rootlist" = "/" ] |
|
3371 |
then |
|
3372 |
# |
|
3373 |
# Disallow from older releases |
|
3374 |
# |
|
3375 |
os_rev=`uname -r | sed -e s/5.//` |
|
3376 |
if [ $os_rev -lt $MINIMUM_OS_REV -a "$force_override" = "no" ]; then |
|
3377 |
fail "Cannot bfu from pre-Solaris $MINIMUM_OS_REV" |
|
3378 |
fi |
|
3379 |
||
3380 |
# |
|
3381 |
# Filesystem space checks |
|
3382 |
# |
|
3383 |
set $root 4 $usr 6 |
|
3384 |
while [ $# -gt 0 ] |
|
3385 |
do |
|
3386 |
test "`df -b $1 | tail -1 | nawk '{ print $2 }'`" -ge ${2}000 || |
|
3387 |
fail "Less than $2 MB free on $1 -- bfu not safe." |
|
3388 |
shift 2 |
|
3389 |
done |
|
3390 |
# |
|
3391 |
# Disable kernel module unloading |
|
3392 |
# |
|
3393 |
print "Disabling kernel module unloading ... \c" |
|
3394 |
test -x /usr/bin/adb || fail "/usr/bin/adb not found: bfu not safe." |
|
3395 |
echo "moddebug/W20000" | adb -kw /dev/ksyms /dev/mem | grep moddebug |
|
3396 |
# |
|
3397 |
# Load modules and drivers here not to reload them when you access |
|
3398 |
# /devices or its subdirectories later. |
|
3399 |
# |
|
3400 |
cut -d' ' -f1 /etc/name_to_major | while read driver |
|
3401 |
do |
|
3402 |
modload -p drv/${driver} >/dev/null 2>&1 |
|
3403 |
done |
|
3404 |
ls $cpiodir >>/dev/null # loads elfexec and networking |
|
3405 |
||
3406 |
# exec/intpexec and sys/kaio are needed by lofi |
|
3407 |
modload -p exec/intpexec >/dev/null 2>&1 |
|
3408 |
modload -p sys/kaio >/dev/null 2>&1 |
|
3409 |
||
3410 |
# |
|
3411 |
# Stop init(1M) so extraction/manipulation of inittab is safe. |
|
3412 |
# |
|
3413 |
print "Quiescing init ..." |
|
3414 |
pstop 1 |
|
3415 |
||
3416 |
# umount /lib/libc.so.1 if necessary |
|
3417 |
if [ -n "`mount | grep '^/lib/libc.so.1'`" ] |
|
3418 |
then |
|
3419 |
print "Unmounting /lib/libc.so.1 ..." |
|
3420 |
umount /lib/libc.so.1 |
|
3421 |
fi |
|
3422 |
||
3423 |
# umount /platform/sun4v/lib/libc_psr.so.1 if necessary |
|
3424 |
if [ -n "`mount | grep '^/platform/sun4v/lib/libc_psr.so.1'`" ] |
|
3425 |
then |
|
3426 |
print "Unmounting /platform/sun4v/lib/libc_psr.so.1 ..." |
|
3427 |
umount /platform/sun4v/lib/libc_psr.so.1 |
|
3428 |
fi |
|
3429 |
||
3430 |
# umount /platform/sun4v/lib/sparcv9/libc_psr.so.1 if necessary |
|
3431 |
if [ -n "`mount | grep '^/platform/sun4v/lib/sparcv9/libc_psr.so.1'`" ] |
|
3432 |
then |
|
3433 |
print "Unmounting /platform/sun4v/lib/sparcv9/libc_psr.so.1 ..." |
|
3434 |
umount /platform/sun4v/lib/sparcv9/libc_psr.so.1 |
|
3435 |
fi |
|
3436 |
||
3437 |
if [ -x /usr/sbin/zoneadm ]; then |
|
3438 |
# |
|
3439 |
# Stop any running zones: the init script will print a |
|
3440 |
# message if needed. |
|
3441 |
# |
|
3442 |
if [ -x /etc/init.d/zones ]; then |
|
3443 |
/etc/init.d/zones stop |
|
3444 |
elif [ -x /lib/svc/method/svc-zones ]; then |
|
3445 |
# |
|
3446 |
# Calling the zone service method directly is |
|
3447 |
# the most straightforward way to block until |
|
3448 |
# all zones are halted. Finding a way that |
|
3449 |
# works once zones are made restartable is an |
|
3450 |
# exercise left to the reader. |
|
3451 |
# |
|
3452 |
/lib/svc/method/svc-zones stop |
|
3453 |
fi |
|
3454 |
||
3455 |
[ -z `zoneadm list | grep -v global` ] || \ |
|
3456 |
fail "zone(s) failed to halt" |
|
3457 |
# |
|
3458 |
# Determine the installed zones, which we will want to do |
|
3459 |
# after we're done with the global zone. This is done now |
|
3460 |
# rather than later in case bfu'ing the global zone causes |
|
3461 |
# the zone configuration to become unreadable (e.g., via a |
|
3462 |
# DTD flag day). |
|
3463 |
# |
|
3464 |
zoneadm list -pi | nawk -F: '{ |
|
3465 |
if ($3 == "installed") { |
|
3466 |
printf "%s %s\n", $2, $4 |
|
3467 |
} |
|
3468 |
}' > $local_zone_info_file |
|
3469 |
fi |
|
3470 |
||
3471 |
# |
|
3472 |
# Stop sendmail so that mail doesn't bounce during the interval |
|
3473 |
# where /etc/mail/aliases is (effectively) empty. |
|
3474 |
# |
|
3475 |
# (note that unlike other services here, /etc/init.d/sendmail |
|
3476 |
# remains post-smf(5) because it is a public interface.) |
|
3477 |
# |
|
3478 |
if [ -r /etc/svc/volatile/repository_door ]; then |
|
3479 |
print "Disabling sendmail temporarily ..." |
|
3480 |
svcadm disable -t network/smtp |
|
3481 |
else |
|
3482 |
print "Killing sendmail ..." |
|
3483 |
/etc/init.d/sendmail stop |
|
3484 |
fi |
|
3485 |
||
3486 |
print "Disabling remote logins ..." |
|
3487 |
echo "bfu in progress -- remote logins disabled" >/etc/nologin |
|
3488 |
||
3489 |
# |
|
3490 |
# Stop syslogd so it doesn't interfere with saving preserved files. |
|
3491 |
# |
|
3492 |
if [ -f /etc/init.d/syslog ]; then |
|
3493 |
print "Killing syslogd ..." |
|
3494 |
/etc/init.d/syslog stop |
|
3495 |
elif [ -r /etc/svc/volatile/repository_door ]; then |
|
3496 |
print "Disabling syslog temporarily ..." |
|
3497 |
svcadm disable -t system/system-log |
|
3498 |
fi |
|
3499 |
||
3500 |
# |
|
3501 |
# Stop apache so it doesn't get upset when the entire world changes |
|
3502 |
# out from underneath it. |
|
3503 |
# |
|
3504 |
if [ -f /etc/init.d/apache ]; then |
|
3505 |
print "Killing httpd ..." |
|
3506 |
/etc/init.d/apache stop |
|
3507 |
elif [ -r /etc/svc/volatile/repository_door ]; then |
|
3508 |
print "Disabling httpd temporarily ..." |
|
3509 |
svcadm disable -t network/http |
|
3510 |
fi |
|
3511 |
||
3512 |
# |
|
3513 |
# Kill off fmd so it doesn't get upset when the entire world changes |
|
3514 |
# out from underneath it. |
|
3515 |
# |
|
3516 |
if [ -f /etc/init.d/savecore ]; then |
|
3517 |
print "Killing fmd ..." |
|
3518 |
pkill -x fmd |
|
3519 |
elif [ -r /etc/svc/volatile/repository_door ]; then |
|
3520 |
print "Disabling fmd temporarily ..." |
|
3521 |
svcadm disable -t system/fmd |
|
3522 |
fi |
|
3523 |
||
3524 |
# |
|
3525 |
# Stop nscd so it doesn't interfere with stuff. |
|
3526 |
# |
|
3527 |
if [ -x /etc/init.d/nscd ]; then |
|
3528 |
print "Killing nscd ..." |
|
3529 |
/etc/init.d/nscd stop |
|
3530 |
elif [ -r /etc/svc/volatile/repository_door ]; then |
|
3531 |
print "Disabling nscd temporarily ..." |
|
3532 |
svcadm disable -t system/name-service-cache:default |
|
3533 |
fi |
|
3534 |
||
3535 |
if grep -v "^#" $rootprefix/etc/vfstab | grep boot | \ |
|
3536 |
grep "[ ]pcfs[ ]" >/dev/null 2>&1 |
|
3537 |
then |
|
3538 |
boot_is_pcfs=yes |
|
3539 |
fi |
|
3540 |
||
3541 |
smf_new_profiles |
|
3542 |
||
3543 |
else |
|
3544 |
# |
|
3545 |
# Check ${root}/etc/motd for SunOS value to get `uname -r` |
|
3546 |
# |
|
3547 |
os_rev=`head -1 ${root}/etc/motd | sed -e 's/^.*SunOS //' | \ |
|
3548 |
awk '{print $1}' | sed -e s/5.//` |
|
3549 |
if [ $os_rev -lt $MINIMUM_OS_REV -a "$force_override" = "no" ]; then |
|
3550 |
fail "Cannot bfu from pre-Solaris $MINIMUM_OS_REV" |
|
3551 |
fi |
|
3552 |
fi |
|
3553 |
||
3554 |
export PATH=/tmp/bfubin:$PATH |
|
3555 |
export LD_LIBRARY_PATH=/tmp/bfulib |
|
3556 |
||
3557 |
if [ -h /tmp/bfulib/64 ] |
|
3558 |
then |
|
3559 |
ldlib64="LD_LIBRARY_PATH_64=/tmp/bfulib/64" |
|
3560 |
export LD_LIBRARY_PATH_64=/tmp/bfulib/64 |
|
3561 |
fi |
|
3562 |
||
598
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
3563 |
# turn off auxiliary filters, since they can cause objects to be loaded |
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
3564 |
# from outside of the protected environment. |
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
3565 |
export LD_NOAUXFLTR=1 |
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
3566 |
|
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
3567 |
# |
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
3568 |
# Since we've turned off auxiliary filters, libc_psr will normally not |
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
3569 |
# be loaded at all. But libc_psr was overriding broken code in libc |
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
3570 |
# for over a week before the fix for 6324631, so we need to explicitly |
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
3571 |
# LD_PRELOAD it to allow users to bfu from the broken libc. This can be |
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
3572 |
# removed once there are no sun4u machines bfued to Nevada bits between |
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
3573 |
# 9/7/2005 and 9/15/2005. |
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
3574 |
# |
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
3575 |
if [ -f /tmp/bfulib/libc_psr.so.1 ]; then |
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
3576 |
export LD_PRELOAD_32=/tmp/bfulib/libc_psr.so.1 |
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
3577 |
fi |
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
3578 |
|
0 | 3579 |
print "Turning on delayed i/o ..." |
3580 |
fastfs -f $rootlist $usr |
|
3581 |
fastfs $rootlist $usr |
|
3582 |
||
3583 |
# |
|
3584 |
# The "| tee -a $EXTRACT_LOG" following do_extraction() is not pulled into the |
|
3585 |
# function itself because it interferes with the cpio exit status detection. |
|
3586 |
# pcfs boot is an exception, since its cpio exit status is expected to be bad, |
|
3587 |
# so a heuristic must be employed to infer whether or not any errors occurred. |
|
3588 |
# |
|
3589 |
do_extraction() { |
|
3590 |
compressed_archive=$1 |
|
3591 |
shift |
|
3592 |
$ZCAT $compressed_archive | cpio -idmucB $* 2>&1 \ |
|
3593 |
|| extraction_error "extracting archive $1" |
|
3594 |
} |
|
3595 |
||
3596 |
do_pcfs_boot_extraction() { |
|
3597 |
PCFS_BOOT_LOG=/tmp/bfu-pcfs-boot-log.$$ |
|
3598 |
$ZCAT $1 | cpio -idmucB 2>&1 | grep -v "error.s" | \ |
|
3599 |
grep -v "cpio: Cannot chown()" | \ |
|
3600 |
grep -v "cpio: Error during chown()" | tee $PCFS_BOOT_LOG |
|
3601 |
cat $PCFS_BOOT_LOG >> $EXTRACT_LOG |
|
3602 |
egrep -s -v blocks $PCFS_BOOT_LOG |
|
3603 |
if [ $? -eq 0 ]; then |
|
3604 |
extraction_error "extracting archive $1 ... see $PCFS_BOOT_LOG" |
|
3605 |
else |
|
3606 |
rm -f $PCFS_BOOT_LOG |
|
3607 |
fi |
|
3608 |
} |
|
3609 |
||
3610 |
# |
|
3611 |
# Usage: extract_archives (root|usr|lib|sbin|kernel) arch-list |
|
3612 |
# |
|
3613 |
extract_archives() { |
|
3614 |
base=$1 |
|
3615 |
shift |
|
3616 |
test $base = usr && cd $usrroot || cd $root |
|
3617 |
for archive in $* |
|
3618 |
do |
|
3619 |
print "Extracting $archive.$base$ZFIX ... \c" \ |
|
3620 |
| tee -a $EXTRACT_LOG |
|
3621 |
test -h platform/$archive && rm platform/$archive |
|
3622 |
if [ $base = root ]; then |
|
3623 |
exclude="-f dev/fd home proc etc/mnttab" |
|
3624 |
[ -d system/contract ] && |
|
3625 |
exclude="$exclude system/contract" |
|
3626 |
[ -d system/object ] && |
|
3627 |
exclude="$exclude system/object" |
|
3628 |
[ -f etc/svc/repository.db ] && |
|
3629 |
exclude="$exclude etc/svc/repository.db" |
|
3630 |
[ -e etc/repository_door ] && |
|
3631 |
exclude="$exclude etc/repository_door" |
|
3632 |
[ -f etc/svc/volatile ] && |
|
3633 |
exclude="$exclude etc/svc/volatile" |
|
3634 |
do_extraction $cpiodir/$archive.$base$ZFIX $exclude | |
|
3635 |
tee -a $EXTRACT_LOG |
|
3636 |
elif [ $base = usr ]; then |
|
3637 |
do_extraction $cpiodir/$archive.$base$ZFIX \ |
|
3638 |
-f "usr/openwin" | tee -a $EXTRACT_LOG |
|
3639 |
else |
|
3640 |
do_extraction $cpiodir/$archive.$base$ZFIX \ |
|
3641 |
| tee -a $EXTRACT_LOG |
|
3642 |
fi |
|
3643 |
done |
|
3644 |
cd $root |
|
3645 |
} |
|
3646 |
||
3647 |
extract_boot_archives() { |
|
3648 |
base=$1 |
|
3649 |
shift |
|
3650 |
cd $root |
|
3651 |
for archive in $* |
|
3652 |
do |
|
3653 |
if [ ! -f $cpiodir/$archive.$base$ZFIX ]; then |
|
3654 |
continue |
|
3655 |
fi |
|
3656 |
print "Extracting $archive.$base$ZFIX ... \c" \ |
|
3657 |
| tee -a $EXTRACT_LOG |
|
3658 |
if [ $boot_is_pcfs = yes ]; then |
|
3659 |
do_pcfs_boot_extraction $cpiodir/$archive.$base$ZFIX |
|
3660 |
else |
|
3661 |
do_extraction $cpiodir/$archive.$base$ZFIX | \ |
|
3662 |
tee -a $EXTRACT_LOG |
|
3663 |
fi |
|
3664 |
$ZCAT $cpiodir/$archive.$base$ZFIX | cpio -it 2>&1 | \ |
|
3665 |
grep "boot/solaris/devicedb/master" >/dev/null 2>&1 |
|
3666 |
if [ "$?" = "0" ]; then |
|
3667 |
have_realmode=yes |
|
3668 |
fi |
|
3669 |
done |
|
3670 |
cd $root |
|
3671 |
} |
|
3672 |
||
3673 |
# |
|
3674 |
# Classic boot pboot and bootblk compatibility with old archives |
|
3675 |
# |
|
3676 |
setup_pboot() |
|
3677 |
{ |
|
3678 |
NEWPBOOTDIR=$GATE/public/pboot |
|
3679 |
NEWPBOOT=${NEWPBOOTDIR}/pboot |
|
3680 |
NEWBOOTBLK=${NEWPBOOTDIR}/bootblk |
|
3681 |
PBOOTDIR=$usr/platform/$karch/lib/fs/ufs |
|
3682 |
PBOOT=${PBOOTDIR}/pboot |
|
3683 |
BOOTBLK=${PBOOTDIR}/bootblk |
|
3684 |
||
3685 |
# they should already be there, but... |
|
3686 |
if [ -f $NEWPBOOT -a ! -f $PBOOT ]; then |
|
3687 |
print "Installing pboot from $NEWPBOOTDIR" |
|
3688 |
cp $NEWPBOOT $PBOOT |
|
3689 |
fi |
|
3690 |
if [ -f $NEWBOOTBLK -a ! -f $BOOTBLK ]; then |
|
3691 |
print "Installing bootblk from $NEWPBOOTDIR" |
|
3692 |
cp $NEWBOOTBLK $BOOTBLK |
|
3693 |
fi |
|
3694 |
||
3695 |
if [ -f $NEWPBOOT -a -f $PBOOT ]; then |
|
3696 |
LATEST=`ls -Lt $PBOOT $NEWPBOOT | head -1` |
|
3697 |
if [ "$LATEST" = "$NEWPBOOT" ]; then |
|
3698 |
print "Updating pboot from $NEWPBOOT" |
|
3699 |
cp $NEWPBOOT $PBOOT |
|
3700 |
fi |
|
3701 |
fi |
|
3702 |
if [ -f $NEWBOOTBLK -a -f $BOOTBLK ]; then |
|
3703 |
LATEST=`ls -Lt $BOOTBLK $NEWBOOTBLK | head -1` |
|
3704 |
if [ "$LATEST" = "$NEWBOOTBLK" ]; then |
|
3705 |
print "Updating bootblk from $NEWBOOTBLK" |
|
3706 |
cp $NEWBOOTBLK $BOOTBLK |
|
3707 |
fi |
|
3708 |
fi |
|
3709 |
if [[ "$rootslice" = /dev/rdsk/* ]]; then |
|
3710 |
print "Installing boot block." |
|
3711 |
( cd $PBOOTDIR ; |
|
3712 |
install_boot_i386 ./pboot ./bootblk ${rootslice%??}s2 ) |
|
3713 |
fi |
|
3714 |
# |
|
3715 |
# Since /platform/i86pc/boot/solaris/boot.bin is moved |
|
3716 |
# to /boot/solaris, remove the old one if it really |
|
3717 |
# exists. |
|
3718 |
# |
|
3719 |
OLDBOOTDIR=${root}/platform/i86pc/boot/solaris |
|
3720 |
OLDBOOTBIN=${OLDBOOTDIR}/boot.bin |
|
3721 |
if [ ! -h ${OLDBOOTDIR} -a -f ${OLDBOOTBIN} ] ; |
|
3722 |
then |
|
3723 |
print "Removing old boot.bin." |
|
3724 |
rm -rf ${OLDBOOTBIN} |
|
3725 |
fi |
|
3726 |
} |
|
3727 |
||
3728 |
# |
|
3729 |
# Multiboot support |
|
3730 |
# |
|
3731 |
||
3732 |
saved_boot_files=" |
|
3733 |
solaris/bootenv.rc |
|
3734 |
solaris/devicedb/master |
|
3735 |
" |
|
3736 |
||
3737 |
# |
|
3738 |
# transition from multiboot to dca |
|
3739 |
# |
|
3740 |
check_multi_to_dca_boot() |
|
3741 |
{ |
|
3742 |
bootdev=`grep p0:boot $rootprefix/etc/vfstab | \ |
|
3743 |
grep pcfs | nawk '{print $1}'` |
|
3744 |
if [ "$bootdev" != "" ]; then |
|
3745 |
is_pcfs_boot=yes |
|
3746 |
fi |
|
3747 |
||
3748 |
if [ $is_pcfs_boot = yes ]; then |
|
3749 |
df -h | grep stubboot >/dev/null 2>&1 |
|
3750 |
if [ $? -eq 0 ]; then |
|
3751 |
||
3752 |
# save configurable files from /boot |
|
3753 |
# before remounting /stubboot. |
|
3754 |
# files are relative to /boot. |
|
3755 |
for file in $saved_boot_files |
|
3756 |
do |
|
3757 |
dir="`/usr/bin/dirname $rootprefix/stubboot/$file`" |
|
3758 |
mkdir -p $dir |
|
3759 |
cp $rootprefix/boot/$file $dir |
|
3760 |
done |
|
3761 |
||
3762 |
echo "unmount $bootdev at $rootprefix/stubboot" |
|
3763 |
ERRMSG=$(umount $bootdev 2>&1) |
|
3764 |
if [ $? -ne 0 ] ; then |
|
3765 |
[ -n "${ERRMSG}" ] && echo "${ERRMSG}" |
|
3766 |
fail "Unable to umount $bootdev on $rootprefix/stubboot." |
|
3767 |
fi |
|
3768 |
||
3769 |
# adjust vfstab |
|
3770 |
sed -e "s/[ ]\/stubboot[ ]/ \/boot /" \ |
|
3771 |
<$rootprefix/etc/vfstab >$rootprefix/etc/vfstab+ |
|
3772 |
mv $rootprefix/etc/vfstab $rootprefix/etc/vfstab- |
|
3773 |
mv $rootprefix/etc/vfstab+ $rootprefix/etc/vfstab |
|
3774 |
||
3775 |
ERRMSG=$(mount -F pcfs $bootdev $rootprefix/boot 2>&1) |
|
3776 |
if [ $? -ne 0 ] ; then |
|
3777 |
[ -n "${ERRMSG}" ] && echo "${ERRMSG}" |
|
3778 |
fail "Unable to mount $bootdev on $rootprefix/boot." |
|
3779 |
fi |
|
3780 |
fi |
|
3781 |
fi |
|
3782 |
} |
|
3783 |
||
3784 |
check_dca_to_multiboot() |
|
3785 |
{ |
|
3786 |
# ensure bootpath is in $rootprefix/boot/solaris/bootenv.rc |
|
3787 |
# It's ok to put a meta device path in there |
|
3788 |
bootenvrc=$rootprefix/boot/solaris/bootenv.rc |
|
3789 |
grep "^setprop[ ]*bootpath[ ]" $bootenvrc > /dev/null |
|
3790 |
if [ $? != 0 ]; then |
|
3791 |
rootdev=`grep -v "^#" $rootprefix/etc/vfstab | \ |
|
3792 |
grep "[ ]/[ ]" | nawk '{print $1}'` |
|
3793 |
bootpath=`ls -l $rootdev | nawk '{ print $NF }' |\ |
|
3794 |
sed "s#../../devices##"` |
|
3795 |
echo "setprop bootpath '$bootpath'" >> $bootenvrc |
|
3796 |
fi |
|
3797 |
||
3798 |
bootdev=`grep p0:boot $rootprefix/etc/vfstab | \ |
|
3799 |
grep pcfs | nawk '{print $1}'` |
|
3800 |
if [ "$bootdev" != "" ]; then |
|
3801 |
is_pcfs_boot=yes |
|
3802 |
fi |
|
3803 |
if [ ! -f $rootprefix/boot/mdboot ]; then |
|
3804 |
return |
|
3805 |
fi |
|
3806 |
dca_to_multi=yes |
|
3807 |
rm -f $rootprefix/boot/mdboot |
|
3808 |
} |
|
3809 |
||
3810 |
# |
|
3811 |
# Detect SVM root and return the list of raw devices under the mirror |
|
3812 |
# |
|
3813 |
get_rootdev_list() |
|
3814 |
{ |
|
3815 |
metadev=`grep -v "^#" $rootprefix/etc/vfstab | \ |
|
3816 |
grep "[ ]/[ ]" | nawk '{print $2}'` |
|
3817 |
if [[ $metadev = /dev/rdsk/* ]]; then |
|
3818 |
rootdevlist=`echo "$metadev" | sed -e "s#/dev/rdsk/##"` |
|
3819 |
elif [[ $metadev = /dev/md/rdsk/* ]]; then |
|
3820 |
metavol=`echo "$metadev" | sed -e "s#/dev/md/rdsk/##"` |
|
3821 |
rootdevlist=`metastat -p $metavol |\ |
|
3822 |
grep -v "^$metavol[ ]" | nawk '{print $4}'` |
|
3823 |
fi |
|
3824 |
for rootdev in $rootdevlist |
|
3825 |
do |
|
3826 |
echo /dev/rdsk/$rootdev |
|
3827 |
done |
|
3828 |
} |
|
3829 |
||
3830 |
# |
|
3831 |
# Done once per transition from classic (dca) to multi boot |
|
3832 |
# |
|
3833 |
setup_stubboot() |
|
3834 |
{ |
|
3835 |
bootdev=`grep -v "^#" $rootprefix/etc/vfstab | grep pcfs | \ |
|
3836 |
grep "[ ]/boot[ ]"` |
|
3837 |
if [[ -n $bootdev ]] ; then |
|
3838 |
||
3839 |
bootdev=`echo "$bootdev" | nawk '{print $1}'` |
|
3840 |
rbootdev=`echo "$bootdev" | sed -e "s/dev\/dsk/dev\/rdsk/"` |
|
3841 |
||
3842 |
# Remount boot partition as /stubboot, set up new /boot |
|
3843 |
mkdir -p $rootprefix/stubboot |
|
3844 |
||
3845 |
ERRMSG=$(umount $bootdev 2>&1) |
|
3846 |
if [ $? -ne 0 ] ; then |
|
3847 |
[ -n "${ERRMSG}" ] && echo "${ERRMSG}" |
|
3848 |
fail "Unable to umount $bootdev." |
|
3849 |
fi |
|
3850 |
ERRMSG=$(mount -F pcfs $bootdev $rootprefix/stubboot 2>&1) |
|
3851 |
if [ $? -ne 0 ] ; then |
|
3852 |
[ -n "${ERRMSG}" ] && echo "${ERRMSG}" |
|
3853 |
fail "Unable to mount $bootdev on $rootprefix/stubboot." |
|
3854 |
fi |
|
3855 |
||
3856 |
mkdir -p $rootprefix/boot |
|
3857 |
cp -r $rootprefix/stubboot/* $rootprefix/boot |
|
3858 |
||
3859 |
# adjust /etc/vfstab |
|
3860 |
sed <$rootprefix/etc/vfstab \ |
|
3861 |
-e "s/[ ]\/boot[ ]/ \/stubboot /" | \ |
|
3862 |
sed -n >$rootprefix/etc/vfstab+ ' |
|
3863 |
/p0:boot/ { |
|
3864 |
s/[ ]no/ yes/ |
|
3865 |
} |
|
3866 |
p |
|
3867 |
' |
|
3868 |
||
3869 |
mv $rootprefix/etc/vfstab $rootprefix/etc/vfstab- |
|
3870 |
mv $rootprefix/etc/vfstab+ $rootprefix/etc/vfstab |
|
3871 |
fi |
|
3872 |
} |
|
3873 |
||
3874 |
# |
|
3875 |
# multiboot: install grub on the boot slice |
|
3876 |
# |
|
3877 |
install_grub() |
|
3878 |
{ |
|
3879 |
STAGE1=$root/boot/grub/stage1 |
|
3880 |
STAGE2=$root/boot/grub/stage2 |
|
3881 |
||
3882 |
if [ $is_pcfs_boot = no ]; then |
|
3883 |
get_rootdev_list | while read rootdev |
|
3884 |
do |
|
3885 |
print "Install grub on $rootdev" |
|
3886 |
PATH=/tmp/bfubin /tmp/bfubin/installgrub \ |
|
3887 |
$STAGE1 $STAGE2 $rootdev |
|
3888 |
done |
|
3889 |
else |
|
3890 |
# copy /boot grub & solaris to /stubboot |
|
3891 |
cp -r $rootprefix/boot/grub $rootprefix/stubboot/grub |
|
3892 |
cp -r $rootprefix/boot/solaris $rootprefix/stubboot/solaris |
|
3893 |
||
3894 |
# Adjust grub paths relative to pcfs filesystem |
|
3895 |
rm -rf $rootprefix/stubboot/boot |
|
3896 |
mkdir -p $rootprefix/stubboot/boot |
|
3897 |
mv $rootprefix/stubboot/grub $rootprefix/stubboot/boot |
|
3898 |
mv $rootprefix/stubboot/solaris $rootprefix/stubboot/boot |
|
3899 |
||
3900 |
# |
|
3901 |
# Run installgrub after copying stubboot to avoid overwriting |
|
3902 |
# /stubboot/boot/grub/stage2, which must stay untouched. |
|
3903 |
# |
|
3904 |
bootdev=`grep -v "^#" $rootprefix/etc/vfstab | grep pcfs | \ |
|
3905 |
grep "[ ]/stubboot[ ]" | nawk '{print $1}'` |
|
3906 |
rbootdev=`echo "$bootdev" | sed -e "s/dev\/dsk/dev\/rdsk/"` |
|
3907 |
if [ "$rbootdev" != "" ]; then |
|
3908 |
print "Install grub on $rbootdev" |
|
3909 |
PATH=/tmp/bfubin /tmp/bfubin/installgrub $STAGE1 $STAGE2 $rbootdev |
|
3910 |
fi |
|
3911 |
fi |
|
3912 |
} |
|
3913 |
||
3914 |
get_biosdisk() |
|
3915 |
{ |
|
3916 |
rootdev=$1 |
|
3917 |
rootphys=`ls -l $rootdev | nawk '{ print $NF }' | \ |
|
3918 |
sed -e "s/\.\.\/\.\.\/devices//" -e "s/:[abcdefgh],raw//"` |
|
3919 |
rbootdev=`echo "$rootdev" | sed -e "s/s[0-7]/p0/"` |
|
3920 |
||
3921 |
# |
|
3922 |
# Use biosdev to get the bios disk number |
|
3923 |
# |
|
3924 |
biosdisk=`biosdev | grep $rootphys | \ |
|
3925 |
nawk '{print $1}' | sed -e "s/0x8//"` |
|
3926 |
} |
|
3927 |
||
3928 |
# |
|
3929 |
# multiboot: set up initial grub menu |
|
3930 |
# |
|
3931 |
update_grub_menu() |
|
3932 |
{ |
|
3933 |
BOOT_PROG=/platform/i86pc/multiboot |
|
3934 |
BOOT_ARCHIVE=/platform/i86pc/boot_archive |
|
3935 |
MENU=$rootprefix/boot/grub/menu.lst |
|
3936 |
||
3937 |
grubhd=$1 |
|
3938 |
||
3939 |
# |
|
3940 |
# Append some useful entries to the existing menu |
|
3941 |
# |
|
3942 |
echo "Update GRUB menu $MENU with entries for $grubhd" |
|
3943 |
||
3944 |
grep ^default $MENU > /dev/null |
|
3945 |
[ $? = 0 ] || echo "default=0" >> $MENU |
|
3946 |
grep ^timeout $MENU > /dev/null |
|
3947 |
[ $? = 0 ] || echo "timeout=10" >> $MENU |
|
3948 |
||
3949 |
echo "#serial --unit=0 --speed=9600" >> $MENU |
|
3950 |
echo "#terminal serial" >> $MENU |
|
3951 |
echo "#splashimage=$grubhd/boot/grub/splash.xpm.gz" >> $MENU |
|
3952 |
echo "title Solaris" >> $MENU |
|
3953 |
echo " root $grubhd" >> $MENU |
|
3954 |
echo " kernel ${BOOT_PROG}" >> $MENU |
|
3955 |
echo " module ${BOOT_ARCHIVE}" >> $MENU |
|
3956 |
||
3957 |
echo "GRUB menu entry 'Solaris' boots to eeprom(1m) settings" |
|
3958 |
||
3959 |
if [ -f ${rootprefix}/boot/multiboot ] && |
|
3960 |
[ -f ${rootprefix}/boot/x86.miniroot-safe ] ; then |
|
3961 |
||
3962 |
TTY=`grep "^setprop input-device" \ |
|
3963 |
${rootprefix}/boot/solaris/bootenv.rc | cut -f 2 -d \'` |
|
3964 |
if [ -z "${TTY}" ] ; then |
|
3965 |
TTY=`grep "^setprop console" \ |
|
3966 |
${rootprefix}/boot/solaris/bootenv.rc | \ |
|
3967 |
cut -f 2 -d \'` |
|
3968 |
fi |
|
3969 |
||
3970 |
if [ "${TTY}" = "ttya" ] || [ "${TTY}" = "ttyb" ] ; then |
|
3971 |
FS_CONSOLE="-B console=${TTY}" |
|
3972 |
fi |
|
3973 |
||
3974 |
echo "title Solaris failsafe" >> $MENU |
|
3975 |
echo " root $grubhd" >> $MENU |
|
3976 |
echo " kernel /boot/multiboot kernel/unix $FS_CONSOLE -s" \ |
|
3977 |
>> $MENU |
|
3978 |
echo " module /boot/x86.miniroot-safe" >> $MENU |
|
3979 |
fi |
|
3980 |
} |
|
3981 |
||
3982 |
install_failsafe() |
|
3983 |
{ |
|
3984 |
if [ ! -f /boot/multiboot -o ! -f /boot/x86.miniroot-safe ] && \ |
|
3985 |
[ -x ${GATEPATH}/public/bin/update_failsafe ] ; then |
|
3986 |
echo Updating boot/multiboot and boot/x86.miniroot-safe |
|
3987 |
${GATEPATH}/public/bin/update_failsafe |
|
3988 |
fi |
|
3989 |
} |
|
3990 |
||
3991 |
setup_grub_menu() |
|
3992 |
{ |
|
3993 |
BOOT_PROG=/platform/i86pc/multiboot |
|
3994 |
BOOT_ARCHIVE=/platform/i86pc/boot_archive |
|
3995 |
MENU=$rootprefix/boot/grub/menu.lst |
|
3996 |
||
3997 |
get_rootdev_list | while read rootdev |
|
3998 |
do |
|
3999 |
rootphys=`ls -l $rootdev | nawk '{print $NF}' | \ |
|
4000 |
sed -e "s/\.\.\/\.\.\/devices//"` |
|
4001 |
gslice=`echo "$rootphys" | cut -f 2 -d : | sed s/,raw//` |
|
4002 |
rootphys=`echo "$rootphys" | sed -e "s/:[abcdefgh],raw//"` |
|
4003 |
rbootdev=`echo "$rootdev" | sed -e "s/s[0-7]/p0/"` |
|
4004 |
||
4005 |
# |
|
4006 |
# Wallow through fdisk to get the active partition number |
|
4007 |
# Partition numbering is zero-based |
|
4008 |
# |
|
4009 |
part=0 |
|
4010 |
fdisk -W - $rbootdev | grep -v '^*' | grep -v '^$' | \ |
|
4011 |
while read id act bhead bcyl ehead ecyl rsect numsect |
|
4012 |
do |
|
4013 |
# Find solaris partition, either older 130 or 191 |
|
4014 |
if [ $id -eq "191" -o $id -eq "130" ] ; then |
|
4015 |
break |
|
4016 |
fi |
|
4017 |
part=`expr "$part" + 1` |
|
4018 |
done |
|
4019 |
||
4020 |
get_biosdisk $rootdev |
|
4021 |
grubhd="(hd${biosdisk},${part},${gslice})" |
|
4022 |
||
4023 |
# |
|
4024 |
# update the grub menu if it doesn't exist or |
|
4025 |
# doesn't have usable boot entries |
|
4026 |
# |
|
4027 |
if [ -f $MENU ]; then |
|
4028 |
grep -v "^#" $MENU | grep $grubhd >/dev/null 2>&1 |
|
4029 |
if [ $? -eq 1 ]; then |
|
4030 |
update_grub_menu $grubhd |
|
4031 |
fi |
|
4032 |
else |
|
4033 |
update_grub_menu $grubhd |
|
4034 |
fi |
|
4035 |
done |
|
4036 |
} |
|
4037 |
||
4038 |
# |
|
4039 |
# Build the multiboot boot archive |
|
4040 |
# |
|
4041 |
build_boot_archive() |
|
4042 |
{ |
|
4043 |
echo "Create ${rootprefix}/platform/i86pc/boot_archive" |
|
4044 |
||
4045 |
# |
|
4046 |
# We should be able to run bootadm here but that's a |
|
4047 |
# little more complicated than one would think |
|
4048 |
#bootadm_args=${rootprefix:+-R $rootprefix} |
|
4049 |
#PATH=/tmp/bfubin /tmp/bfubin/bootadm update $bootadm_args |
|
4050 |
||
4051 |
cr_args=${rootprefix:+ -R $rootprefix} |
|
4052 |
LD_LIBRARY_PATH=/tmp/bfulib PATH=/tmp/bfubin \ |
|
4053 |
/tmp/bfubin/ksh /tmp/bfubin/create_ramdisk $cr_args |
|
4054 |
||
4055 |
# |
|
4056 |
# Disable the boot-archive service on the first boot |
|
4057 |
# to silence complaints about new files |
|
4058 |
# svccfg -s system/boot-archive setprop start/exec = true |
|
4059 |
||
12
606827e00c98
6281986 bfu on alt mount fails to set up boot-archive conflicts correctly
jg
parents:
0
diff
changeset
|
4060 |
mkdir -p $rootprefix/bfu.conflicts/lib/svc/method |
0 | 4061 |
cp $rootprefix/lib/svc/method/boot-archive \ |
4062 |
$rootprefix/bfu.conflicts/lib/svc/method/boot-archive |
|
4063 |
cat >$rootprefix/lib/svc/method/boot-archive <<"EOF" |
|
4064 |
#!/sbin/sh |
|
4065 |
exit 0 |
|
4066 |
EOF |
|
4067 |
||
4068 |
cat >$rootprefix/etc/rc2.d/S99postbfu <<EOF |
|
4069 |
#!/bin/sh |
|
4070 |
# |
|
4071 |
case "\$1" in |
|
4072 |
'start') |
|
4073 |
cp /bfu.conflicts/lib/svc/method/boot-archive /lib/svc/method/boot-archive |
|
4074 |
chmod +x /lib/svc/method/boot-archive |
|
4075 |
rm -f /etc/rc2.d/S99postbfu |
|
4076 |
;; |
|
4077 |
*) |
|
4078 |
echo "usage: \$0 start" |
|
4079 |
exit 1 |
|
4080 |
;; |
|
4081 |
esac |
|
4082 |
exit 0 |
|
4083 |
EOF |
|
4084 |
||
4085 |
chmod +x $rootprefix/etc/rc2.d/S99postbfu |
|
4086 |
chmod +x $rootprefix/lib/svc/method/boot-archive |
|
4087 |
chmod +x $rootprefix/bfu.conflicts/lib/svc/method/boot-archive |
|
4088 |
} |
|
4089 |
||
4090 |
disable_boot_service() |
|
4091 |
{ |
|
4092 |
svccfg -s system/boot-archive setprop start/exec = true |
|
4093 |
cat >$rootprefix/lib/svc/method/boot-archive <<EOF |
|
4094 |
#!/sbin/sh |
|
4095 |
. /lib/svc/share/smf_include.sh |
|
4096 |
. /lib/svc/share/fs_include.sh |
|
4097 |
exit 0 |
|
4098 |
EOF |
|
4099 |
} |
|
4100 |
||
4101 |
mondo_loop() { |
|
4102 |
typeset pkgroot |
|
4103 |
typeset pkg |
|
4104 |
root=$1 |
|
4105 |
zone=$2 |
|
4106 |
||
4107 |
# If the archives being installed contain i86pc.boot, |
|
4108 |
# check to see if it contains strap.com, one of the |
|
4109 |
# four possibly-required booters. If i86pc.boot does, |
|
4110 |
# try to upgrade the realmode booters from the current |
|
4111 |
# archive set. |
|
4112 |
# |
|
4113 |
# Don't bother doing the upgrade for diskless bfu, as the boot |
|
4114 |
# will be done with floppy or PXE, which must match the build |
|
4115 |
# anyway (floppy must match or add_install_client must be |
|
4116 |
# rerun), and in any event we can't touch the boot bits |
|
4117 |
# for diskless boot from here. Also don't do this for |
|
4118 |
# any zone but 'global'. |
|
4119 |
||
4120 |
cd $root || fail "Cannot cd $root" |
|
4121 |
rootprefix=${root%/} |
|
4122 |
||
4123 |
if [ "$karch" = "i86pc" -a "$diskless" = "no" -a "$zone" = "global" ] |
|
4124 |
then |
|
4125 |
remove_properties |
|
4126 |
if boot_is_upgradeable $root && \ |
|
4127 |
[ -f $cpiodir/i86pc.boot$ZFIX ] && \ |
|
4128 |
$ZCAT $cpiodir/i86pc.boot$ZFIX | cpio -it | \ |
|
4129 |
grep strap.com >/dev/null 2>&1 ; then |
|
4130 |
check_multi_to_dca_boot |
|
4131 |
print "\nUpdating realmode boot loaders\n" |
|
4132 |
update_realmode_booters $root |
|
4133 |
setup_pboot |
|
4134 |
fi |
|
4135 |
if [ $multiboot_archives = yes ]; then |
|
4136 |
check_dca_to_multiboot |
|
4137 |
if [ $is_pcfs_boot = yes ]; then |
|
4138 |
setup_stubboot |
|
4139 |
fi |
|
4140 |
fi |
|
4141 |
fi |
|
4142 |
||
4143 |
SECONDS=0 # time each iteration |
|
4144 |
||
4145 |
print "\nSaving configuration files in $rootprefix/bfu.child ... \c" |
|
4146 |
cd $root |
|
4147 |
rm -rf bfu.default bfu.restore # historical |
|
4148 |
rm -rf bfu.child bfu.conflicts |
|
4149 |
mkdir bfu.child bfu.conflicts |
|
4150 |
filelist $zone | cpio -pdmu bfu.child || \ |
|
4151 |
fail 'failed to save config files' |
|
4152 |
test -f etc/motd && mv etc/motd etc/motd.old |
|
4153 |
||
4154 |
# |
|
4155 |
# If the var/sadm/system/admin/INST_RELEASE file still exists, |
|
4156 |
# this system has never been bfu'd before. Therefore, the |
|
4157 |
# information in var/sadm/install/contents is still valid and |
|
4158 |
# can be used to determine whether files have been modified |
|
4159 |
# since installation (the bfu.ancestors directory serves this |
|
4160 |
# purpose for systems that have already been bfu'd.) |
|
4161 |
# |
|
4162 |
if [ -f var/sadm/system/admin/INST_RELEASE ] ; then |
|
4163 |
firstbfu=yes |
|
4164 |
else |
|
4165 |
firstbfu=no |
|
4166 |
fi |
|
4167 |
||
4168 |
# |
|
4169 |
# bfu'ed systems are not upgradeable; prevent suninstall from |
|
4170 |
# even *presenting* the upgrade option by removing INST_RELEASE. |
|
4171 |
# |
|
4172 |
rm -f var/sadm/system/admin/INST_RELEASE |
|
4173 |
||
4174 |
# |
|
4175 |
# Hacks to work around minor annoyances and make life more pleasant. |
|
4176 |
# Part 1 of 2: pre-archive-extraction stuff |
|
4177 |
# |
|
4178 |
||
4179 |
# |
|
4180 |
# Do not remove remove_initd_links, since this makes sure things |
|
4181 |
# work properly when init scripts are shuffled around. |
|
4182 |
# |
|
4183 |
remove_initd_links |
|
4184 |
||
4185 |
# |
|
4186 |
# Remove rc.d scripts and things made superfluous by smf. |
|
4187 |
# Backwards BFUs will resurrect them from the archives. |
|
4188 |
# |
|
4189 |
smf_cleanup |
|
4190 |
||
4191 |
# |
|
4192 |
# New, enabled-by-default services need to be checked for, such |
|
4193 |
# that their enabled status is not flipped by BFU after their |
|
4194 |
# initial arrival. |
|
4195 |
# |
|
4196 |
smf_handle_new_services |
|
4197 |
||
4198 |
# |
|
4199 |
# Remove obsolete Sun-Fire-880 (daktari) FMA Fault Tree directory |
|
4200 |
# and file. Backwards BFUs will resurrect them from the archives. |
|
4201 |
# |
|
4202 |
if [ $target_isa = sparc ]; then |
|
4203 |
rm -rf $usr/platform/SUNW,Sun-Fire-880/lib/fm |
|
4204 |
fi |
|
4205 |
||
4206 |
# |
|
4207 |
# Remove old FMA dictionary files |
|
4208 |
# |
|
4209 |
rm -f $usr/lib/fm/FMD.dict |
|
4210 |
rm -f $usr/lib/fm/SUN4U.dict |
|
4211 |
rm -f $usr/lib/fm/SUNOS.dict |
|
4212 |
||
4213 |
# |
|
4214 |
# Remove old FMA .eft files and directories |
|
4215 |
# |
|
4216 |
rm -f $usr/platform/sun4u/lib/fm/eft/pci-sun4u.eft |
|
4217 |
rm -rf $usr/platform/SUNW,Serverblade1/lib/fm |
|
4218 |
rm -rf $usr/platform/SUNW,Sun-Fire/lib/fm |
|
4219 |
rm -rf $usr/platform/SUNW,Sun-Fire-15000/lib/fm |
|
4220 |
||
4221 |
# |
|
4222 |
# Remove obsolete buildmnttab script. Backwards BFUs will |
|
4223 |
# resurrect it by extracting it from the archives. |
|
4224 |
# |
|
4225 |
rm -f $root/etc/init.d/buildmnttab |
|
4226 |
rm -f $root/etc/rcS.d/S70buildmnttab.sh |
|
4227 |
||
4228 |
# |
|
4229 |
# Break-up of inetsvc, inetinit & network -- remove both the old |
|
4230 |
# and new init scripts. The correct ones will be extracted from |
|
4231 |
# the archives whether bfu'ing backwards or forwards. |
|
4232 |
# |
|
4233 |
# old: need to remove going forwards: |
|
4234 |
# |
|
4235 |
rm -f $root/etc/rc0.d/K42inetsvc |
|
4236 |
rm -f $root/etc/rc1.d/K42inetsvc |
|
4237 |
rm -f $root/etc/rcS.d/K42inetsvc |
|
4238 |
rm -f $root/etc/rcS.d/S29network.sh |
|
4239 |
# |
|
4240 |
# new: need to remove going backwards: |
|
4241 |
# |
|
4242 |
rm -f $root/etc/init.d/domainname |
|
4243 |
rm -f $root/etc/init.d/inetd |
|
4244 |
rm -f $root/etc/init.d/named |
|
4245 |
rm -f $root/etc/init.d/nodename |
|
4246 |
rm -f $root/etc/rc0.d/K40inetd |
|
4247 |
rm -f $root/etc/rc0.d/K42named |
|
4248 |
rm -f $root/etc/rc1.d/K40inetd |
|
4249 |
rm -f $root/etc/rc1.d/K42named |
|
4250 |
rm -f $root/etc/rc2.d/S69domainname |
|
4251 |
rm -f $root/etc/rc2.d/S72named |
|
4252 |
rm -f $root/etc/rc2.d/S77inetd |
|
4253 |
rm -f $root/etc/rcS.d/K40inetd |
|
4254 |
rm -f $root/etc/rcS.d/K42named |
|
4255 |
rm -f $root/etc/rcS.d/S28network.sh |
|
4256 |
rm -f $root/etc/rcS.d/S29nodename.sh |
|
4257 |
||
4258 |
# |
|
4259 |
# Remove Zones init scripts: they will be extracted properly |
|
4260 |
# going forwards; after going backwards, they will be gone, |
|
4261 |
# thus preventing scary warnings on subsequent bfu's. |
|
4262 |
# |
|
4263 |
rm -f $root/etc/init.d/zones |
|
4264 |
rm -f $root/etc/rc0.d/K01zones |
|
4265 |
rm -f $root/etc/rc1.d/K01zones |
|
4266 |
rm -f $root/etc/rc2.d/K01zones |
|
4267 |
rm -f $root/etc/rc3.d/S99zones |
|
4268 |
rm -f $root/etc/rcS.d/K01zones |
|
4269 |
||
4270 |
# |
|
4271 |
# Remove <inet>6 STREAMS modules; these no longer exist (and |
|
4272 |
# should never have existed in the first place). |
|
4273 |
# |
|
4274 |
rm -f $root/kernel/strmod/icmp6 \ |
|
4275 |
$root/kernel/strmod/ip6 \ |
|
4276 |
$root/kernel/strmod/tcp6 \ |
|
4277 |
$root/kernel/strmod/udp6 \ |
|
4278 |
||
4279 |
rm -f $root/kernel/strmod/sparcv9/icmp6 \ |
|
4280 |
$root/kernel/strmod/sparcv9/ip6 \ |
|
4281 |
$root/kernel/strmod/sparcv9/tcp6 \ |
|
4282 |
$root/kernel/strmod/sparcv9/udp6 \ |
|
4283 |
||
4284 |
# |
|
4285 |
# Remove /usr/lib/old_libthread since support for it has |
|
4286 |
# been removed from the kernel in Solaris 10. If this is |
|
4287 |
# a backwards BFU, it will all be extracted again by cpio. |
|
4288 |
rm -rf $usr/lib/old_libthread |
|
4289 |
||
4290 |
# Remove libconfig |
|
4291 |
rm -f $usr/lib/drv/config_md.so.1 |
|
4292 |
rm -f $usr/include/config_md.h |
|
4293 |
# remove libssd |
|
4294 |
rm -f $usr/lib/libssd.a |
|
4295 |
rm -f $usr/lib/libssd.so |
|
4296 |
rm -f $usr/lib/libssd.so.1 |
|
4297 |
# remove libap |
|
4298 |
rm -f $usr/lib/libap_dmd.a |
|
4299 |
rm -f $usr/lib/libap_dmd.so.1 |
|
4300 |
# remove libintpos |
|
4301 |
rm -f $usr/lib/libintpos.a |
|
4302 |
rm -f $usr/lib/libintpos.so.1 |
|
4303 |
||
4304 |
# Remove obsolete abi subdirectories |
|
4305 |
if [ -d $usr/platform/*/lib/abi ]; then |
|
4306 |
rm -rf $usr/platform/*/lib/abi |
|
4307 |
fi |
|
4308 |
rm -rf $usr/lib/gss/abi |
|
4309 |
rm -rf $usr/lib/krb5/abi |
|
4310 |
rm -rf $usr/xpg4/lib/abi |
|
4311 |
rm -rf $usr/ucblib/abi |
|
4312 |
||
4313 |
# |
|
4314 |
# Remove old stuff related to libthread now that libthread has |
|
4315 |
# been folded into libc and libthread_db has been renamed libc_db. |
|
4316 |
# In addition, all the apptrace's tracing libraries (i.e., abi_*.so*) |
|
4317 |
# are no longer needed, should be removed. |
|
4318 |
rm -f \ |
|
4319 |
$usr/lib/mdb/proc/libthread.so \ |
|
4320 |
$usr/lib/mdb/proc/sparcv9/libthread.so \ |
|
4321 |
$usr/lib/abi/abi_*.so* \ |
|
4322 |
$usr/lib/abi/sparcv9/abi_*.so* |
|
4323 |
||
4324 |
# |
|
4325 |
# Remove the old symlink /lib => usr/lib, if necessary. |
|
4326 |
# /lib is now a real directory in the root filesystem. |
|
4327 |
# Remove all of the old static libraries and commands now |
|
4328 |
# that we no longer build them. If this is a backwards |
|
4329 |
# BFU, all this will all be extracted again by cpio. |
|
4330 |
rm $root/lib 2>/dev/null |
|
4331 |
rm -rf $usr/lib/pics |
|
4332 |
rm -rf $usr/sbin/static |
|
4333 |
rm -f \ |
|
4334 |
$usr/ccs/lib/libcurses.a \ |
|
4335 |
$usr/ccs/lib/libform.a \ |
|
4336 |
$usr/ccs/lib/libgen.a \ |
|
4337 |
$usr/ccs/lib/libl.a \ |
|
4338 |
$usr/ccs/lib/libmalloc.a \ |
|
4339 |
$usr/ccs/lib/libmenu.a \ |
|
4340 |
$usr/ccs/lib/libpanel.a \ |
|
4341 |
$usr/ccs/lib/libtermcap.a \ |
|
4342 |
$usr/ccs/lib/libtermlib.a \ |
|
4343 |
$usr/ccs/lib/liby.a \ |
|
4344 |
$usr/lib/lib300.a \ |
|
4345 |
$usr/lib/lib300s.a \ |
|
4346 |
$usr/lib/lib4014.a \ |
|
4347 |
$usr/lib/lib450.a \ |
|
4348 |
$usr/lib/libTL.a \ |
|
4349 |
$usr/lib/libadm.a \ |
|
4350 |
$usr/lib/libadt_jni.a \ |
|
4351 |
$usr/lib/libbsdmalloc.a \ |
|
4352 |
$usr/lib/libbsm.a \ |
|
4353 |
$usr/lib/libc.a \ |
|
4354 |
$usr/lib/libc2.a \ |
|
4355 |
$usr/lib/libc2stubs.a \ |
|
4356 |
$usr/lib/libcmd.a \ |
|
4357 |
$usr/lib/libcrypt.a \ |
|
4358 |
$usr/lib/libcrypt_d.a \ |
|
4359 |
$usr/lib/libcrypt_i.a \ |
|
4360 |
$usr/lib/libcurses.a \ |
|
4361 |
$usr/lib/libdevid.a \ |
|
4362 |
$usr/lib/libdevinfo.a \ |
|
4363 |
$usr/lib/libdhcpagent.a \ |
|
4364 |
$usr/lib/libdhcputil.a \ |
|
4365 |
$usr/lib/libdl_stubs.a \ |
|
4366 |
$usr/lib/libefi.a \ |
|
4367 |
$usr/lib/libelf.a \ |
|
4368 |
$usr/lib/libform.a \ |
|
4369 |
$usr/lib/libgen.a \ |
|
4370 |
$usr/lib/libgenIO.a \ |
|
4371 |
$usr/lib/libike.a \ |
|
4372 |
$usr/lib/libinetcfg.a \ |
|
4373 |
$usr/lib/libinetutil.a \ |
|
4374 |
$usr/lib/libintl.a \ |
|
4375 |
$usr/lib/libkstat.a \ |
|
4376 |
$usr/lib/libl.a \ |
|
4377 |
$usr/lib/libldfeature.a \ |
|
4378 |
$usr/lib/libmail.a \ |
|
4379 |
$usr/lib/libmalloc.a \ |
|
4380 |
$usr/lib/libmapmalloc.a \ |
|
4381 |
$usr/lib/libmenu.a \ |
|
4382 |
$usr/lib/libmeta.a \ |
|
4383 |
$usr/lib/libmp.a \ |
|
4384 |
$usr/lib/libnisdb.a \ |
|
4385 |
$usr/lib/libnls.a \ |
|
4386 |
$usr/lib/libnsl.a \ |
|
4387 |
$usr/lib/libnss_compat.a \ |
|
4388 |
$usr/lib/libnss_dns.a \ |
|
4389 |
$usr/lib/libnss_files.a \ |
|
4390 |
$usr/lib/libnss_nis.a \ |
|
4391 |
$usr/lib/libnss_nisplus.a \ |
|
4392 |
$usr/lib/libp/libc.a \ |
|
4393 |
$usr/lib/libpam.a \ |
|
4394 |
$usr/lib/libpanel.a \ |
|
4395 |
$usr/lib/libplot.a \ |
|
4396 |
$usr/lib/librac.a \ |
|
4397 |
$usr/lib/libresolv.a \ |
|
4398 |
$usr/lib/librpcsvc.a \ |
|
4399 |
$usr/lib/libsec.a \ |
|
4400 |
$usr/lib/libsendfile.a \ |
|
4401 |
$usr/lib/libsocket.a \ |
|
4402 |
$usr/lib/libstraddr.a \ |
|
4403 |
$usr/lib/libtermcap.a \ |
|
4404 |
$usr/lib/libtermlib.a \ |
|
4405 |
$usr/lib/libuuid.a \ |
|
4406 |
$usr/lib/libvolmgt.a \ |
|
4407 |
$usr/lib/libvt0.a \ |
|
4408 |
$usr/lib/libw.a \ |
|
4409 |
$usr/lib/liby.a \ |
|
4410 |
$usr/lib/null.a \ |
|
4411 |
$usr/lib/sparcv9/libadt_jni.a \ |
|
4412 |
$usr/lib/sparcv9/libinetutil.a \ |
|
4413 |
$usr/lib/sparcv9/libldfeature.a \ |
|
4414 |
$usr/lib/sparcv9/libsendfile.a \ |
|
4415 |
$usr/platform/sun4u/lib/libwrsmconf.a \ |
|
4416 |
$usr/ucblib/libcurses.a \ |
|
4417 |
$usr/ucblib/libdbm.a \ |
|
4418 |
$usr/ucblib/libtermcap.a \ |
|
4419 |
$usr/ucblib/libucb.a |
|
4420 |
||
4421 |
# |
|
4422 |
# Remove other obsolete files, too |
|
4423 |
rm -f \ |
|
4424 |
$usr/include/table.h \ |
|
4425 |
$usr/include/libgenIO.h \ |
|
4426 |
$usr/lib/llib-lTL \ |
|
4427 |
$usr/lib/llib-lTL.ln |
|
4428 |
||
4429 |
# |
|
4430 |
# libc_psr.so.1 and libmd5_psr.so.1 have been moved |
|
4431 |
# from /usr/platform/*/lib to /platform/*/lib. |
|
4432 |
# Remove the old files and their containing directories |
|
4433 |
rm -f $usr/platform/*/lib/libc_psr.so.1 |
|
4434 |
rm -f $usr/platform/*/lib/sparcv9/libc_psr.so.1 |
|
4435 |
rm -f $usr/platform/*/lib/libmd5_psr.so.1 |
|
4436 |
rm -f $usr/platform/*/lib/sparcv9/libmd5_psr.so.1 |
|
4437 |
rmdir $usr/platform/*/lib/sparcv9 2>/dev/null |
|
4438 |
rmdir $usr/platform/*/lib 2>/dev/null |
|
4439 |
||
4440 |
# |
|
4441 |
# Remove obsolete profile libc symlinks |
|
4442 |
rm -f $usr/lib/libp/libc.so |
|
4443 |
rm -f $usr/lib/libp/sparcv9/libc.so |
|
4444 |
||
4445 |
# |
|
4446 |
# Remove Legacy DR files, now obsolete due to NGDR Phase II putback |
|
4447 |
# |
|
4448 |
STARFIRE_PLAT=platform/SUNW,Ultra-Enterprise-10000 |
|
4449 |
rm -f \ |
|
4450 |
$root/$STARFIRE_PLAT/kernel/drv/dr \ |
|
4451 |
$root/$STARFIRE_PLAT/kernel/drv/dr.conf \ |
|
4452 |
$root/$STARFIRE_PLAT/kernel/misc/drmach \ |
|
4453 |
$root/$STARFIRE_PLAT/kernel/drv/sparcv9/dr \ |
|
4454 |
$root/$STARFIRE_PLAT/kernel/misc/sparcv9/drmach \ |
|
4455 |
$root/$STARFIRE_PLAT/lib/dr_daemon \ |
|
4456 |
$usr/platform/sun4u/include/sys/dr.h \ |
|
4457 |
$usr/platform/sun4u/include/sys/sfdr.h |
|
4458 |
||
4459 |
# Solstice Enterprise Agent(SEA) : mib-II subagent mibiisa |
|
4460 |
# needs to be disabled during startup. SMA(System Management Agent) |
|
4461 |
# has the capability to support mib-II requests. |
|
4462 |
# The correct ones will be extracted from |
|
4463 |
# the archives whether bfu'ing backwards or forwards. |
|
4464 |
# |
|
4465 |
# old: need to remove going forwards: |
|
4466 |
rm -f $root/etc/snmp/conf/mibiisa.rsrc |
|
4467 |
# |
|
4468 |
# new: need to remove going backwards: |
|
4469 |
rm -f $root/etc/snmp/conf/mibiisa.rsrc- |
|
4470 |
||
4471 |
# |
|
4472 |
# Remove /dev/mc symlink and /platform/sun4u/kernel/drv/mc-us3.conf |
|
4473 |
# if any. |
|
4474 |
# |
|
4475 |
if [ -h $root/dev/mc ]; then |
|
4476 |
rm -f $root/dev/mc |
|
4477 |
fi |
|
4478 |
||
4479 |
if [ -f $root/platform/sun4u/kernel/drv/mc-us3.conf ]; then |
|
4480 |
rm -f $root/platform/sun4u/kernel/drv/mc-us3.conf |
|
4481 |
fi |
|
4482 |
||
4483 |
# |
|
4484 |
# Remove the snowbird sbin and include symlinks |
|
4485 |
# |
|
4486 |
||
4487 |
if [[ -h $usr/platform/SUNW,Netra-CP2300/sbin ]] ; then |
|
4488 |
rm -f $usr/platform/SUNW,Netra-CP2300/sbin |
|
4489 |
fi |
|
4490 |
||
4491 |
if [[ -h $usr/platform/SUNW,Netra-CP2300/include ]] ; then |
|
4492 |
rm -f $usr/platform/SUNW,Netra-CP2300/include |
|
4493 |
fi |
|
4494 |
||
4495 |
# If we still have the old lp(7D) driver, remove it and its symlinks |
|
4496 |
# and header file. (If driver already gone, don't trample new symlinks.) |
|
4497 |
# |
|
4498 |
if [ -f $root/platform/i86pc/kernel/drv/lp -a \ |
|
4499 |
-h $root/dev/lp[012] ]; then |
|
4500 |
rm -f $root/dev/lp[012] |
|
4501 |
fi |
|
4502 |
rm -f $root/platform/i86pc/kernel/drv/lp.conf |
|
4503 |
rm -f $root/platform/i86pc/kernel/drv/lp |
|
4504 |
rm -f $root/usr/include/sys/lp.h |
|
4505 |
||
4506 |
# |
|
4507 |
# Remove V880 CPU DR files, program cancelled |
|
4508 |
# |
|
4509 |
DAKTARI_PLAT=platform/SUNW,Sun-Fire-880 |
|
4510 |
rm -f \ |
|
4511 |
$root/$DAKTARI_PLAT/kernel/drv/gptwo.conf \ |
|
4512 |
$root/$DAKTARI_PLAT/kernel/drv/sparcv9/bbc \ |
|
4513 |
$root/$DAKTARI_PLAT/kernel/drv/sparcv9/gptwo \ |
|
4514 |
$root/$DAKTARI_PLAT/kernel/misc/sparcv9/sbdp \ |
|
4515 |
$usr/platform/sun4u/include/sys/sbdp.h |
|
4516 |
||
4517 |
# |
|
4518 |
# Remove crash(1M), now obsoleted by mdb(1). If this is a backwards |
|
4519 |
# BFU, it will be extracted again by cpio. |
|
4520 |
# |
|
4521 |
rm -f $root/etc/crash $usr/sbin/crash $usr/sbin/i86/crash \ |
|
4522 |
$usr/sbin/sparcv7/crash $usr/sbin/sparcv9/crash |
|
4523 |
||
4524 |
# |
|
4525 |
# Remove kadb(1M), now obsoleted by kmdb(1M) |
|
4526 |
# |
|
4527 |
rm -f $root/platform/*/kadb |
|
4528 |
||
4529 |
# |
|
4530 |
# Remove old platform dmod symlinks |
|
4531 |
# |
|
4532 |
for dir in $usr/platform/*/lib/mdb ; do |
|
4533 |
[[ -h $dir ]] && rm -f $dir |
|
4534 |
done |
|
4535 |
||
4536 |
# |
|
4537 |
# Remove ADB macros |
|
4538 |
# |
|
4539 |
rm -fr $usr/lib/adb |
|
4540 |
||
4541 |
for dir in $usr/platform/*/lib/adb ; do |
|
4542 |
rm -fr $dir |
|
4543 |
done |
|
4544 |
||
4545 |
# |
|
4546 |
# Remove the SGENV driver from the Sun-Fire directory structure. |
|
4547 |
# If this is a backwards BFU, it will be extracted again by cpio. |
|
4548 |
# |
|
4549 |
SERENGETI_PLAT=platform/SUNW,Sun-Fire |
|
4550 |
rm -f $root/$SERENGETI_PLAT/kernel/drv/sgenv.conf \ |
|
4551 |
$root/$SERENGETI_PLAT/kernel/drv/sparcv9/sgenv |
|
4552 |
||
4553 |
# |
|
4554 |
# Remove sun4m |
|
4555 |
# |
|
4556 |
rm -rf $root/platform/sun4m |
|
4557 |
rm -rf $usr/platform/sun4m |
|
4558 |
if [ $target_isa = sparc ]; then |
|
4559 |
rm -f $root/kernel/genunix |
|
4560 |
fi |
|
4561 |
rm -f $root/kernel/drv/xbox |
|
4562 |
rm -f $usr/include/sys/comvec.h |
|
4563 |
rm -f $usr/include/sys/openprom.h |
|
4564 |
rm -f $usr/include/sys/cg14io.h |
|
4565 |
rm -f $usr/include/sys/cg14reg.h |
|
4566 |
rm -f $usr/include/sys/cg8reg.h |
|
4567 |
rm -f $usr/include/sys/cg8var.h |
|
4568 |
||
4569 |
# |
|
4570 |
# Remove perl 5.005_03. If this is a backwards bfu, |
|
4571 |
# it will be extracted again by cpio. |
|
4572 |
# |
|
4573 |
if [[ -d $usr/perl5/5.00503 ]]; then |
|
4574 |
remove_perl_500503 |
|
4575 |
fi |
|
4576 |
||
4577 |
# |
|
4578 |
# Remove perl 5.8.3, but only if the generic.usr archive contains 5.8.4. |
|
4579 |
# If this is a backwards bfu, 5.8.3 will be extracted again by cpio. |
|
4580 |
# |
|
4581 |
if [[ -d $usr/perl5/5.8.3 ]] && $ZCAT $cpiodir/generic.usr$ZFIX | \ |
|
4582 |
cpio -it 2>/dev/null | egrep -s '^usr/perl5/5.8.4/'; then |
|
4583 |
remove_perl_583 |
|
4584 |
fi |
|
4585 |
||
4586 |
# |
|
4587 |
# Clean up legacy versions of the FMA CPU/Mem DE which may be still |
|
4588 |
# be laying around. This check may be removed when a sufficient time |
|
4589 |
# has lapsed between the FMA putback as to ensure that no test machines |
|
4590 |
# still have development FMA bits. |
|
4591 |
# |
|
4592 |
for platdir in $usr/platform/SUNW,* ; do |
|
4593 |
[[ -h $platdir ]] && continue |
|
4594 |
||
4595 |
rm -f $platdir/lib/fm/fmd/plugins/cpumem-diagnosis.so |
|
4596 |
rm -f $platdir/lib/fm/fmd/plugins/cpumem-diagnosis.conf |
|
4597 |
done |
|
4598 |
||
4599 |
# Remove pam_unix |
|
4600 |
# |
|
4601 |
rm -f $usr/lib/security/pam_unix.so.1 |
|
4602 |
rm -f $usr/lib/security/pam_unix.so |
|
4603 |
rm -f $usr/lib/security/sparcv9/pam_unix.so.1 |
|
4604 |
rm -f $usr/lib/security/sparcv9/pam_unix.so |
|
4605 |
||
4606 |
# |
|
4607 |
# Remove libldap.so.3 |
|
4608 |
# |
|
4609 |
rm -f $usr/lib/libldap.so.3 |
|
4610 |
rm -f $usr/lib/sparcv9/libldap.so.3 |
|
4611 |
||
4612 |
# |
|
4613 |
# Remove nss XFN support no longer used by printing |
|
4614 |
# |
|
4615 |
sed -e '/printers:/s/xfn[ ]*//' \ |
|
4616 |
$rootprefix/bfu.child/etc/nsswitch.conf > /tmp/nssw.$$ |
|
4617 |
cp /tmp/nssw.$$ $rootprefix/bfu.child/etc/nsswitch.conf |
|
4618 |
rm -f /tmp/nssw.$$ |
|
4619 |
rm -f $usr/lib/nss_xfn.so.1 |
|
4620 |
rm -f $usr/lib/sparcv9/nss_xfn.so.1 |
|
4621 |
||
4622 |
# |
|
4623 |
# Remove FNS/XFN. |
|
4624 |
# |
|
4625 |
if [ -d $rootprefix/etc/fn -o \ |
|
4626 |
-d $usr/include/xfn -o \ |
|
4627 |
-d $usr/lib/fn -o \ |
|
4628 |
-d $rootprefix/var/fn ]; then |
|
4629 |
remove_eof_fns |
|
4630 |
fi |
|
4631 |
||
4632 |
# |
|
4633 |
# Remove BIND 8, but only if the generic.usr archive doesn't contains |
|
4634 |
# BIND 8 named server/tools. If this is a backwards bfu, BIND 8 will |
|
4635 |
# be extracted again by cpio. |
|
4636 |
# |
|
4637 |
if [[ -f $usr/sbin/dnskeygen ]] && ! $ZCAT $cpiodir/generic.usr$ZFIX \ |
|
4638 |
| cpio -it 2>/dev/null | egrep -s '^usr/sbin/ndc' ; then |
|
4639 |
remove_eof_bind8 |
|
4640 |
fi |
|
4641 |
||
4642 |
# |
|
4643 |
# Remove any sendmailvars: line from /etc/nsswitch.conf |
|
4644 |
# |
|
4645 |
sed -e '/^sendmailvars:/d' $rootprefix/bfu.child/etc/nsswitch.conf > \ |
|
4646 |
/tmp/nssw.$$ |
|
4647 |
cp /tmp/nssw.$$ $rootprefix/bfu.child/etc/nsswitch.conf |
|
4648 |
rm -f /tmp/nssw.$$ |
|
4649 |
||
4650 |
# |
|
4651 |
# Remove SUNWcoff package |
|
4652 |
# |
|
4653 |
pkgroot=${rootprefix:+-R $rootprefix} |
|
4654 |
pkg=SUNWcoff |
|
4655 |
if [ $target_isa = i386 ]; then |
|
4656 |
if pkginfo $pkgroot -q $pkg; then |
|
4657 |
pkgrm $pkgroot -n $pkg >/dev/null 2>&1 |
|
4658 |
fi |
|
4659 |
||
4660 |
# In case that did not work, do it manually. |
|
4661 |
if [ -d $rootprefix/var/sadm/pkg/$pkg ]; then |
|
4662 |
rm -rf $rootprefix/var/sadm/pkg/$pkg |
|
4663 |
rm $rootprefix/kernel/exec/coffexec |
|
4664 |
fi |
|
4665 |
fi |
|
4666 |
||
4667 |
# |
|
4668 |
# Remove GMT* zoneinfo files |
|
4669 |
# |
|
4670 |
rm -f $usr/share/lib/zoneinfo/GMT-12 |
|
4671 |
rm -f $usr/share/lib/zoneinfo/GMT-11 |
|
4672 |
rm -f $usr/share/lib/zoneinfo/GMT-10 |
|
4673 |
rm -f $usr/share/lib/zoneinfo/GMT-9 |
|
4674 |
rm -f $usr/share/lib/zoneinfo/GMT-8 |
|
4675 |
rm -f $usr/share/lib/zoneinfo/GMT-7 |
|
4676 |
rm -f $usr/share/lib/zoneinfo/GMT-6 |
|
4677 |
rm -f $usr/share/lib/zoneinfo/GMT-5 |
|
4678 |
rm -f $usr/share/lib/zoneinfo/GMT-4 |
|
4679 |
rm -f $usr/share/lib/zoneinfo/GMT-3 |
|
4680 |
rm -f $usr/share/lib/zoneinfo/GMT-2 |
|
4681 |
rm -f $usr/share/lib/zoneinfo/GMT-1 |
|
4682 |
rm -f $usr/share/lib/zoneinfo/GMT+1 |
|
4683 |
rm -f $usr/share/lib/zoneinfo/GMT+2 |
|
4684 |
rm -f $usr/share/lib/zoneinfo/GMT+3 |
|
4685 |
rm -f $usr/share/lib/zoneinfo/GMT+4 |
|
4686 |
rm -f $usr/share/lib/zoneinfo/GMT+5 |
|
4687 |
rm -f $usr/share/lib/zoneinfo/GMT+6 |
|
4688 |
rm -f $usr/share/lib/zoneinfo/GMT+7 |
|
4689 |
rm -f $usr/share/lib/zoneinfo/GMT+8 |
|
4690 |
rm -f $usr/share/lib/zoneinfo/GMT+9 |
|
4691 |
rm -f $usr/share/lib/zoneinfo/GMT+10 |
|
4692 |
rm -f $usr/share/lib/zoneinfo/GMT+11 |
|
4693 |
rm -f $usr/share/lib/zoneinfo/GMT+12 |
|
4694 |
rm -f $usr/share/lib/zoneinfo/GMT+13 |
|
4695 |
||
4696 |
# Remove stc(7d)-related files |
|
4697 |
rm -f $usr/include/sys/stcio.h |
|
4698 |
rm -f $usr/include/sys/stcvar.h |
|
4699 |
rm -f $usr/include/sys/stcreg.h |
|
4700 |
rm -f $usr/include/sys/stcconf.h |
|
4701 |
SUN4U_DRV=platform/sun4u/kernel/drv |
|
4702 |
rm -f $rootprefix/$SUN4U_DRV/stc.conf |
|
4703 |
rm -f $rootprefix/$SUN4U_DRV/stc |
|
4704 |
rm -f $rootprefix/$SUN4U_DRV/sparcv9/stc |
|
4705 |
||
4706 |
# Remove old CPC adb macros. |
|
4707 |
rm -f $usr/lib/adb/cpc_ctx |
|
4708 |
rm -f $usr/lib/adb/cpc_event |
|
4709 |
if [ $target_isa = sparc ]; then |
|
4710 |
rm -f $usr/lib/adb/sparcv9/cpc_ctx |
|
4711 |
rm -f $usr/lib/adb/sparcv9/cpc_event |
|
4712 |
fi; |
|
4713 |
||
4714 |
# Remove obsolete DTrace demos |
|
4715 |
rm -f $usr/demo/dtrace/cputick.d |
|
4716 |
||
4717 |
# Remove flashprom-related files. |
|
4718 |
if [ $target_isa = sparc ]; then |
|
4719 |
for x in $FLASHPROMLIST |
|
4720 |
do |
|
4721 |
rm -f $root/$x; |
|
4722 |
done |
|
4723 |
fi; |
|
4724 |
||
4725 |
if [ $RM_32BIT_KERNEL -eq 1 -a $zone = global ]; |
|
4726 |
then |
|
4727 |
print "Removing 32-bit commands and kernel binaries ... \c"; |
|
4728 |
rm -rf \ |
|
4729 |
$usr/bin/sparcv7/amt \ |
|
4730 |
$usr/bin/sparcv7/cputrack \ |
|
4731 |
$usr/bin/sparcv7/newtask \ |
|
4732 |
$usr/bin/sparcv7/nohup \ |
|
4733 |
$usr/bin/sparcv7/pargs \ |
|
4734 |
$usr/bin/sparcv7/pcred \ |
|
4735 |
$usr/bin/sparcv7/pfiles \ |
|
4736 |
$usr/bin/sparcv7/pflags \ |
|
4737 |
$usr/bin/sparcv7/pldd \ |
|
4738 |
$usr/bin/sparcv7/plimit \ |
|
4739 |
$usr/bin/sparcv7/pmap \ |
|
4740 |
$usr/bin/sparcv7/ppgsz \ |
|
4741 |
$usr/bin/sparcv7/ppriv \ |
|
4742 |
$usr/bin/sparcv7/prctl \ |
|
4743 |
$usr/bin/sparcv7/preap \ |
|
4744 |
$usr/bin/sparcv7/prex \ |
|
4745 |
$usr/bin/sparcv7/prstat \ |
|
4746 |
$usr/bin/sparcv7/prun \ |
|
4747 |
$usr/bin/sparcv7/ps \ |
|
4748 |
$usr/bin/sparcv7/psig \ |
|
4749 |
$usr/bin/sparcv7/pstack \ |
|
4750 |
$usr/bin/sparcv7/pstop \ |
|
4751 |
$usr/bin/sparcv7/ptime \ |
|
4752 |
$usr/bin/sparcv7/ptree \ |
|
4753 |
$usr/bin/sparcv7/pwait \ |
|
4754 |
$usr/bin/sparcv7/pwdx \ |
|
4755 |
$usr/bin/sparcv7/setuname \ |
|
4756 |
$usr/bin/sparcv7/sort \ |
|
4757 |
$usr/bin/sparcv7/tnfxtract \ |
|
4758 |
$usr/bin/sparcv7/uptime \ |
|
4759 |
$usr/bin/sparcv7/w \ |
|
4760 |
$usr/sbin/sparcv7/intrstat \ |
|
4761 |
$usr/sbin/sparcv7/lockstat \ |
|
4762 |
$usr/sbin/sparcv7/prtconf \ |
|
4763 |
$usr/sbin/sparcv7/swap \ |
|
4764 |
$usr/sbin/sparcv7/sysdef \ |
|
4765 |
$usr/sbin/sparcv7/whodo \ |
|
4766 |
$root/kernel/dacf/consconfig_dacf \ |
|
4767 |
$root/kernel/drv/arp \ |
|
4768 |
$root/kernel/drv/audiocs \ |
|
4769 |
$root/kernel/drv/audioens \ |
|
4770 |
$root/kernel/drv/bofi \ |
|
4771 |
$root/kernel/drv/bpp \ |
|
4772 |
$root/kernel/drv/clone \ |
|
4773 |
$root/kernel/drv/cn \ |
|
4774 |
$root/kernel/drv/conskbd \ |
|
4775 |
$root/kernel/drv/consms \ |
|
4776 |
$root/kernel/drv/dad \ |
|
4777 |
$root/kernel/drv/dbri \ |
|
4778 |
$root/kernel/drv/devinfo \ |
|
4779 |
$root/kernel/drv/ecpp \ |
|
4780 |
$root/kernel/drv/ehci \ |
|
4781 |
$root/kernel/drv/esp \ |
|
4782 |
$root/kernel/drv/fas \ |
|
4783 |
$root/kernel/drv/fcip \ |
|
4784 |
$root/kernel/drv/fcp \ |
|
4785 |
$root/kernel/drv/fp \ |
|
4786 |
$root/kernel/drv/glm \ |
|
4787 |
$root/kernel/drv/hid \ |
|
4788 |
$root/kernel/drv/hme \ |
|
4789 |
$root/kernel/drv/hubd \ |
|
4790 |
$root/kernel/drv/icmp \ |
|
4791 |
$root/kernel/drv/icmp6 \ |
|
4792 |
$root/kernel/drv/ifp \ |
|
4793 |
$root/kernel/drv/ip \ |
|
4794 |
$root/kernel/drv/ip6 \ |
|
4795 |
$root/kernel/drv/ippctl \ |
|
4796 |
$root/kernel/drv/ipsecah \ |
|
4797 |
$root/kernel/drv/ipsecesp \ |
|
4798 |
$root/kernel/drv/isp \ |
|
4799 |
$root/kernel/drv/iwscn \ |
|
4800 |
$root/kernel/drv/keysock \ |
|
4801 |
$root/kernel/drv/le \ |
|
4802 |
$root/kernel/drv/lebuffer \ |
|
4803 |
$root/kernel/drv/llc1 \ |
|
4804 |
$root/kernel/drv/lofi \ |
|
4805 |
$root/kernel/drv/log \ |
|
4806 |
$root/kernel/drv/md \ |
|
4807 |
$root/kernel/drv/mm \ |
|
4808 |
$root/kernel/drv/mpt \ |
|
4809 |
$root/kernel/drv/nca \ |
|
4810 |
$root/kernel/drv/ohci \ |
|
4811 |
$root/kernel/drv/openeepr \ |
|
4812 |
$root/kernel/drv/options \ |
|
4813 |
$root/kernel/drv/pcata \ |
|
4814 |
$root/kernel/drv/pcelx \ |
|
4815 |
$root/kernel/drv/pcic \ |
|
4816 |
$root/kernel/drv/pcmem \ |
|
4817 |
$root/kernel/drv/pcram \ |
|
4818 |
$root/kernel/drv/pcs \ |
|
4819 |
$root/kernel/drv/pcser \ |
|
4820 |
$root/kernel/drv/pem \ |
|
4821 |
$root/kernel/drv/pln \ |
|
4822 |
$root/kernel/drv/poll \ |
|
4823 |
$root/kernel/drv/pseudo \ |
|
4824 |
$root/kernel/drv/ptc \ |
|
4825 |
$root/kernel/drv/ptsl \ |
|
4826 |
$root/kernel/drv/qlc \ |
|
4827 |
$root/kernel/drv/random \ |
|
4828 |
$root/kernel/drv/rts \ |
|
4829 |
$root/kernel/drv/sad \ |
|
4830 |
$root/kernel/drv/scsa2usb \ |
|
4831 |
$root/kernel/drv/scsi_vhci \ |
|
4832 |
$root/kernel/drv/sd \ |
|
4833 |
$root/kernel/drv/se \ |
|
4834 |
$root/kernel/drv/ses \ |
|
4835 |
$root/kernel/drv/sgen \ |
|
4836 |
$root/kernel/drv/soc \ |
|
4837 |
$root/kernel/drv/socal \ |
|
4838 |
$root/kernel/drv/spdsock \ |
|
4839 |
$root/kernel/drv/ssd \ |
|
4840 |
$root/kernel/drv/st \ |
|
4841 |
$root/kernel/drv/stp4020 \ |
|
4842 |
$root/kernel/drv/sy \ |
|
4843 |
$root/kernel/drv/sysmsg \ |
|
4844 |
$root/kernel/drv/tcp \ |
|
4845 |
$root/kernel/drv/tcp6 \ |
|
4846 |
$root/kernel/drv/tl \ |
|
4847 |
$root/kernel/drv/uata \ |
|
4848 |
$root/kernel/drv/udp \ |
|
4849 |
$root/kernel/drv/udp6 \ |
|
4850 |
$root/kernel/drv/ugen \ |
|
4851 |
$root/kernel/drv/usb_ac \ |
|
4852 |
$root/kernel/drv/usb_as \ |
|
4853 |
$root/kernel/drv/usb_mid \ |
|
4854 |
$root/kernel/drv/usbprn \ |
|
4855 |
$root/kernel/drv/usbser_edge \ |
|
4856 |
$root/kernel/drv/usoc \ |
|
4857 |
$root/kernel/drv/wc \ |
|
4858 |
$root/kernel/exec/aoutexec \ |
|
4859 |
$root/kernel/exec/elfexec \ |
|
4860 |
$root/kernel/exec/intpexec \ |
|
4861 |
$root/kernel/fs/autofs \ |
|
4862 |
$root/kernel/fs/cachefs \ |
|
4863 |
$root/kernel/fs/devfs \ |
|
4864 |
$root/kernel/fs/fifofs \ |
|
4865 |
$root/kernel/fs/hsfs \ |
|
4866 |
$root/kernel/fs/lofs \ |
|
4867 |
$root/kernel/fs/mntfs \ |
|
4868 |
$root/kernel/fs/nfs \ |
|
4869 |
$root/kernel/fs/procfs \ |
|
4870 |
$root/kernel/fs/sockfs \ |
|
4871 |
$root/kernel/fs/specfs \ |
|
4872 |
$root/kernel/fs/tmpfs \ |
|
4873 |
$root/kernel/fs/udfs \ |
|
4874 |
$root/kernel/fs/ufs \ |
|
4875 |
$root/kernel/ipp/dlcosmk \ |
|
4876 |
$root/kernel/ipp/dscpmk \ |
|
4877 |
$root/kernel/ipp/flowacct \ |
|
4878 |
$root/kernel/ipp/ipgpc \ |
|
4879 |
$root/kernel/ipp/tokenmt \ |
|
4880 |
$root/kernel/ipp/tswtclmt \ |
|
4881 |
$root/kernel/misc/amsrc1 \ |
|
4882 |
$root/kernel/misc/audiosup \ |
|
4883 |
$root/kernel/misc/busra \ |
|
4884 |
$root/kernel/misc/consconfig \ |
|
4885 |
$root/kernel/misc/dada \ |
|
4886 |
$root/kernel/misc/des \ |
|
4887 |
$root/kernel/misc/diaudio \ |
|
4888 |
$root/kernel/misc/fctl \ |
|
4889 |
$root/kernel/misc/fssnap_if \ |
|
4890 |
$root/kernel/misc/gld \ |
|
4891 |
$root/kernel/misc/hidparser \ |
|
4892 |
$root/kernel/misc/hpcsvc \ |
|
4893 |
$root/kernel/misc/ipc \ |
|
4894 |
$root/kernel/misc/kbtrans \ |
|
4895 |
$root/kernel/misc/kgss/do_kmech_krb5 \ |
|
4896 |
$root/kernel/misc/kgss/gl_kmech_krb5 \ |
|
4897 |
$root/kernel/misc/kgssapi \ |
|
4898 |
$root/kernel/misc/klmmod \ |
|
4899 |
$root/kernel/misc/klmops \ |
|
4900 |
$root/kernel/misc/krtld \ |
|
4901 |
$root/kernel/misc/md5 \ |
|
4902 |
$root/kernel/misc/md_hotspares \ |
|
4903 |
$root/kernel/misc/md_mirror \ |
|
4904 |
$root/kernel/misc/md_notify \ |
|
4905 |
$root/kernel/misc/md_raid \ |
|
4906 |
$root/kernel/misc/md_sp \ |
|
4907 |
$root/kernel/misc/md_stripe \ |
|
4908 |
$root/kernel/misc/md_trans \ |
|
4909 |
$root/kernel/misc/mixer \ |
|
4910 |
$root/kernel/misc/mpxio \ |
|
4911 |
$root/kernel/misc/nfs_dlboot \ |
|
4912 |
$root/kernel/misc/nfssrv \ |
|
4913 |
$root/kernel/misc/pcicfg \ |
|
4914 |
$root/kernel/misc/pcihp \ |
|
4915 |
$root/kernel/misc/phx \ |
|
4916 |
$root/kernel/misc/rpcsec \ |
|
4917 |
$root/kernel/misc/rpcsec_gss \ |
|
4918 |
$root/kernel/misc/rsmops \ |
|
4919 |
$root/kernel/misc/scsi \ |
|
4920 |
$root/kernel/misc/seg_drv \ |
|
4921 |
$root/kernel/misc/seg_mapdev \ |
|
4922 |
$root/kernel/misc/sha1 \ |
|
4923 |
$root/kernel/misc/strplumb \ |
|
4924 |
$root/kernel/misc/swapgeneric \ |
|
4925 |
$root/kernel/misc/tlimod \ |
|
4926 |
$root/kernel/misc/ufs_log \ |
|
4927 |
$root/kernel/misc/usba \ |
|
4928 |
$root/kernel/misc/usbser \ |
|
4929 |
$root/kernel/sched/TS \ |
|
4930 |
$root/kernel/sched/TS_DPTBL \ |
|
4931 |
$root/kernel/strmod/6to4tun \ |
|
4932 |
$root/kernel/strmod/arp \ |
|
4933 |
$root/kernel/strmod/atun \ |
|
4934 |
$root/kernel/strmod/authmd5h \ |
|
4935 |
$root/kernel/strmod/authsha1 \ |
|
4936 |
$root/kernel/strmod/bufmod \ |
|
4937 |
$root/kernel/strmod/connld \ |
|
4938 |
$root/kernel/strmod/dedump \ |
|
4939 |
$root/kernel/strmod/drcompat \ |
|
4940 |
$root/kernel/strmod/encr3des \ |
|
4941 |
$root/kernel/strmod/encraes \ |
|
4942 |
$root/kernel/strmod/encrbfsh \ |
|
4943 |
$root/kernel/strmod/encrdes \ |
|
4944 |
$root/kernel/strmod/icmp \ |
|
4945 |
$root/kernel/strmod/ip \ |
|
4946 |
$root/kernel/strmod/ipsecah \ |
|
4947 |
$root/kernel/strmod/ipsecesp \ |
|
4948 |
$root/kernel/strmod/keysock \ |
|
4949 |
$root/kernel/strmod/ldterm \ |
|
4950 |
$root/kernel/strmod/ms \ |
|
4951 |
$root/kernel/strmod/nca \ |
|
4952 |
$root/kernel/strmod/pckt \ |
|
4953 |
$root/kernel/strmod/pfmod \ |
|
4954 |
$root/kernel/strmod/pipemod \ |
|
4955 |
$root/kernel/strmod/ptem \ |
|
4956 |
$root/kernel/strmod/redirmod \ |
|
4957 |
$root/kernel/strmod/rpcmod \ |
|
4958 |
$root/kernel/strmod/rts \ |
|
4959 |
$root/kernel/strmod/tcp \ |
|
4960 |
$root/kernel/strmod/timod \ |
|
4961 |
$root/kernel/strmod/tirdwr \ |
|
4962 |
$root/kernel/strmod/ttcompat \ |
|
4963 |
$root/kernel/strmod/tun \ |
|
4964 |
$root/kernel/strmod/udp \ |
|
4965 |
$root/kernel/strmod/usb_ah \ |
|
4966 |
$root/kernel/strmod/usbkbm \ |
|
4967 |
$root/kernel/strmod/usbms \ |
|
4968 |
$root/kernel/sys/c2audit \ |
|
4969 |
$root/kernel/sys/doorfs \ |
|
4970 |
$root/kernel/sys/inst_sync \ |
|
4971 |
$root/kernel/sys/kaio \ |
|
4972 |
$root/kernel/sys/msgsys \ |
|
4973 |
$root/kernel/sys/nfs \ |
|
4974 |
$root/kernel/sys/pipe \ |
|
4975 |
$root/kernel/sys/pset \ |
|
4976 |
$root/kernel/sys/rpcmod \ |
|
4977 |
$root/kernel/sys/semsys \ |
|
4978 |
$root/kernel/sys/shmsys \ |
|
4979 |
$root/platform/SUNW,Ultra-250/kernel/drv/envctrltwo \ |
|
4980 |
$root/platform/SUNW,Ultra-250/kernel/misc/platmod \ |
|
4981 |
$root/platform/SUNW,Ultra-4/kernel/drv/envctrl \ |
|
4982 |
$root/platform/SUNW,Ultra-4/kernel/misc/platmod \ |
|
4983 |
$root/platform/SUNW,Ultra-5_10/kernel/misc/platmod \ |
|
4984 |
$root/platform/SUNW,Ultra-80/kernel/misc/platmod \ |
|
4985 |
$root/platform/SUNW,Ultra-Enterprise-10000/kernel/cpu/SUNW,UltraSPARC \ |
|
4986 |
$root/platform/SUNW,Ultra-Enterprise-10000/kernel/cpu/SUNW,UltraSPARC-II \ |
|
4987 |
$root/platform/SUNW,Ultra-Enterprise-10000/kernel/drv/cvc \ |
|
4988 |
$root/platform/SUNW,Ultra-Enterprise-10000/kernel/drv/cvcredir \ |
|
4989 |
$root/platform/SUNW,Ultra-Enterprise-10000/kernel/drv/idn \ |
|
4990 |
$root/platform/SUNW,Ultra-Enterprise-10000/kernel/drv/ngdr \ |
|
4991 |
$root/platform/SUNW,Ultra-Enterprise-10000/kernel/drv/pcipsy \ |
|
4992 |
$root/platform/SUNW,Ultra-Enterprise-10000/kernel/drv/rootnex \ |
|
4993 |
$root/platform/SUNW,Ultra-Enterprise-10000/kernel/drv/sbus \ |
|
4994 |
$root/platform/SUNW,Ultra-Enterprise-10000/kernel/misc/ngdrmach \ |
|
4995 |
$root/platform/SUNW,Ultra-Enterprise-10000/kernel/misc/platmod \ |
|
4996 |
$root/platform/SUNW,Ultra-Enterprise-10000/kernel/unix \ |
|
4997 |
$root/platform/SUNW,Ultra-Enterprise/kernel/drv/ac \ |
|
4998 |
$root/platform/SUNW,Ultra-Enterprise/kernel/drv/central \ |
|
4999 |
$root/platform/SUNW,Ultra-Enterprise/kernel/drv/environ \ |
|
5000 |
$root/platform/SUNW,Ultra-Enterprise/kernel/drv/fhc \ |
|
5001 |
$root/platform/SUNW,Ultra-Enterprise/kernel/drv/simmstat \ |
|
5002 |
$root/platform/SUNW,Ultra-Enterprise/kernel/drv/sram \ |
|
5003 |
$root/platform/SUNW,Ultra-Enterprise/kernel/drv/sysctrl \ |
|
5004 |
$root/platform/SUNW,Ultra-Enterprise/kernel/misc/platmod \ |
|
5005 |
$root/platform/sun4u/boot.conf \ |
|
5006 |
$root/platform/sun4u/kernel/cpu/SUNW,UltraSPARC \ |
|
5007 |
$root/platform/sun4u/kernel/cpu/SUNW,UltraSPARC-II \ |
|
5008 |
$root/platform/sun4u/kernel/cpu/SUNW,UltraSPARC-III \ |
|
5009 |
$root/platform/sun4u/kernel/cpu/SUNW,UltraSPARC-III+ \ |
|
5010 |
$root/platform/sun4u/kernel/cpu/SUNW,UltraSPARC-IIIi \ |
|
5011 |
$root/platform/sun4u/kernel/cpu/SUNW,UltraSPARC-IIe \ |
|
5012 |
$root/platform/sun4u/kernel/cpu/SUNW,UltraSPARC-IIi \ |
|
5013 |
$root/platform/sun4u/kernel/cpu/SUNW,UltraSPARC-IV \ |
|
5014 |
$root/platform/sun4u/kernel/drv/bwtwo \ |
|
5015 |
$root/platform/sun4u/kernel/drv/cgsix \ |
|
5016 |
$root/platform/sun4u/kernel/drv/cgthree \ |
|
5017 |
$root/platform/sun4u/kernel/drv/cpc \ |
|
5018 |
$root/platform/sun4u/kernel/drv/db21554 \ |
|
5019 |
$root/platform/sun4u/kernel/drv/dma \ |
|
5020 |
$root/platform/sun4u/kernel/drv/ebus \ |
|
5021 |
$root/platform/sun4u/kernel/drv/fd \ |
|
5022 |
$root/platform/sun4u/kernel/drv/ledma \ |
|
5023 |
$root/platform/sun4u/kernel/drv/memtest \ |
|
5024 |
$root/platform/sun4u/kernel/drv/pci_pci \ |
|
5025 |
$root/platform/sun4u/kernel/drv/pcipsy \ |
|
5026 |
$root/platform/sun4u/kernel/drv/power \ |
|
5027 |
$root/platform/sun4u/kernel/drv/rootnex \ |
|
5028 |
$root/platform/sun4u/kernel/drv/sbbc \ |
|
5029 |
$root/platform/sun4u/kernel/drv/sbus \ |
|
5030 |
$root/platform/sun4u/kernel/drv/sbusmem \ |
|
5031 |
$root/platform/sun4u/kernel/drv/sf \ |
|
5032 |
$root/platform/sun4u/kernel/drv/simba \ |
|
5033 |
$root/platform/sun4u/kernel/drv/su \ |
|
5034 |
$root/platform/sun4u/kernel/drv/tod \ |
|
5035 |
$root/platform/sun4u/kernel/drv/trapstat \ |
|
5036 |
$root/platform/sun4u/kernel/drv/zs \ |
|
5037 |
$root/platform/sun4u/kernel/drv/zsh \ |
|
5038 |
$root/platform/sun4u/kernel/genunix \ |
|
5039 |
$root/platform/sun4u/kernel/misc/bootdev \ |
|
5040 |
$root/platform/sun4u/kernel/misc/cpr \ |
|
5041 |
$root/platform/sun4u/kernel/misc/forthdebug \ |
|
5042 |
$root/platform/sun4u/kernel/misc/kgss/do_kmech_krb5 \ |
|
5043 |
$root/platform/sun4u/kernel/misc/kgss/gl_kmech_krb5 \ |
|
5044 |
$root/platform/sun4u/kernel/misc/md5 \ |
|
5045 |
$root/platform/sun4u/kernel/misc/obpsym \ |
|
5046 |
$root/platform/sun4u/kernel/misc/pcmcia \ |
|
5047 |
$root/platform/sun4u/kernel/misc/platmod \ |
|
5048 |
$root/platform/sun4u/kernel/misc/vis \ |
|
5049 |
$root/platform/sun4u/kernel/strmod/kb \ |
|
5050 |
$root/platform/sun4u/kernel/sys/cpc \ |
|
5051 |
$root/platform/sun4u/kernel/tod/todmostek \ |
|
5052 |
$root/platform/sun4u/kernel/tod/todstarfire \ |
|
5053 |
$usr/include/v7/sys/mon_clock.h \ |
|
5054 |
$usr/kernel/drv/dump \ |
|
5055 |
$usr/kernel/drv/fssnap \ |
|
5056 |
$usr/kernel/drv/gen_drv \ |
|
5057 |
$usr/kernel/drv/kstat \ |
|
5058 |
$usr/kernel/drv/ksyms \ |
|
5059 |
$usr/kernel/drv/llc2 \ |
|
5060 |
$usr/kernel/drv/lo \ |
|
5061 |
$usr/kernel/drv/lockstat \ |
|
5062 |
$usr/kernel/drv/logindmux \ |
|
5063 |
$usr/kernel/drv/pm \ |
|
5064 |
$usr/kernel/drv/pshot \ |
|
5065 |
$usr/kernel/drv/ptm \ |
|
5066 |
$usr/kernel/drv/pts \ |
|
5067 |
$usr/kernel/drv/rsm \ |
|
5068 |
$usr/kernel/drv/sppp \ |
|
5069 |
$usr/kernel/drv/sppptun \ |
|
5070 |
$usr/kernel/drv/sysevent \ |
|
5071 |
$usr/kernel/drv/tidg \ |
|
5072 |
$usr/kernel/drv/tivc \ |
|
5073 |
$usr/kernel/drv/tmux \ |
|
5074 |
$usr/kernel/drv/tnf \ |
|
5075 |
$usr/kernel/drv/vol \ |
|
5076 |
$usr/kernel/drv/winlock \ |
|
5077 |
$usr/kernel/exec/javaexec \ |
|
5078 |
$usr/kernel/fs/fdfs \ |
|
5079 |
$usr/kernel/fs/namefs \ |
|
5080 |
$usr/kernel/fs/pcfs \ |
|
5081 |
$usr/kernel/sched/FSS \ |
|
5082 |
$usr/kernel/sched/FX \ |
|
5083 |
$usr/kernel/sched/FX_DPTBL \ |
|
5084 |
$usr/kernel/sched/IA \ |
|
5085 |
$usr/kernel/sched/RT \ |
|
5086 |
$usr/kernel/sched/RT_DPTBL \ |
|
5087 |
$usr/kernel/strmod/cryptmod \ |
|
5088 |
$usr/kernel/strmod/lmodb \ |
|
5089 |
$usr/kernel/strmod/lmode \ |
|
5090 |
$usr/kernel/strmod/lmodr \ |
|
5091 |
$usr/kernel/strmod/lmodt \ |
|
5092 |
$usr/kernel/strmod/rlmod \ |
|
5093 |
$usr/kernel/strmod/spppasyn \ |
|
5094 |
$usr/kernel/strmod/spppcomp \ |
|
5095 |
$usr/kernel/strmod/sppptun \ |
|
5096 |
$usr/kernel/strmod/telmod \ |
|
5097 |
$usr/kernel/sys/acctctl \ |
|
5098 |
$usr/kernel/sys/exacctsys \ |
|
5099 |
$usr/kernel/sys/sysacct \ |
|
5100 |
$usr/lib/gss/mech_spnego.so \ |
|
5101 |
$usr/lib/gss/mech_spnego.so.1 \ |
|
5102 |
$usr/lib/mdb/kvm/cpc.so \ |
|
5103 |
$usr/lib/mdb/kvm/genunix.so \ |
|
5104 |
$usr/lib/mdb/kvm/ip.so \ |
|
5105 |
$usr/lib/mdb/kvm/ipc.so \ |
|
5106 |
$usr/lib/mdb/kvm/ipp.so \ |
|
5107 |
$usr/lib/mdb/kvm/isp.so \ |
|
5108 |
$usr/lib/mdb/kvm/krtld.so \ |
|
5109 |
$usr/lib/mdb/kvm/lofs.so \ |
|
5110 |
$usr/lib/mdb/kvm/logindmux.so \ |
|
5111 |
$usr/lib/mdb/kvm/mdb_ks.so \ |
|
5112 |
$usr/lib/mdb/kvm/nca.so \ |
|
5113 |
$usr/lib/mdb/kvm/nfs.so \ |
|
5114 |
$usr/lib/mdb/kvm/ptm.so \ |
|
5115 |
$usr/lib/mdb/kvm/random.so \ |
|
5116 |
$usr/lib/mdb/kvm/sd.so \ |
|
5117 |
$usr/lib/mdb/kvm/sppp.so \ |
|
5118 |
$usr/lib/mdb/kvm/ssd.so \ |
|
5119 |
$usr/lib/mdb/kvm/ufs_log.so \ |
|
5120 |
$usr/lib/mdb/kvm/usba.so \ |
|
5121 |
$usr/lib/sparcv9/gss/mech_spnego.so \ |
|
5122 |
$usr/lib/sparcv9/gss/mech_spnego.so.1 \ |
|
5123 |
$usr/platform/SUNW,Ultra-1 \ |
|
5124 |
$usr/platform/SUNW,Ultra-250/doc \ |
|
5125 |
$usr/platform/SUNW,Ultra-250/lib/flash-update.sh \ |
|
5126 |
$usr/platform/SUNW,Ultra-250/lib/prom \ |
|
5127 |
$usr/platform/SUNW,Ultra-Enterprise-10000/doc \ |
|
5128 |
$usr/platform/SUNW,Ultra-Enterprise-10000/lib/flash-update.sh \ |
|
5129 |
$usr/platform/SUNW,Ultra-Enterprise-10000/lib/prom \ |
|
5130 |
$usr/platform/sun4u/lib/mdb/kvm/unix.so \ |
|
5131 |
$usr/platform/sun4u/lib/prom/SUNW,Ultra-1 > /dev/null 2>&1; |
|
5132 |
print "done."; |
|
5133 |
fi; |
|
5134 |
||
5135 |
# |
|
5136 |
# Remove kmdbmod from /kernel |
|
5137 |
# |
|
5138 |
rm -f $root/kernel/misc/sparcv9/kmdbmod |
|
5139 |
||
5140 |
# |
|
5141 |
# Remove obsolete drivers/header files as a result of sun4v source |
|
5142 |
# code reorg |
|
5143 |
# |
|
5144 |
rm -f $root/platform/sun4u/kernel/drv/sparcv9/pci_pci |
|
5145 |
rm -f $root/platform/sun4u/kernel/misc/sparcv9/pcmcia |
|
5146 |
rm -f $usr/include/v9/sys/traptrace.h |
|
5147 |
rm -f $usr/platform/sun4u/include/sys/spitasi.h |
|
78
0e13b95244dd
6289703 Remove SUNWust1u.v package -- we do not need it
ae112802
parents:
25
diff
changeset
|
5148 |
rm -f $usr/kernel/pcbe/sparcv9/pcbe.SUNW,UltraSPARC-T1 |
0 | 5149 |
|
5150 |
# |
|
5151 |
# Remove the IPsec encryption and authentication modules. |
|
5152 |
# IPsec now uses the Kernel Crypto Framework for crypto. |
|
5153 |
# |
|
5154 |
rm -f $rootprefix/kernel/strmod/encr3des |
|
5155 |
rm -f $rootprefix/kernel/strmod/encrdes |
|
5156 |
rm -f $rootprefix/kernel/strmod/encrbfsh |
|
5157 |
rm -f $rootprefix/kernel/strmod/encraes |
|
5158 |
rm -f $rootprefix/kernel/strmod/authmd5h |
|
5159 |
rm -f $rootprefix/kernel/strmod/authsha1 |
|
5160 |
rm -f $rootprefix/kernel/strmod/sparcv9/encr3des |
|
5161 |
rm -f $rootprefix/kernel/strmod/sparcv9/encrdes |
|
5162 |
rm -f $rootprefix/kernel/strmod/sparcv9/encrbfsh |
|
5163 |
rm -f $rootprefix/kernel/strmod/sparcv9/encraes |
|
5164 |
rm -f $rootprefix/kernel/strmod/sparcv9/authmd5h |
|
5165 |
rm -f $rootprefix/kernel/strmod/sparcv9/authsha1 |
|
5166 |
||
5167 |
# |
|
5168 |
# Remove obsolete SSA utility, firmware and fcode. |
|
5169 |
# usr/lib/firmware/ssa contains ssafirmware |
|
5170 |
# |
|
5171 |
rm -rf $usr/lib/firmware/ssa |
|
5172 |
rm -f $usr/lib/firmware/fc_s/fc_s_fcode |
|
5173 |
rm -f $usr/sbin/ssaadm |
|
5174 |
||
5175 |
# |
|
5176 |
# Remove seg_drv, seg_mapdev driver |
|
5177 |
# |
|
5178 |
rm -f $root/kernel/misc/seg_drv |
|
5179 |
rm -f $root/kernel/misc/sparcv9/seg_drv |
|
5180 |
rm -f $usr/include/sys/seg_drv.h |
|
5181 |
rm -f $root/kernel/misc/seg_mapdev |
|
5182 |
rm -f $root/kernel/misc/sparcv9/seg_mapdev |
|
5183 |
||
5184 |
# |
|
5185 |
# Remove mpxio module |
|
5186 |
# |
|
5187 |
rm -f $root/kernel/misc/sparcv9/mpxio |
|
5188 |
||
5189 |
# |
|
5190 |
# Remove mpxio/vhci adb macros. |
|
5191 |
# |
|
5192 |
if [ $target_isa = sparc -a $zone = global ]; then |
|
5193 |
rm -f $usr/lib/adb/mdi_client |
|
5194 |
rm -f $usr/lib/adb/sparcv9/mdi_client |
|
5195 |
rm -f $usr/lib/adb/mdi_pathinfo |
|
5196 |
rm -f $usr/lib/adb/sparcv9/mdi_pathinfo |
|
5197 |
rm -f $usr/lib/adb/mdi_phci |
|
5198 |
rm -f $usr/lib/adb/sparcv9/mdi_phci |
|
5199 |
rm -f $usr/lib/adb/mdi_vhci |
|
5200 |
rm -f $usr/lib/adb/sparcv9/mdi_vhci |
|
5201 |
rm -f $usr/lib/adb/scsi_vhci_pkt |
|
5202 |
rm -f $usr/lib/adb/sparcv9/scsi_vhci_pkt |
|
5203 |
rm -f $usr/lib/adb/scsi_vhci_softstate |
|
5204 |
rm -f $usr/lib/adb/sparcv9/scsi_vhci_softstate |
|
5205 |
fi |
|
5206 |
||
5207 |
# |
|
5208 |
# new: need to remove going backwards: |
|
5209 |
# |
|
5210 |
# Diskless clients have already extracted /usr so don't delete this |
|
5211 |
# Non-global zones never extracts /usr so don't delete these |
|
5212 |
# |
|
5213 |
if [ $diskless = no -a $zone = global ]; then |
|
5214 |
rm -f $usr/sbin/stmsboot |
|
5215 |
fi |
|
5216 |
rm -f $root/lib/mpxio/mpxio |
|
5217 |
rm -f $root/lib/mpxio/stmsboot_util |
|
5218 |
||
5219 |
# |
|
5220 |
# Remove rpcib misc module (converted to driver) |
|
5221 |
# |
|
5222 |
rm -f $root/kernel/misc/sparcv9/rpcib |
|
5223 |
rm -f $root/kernel/drv/sparcv9/rpcib |
|
5224 |
||
5225 |
# |
|
5226 |
# Remove old smartcard header files |
|
5227 |
# |
|
5228 |
||
5229 |
rm -f \ |
|
5230 |
$usr/include/smartcard.h \ |
|
5231 |
$usr/include/smartcard/ocf_authenticate.h \ |
|
5232 |
$usr/include/smartcard/ocf_core.h \ |
|
5233 |
$usr/include/smartcard/ocf_core_cardservices.h |
|
5234 |
||
5235 |
# |
|
5236 |
# Remove smartcard libraries that should not have been shipped. |
|
5237 |
# |
|
5238 |
rm -rf $usr/lib/smartcard/sparcv9/ \ |
|
5239 |
$usr/share/lib/smartcard/scmtester.jar |
|
5240 |
||
5241 |
# |
|
5242 |
# Remove external smartcard reader driver |
|
5243 |
# |
|
5244 |
rm -f $usr/share/lib/smartcard/scmrsr3.jar |
|
5245 |
||
5246 |
# |
|
5247 |
# Remove old internal smartcard reader driver |
|
5248 |
# |
|
5249 |
rm -f $usr/share/lib/smartcard/scmiscr.jar |
|
5250 |
rm -f $usr/lib/smartcard/libSCMI2CNative.so |
|
5251 |
rm -f $usr/lib/smartcard/libSCMI2CNative.so.1 |
|
5252 |
||
5253 |
# |
|
5254 |
# Remove Smart OS |
|
5255 |
# |
|
5256 |
rm -f $usr/share/lib/smartcard/smartos.jar |
|
5257 |
||
5258 |
# |
|
5259 |
# Remove drivers & header files for EOL of soc & pln drivers |
|
5260 |
# as per PSARC/2003/233 |
|
5261 |
# |
|
5262 |
rm -f $root/kernel/drv/pln.conf |
|
5263 |
rm -f $root/kernel/drv/sparcv9/pln |
|
5264 |
rm -f $root/kernel/drv/sparcv9/soc |
|
5265 |
rm -f $usr/include/sys/socvar.h |
|
5266 |
rm -f $usr/include/sys/socmap.h |
|
5267 |
rm -f $usr/include/sys/soc_cq_defs.h |
|
5268 |
rm -f $usr/include/sys/socreg.h |
|
5269 |
rm -f $usr/include/sys/scsi/adapters/plndef.h |
|
5270 |
rm -f $usr/include/sys/scsi/adapters/plnvar.h |
|
5271 |
rm -f $usr/include/sys/scsi/adapters/ssaisp.h |
|
5272 |
rm -f $usr/include/sys/scsi/targets/pln_ctlr.h |
|
5273 |
rm -f $usr/include/sys/scsi/targets/osesio.h |
|
5274 |
||
5275 |
# |
|
5276 |
# PSARC/2003/629 Common Solaris Target Disk Driver |
|
5277 |
# remove adb macro "scsi_disk" for the x86 platform |
|
5278 |
# |
|
5279 |
if [ $target_isa = i386 ]; then |
|
5280 |
rm -f $usr/lib/adb/scsi_disk |
|
5281 |
fi |
|
5282 |
||
5283 |
# Remove CPCv1 API header per PSARC/2004/648 |
|
5284 |
rm -f $usr/include/sys/cpc_event.h |
|
5285 |
||
693 | 5286 |
# Remove headers per PSARC/2005/561 |
5287 |
rm -f $usr/include/sys/nexusintr.h |
|
5288 |
rm -f $usr/platform/sun4u/include/sys/nexusintr_impl.h |
|
5289 |
rm -f $usr/platform/sun4v/include/sys/nexusintr_impl.h |
|
5290 |
||
0 | 5291 |
# Remove usr/lib/mail which has moved to etc/mail/cf, but first, |
5292 |
# attempt to migrate any user-added files, which primarily live |
|
5293 |
# under usr/lib/mail/cf . Blow away the seven files which we |
|
5294 |
# ship under that directory, then move any that remain to the |
|
5295 |
# new location, which we will `mkdir -p` just to be safe. |
|
5296 |
# If the zone in question is non-global, then skip all this. |
|
5297 |
# |
|
5298 |
if [ $zone = "global" ]; then |
|
5299 |
# -d follow sym-links: make sure it's not a link. |
|
5300 |
if [ -d $usr/lib/mail -a ! -h $usr/lib/mail ]; then |
|
5301 |
# Only do this if usr/lib/mail is still a directory; |
|
5302 |
# bfu'ing backwards does not merit such migration. |
|
5303 |
rm -f $usr/lib/mail/cf/Makefile |
|
5304 |
rm -f $usr/lib/mail/cf/main.cf |
|
5305 |
rm -f $usr/lib/mail/cf/main.mc |
|
5306 |
rm -f $usr/lib/mail/cf/submit.cf |
|
5307 |
rm -f $usr/lib/mail/cf/submit.mc |
|
5308 |
rm -f $usr/lib/mail/cf/subsidiary.cf |
|
5309 |
rm -f $usr/lib/mail/cf/subsidiary.mc |
|
5310 |
mkdir -p -m 0755 $root/etc/mail/cf/cf |
|
5311 |
mv $usr/lib/mail/cf/* $root/etc/mail/cf/cf >/dev/null 2>&1 |
|
5312 |
fi |
|
5313 |
rm -rf $usr/lib/mail |
|
5314 |
fi |
|
5315 |
||
5316 |
# |
|
5317 |
# Remove drivers and header files for EOF of Lance Ethernet |
|
5318 |
# driver(le) as per PSARC/2003/335. |
|
5319 |
# |
|
5320 |
rm -f $root/kernel/drv/le |
|
5321 |
rm -f $root/kernel/drv/sparcv9/le |
|
5322 |
rm -f $root/kernel/drv/lebuffer |
|
5323 |
rm -f $root/kernel/drv/sparcv9/lebuffer |
|
5324 |
rm -f $root/platform/sun4u/kernel/drv/ledma |
|
5325 |
rm -f $root/platform/sun4u/kernel/drv/sparcv9/ledma |
|
5326 |
rm -f $usr/include/sys/le.h |
|
5327 |
rm -f $usr/include/sys/lance.h |
|
5328 |
rm -f $usr/lib/adb/le |
|
5329 |
rm -f $usr/lib/adb/lestr |
|
5330 |
||
5331 |
# |
|
5332 |
# Remove drivers and header files for EOF of ieef driver as |
|
5333 |
# per PSARC/2003/009 |
|
5334 |
# |
|
5335 |
rm -f $root/kernel/drv/ieef |
|
5336 |
rm -f $root/kernel/drv/ieef.conf |
|
5337 |
rm -f $usr/include/sys/ieef.h |
|
5338 |
rm -f $root/boot/solaris/drivers/notisa.010/ieef.bef |
|
5339 |
||
5340 |
# |
|
5341 |
# Remove drivers and header files for EOF of elx driver as |
|
5342 |
# per PSARC/2003/770 |
|
5343 |
# |
|
5344 |
rm -f $root/platform/i86pc/kernel/drv/elx |
|
5345 |
rm -f $root/platform/i86pc/kernel/drv/elx.conf |
|
5346 |
rm -f $usr/include/sys/elx.h |
|
5347 |
rm -f $root/boot/solaris/drivers/isa.175/elx.bef |
|
5348 |
||
5349 |
# |
|
5350 |
# Remove drivers for EOF of pe driver as per PSARC/2004/051 |
|
5351 |
# |
|
5352 |
rm -f $root/kernel/drv/pe |
|
5353 |
rm -f $root/kernel/drv/pe.conf |
|
5354 |
rm -f $root/boot/solaris/drivers/isa.125/pe3.bef |
|
5355 |
||
5356 |
# |
|
5357 |
# Remove drivers for EOF of Compaq NCR, Compaq SMART2, AMI Mega |
|
5358 |
# card and /usr/bin/smart2cfg as per PSARC/2003/701 and |
|
5359 |
# PSARC/2004/207 |
|
5360 |
# |
|
5361 |
rm -f $root/kernel/drv/cpqncr |
|
5362 |
rm -f $root/kernel/drv/cpqncr.conf |
|
5363 |
rm -f $root/boot/solaris/drivers/notisa.020/cpqncr.bef |
|
5364 |
rm -f $root/platform/i86pc/kernel/drv/smartii |
|
5365 |
rm -f $root/platform/i86pc/kernel/drv/smartii.conf |
|
5366 |
rm -f $usr/bin/smart2cfg |
|
5367 |
rm -f $root/kernel/drv/mega |
|
5368 |
rm -f $root/kernel/drv/mega.conf |
|
5369 |
rm -f $root/boot/solaris/drivers/notisa.010/mega.bef |
|
5370 |
rm -f $root/kernel/mach/compaq |
|
5371 |
rm -f $root/kernel/mach/corollary |
|
5372 |
||
5373 |
# |
|
5374 |
# Remove eisa nexus driver and header files for EOF of EISA |
|
5375 |
# support as per PSARC/2003/650 |
|
5376 |
# |
|
5377 |
rm -f $root/platform/i86pc/kernel/drv/eisa |
|
5378 |
rm -f $usr/platform/i86pc/include/sys/eisarom.h |
|
5379 |
rm -f $usr/platform/i86pc/include/sys/nvm.h |
|
5380 |
||
5381 |
# |
|
5382 |
# Remove xmem headers (they moved back to usr/include/sys/fs) |
|
5383 |
# |
|
5384 |
rm -f $usr/include/ia32/sys/fs/xmem.h |
|
5385 |
rm -f $usr/include/ia32/sys/fs/seg_xmem.h |
|
5386 |
rm -rf $usr/include/ia32/sys/fs |
|
5387 |
||
5388 |
# |
|
5389 |
# Remove junk headers |
|
5390 |
# |
|
5391 |
rm -f $usr/platform/i86pc/include/sys/mcdma.h |
|
5392 |
rm -f $usr/platform/i86pc/include/sys/xque.h |
|
5393 |
||
5394 |
# |
|
5395 |
# Remove obsolete x86 hat layer and associated adb scripts |
|
5396 |
# |
|
5397 |
rm -f $root/platform/i86pc/kernel/mmu/mmu32 |
|
5398 |
rm -f $root/platform/i86pc/kernel/mmu/mmu36 |
|
5399 |
rm -rf $root/platform/i86pc/kernel/mmu |
|
5400 |
rm -f $usr/lib/adb/hwpp |
|
5401 |
rm -f $usr/lib/adb/hatppp |
|
5402 |
rm -f $usr/lib/adb/hat.nxt |
|
5403 |
rm -f $usr/lib/adb/hwpp.nxt |
|
5404 |
||
5405 |
# |
|
5406 |
# Remove drivers for EOF of pcscsi as per PSARC/2005/003 |
|
5407 |
# |
|
5408 |
rm -f $root/kernel/drv/pcscsi |
|
5409 |
rm -f $root/kernel/drv/pcscsi.conf |
|
5410 |
rm -f $root/boot/solaris/drivers/notisa.010/pcscsi.bef |
|
5411 |
||
5412 |
# |
|
5413 |
# Remove drivers for EOF of dpt as per PSARC/2003/701 |
|
5414 |
# |
|
5415 |
rm -f $root/boot/solaris/drivers/isa.125/dpt.bef |
|
5416 |
rm -f $root/platform/i86pc/kernel/drv/dpt |
|
5417 |
rm -f $root/platform/i86pc/kernel/drv/dpt.conf |
|
5418 |
rm -rf $usr/include/sys/dktp/dpt |
|
5419 |
||
5420 |
# |
|
5421 |
# Remove drivers for EOF of mlx driver as per PSARC/2003/701 |
|
5422 |
# |
|
5423 |
rm -f $root/boot/solaris/drivers/notisa.010/mlx.bef |
|
5424 |
rm -f $root/platform/i86pc/kernel/drv/mlx |
|
5425 |
rm -f $root/platform/i86pc/kernel/drv/mlx.conf |
|
5426 |
rm -rf $usr/include/sys/dktp/mlx |
|
5427 |
||
5428 |
# |
|
5429 |
# Remove Floating Point Emulator for EOF as per PSARC/2003/651 |
|
5430 |
# |
|
5431 |
rm -f $root/platform/i86pc/kernel/misc/emul_80387 |
|
5432 |
||
5433 |
# |
|
5434 |
# Remove 64-bit adp, cadp and cpqhpc |
|
5435 |
# |
|
5436 |
rm -f $root/kernel/drv/amd64/adp |
|
5437 |
rm -f $root/kernel/drv/amd64/cadp |
|
5438 |
rm -f $root/kernel/drv/amd64/cpqhpc |
|
5439 |
||
5440 |
# |
|
5441 |
# Remove 64-bit i2o_bs, i2o_msg, i2o_scsi, pci_to_i2o, mscsi, ncrs, |
|
5442 |
# msm, spwr, bscv, bscbus |
|
5443 |
# |
|
5444 |
rm -f $root/kernel/drv/amd64/i2o_bs |
|
5445 |
rm -f $root/kernel/misc/amd64/i2o_msg |
|
5446 |
rm -f $root/kernel/drv/amd64/i2o_scsi |
|
5447 |
rm -f $root/kernel/drv/amd64/pci_to_i2o |
|
5448 |
rm -f $root/platform/i86pc/kernel/drv/amd64/mscsi |
|
5449 |
rm -f $root/kernel/drv/amd64/ncrs |
|
5450 |
rm -f $root/platform/i86pc/kernel/drv/amd64/msm |
|
5451 |
rm -f $root/kernel/drv/amd64/spwr |
|
5452 |
rm -f $root/platform/i86pc/kernel/drv/amd64/bscv |
|
5453 |
rm -f $root/platform/i86pc/kernel/drv/amd64/bscbus |
|
5454 |
||
5455 |
# Remove obsolete atomic_prim.h file. |
|
5456 |
rm -f $usr/include/v9/sys/atomic_prim.h |
|
5457 |
||
5458 |
# |
|
5459 |
# Remove sc_nct binary and the corresponding symlink to sc_nct from the |
|
5460 |
# Montecarlo platform specific directories (Reference: PSARC 2003/606). |
|
5461 |
# To be specific, the following binary will be removed. |
|
5462 |
# /platform/SUNW,UltraSPARC-IIe-NetraCT-40/kernel/drv/sparcv9/sc_nct |
|
5463 |
# Also, the following symlink will be removed. |
|
5464 |
# /platform/SUNW,UltraSPARC-IIe-NetraCT-60/kernel/drv/sparcv9/sc_nct |
|
5465 |
# |
|
5466 |
if [ -f $root/platform/SUNW,UltraSPARC-IIe-NetraCT-40/kernel/drv/sparcv9/sc_nct ]; then |
|
5467 |
rm -f $root/platform/SUNW,UltraSPARC-IIe-NetraCT-40/kernel/drv/sparcv9/sc_nct |
|
5468 |
rm -f $root/platform/SUNW,UltraSPARC-IIe-NetraCT-60/kernel/drv/sparcv9/sc_nct |
|
5469 |
fi |
|
5470 |
||
5471 |
# |
|
5472 |
# In case of bfu to an older release, remove traces of "new" |
|
5473 |
# Kerberos mechanisms. Kerberos libraries and paths are corrected |
|
5474 |
# after extraction is complete. |
|
5475 |
# |
|
5476 |
rm -f $root/kernel/misc/kgss/kmech_krb5 |
|
5477 |
rm -f $root/kernel/misc/kgss/sparcv9/kmech_krb5 |
|
5478 |
rm -f $root/platform/$karch/kernel/misc/kgss/sparcv9/kmech_krb5 |
|
5479 |
# |
|
5480 |
# Diskless clients have already extracted /usr so don't delete these |
|
5481 |
# Non-global zones never extracts /usr so don't delete these |
|
5482 |
# |
|
5483 |
if [ $diskless = no -a $zone = global ]; then |
|
5484 |
rm -f $usr/lib/gss/mech_krb5.so |
|
5485 |
rm -f $usr/lib/gss/mech_krb5.so.1 |
|
5486 |
rm -f $usr/lib/sparcv9/gss/mech_krb5.so |
|
5487 |
rm -f $usr/lib/sparcv9/gss/mech_krb5.so.1 |
|
5488 |
fi |
|
5489 |
||
5490 |
# Remove old OpenSSL stuff from SUNWwbint |
|
5491 |
rm -rf $usr/include/openssl |
|
5492 |
rm -rf $usr/lib/openssl |
|
5493 |
||
5494 |
#Remove ufs logging module - now merged into ufs module |
|
5495 |
rm -f $rootprefix/kernel/misc/ufs_log |
|
5496 |
rm -f $rootprefix/kernel/misc/sparcv9/ufs_log |
|
5497 |
||
5498 |
#Remove diskmgtd. If backward BFU, will get re-installed from |
|
5499 |
#archive. |
|
5500 |
rm -f $usr/lib/diskmgtd |
|
5501 |
||
5502 |
# |
|
5503 |
# Remove old ia64 cruft |
|
5504 |
# |
|
5505 |
if [ $target_isa = i386 ]; then |
|
5506 |
rm -f $usr/include/sys/ia64_archext.h |
|
5507 |
rm -f $usr/include/sys/sysia64.h |
|
5508 |
rm -rf $usr/include/ia64 |
|
5509 |
fi |
|
5510 |
||
5511 |
# |
|
5512 |
# Remove machpage-related stuff |
|
5513 |
# |
|
5514 |
rm -f $usr/platform/*/include/vm/mach_page.h |
|
5515 |
rm -f $usr/lib/adb/machpp |
|
5516 |
||
5517 |
# |
|
5518 |
# Remove old cacheos |
|
5519 |
# |
|
5520 |
rm -f $root/etc/init.d/cacheos |
|
5521 |
rm -f $root/etc/init.d/cacheos.finish |
|
5522 |
rm -f $root/etc/init.d/cachefs.root |
|
5523 |
rm -f $root/etc/rcS.d/S35cacheos.sh |
|
5524 |
rm -f $root/etc/rc2.d/S93cacheos.finish |
|
5525 |
rm -f $root/etc/rcS.d/S41cachefs.root |
|
5526 |
||
5527 |
# |
|
5528 |
# Remove unneeded nfsmapid entries |
|
5529 |
# |
|
5530 |
nfsmapid_cfg |
|
5531 |
||
5532 |
# |
|
5533 |
# Move the original manifests aside; later we will restore |
|
5534 |
# unchanged originals to avoid superfluous re-import on reboot. |
|
5535 |
# (First blow away the old dir path just to be safe.) |
|
5536 |
# |
|
5537 |
rm -rf $root/$old_mfst_dir |
|
5538 |
[ -d $root/$new_mfst_dir ] && mv $root/$new_mfst_dir $root/$old_mfst_dir |
|
5539 |
||
5540 |
# |
|
5541 |
# Remove obsolete sum.h |
|
5542 |
# |
|
5543 |
rm -f $usr/include/sum.h |
|
5544 |
||
5545 |
# |
|
5546 |
# Remove obsolete std.h |
|
5547 |
# |
|
5548 |
rm -f $usr/include/std.h |
|
5549 |
||
5550 |
# |
|
132 | 5551 |
# Remove obsolete rpc/trace.h |
5552 |
# |
|
5553 |
rm -f $usr/include/rpc/trace.h |
|
5554 |
||
5555 |
# |
|
0 | 5556 |
# Remove acpi_intp module |
5557 |
# |
|
5558 |
if [ $target_isa = i386 ]; then |
|
5559 |
rm -f $root/kernel/misc/acpi_intp |
|
5560 |
rm -f $root/kernel/misc/amd64/acpi_intp |
|
5561 |
fi |
|
5562 |
||
461
7f48ccb9d9a6
PSARC/2005/378 Obsolete and/or removal of disparaged librac
robinson
parents:
305
diff
changeset
|
5563 |
# |
7f48ccb9d9a6
PSARC/2005/378 Obsolete and/or removal of disparaged librac
robinson
parents:
305
diff
changeset
|
5564 |
# Remove obsolete librac |
7f48ccb9d9a6
PSARC/2005/378 Obsolete and/or removal of disparaged librac
robinson
parents:
305
diff
changeset
|
5565 |
# |
7f48ccb9d9a6
PSARC/2005/378 Obsolete and/or removal of disparaged librac
robinson
parents:
305
diff
changeset
|
5566 |
rm -f $usr/include/rpc/rac.h |
7f48ccb9d9a6
PSARC/2005/378 Obsolete and/or removal of disparaged librac
robinson
parents:
305
diff
changeset
|
5567 |
rm -f $usr/lib/llib-lrac |
7f48ccb9d9a6
PSARC/2005/378 Obsolete and/or removal of disparaged librac
robinson
parents:
305
diff
changeset
|
5568 |
rm -f $usr/lib/llib-lrac.ln |
7f48ccb9d9a6
PSARC/2005/378 Obsolete and/or removal of disparaged librac
robinson
parents:
305
diff
changeset
|
5569 |
rm -f $usr/lib/amd64/llib-lrac.ln |
7f48ccb9d9a6
PSARC/2005/378 Obsolete and/or removal of disparaged librac
robinson
parents:
305
diff
changeset
|
5570 |
rm -f $usr/lib/sparcv9/llib-lrac.ln |
7f48ccb9d9a6
PSARC/2005/378 Obsolete and/or removal of disparaged librac
robinson
parents:
305
diff
changeset
|
5571 |
rm -f $usr/lib/librac.so |
7f48ccb9d9a6
PSARC/2005/378 Obsolete and/or removal of disparaged librac
robinson
parents:
305
diff
changeset
|
5572 |
rm -f $usr/lib/librac.so.1 |
7f48ccb9d9a6
PSARC/2005/378 Obsolete and/or removal of disparaged librac
robinson
parents:
305
diff
changeset
|
5573 |
rm -f $usr/lib/amd64/librac.so |
7f48ccb9d9a6
PSARC/2005/378 Obsolete and/or removal of disparaged librac
robinson
parents:
305
diff
changeset
|
5574 |
rm -f $usr/lib/amd64/librac.so.1 |
7f48ccb9d9a6
PSARC/2005/378 Obsolete and/or removal of disparaged librac
robinson
parents:
305
diff
changeset
|
5575 |
rm -f $usr/lib/sparcv9/librac.so |
7f48ccb9d9a6
PSARC/2005/378 Obsolete and/or removal of disparaged librac
robinson
parents:
305
diff
changeset
|
5576 |
rm -f $usr/lib/sparcv9/librac.so.1 |
7f48ccb9d9a6
PSARC/2005/378 Obsolete and/or removal of disparaged librac
robinson
parents:
305
diff
changeset
|
5577 |
|
0 | 5578 |
# End of pre-archive extraction hacks. |
5579 |
||
5580 |
if [ $diskless = no -a $zone = global ]; then |
|
5581 |
print "Extracting ufs modules for boot block ... \c" | \ |
|
5582 |
tee -a $EXTRACT_LOG |
|
5583 |
do_extraction $cpiodir/$karch.usr$ZFIX \ |
|
5584 |
'usr/platform/'$karch'/lib/fs/ufs/*' | \ |
|
5585 |
tee -a $EXTRACT_LOG |
|
5586 |
case $target_isa in |
|
5587 |
sparc) |
|
5588 |
if [[ "$rootslice" = /dev/rdsk/* ]]; then |
|
5589 |
print "Installing boot block on $rootslice." |
|
5590 |
cd $usr/platform/$karch/lib/fs/ufs |
|
5591 |
installboot ./bootblk $rootslice |
|
5592 |
fi |
|
5593 |
;; |
|
5594 |
i386) |
|
5595 |
;; |
|
5596 |
*) |
|
5597 |
;; # unknown ISA |
|
5598 |
esac |
|
5599 |
fi |
|
5600 |
||
5601 |
if [ $diskless = yes ]; then |
|
5602 |
node=${root##*/} |
|
5603 |
archlist="" |
|
5604 |
for arch in $allarchs |
|
5605 |
do |
|
5606 |
egrep -s '/export/exec/.*'$arch'/usr/kvm' \ |
|
5607 |
$root/etc/vfstab || |
|
5608 |
test -d $root/platform/$arch && |
|
5609 |
archlist="$archlist $arch" |
|
5610 |
done |
|
5611 |
if [ -z "$old_style_archives" ]; then |
|
5612 |
extract_archives lib generic |
|
5613 |
extract_archives sbin generic |
|
5614 |
extract_archives kernel generic |
|
5615 |
fi |
|
5616 |
extract_archives root generic $archlist |
|
5617 |
if [ $target_isa = i386 ]; then |
|
5618 |
extract_boot_archives boot $archlist |
|
5619 |
fi |
|
5620 |
else |
|
5621 |
export PATH=/tmp/bfubin |
|
5622 |
node=`uname -n` |
|
5623 |
if [ $zone = global ]; then |
|
5624 |
extract_archives usr generic $usrarchs |
|
5625 |
if [ -z "$old_style_archives" ]; then |
|
5626 |
extract_archives lib generic |
|
5627 |
extract_archives sbin generic |
|
5628 |
extract_archives kernel generic |
|
5629 |
fi |
|
5630 |
extract_archives root generic $rootarchs |
|
5631 |
if [ $target_isa = i386 ]; then |
|
5632 |
# |
|
5633 |
# The assumption here is that if boot |
|
5634 |
# archives exist at all, they only exist |
|
5635 |
# for architectures where we also have |
|
5636 |
# .root archives. |
|
5637 |
# |
|
5638 |
extract_boot_archives boot $rootarchs |
|
5639 |
fi |
|
5640 |
else |
|
5641 |
extract_archives root generic |
|
5642 |
fi |
|
5643 |
fi |
|
5644 |
||
5645 |
touch reconfigure |
|
5646 |
||
5647 |
# |
|
5648 |
# UltraSparc III platforms have aes module in platform directory |
|
5649 |
# |
|
5650 |
if [ ! -f $root/platform/$plat/kernel/crypto/sparcv9/aes ]; then |
|
5651 |
rm -f $root/platform/sun4u-us3/kernel/crypto/sparcv9/aes |
|
5652 |
rm -f $root/platform/sun4u-us3/kernel/crypto/sparcv9/aes256 |
|
5653 |
fi |
|
5654 |
||
5655 |
if [ $zone = global ]; then |
|
5656 |
print "\nRemoving duplicate kernel binaries ..." |
|
5657 |
# |
|
5658 |
# First, find all regular files underneath the */kernel |
|
5659 |
# directories we extracted, and mark them as older or newer |
|
5660 |
# than our reference file -- if newer, they were extracted |
|
5661 |
# during the bfu. |
|
5662 |
# |
|
5663 |
# We then split out the pre-/kernel part from the post-/kernel |
|
5664 |
# part, sort by post-/kernel part and age (new first), and |
|
5665 |
# delete old files which have new counterparts. |
|
5666 |
# |
|
5667 |
dirs="$rootprefix/kernel $usr/kernel" |
|
5668 |
for plat in $archlist $rootarchs $usrarchs; do |
|
5669 |
dir=$rootprefix/platform/$plat/kernel |
|
5670 |
[[ -d $dir ]] && dirs="$dirs $dir" |
|
5671 |
done |
|
5672 |
||
5673 |
age=new |
|
5674 |
ls -ct $time_ref `find $dirs -type f 2>/dev/null` | uniq | |
|
5675 |
while read f; do |
|
5676 |
if [[ $f = $time_ref ]] then |
|
5677 |
age=old |
|
5678 |
else |
|
5679 |
echo $age $f |
|
5680 |
fi |
|
5681 |
done | |
|
5682 |
sed 's@\(.*/kernel\)/@\1 @' | sort -k 3 -k 1 | nawk ' |
|
5683 |
/^new/ { lastname = $3 } |
|
5684 |
/^old/ { if (lastname == $3) { print $2 "/" $3 } } |
|
5685 |
' | while read x; do |
|
5686 |
echo rm $x |
|
5687 |
rm $x |
|
5688 |
done |
|
5689 |
fi |
|
5690 |
||
5691 |
echo |
|
5692 |
# Simulate installation of SUNWcry* - these are in the bfu archives. |
|
5693 |
if [ -f $rootprefix/etc/crypto/kcf.conf -a \ |
|
5694 |
-f $rootprefix/etc/crypto/pkcs11.conf ]; then |
|
5695 |
enable_crypto_unlimited |
|
5696 |
fi |
|
5697 |
||
5698 |
# Add uCF's metaslot feature |
|
5699 |
if [ -f $rootprefix/etc/crypto/pkcs11.conf ] ; then |
|
5700 |
enable_crypto_metaslot |
|
5701 |
fi |
|
5702 |
||
5703 |
# Cleanup old Kerberos mechanisms |
|
5704 |
cleanup_kerberos_mechanisms |
|
5705 |
||
305 | 5706 |
# Fix network datalink configuration |
5707 |
if [ $zone = global -a $need_datalink = yes ]; then |
|
5708 |
create_datalink_conf |
|
5709 |
fi |
|
5710 |
||
0 | 5711 |
print "\nRestoring configuration files.\n" |
5712 |
||
5713 |
cd $root |
|
5714 |
rm -rf bfu.ancestor |
|
5715 |
test -d bfu.parent && mv bfu.parent bfu.ancestor |
|
5716 |
mkdir bfu.parent |
|
5717 |
print "Restoring configuration files ... \c" >> $EXTRACT_LOG |
|
5718 |
filelist $zone | cpio -pdmu bfu.parent 2>>$EXTRACT_LOG || \ |
|
5719 |
extraction_error "restoring configuration files" |
|
5720 |
if [ $multiboot_archives = no ]; then |
|
5721 |
if [ $have_realmode = yes ]; then |
|
5722 |
if [ -d bfu.realmode ]; then |
|
5723 |
( cd bfu.realmode ; realmode_filelist | \ |
|
5724 |
cpio -pdmu ../bfu.ancestor 2>/dev/null ) |
|
5725 |
rm -rf bfu.realmode |
|
5726 |
fi |
|
5727 |
mkdir bfu.realmode |
|
5728 |
( cd bfu.parent ; realmode_filelist | \ |
|
5729 |
cpio -pdmu ../bfu.realmode 2>/dev/null ) |
|
5730 |
else |
|
5731 |
for file in $realmode_files |
|
5732 |
do |
|
5733 |
rm -rf bfu.parent/$file |
|
5734 |
done |
|
5735 |
fi |
|
5736 |
fi |
|
5737 |
if [ $zone != global ]; then |
|
5738 |
rm -rf $global_zone_only_files $superfluous_local_zone_files |
|
5739 |
fi |
|
5740 |
cd bfu.child |
|
5741 |
||
5742 |
for file in `filelist $zone` |
|
5743 |
do |
|
5744 |
# parent: freshly-BFUed version |
|
5745 |
# child: pre-BFU version |
|
5746 |
# ancestor: installed from archives the last time you BFUed |
|
5747 |
# actual: in the root filesystem at this moment (same as parent) |
|
5748 |
||
5749 |
parent=$rootprefix/bfu.parent/$file |
|
5750 |
child=$rootprefix/bfu.child/$file |
|
5751 |
ancestor=$rootprefix/bfu.ancestor/$file |
|
5752 |
conflicts=$rootprefix/bfu.conflicts/$file |
|
5753 |
actual=$rootprefix/$file |
|
5754 |
||
5755 |
# if a superfluous-to-local-zones file was blown away, skip it |
|
5756 |
[ -f $actual ] || continue |
|
5757 |
||
5758 |
# if there's been no change by the BFU, skip it |
|
5759 |
cmp -s $child $actual && continue |
|
5760 |
||
5761 |
# if the file was not installed by the BFU, skip it |
|
5762 |
[ -f $parent ] || continue |
|
5763 |
||
5764 |
# if this is a file which should never be updated by BFU, |
|
5765 |
# preserve the original (child) version |
|
5766 |
if (echo $preserve_files | grep $file >/dev/null 2>&1) |
|
5767 |
then |
|
5768 |
print " preserve: $file" |
|
5769 |
cp -p $child $actual |
|
5770 |
continue |
|
5771 |
fi |
|
5772 |
||
5773 |
# if the file was accepted from the parent on the last BFU, |
|
5774 |
# then accept it again this time without argument. Or, if |
|
5775 |
# this is the first bfu after an standard Solaris install |
|
5776 |
# or upgrade, compare the file to one installed from packages. |
|
5777 |
# If it hasn't been modified since installation, accept |
|
5778 |
# the file from the parent. |
|
5779 |
if [ -f $ancestor ] ; then |
|
5780 |
if cmp -s $child $ancestor; then |
|
5781 |
print " update: $file" |
|
5782 |
continue |
|
5783 |
fi |
|
5784 |
elif [ "$firstbfu" = "yes" ] ; then |
|
5785 |
installedsum=$(grep "^/$file " \ |
|
5786 |
$rootprefix/var/sadm/install/contents | |
|
5787 |
awk '{ print $8 }') |
|
5788 |
if [ -n "$installedsum" ] ; then |
|
5789 |
actualsum=`sum $child | sed 's/ .*//'` |
|
5790 |
if [ "$installedsum" -eq "$actualsum" ] ; then |
|
5791 |
print " update: $file" |
|
5792 |
continue |
|
5793 |
fi |
|
5794 |
fi |
|
5795 |
fi |
|
5796 |
||
5797 |
# if the BFU'ed file is the same as the beginning of the |
|
5798 |
# pre-BFUed file, assume the user has added lines to the |
|
5799 |
# end, and restore the pre-BFUed version |
|
5800 |
if (cmp $child $parent 2>&1) | egrep -s 'EOF on '$parent; then |
|
5801 |
print " restore: $file" |
|
5802 |
cp -p $child $actual |
|
5803 |
continue |
|
5804 |
fi |
|
5805 |
||
5806 |
# if the new version is the same as it was the last time |
|
5807 |
# BFU was run, but still different than the pre-BFU version, |
|
5808 |
# this is an "old" conflict; otherwise, it's a "NEW" |
|
5809 |
# conflict. Old conflicts can usually be safely ignored. |
|
5810 |
if cmp -s $parent $ancestor; then |
|
5811 |
print "old \c" |
|
5812 |
else |
|
5813 |
print "NEW \c" |
|
5814 |
print $file >>$rootprefix/bfu.conflicts/NEW |
|
5815 |
fi |
|
5816 |
print "conflict: $file" |
|
5817 |
(cd $root; print $file | cpio -pdmu bfu.conflicts 2>/dev/null) |
|
5818 |
||
5819 |
# for all conflicts, restore the pre-BFU version and let |
|
5820 |
# the user decide what to do. |
|
5821 |
cp -p $child $actual |
|
5822 |
done |
|
5823 |
||
5824 |
if [ $zone = global ]; then |
|
5825 |
# |
|
5826 |
# correct permissions using /etc/minor_perm from the parent and |
|
5827 |
# child, prefer parent. |
|
5828 |
# |
|
5829 |
mperm=$rootprefix/etc/minor_perm |
|
5830 |
pmperm=$rootprefix/bfu.parent/etc/minor_perm |
|
5831 |
if [ -f $pmperm ] |
|
5832 |
then |
|
5833 |
mperm="$pmperm $mperm" |
|
5834 |
fi |
|
5835 |
||
5836 |
# |
|
5837 |
# Devices with changed permissions should be added here much |
|
5838 |
# like in i.minorperm. The "ssm" devices are special in that |
|
5839 |
# they have no /dev links associated with them. |
|
5840 |
# |
|
5841 |
while read minor dev |
|
5842 |
do ( |
|
5843 |
set -- `fgrep -h "$minor" $mperm` ""; |
|
5844 |
if [ ! -z "$2" ] |
|
5845 |
then |
|
5846 |
chmod $2 $rootprefix/dev/$dev 2>/dev/null |
|
5847 |
chown $3:$4 $rootprefix/dev/$dev 2>/dev/null |
|
5848 |
fi |
|
5849 |
) done <<-EOF |
|
5850 |
ssm:* ../devices/ssm*:* |
|
5851 |
cpc:shared ../devices/pseudo/cpc* |
|
5852 |
icmp:icmp icmp |
|
5853 |
icmp6:icmp6 icmp6 |
|
5854 |
ip:ip ip |
|
5855 |
ip6:ip6 ip6 |
|
5856 |
rts:rts rts |
|
5857 |
keysock:keysock keysock |
|
5858 |
ipsecah:ipsecah ipsecah |
|
5859 |
ipsecesp:ipsecesp ipsecesp |
|
5860 |
spdsock:spdsock spdsock |
|
5861 |
sad:admin sad/admin |
|
5862 |
fssnap:ctl fssnapctl |
|
5863 |
fssnap:* fssnap/* |
|
5864 |
clone:ce ce |
|
5865 |
clone:eri eri |
|
5866 |
clone:ge ge |
|
5867 |
clone:hme hme |
|
5868 |
clone:le le |
|
5869 |
clone:qfe qfe |
|
5870 |
clone:bge bge |
|
5871 |
bge:* bge* |
|
5872 |
clone:dmfe dmfe |
|
5873 |
dmfe:* dmfe* |
|
5874 |
clone:pcelx pcelx |
|
5875 |
pcelx:* pcelx* |
|
5876 |
clone:dnet dnet |
|
5877 |
dnet:* dnet* |
|
5878 |
clone:elxl elxl |
|
5879 |
elxl:* elxl* |
|
5880 |
clone:iprb iprb |
|
5881 |
iprb:* iprb* |
|
5882 |
clone:spwr spwr |
|
5883 |
spwr:* spwr* |
|
5884 |
EOF |
|
5885 |
||
5886 |
if [ $target_isa = i386 ] && [[ $rootslice = /dev/rdsk/* || \ |
|
5887 |
$rootslice = /dev/md/rdsk/* ]]; then |
|
5888 |
if [ $multiboot_archives = yes ]; then |
|
5889 |
if [ $dca_to_multi = yes ]; then |
|
5890 |
install_failsafe |
|
5891 |
setup_grub_menu |
|
5892 |
install_grub |
|
5893 |
fi |
|
5894 |
build_boot_archive |
|
5895 |
else |
|
5896 |
disable_boot_service |
|
5897 |
fi |
|
5898 |
fi |
|
5899 |
fi |
|
5900 |
||
5901 |
||
5902 |
print "\nFor each file in conflict, your version has been restored." |
|
5903 |
print "The new versions are under $rootprefix/bfu.conflicts." |
|
5904 |
print "\nMAKE SURE YOU RESOLVE ALL CONFLICTS BEFORE REBOOTING.\n" |
|
5905 |
if [ $multiboot_archives = yes ]; then |
|
5906 |
print "To install resolved changes required for reboot in the boot" |
|
5907 |
print "archive, invoke 'bootadm update-archive${cr_args}'\n" |
|
5908 |
fi |
|
5909 |
||
5910 |
if [ $zone != global ]; then |
|
5911 |
print "Resolve conflicts in the global zone first. Many of" |
|
5912 |
print "the conflicts in non-global zones can be resolved by" |
|
5913 |
print "copying the corresponding file from the global zone.\n" |
|
5914 |
else |
|
5915 |
fixup_mpxio |
|
5916 |
fi |
|
5917 |
||
5918 |
cd $root |
|
5919 |
||
5920 |
smf_apply_conf |
|
5921 |
||
5922 |
update_policy_conf |
|
5923 |
||
5924 |
print "bfu'ed from $cpiodir on `date +%Y-%m-%d`" >>etc/motd |
|
5925 |
tail +`nawk '/bfu.ed from/ { x=NR }; END { print x+1 }' \ |
|
5926 |
etc/motd.old` etc/motd.old >> etc/motd |
|
5927 |
||
5928 |
# |
|
5929 |
# Hacks to work around minor annoyances and make life more pleasant. |
|
5930 |
# Part 2 of 2: post-archive-extraction stuff |
|
5931 |
# |
|
5932 |
||
5933 |
rm -f var/statmon/state # to prevent lockd/statd hangs |
|
5934 |
for f in etc/auto_* # to make autofs happy |
|
5935 |
do |
|
5936 |
file $f | grep executable >/dev/null || chmod -x $f |
|
5937 |
done |
|
5938 |
||
5939 |
epilogue=$rootprefix/bfu.epilogue |
|
5940 |
if [ -f $epilogue ]; then |
|
5941 |
print "Executing $epilogue" |
|
5942 |
$epilogue || print "WARNING: $epilogue failed with code $?" |
|
5943 |
fi |
|
5944 |
||
5945 |
((seconds = SECONDS)) |
|
5946 |
((min = seconds / 60)) |
|
5947 |
((sec = seconds % 60)) |
|
5948 |
||
5949 |
if [ $zone = global ]; then |
|
5950 |
target=$node |
|
5951 |
else |
|
5952 |
target=$zone |
|
5953 |
fi |
|
5954 |
printf "Upgrade of $target took ${min}:%02d.\n" $sec |
|
5955 |
||
5956 |
# |
|
5957 |
# Do logging in the background so that if the automounter is gone, |
|
5958 |
# bfu doesn't wedge at this point. |
|
5959 |
# |
|
5960 |
log=$GATE/public/bfu.log |
|
5961 |
(test -w $log && printf \ |
|
5962 |
"`date +%Y'%'m%d` $node `uname -rv` $karch $cpiodir ${min}:%02d\n" \ |
|
5963 |
$sec >>$log) & |
|
5964 |
} |
|
5965 |
||
5966 |
# |
|
5967 |
# make sure the time reference is older than anything extracted |
|
5968 |
# |
|
5969 |
test $time_ref_seconds -eq $SECONDS && sleep 1 |
|
5970 |
||
5971 |
test $diskless = yes && extract_archives usr generic $allarchs |
|
5972 |
||
5973 |
for root in $rootlist |
|
5974 |
do |
|
5975 |
mondo_loop $root global |
|
5976 |
lastroot=$root |
|
5977 |
done |
|
5978 |
||
5979 |
if [ -s $local_zone_info_file ]; then |
|
5980 |
cat $local_zone_info_file | while read zone zonepath; do |
|
5981 |
print "\nNow for zone $zone..." |
|
5982 |
mondo_loop $zonepath/root $zone |
|
5983 |
done |
|
5984 |
rm -f $local_zone_info_file |
|
5985 |
fi |
|
5986 |
||
5987 |
print "Turning off delayed i/o and syncing filesystems ..." |
|
5988 |
sync |
|
5989 |
fastfs -s $rootlist $usr |
|
5990 |
fastfs $rootlist $usr |
|
5991 |
sync |
|
5992 |
lockfs -f $rootlist $usr |
|
5993 |
||
5994 |
egrep -s "^error " $EXTRACT_LOG |
|
5995 |
if [ $? -eq 0 ]; then |
|
5996 |
print "\nWARNING: archive extraction errors occurred.\n" |
|
5997 |
print "See $EXTRACT_LOG for details.\n" |
|
5998 |
fi |
|
5999 |
||
6000 |
lastrootprefix=${lastroot%/} |
|
6001 |
||
6002 |
if [ -t 0 -a -t 1 -a -t 2 ]; then |
|
6003 |
print "\nEntering post-bfu protected environment (shell: ksh)." |
|
6004 |
print "Edit configuration files as necessary, then reboot.\n" |
|
6005 |
cd $lastrootprefix/bfu.conflicts |
|
6006 |
PS1='bfu# ' ksh -ip |
|
6007 |
fi |
|
6008 |
||
6009 |
print "Exiting post-bfu protected environment. To reenter, type:" |
|
598
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
6010 |
print LD_NOAUXFLTR=1 LD_LIBRARY_PATH=/tmp/bfulib $ldlib64 PATH=/tmp/bfubin \ |
62a3fdbde968
6327152 bfuing over the fix for 6324631 can cause BFU/acr failures
jwadams
parents:
461
diff
changeset
|
6011 |
/tmp/bfubin/ksh |
0 | 6012 |
|
6013 |
# Allow init(1M) to continue, if we're leaving. |
|
6014 |
print "Reactivating init ..." |
|
6015 |
prun 1 |
|
6016 |
||
6017 |
exit 0 |