diff options
Diffstat (limited to 'rc/bin/inst')
-rwxr-xr-x | rc/bin/inst/configarch | 40 | ||||
-rwxr-xr-x | rc/bin/inst/configether | 2 | ||||
-rwxr-xr-x | rc/bin/inst/configip | 64 | ||||
-rwxr-xr-x | rc/bin/inst/confignet | 22 | ||||
-rwxr-xr-x | rc/bin/inst/configppp | 4 | ||||
-rwxr-xr-x | rc/bin/inst/download | 10 | ||||
-rwxr-xr-x | rc/bin/inst/main | 5 | ||||
-rwxr-xr-x | rc/bin/inst/moveoldfs | 72 | ||||
-rwxr-xr-x | rc/bin/inst/ndbsetup | 44 | ||||
-rwxr-xr-x | rc/bin/inst/startether | 2 | ||||
-rwxr-xr-x | rc/bin/inst/xxx | 9 |
11 files changed, 62 insertions, 212 deletions
diff --git a/rc/bin/inst/configarch b/rc/bin/inst/configarch deleted file mode 100755 index 61912bfdb..000000000 --- a/rc/bin/inst/configarch +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/rc - -# desc: set source of distribution archives -# prereq: mountfs - -switch($1) { -case go - echo - echo 'Will you be using a distribution archive on local media or the internet?' - echo - - prompt 'Distribution is from' local internet - archmedium=$rd - export archmedium - - switch($archmedium) { - case local - exec configlocal go - case internet - exec configip go - } - -case checkdone - switch($#archmedium) { - case 1 - switch($archmedium) { - case local - exec configlocal checkdone - case internet - exec configip checkdone - case * - configarch=notdone - export configarch - } - case * - configarch=notdone - export configarch - } -} - diff --git a/rc/bin/inst/configether b/rc/bin/inst/configether index 0922ea339..e52dc344f 100755 --- a/rc/bin/inst/configether +++ b/rc/bin/inst/configether @@ -11,7 +11,7 @@ case go echo ' dhcp - use DHCP to automatically configure' echo - prompt 'Configuration method' manual dhcp + prompt -d dhcp 'Configuration method' manual dhcp ethermethod=$rd gwaddr=xxx ipaddr=xxx diff --git a/rc/bin/inst/configip b/rc/bin/inst/configip deleted file mode 100755 index a7873c9f1..000000000 --- a/rc/bin/inst/configip +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/rc - -switch($1) { -case go - - devs='' - if(test -d '#l/ether0' >[2]/dev/null) - devs=$devs^ether - if(test -f '#t'/eia? >[2]/dev/null) - devs=$devs^ppp - - switch($devs){ - case '' - echo - echo 'Could not find ethernet card nor serial port nor modem.' - echo 'Please use a local copy of the distribution archive.' - echo - ifc=none - - case ppp - echo - echo 'No ethernet card was detected, but there is a serial port or modem.' - echo 'We will configure PPP.' - echo - ifc=ppp - - case ether - echo - echo 'No serial port or modem detected, but there is an ethernet card.' - echo 'We will configure the ethernet.' - echo - ifc=ether - - case etherppp - echo - echo 'You can connect to the internet via' - echo 'a local ethernet or a dial-up PPP connection.' - echo - prompt 'Interface to use' ether ppp - ifc=$rd - } - - ipinterface=$ifc - export ipinterface - - switch($ifc) { - case ether - exec configether go - case ppp - exec configppp go - } - -case checkdone - if(~ $#ipinterface 1) - switch($ipinterface) { - case ether - exec configether checkdone - case ppp - exec configppp checkdone - } - configarch=notdone - export configarch - -} diff --git a/rc/bin/inst/confignet b/rc/bin/inst/confignet index 182ed40cb..816bc7dd8 100755 --- a/rc/bin/inst/confignet +++ b/rc/bin/inst/confignet @@ -1,16 +1,15 @@ #!/bin/rc -# prereq: configdist -# desc: configure the network to download the distribution +# desc: configure the network switch($1){ case checkready checkdone - if(! ~ $distisfrom net){ - confignet=notdone + if(~ $netisfrom none){ + confignet=done export confignet exit } - if(~ $distisfrom net && ~ $netisfrom ppp ether){ + if(~ $netisfrom ppp ether){ x=config$netisfrom $x=done config$netisfrom checkdone @@ -24,16 +23,15 @@ case checkready checkdone case go devs='' - if(test -d '#l/ether0' >[2]/dev/null) + if(test -d /net/ether0 >[2]/dev/null) devs=$devs^ether - if(test -f '#t'/eia? >[2]/dev/null) + if(test -f /dev/eia? >[2]/dev/null) devs=$devs^ppp switch($devs){ case '' echo echo 'Could not find ethernet card nor serial port nor modem.' - echo 'Please use a local copy of the distribution archive.' echo netisfrom=none @@ -56,12 +54,16 @@ case go echo 'You can connect to the internet via' echo 'a local ethernet or a dial-up PPP connection.' echo - prompt 'Interface to use' ether ppp + prompt -d ether 'Interface to use' ether ppp netisfrom=$rd } export netisfrom if(~ $netisfrom ether ppp) exec config$netisfrom go -} + if(! test -f /srv/cs && ! test -f /net/cs) + ndb/cs + if(! test -f /srv/dns && ! test -f /net/dns) + ndb/dns -r +} diff --git a/rc/bin/inst/configppp b/rc/bin/inst/configppp index 6bbffc4f0..65e97a78b 100755 --- a/rc/bin/inst/configppp +++ b/rc/bin/inst/configppp @@ -4,9 +4,9 @@ switch($1) { case go - devs=`{ls -p '#t/'eia? >[2]/dev/null} + devs=`{ls -p /dev/eia? >[2]/dev/null} if(~ $#devs 0) { - echo 'No serial port found; this can''t happen.' # because configip checks + echo 'No serial port found; this can''t happen.' # because confignet checks exit } diff --git a/rc/bin/inst/download b/rc/bin/inst/download index 6a070e8ef..35f0462f7 100755 --- a/rc/bin/inst/download +++ b/rc/bin/inst/download @@ -18,16 +18,6 @@ case checkready } case go - if(! test -f /srv/cs) { - log starting cs, dns - logprog ndb/cs >>/srv/log >[2=1] - logprog ndb/dns -r >>/srv/log >[2=1] - } - if(! test -f /net/cs) { - logprog mount -a /srv/cs /net - logprog mount -a /srv/dns /net - } - # BUG make restartable echo 'Downloading distribution package...' baropt='-w 145,129,445,168' diff --git a/rc/bin/inst/main b/rc/bin/inst/main index db7412dce..1b9a0960d 100755 --- a/rc/bin/inst/main +++ b/rc/bin/inst/main @@ -21,14 +21,13 @@ tasks=(\ mountdist\ download\ copydist\ - nvramsetup\ + ndbsetup nvramsetup\ bootsetup finish stop\ stopether stopppp\ ) -# startether startppp stopether stopppp download\ # these don't show up in the menu but still matter -pseudotasks=(configip havefiles etherup etherdown pppup pppdown) +pseudotasks=(havefiles etherup etherdown pppup pppdown) for(i in $tasks $pseudotasks) $i=notdone diff --git a/rc/bin/inst/moveoldfs b/rc/bin/inst/moveoldfs deleted file mode 100755 index 819beeb39..000000000 --- a/rc/bin/inst/moveoldfs +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/rc - -# desc: move an old third edition plan 9 file system out of the way -# prereq: mountfs - -rootfiles=(\ - 386\ - 68000\ - 68020\ - LICENSE\ - NOTICE\ - acme\ - adm\ - alpha\ - arm\ - cron\ - dist\ - fd\ - lib\ - lp\ - mail\ - mips\ - mnt\ - n\ - power\ - rc\ - sparc\ - sys\ - tmp\ - usr/glenda\ - wrap\ -) - -switch($1){ -case checkready - if(! test -d /n/kfs/wrap){ - moveoldfs=done - export moveoldfs - } - -case go - if(test -d /n/kfs/wrap){ - echo 'You have a Third Edition Plan 9 installation on '^$fs^'.' - echo 'We need to move the old file system out of the way (into /3e)' - echo 'in order to continue.' - echo - prompt 'Move old file system' y n - switch($rd){ - case y - kname=`{kfsname $fs} - log Moving old Plan 9 installation into /3e on kfs - logprog disk/kfscmd -n$kname 'create /3e sys sys 555 d' >>[2]/srv/log - logprog disk/kfscmd -n$kname 'create /3e/usr sys sys 555 d' >>[2]/srv/log - for(i in $rootfiles) - if(test -e /n/kfs/$i) - logprog disk/kfscmd -n$kname 'rename /'^$i^' /3e/'^$i - # copy extant /adm/users in case there have been modifications - logprog disk/kfscmd -n$kname 'create /adm adm adm 555 d' >>[2]/srv/log - logprog cp /n/kfs/3e/adm/users /n/kfs/adm/users >>[2]/srv/log - - case n - echo 'Okay, but we can''t continue.' - echo - } - } - -case checkdone - if(test -d /n/kfs/wrap){ - moveoldfs=notdone - export moveoldfs - } -} diff --git a/rc/bin/inst/ndbsetup b/rc/bin/inst/ndbsetup new file mode 100755 index 000000000..0ab4e8250 --- /dev/null +++ b/rc/bin/inst/ndbsetup @@ -0,0 +1,44 @@ +#!/bin/rc + +# desc: setup network configuration +# prereq: confignet copydist + +switch($1){ +case checkready chekdone + if(! ~ $netisfrom ether || \ + grep -s `{cat /net/ether0/addr} /n/newfs/lib/ndb/local){ + ndbsetup=done + export ndbsetup + exit + } + if(~ $netisfrom ether && test -w /n/newfs/lib/ndb/local && \ + test -r /net/ether0/addr){ + ndbsetup=ready + export ndbsetup + exit + } + +case go + echo + echo 'Setup network configuration' + echo + + default=() + if(~ $#sysname 1) + default=(-d $sysname) + prompt $default 'sysname' + sysname=$rd + + { + echo + switch($ethermethod){ + case dhcp + echo 'sys='^$sysname 'ether='^`{cat /net/ether0/addr} + + case manual + echo 'sys='^$sysname 'ether='^`{cat /net/ether0/addr} \ + 'ip='^$ipaddr 'ipmask='^$ipmask 'ipgw='^$gwaddr + } + echo + } >>/n/newfs/lib/ndb/local +} diff --git a/rc/bin/inst/startether b/rc/bin/inst/startether index 077504c1a..bfe8764dd 100755 --- a/rc/bin/inst/startether +++ b/rc/bin/inst/startether @@ -19,7 +19,7 @@ case go case manual ip/ipconfig -g $gwaddr ether /net/ether0 $ipaddr $ipmask >>[2]/srv/log case dhcp - ip/ipconfig $dhcphost -D >>/srv/log >[2=1] + ip/ipconfig $dhcphost >>[2]/srv/log } case checkdone diff --git a/rc/bin/inst/xxx b/rc/bin/inst/xxx deleted file mode 100755 index 56b4eb23a..000000000 --- a/rc/bin/inst/xxx +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/rc - -ip/ipconfig -echo ' auth=204.178.31.3 - authdom=cs.bell-labs.com' >>/net/ndb -ndb/cs -auth/factotum -bind -a /bin/auth / -cpu -e clear -h tcp!204.178.31.2 |