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