parts=`{ls /dev/sd*/* /srv/sd*/*.iso >[2]/dev/null |
grep -v '/(plan9.*|nvram|ctl|log|raw)$'}
for (i in $parts) {
echo -n ' '^$i
t=`{fstype $i}
switch($t){
case dos
fat=($fat $i)
case 9660
x9660=($x9660 $i)
}
echo
}
echo
echo The following storage media were detected.
echo Choose the one containing the distribution.
echo
for(i in $parts){
switch($i){
case $fat
echo ' '^$i^' (microsoft fat)'
case $x9660
echo ' '^$i^' (iso9660 cdrom)'
}
}
echo
srvmedia=()
mountmedia=()
switch($disk){
case /
mountmedia=(mount /srv/boot /n/distmedia)
case $fs
mountmedia=(bind /n/newfs /n/distmedia)
case $fat
srvmedia=(dossrv)
mountmedia=(mount /srv/dos /n/distmedia $disk)
case $x9660
srvmedia=(9660srv)
mountmedia=(mount /srv/9660 /n/distmedia $disk)
case *
echo Unknown disk type '(cannot happen)'
exit oops
}
export srvmedia mountmedia
domount
mountstatus=$status
}
first=yes
dir=/
while(~ $first yes || ! havedist /n/distmedia/$dir){
if(~ $first yes){
echo
echo Which directory contains the distribution?
echo 'Any of the following will suffice (in order of preference):'
echo ' - the root directory of the cd image'
echo ' - the directory containing 9front.iso'
echo ' - the directory containing 9front.iso.bz2'
echo
first=no
}
prompt -d $dir 'Location of archives'
dir=$rd
if(~ $#dir 0)
dir=/
if(! ~ $#dir 1)
dir=$"dir
if(! havedist /n/distmedia/$dir)
echo 'No distribution found in '^`{cleanname /$dir}
}