89 log "$f_sanity_sparse"
90 res=1
91 fi
92 done
93
94 if (( $res != 0 )); then
95 log "$sanity_fail"
96 fatal "$install_fail" "$ZONENAME"
97 fi
98
99 if [[ "$SANITY_SKIP" == 1 ]]; then
100 log "$w_sanity_detail"
101 return
102 fi
103
104 #
105 # Check image release to be sure its S10.
106 #
107 image_vers="unknown"
108 if [[ -f $dir/var/sadm/system/admin/INST_RELEASE ]]; then
109 image_vers=$(nawk -F= '{if ($1 == "VERSION") print $2}' \
110 $dir/var/sadm/system/admin/INST_RELEASE)
111 fi
112
113 if [[ "$image_vers" != "10" ]]; then
114 log "$f_sanity_vers" "$image_vers"
115 res=1
116 fi
117
118 #
119 # Make sure we have the minimal KU patch we support. These are the
120 # KUs for S10u8.
121 #
122 if [[ $(uname -p) == "i386" ]]; then
123 req_patch="141445-09"
124 else
125 req_patch="141444-09"
126 fi
127
128 for i in $dir/var/sadm/pkg/SUNWcakr*
129 do
130 if [[ ! -d $i || ! -f $i/pkginfo ]]; then
131 log "$f_sanity_nopatch"
132 res=1
133 fi
134 done
135
136 #
137 # Check the core kernel pkg for the required KU patch.
138 #
139 found=0
140 for i in $dir/var/sadm/pkg/SUNWcakr*/pkginfo
141 do
142 patches=$(nawk -F= '{if ($1 == "PATCHLIST") print $2}' $i)
143 for patch in $patches
144 do
145 if [[ $patch == $req_patch ]]; then
146 found=1
147 break
148 fi
149 done
150
151 if (( $found == 1 )); then
152 break
153 fi
154 done
155
156 if (( $found != 1 )); then
157 log "$f_sanity_downrev" "$patches"
158 res=1
159 fi
160
161 #
162 # Check the S10 image for a required version of the emulation.
296 # think its working on an alternate root and let the caller halt the zone.
297 #
298 sysunconfig_zone() {
299 /usr/sbin/zlogin -S $ZONENAME /usr/sbin/sys-unconfig -R /./ \
300 >/dev/null 2>&1
301 if (( $? != 0 )); then
302 error "$e_unconfig"
303 return 1
304 fi
305
306 return 0
307 }
308
309 #
310 # Get zone's uuid for service tag.
311 #
312 get_inst_uuid()
313 {
314 typeset ZONENAME="$1"
315
316 ZONEUUID=`zoneadm -z $ZONENAME list -p | nawk -F: '{print $5}'`
317 [[ $? -ne 0 || -z $ZONEUUID ]] && return 1
318
319 INSTANCE_UUID="urn:st:${ZONEUUID}"
320 return 0
321 }
322
323 #
324 # Add a service tag for a given zone. We use two UUIDs-- the first,
325 # the Product UUID, comes from the Sun swoRDFish ontology. The second
326 # is the UUID of the zone itself, which forms the instance UUID.
327 #
328 add_svc_tag()
329 {
330 typeset ZONENAME="$1"
331 typeset SOURCE="$2"
332
333 if [ ! -x $STCLIENT ]; then
334 vlog "$v_no_tags"
335 return 0
336 fi
|
89 log "$f_sanity_sparse"
90 res=1
91 fi
92 done
93
94 if (( $res != 0 )); then
95 log "$sanity_fail"
96 fatal "$install_fail" "$ZONENAME"
97 fi
98
99 if [[ "$SANITY_SKIP" == 1 ]]; then
100 log "$w_sanity_detail"
101 return
102 fi
103
104 #
105 # Check image release to be sure its S10.
106 #
107 image_vers="unknown"
108 if [[ -f $dir/var/sadm/system/admin/INST_RELEASE ]]; then
109 image_vers=$(/usr/xpg4/bin/awk -F= '{if ($1 == "VERSION") print $2}' \
110 $dir/var/sadm/system/admin/INST_RELEASE)
111 fi
112
113 if [[ "$image_vers" != "10" ]]; then
114 log "$f_sanity_vers" "$image_vers"
115 res=1
116 fi
117
118 #
119 # Make sure we have the minimal KU patch we support. These are the
120 # KUs for S10u8.
121 #
122 if [[ $(uname -p) == "i386" ]]; then
123 req_patch="141445-09"
124 else
125 req_patch="141444-09"
126 fi
127
128 for i in $dir/var/sadm/pkg/SUNWcakr*
129 do
130 if [[ ! -d $i || ! -f $i/pkginfo ]]; then
131 log "$f_sanity_nopatch"
132 res=1
133 fi
134 done
135
136 #
137 # Check the core kernel pkg for the required KU patch.
138 #
139 found=0
140 for i in $dir/var/sadm/pkg/SUNWcakr*/pkginfo
141 do
142 patches=$(/usr/xpg4/bin/awk -F= '{if ($1 == "PATCHLIST") print $2}' $i)
143 for patch in $patches
144 do
145 if [[ $patch == $req_patch ]]; then
146 found=1
147 break
148 fi
149 done
150
151 if (( $found == 1 )); then
152 break
153 fi
154 done
155
156 if (( $found != 1 )); then
157 log "$f_sanity_downrev" "$patches"
158 res=1
159 fi
160
161 #
162 # Check the S10 image for a required version of the emulation.
296 # think its working on an alternate root and let the caller halt the zone.
297 #
298 sysunconfig_zone() {
299 /usr/sbin/zlogin -S $ZONENAME /usr/sbin/sys-unconfig -R /./ \
300 >/dev/null 2>&1
301 if (( $? != 0 )); then
302 error "$e_unconfig"
303 return 1
304 fi
305
306 return 0
307 }
308
309 #
310 # Get zone's uuid for service tag.
311 #
312 get_inst_uuid()
313 {
314 typeset ZONENAME="$1"
315
316 ZONEUUID=`zoneadm -z $ZONENAME list -p | /usr/xpg4/bin/awk -F: '{print $5}'`
317 [[ $? -ne 0 || -z $ZONEUUID ]] && return 1
318
319 INSTANCE_UUID="urn:st:${ZONEUUID}"
320 return 0
321 }
322
323 #
324 # Add a service tag for a given zone. We use two UUIDs-- the first,
325 # the Product UUID, comes from the Sun swoRDFish ontology. The second
326 # is the UUID of the zone itself, which forms the instance UUID.
327 #
328 add_svc_tag()
329 {
330 typeset ZONENAME="$1"
331 typeset SOURCE="$2"
332
333 if [ ! -x $STCLIENT ]; then
334 vlog "$v_no_tags"
335 return 0
336 fi
|