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 or the disk device name ==> "
56 if [[ $choice == 9 ]]; then
58 elif [[ $choice == 8 ]]; then
60 if [[ $page == $highpage ]]; then
63 offset
=$
(($page * $onepage + 2))
64 elif [[ $choice == 0 ]]; then
65 if [[ $DISKLIST == "" ]]; then
66 echo -n "Press RETURN to go back to the main menu: "
73 if [[ $choice == "" ]]; then
76 NEWDISK
=`nawk -v choice=$choice '$1 == choice {print $3}' < /tmp/dp.$$`
77 if [[ $NEWDISK == "" ]]; then
78 NEWDISK
=`nawk -v choice=$choice '$3 == choice {print $3}' < \
81 if [[ $NEWDISK != "" ]]; then
82 if [[ $DISKLIST == "" ]]; then
84 elif [[ `echo $DISKLIST | grep $NEWDISK` == "" ]]; then
85 DISKLIST
="$DISKLIST $NEWDISK"
94 mkfile
64m
/tmp
/test.$$
95 if [[ $?
!= 0 ]]; then
96 echo "WARNING: Insufficient space in /tmp for installation..."
99 zpool create
$1 /tmp
/test.$$
100 if [[ $?
!= 0 ]]; then
101 echo "Can't test zpool create $1"
110 until [[ $NEWRPOOL == "" ]]; do
112 echo -n "Enter the root pool name or press RETURN if you want [$RPOOL]: "
114 if [[ $NEWRPOOL != "" ]]; then
115 reality_check
$NEWRPOOL
116 if [[ $?
!= 0 ]]; then
122 .
/kayak
/install_help.sh
123 .
/kayak
/disk_help.sh
124 BuildRpoolOnly
$DISKLIST
128 # Running actual install.
129 /kayak
/rpool-install.sh
$RPOOL $keyboard_layout