|
Jon, We have kind of the same problem where you actually have those stupid WWN names for the disks, the t3-1's are in this example The easiest way is to boot the system from the network (pxe, wanboot) and label the disk first with format (sparc) and label it like: "rootdisk" Then you specify in your sc_manifest the volid=rootdisk, something like: <target> <target_device> <disk> <disk_name name="rootdisk" name_type="volid"/> <partition name="1" action=""/> <partition name="2" action=""/> <partition name="3" action=""/> <partition name="1" action=""/> <slice name="0" action=""/> <slice name="1" action=""/> <slice name="3" action=""/> <slice name="4" action=""/> <slice name="5" action=""/> <slice name="6" action=""/> <slice name="0" action=""/> </disk> </target_device> </target> Then you can install. For x86 we use the simple "boot_disk" (as pre-defined keyword in the manifest): <target> <target_device> <disk> <disk_keyword key="boot_disk"/> <partition name="1" action=""/> <partition name="2" action=""/> <partition name="3" action=""/> <partition name="1" action=""/> <slice name="0" action=""/> <slice name="1" action=""/> <slice name="3" action=""/> <slice name="4" action=""/> <slice name="5" action=""/> <slice name="6" action=""/> <slice name="7" action=""/> <slice name="6" action=""> <size val="100mb"/> </slice> <slice name="7" action=""> <size val="100mb"/> </slice> </disk> </target_device> Of course, for the t3's , you have to know up front to specify which disk it actually is (HDD0, HDD1, etc) attached is a little script to figure that out, maybe you can download that to find you what is what. Actually, this is a derived profile script for solaris10, but it should work as a single script on Solaris 11 Express It would be easier of course when the derived profiles (with pre and post-scripts) show up in ai as well ;-) Paul On 03/23/11 10:13 AM, Ethan Quach wrote: Hi Jon, --
|
#! /bin/ksh
#
# This is a derived profile for the Sevilles and Solaris 10
# for now it installs on HDD0
TARGET_DISK="HDD0"
prtconf=/tmp/prtconf.out
wwn_disks=/tmp/wwn_disks.out
sas_ports=/tmp/sas_ports.out
format=/tmp/format.out
HDD_cXtYdZ=/tmp/HDD_cXtYdZ
# create the $format file ...
echo | /usr/sbin/format >$format
# create the $prtconf file ...
/usr/sbin/prtconf -v >$prtconf
SYSTEM_MODEL=`prtconf -pbv | awk '{
if ($0 ~ /banner-name/) {
split($0,a,":");
print a[2]
}
}'| sed "s/^ *//"`
cat $prtconf | \
nawk '
BEGIN {
path="";
prev_path="";
wwn_counter=0;
}
/wwn/,/path-class/ {
if ($0 ~ /wwn/) {
getline;
wwn=$0;
gsub(/^.*value=/,"",wwn);
gsub(/\047/,"",wwn);
info[wwn_counter,0]=wwn;
}
if ($0 ~ /lun/) {
getline;
getline;
}
if ($0 ~ /target-port/) {
getline;
wwn_port=$0;
gsub(/^.*value=/,"",wwn_port);
gsub(/\047/,"",wwn_port);
info[wwn_counter,1]=wwn_port;
}
if ($0 ~ /obp-path/) {
getline;
wwn_port_path=$0;
gsub(/^.*value=/,"",wwn_port_path);
gsub(/\047/,"",wwn_port_path);
gsub(/\/disk.*/,"",wwn_port_path);
info[wwn_counter,2]=wwn_port_path;
}
if ($0 ~ /phy-num/) {
getline;
wwn_port_num=$0;
gsub(/^.*value=/,"",wwn_port_num);
gsub(/\047/,"",wwn_port_num);
info[wwn_counter,3]=wwn_port_num;
wwn_counter++;
}
}
END {
for (i=0;i<wwn_counter;i++) {
printf("%s:%s:%s:%d\n",
info[i,0],info[i,1],info[i,2],info[i,3]);
}
}
' > $wwn_disks
cat $prtconf | \
nawk '
BEGIN {
instance=0;
sas_counter=0;
}
/LSI,sas, instance \#/,/dev_path/ {
if ($0 ~ /LSI,sas, instance \#/) {
instance=$0;
gsub(/^.*LSI,sas, instance #/,"",instance);
info[sas_counter,0]=instance;
}
if ($0 ~ /dev_path/ ) {
path=$0;
gsub(/^.*dev_path=/,"",path);
gsub(/:devctl.*/,"",path);
info[sas_counter,1]=path;
sas_counter++;
}
}
END {
for (i=0;i<sas_counter;i++) {
printf("%d:%s\n",info[i,0],info[i,1]);
}
}
' > $sas_ports
if [ "$SYSTEM_MODEL" == "SPARC T3-1" -o "$SYSTEM_MODEL" == "SPARC T3-2" ]
then
/usr/sbin/prtconf -vp | grep disk[0-9] | \
nawk -F ":" '{
d=$1;
gsub(/ /,"",d);
gsub(/disk/,"",d);
p=$2;
gsub(/\047/,"",p);
gsub(/\/disk@p.*/,"",p)
gsub(/ /,"",p);
printf("%d:%s\n",d,p);
}' | \
sort -t: +1n | \
nawk -F ":" '
BEGIN {
sas_counter=0;
prev_path="";
}
{
if ($2 != prev_path) {
info[sas_counter,0]=sas_counter;
info[sas_counter,1]=$2;
sas_counter++;
}
prev_path=$2;
}
END {
for (i=0;i<sas_counter;i++) {
printf("%d:%s\n",info[i,0],info[i,1]);
}
}
' > $sas_ports
fi
# 3 files, format.out, wwn_disks and sas_ports
nawk '
BEGIN {
fmt_cnt=0;
wwn_cnt=0;
sas_cnt=0;
}
{
# read in all 3 files
if (FILENAME=="'"$format"'") {
if ($0 ~ /[0-9]+. c[0-9]+t[A-Z0-9]+d[0-9]+/) {
format_disk[fmt_cnt,0]=$2;
fmt_cnt++;
}
}
if (FILENAME=="'"$wwn_disks"'") {
split($0,a,":");
wwn_disks[wwn_cnt,0]=a[1];
wwn_disks[wwn_cnt,1]=a[2];
wwn_disks[wwn_cnt,2]=a[3];
wwn_disks[wwn_cnt,3]=a[4];
wwn_cnt++;
}
if (FILENAME=="'"$sas_ports"'") {
split($0,b,":");
sas_ports[sas_cnt,0]=b[1];
sas_ports[sas_cnt,1]=b[2];
sas_cnt++;
}
}
END {
# combine wwn_disks and sas_ports, write out the disk number
# and of course the real disk from the format output
for(i=0;i<wwn_cnt;i++) {
disk_wwn=toupper(wwn_disks[i,0]);
for(j=0;j<sas_cnt;j++) {
if (wwn_disks[i,2]==sas_ports[j,1]) {
# hey, they match !!!
# print out the hddx and disk_wwn
hddx=sas_ports[j,0]*4 + wwn_disks[i,3]
# ok, match, now print out the real
disk from the format_disk array
for (k=0;k<fmt_cnt;k++) {
test=format_disk[k,0];
gsub(/c[0-9]+t/,"",test);
gsub(/d0/,"",test);
if (test==disk_wwn) {
printf("HDD%d:%s:%d\n",hddx,format_disk[k,0],hddx);
continue;
}
}
continue;
}
}
}
}
' $format $wwn_disks $sas_ports | sort -t : +2n > $HDD_cXtYdZ
echo "These are the local disks:"
cat $HDD_cXtYdZ
target_disk=`cat $HDD_cXtYdZ | \
awk -F: '{
if ($1 == "'"$TARGET_DISK"'") {
print $2;
}
}'`
if [ -z "$target_disk" ]
then
echo "Bummer! Your requested disk $TARGET_DISK is not there !!!"
exit 1
fi
if [ -z "${SI_PROFILE}" ]
then
exit 0;
fi
# write the new "profile"
echo
echo "Target disk: $target_disk ($TARGET_DISK)"
echo
cat <<- EOF >>${SI_PROFILE}
install_type initial_install
system_type standalone
partitioning explicit
cluster SUNWCXall
filesys ${target_disk}s1 4096 swap
filesys ${target_disk}s5 50
filesys ${target_disk}s6 50
filesys ${target_disk}s7 50
filesys ${target_disk}s0 free /
EOF
_______________________________________________ caiman-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/caiman-discuss

