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 (the "License"). 7 # You may not use this file except in compliance with the License. 8 # 9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 # or http://www.opensolaris.org/os/licensing. 11 # See the License for the specific language governing permissions 12 # and limitations under the License. 13 # 14 # When distributing Covered Code, include this CDDL HEADER in each 15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 # If applicable, add the following below this CDDL HEADER, with the 17 # fields enclosed by brackets "[]" replaced with your own identifying 18 # information: Portions Copyright [yyyy] [name of copyright owner] 19 # 20 # CDDL HEADER END 21 # 22 # Copyright 2007 Sun Microsystems, Inc. All rights reserved. 23 # Use is subject to license terms. 24 # 25 # Simple interface script to plug into Dwarf Caiman GUI 26 27 ( 28 echo "=== $0 started at `date`" 29 30 progress=$2 31 32 profile=$3 33 34 bootdev=`grep ^boot_device $profile|cut -f2 -d' '` 35 36 rootspec=`grep '^filesys.*/$' $profile` 37 38 rootslice=`echo $rootspec | cut -f2 -d' ' | cut -f2 -d'.'` 39 40 rootslicenum=`echo $rootslice | cut -c2` 41 42 rootsz=`echo $rootspec | cut -f3 -d' '` 43 44 swapspec=`grep '^filesys.*swap$' $profile` 45 46 swapslice=`echo $swapspec | cut -f2 -d' ' | cut -f2 -d'.'` 47 48 swapslicenum=`echo $swapslice | cut -c2` 49 50 swapsz=`echo $swapspec | cut -f3 -d' '` 51 52 rootdev=$bootdev$rootslice 53 swapdev=$bootdev$swapslice 54 55 # Unmount any mounted solaris instances 56 for d in /mnt/solaris*; do 57 umount -f $d 58 done 59 60 # Set up boot and swap slices 61 cat >/tmp/fmt <<EOF 62 pa 63 $swapslicenum 64 swap 65 wu 66 1 67 ${swapsz}mb 68 label 69 0 70 EOF 71 format -e -d $bootdev -f /tmp/fmt -s 72 73 # Now setup root slice 74 cat >/tmp/fmt <<EOF 75 pa 76 pr 77 EOF 78 swapcyls=`format -e -d $bootdev -f /tmp/fmt|grep swap|sed -e's/ */ /g'|cut -f 7 -d ' '` 79 rootcyl=$(($swapcyls+1)) 80 cat >/tmp/fmt <<EOF 81 pa 82 $rootslicenum 83 root 84 wm 85 $rootcyl 86 ${rootsz}mb 87 label 88 0 89 EOF 90 format -e -d $bootdev -f /tmp/fmt -s 91 92 /root/installer/install_live ufs /dev/dsk/$rootdev /dev/dsk/$swapdev $progress 93 94 ) >/tmp/dummy_install.log 2>&1 95