4 # This file and its contents are supplied under the terms of the
5 # Common Development and Distribution License ("CDDL"), version 1.0.
6 # You may only use this file in accordance with the terms of version
9 # A full copy of the text of the CDDL should have accompanied this
10 # source. A copy of the CDDL is also available via the Internet at
11 # http://www.illumos.org/license/CDDL.
15 # Copyright 2017 OmniTI Computer Consulting, Inc. All rights reserved.
18 # Capture diskinfo(1M) output in a tempfile.
20 keyboard_layout
=${1:-US-English}
23 numdisks
=`wc -l $SCRATCH | awk '{print $1}'`
24 echo "numdisks before $numdisks"
25 numdisks
=$
(($numdisks - 1))
26 echo "numdisks after $numdisks"
28 # Number of disks on one page, must be <= 7.
30 highpage
=$
(($numdisks / $onepage))
31 remainder
=$
(($numdisks % $onepage))
32 if [[ $remainder != 0 ]]; then
33 highpage
=$
(($highpage + 1))
36 # Present the list of disks in a pretty manner, and get the user to
37 # generate a list of one or more disks. Put them in $DISKLIST...
42 until [[ $finished == 1 ]]; do
44 echo "root pool disks: [$DISKLIST]"
45 echo "0 == done, 1-7 == select-disk 8 == next-page, 9 == clear"
46 echo "--------------------------------------------------------"
47 head -1 $SCRATCH |
awk '{print "# ",$0}'
49 tail +$offset $SCRATCH |
head -$onepage |
awk '{print NR," ",$0}' \
53 echo -n "Enter a digit ==> "
56 if [[ $choice == 9 ]]; then
58 elif [[ $choice == 8 ]]; then
60 #echo -n "Old page $page, offset $offset... HIT RETURN!"
64 if [[ $page == $highpage ]]; then
67 offset
=$
(($page * $onepage + 2))
69 #echo -n "New page $page, offset $offset... HIT RETURN!"
71 elif [[ $choice == 0 ]]; then
72 if [[ $DISKLIST == "" ]]; then
73 echo -n "Press RETURN to go back to the main menu: "
80 if [[ $choice == "" ]]; then
83 NEWDISK
=`grep -w $choice /tmp/dp.$$ | awk '{print $3}'`
84 if [[ $NEWDISK != "" ]]; then
85 if [[ $DISKLIST == "" ]]; then
87 elif [[ `echo $DISKLIST | grep $NEWDISK` == "" ]]; then
88 DISKLIST
="$DISKLIST $NEWDISK"
97 mkfile
64m
/tmp
/test.$$
98 if [[ $?
!= 0 ]]; then
99 echo "WARNING: Insufficient space in /tmp for installation..."
102 zpool create
$1 /tmp
/test.$$
103 if [[ $?
!= 0 ]]; then
104 echo "Can't test zpool create $1"
113 until [[ $NEWRPOOL == "" ]]; do
115 echo -n "Enter the root pool name or press RETURN if you want [$RPOOL]: "
117 if [[ $NEWRPOOL != "" ]]; then
118 reality_check
$NEWRPOOL
119 if [[ $?
!= 0 ]]; then
126 #echo "Would do this:"
127 #echo " BuildRpool $DISKLIST"
128 .
/kayak
/install_help.sh
129 .
/kayak
/disk_help.sh
130 BuildRpoolOnly
$DISKLIST
134 # Running actual install.
135 /kayak
/rpool-install.sh
$RPOOL $keyboard_layout