inst: fix pbs update for bootsetup, remove stopether and stopppp tasks

the pbs update might fail if we dont unmount the 9fat.
This commit is contained in:
cinap_lenrek 2012-12-20 11:17:10 +01:00
parent 9465269c40
commit 91cc172719
5 changed files with 35 additions and 69 deletions

View file

@ -52,35 +52,57 @@ case go
} >/tmp/plan9.ini
}
need9fatformat=no
if(! ~ `{fstype $9fat} dos)
need9fatformat=yes
# clean state
rm -f /tmp/oldplan9.ini /tmp/pbs.bak
unmount /n/9fat >[2]/dev/null
if(! test -f /srv/dos)
dossrv
if(! mount -c /srv/dos /n/9fat $9fat >[2]/dev/null)
need9fatformat=yes
if not if(! test -f /n/9fat/plan9.ini)
need9fatformat=yes
need9fatformat=yes
if(~ `{fstype $9fat} dos){
if(mount /srv/dos /n/9fat $9fat >[2]/dev/null){
if(cp /n/9fat/plan9.ini /tmp/oldplan9.ini >[2]/dev/null)
need9fatformat=no
unmount /n/9fat >[2]/dev/null
# make sure dossrv is gone
sleep 1
}
}
# always make backup of old bootsector
logprog dd -bs 512 -count 1 -if $9fat -of /tmp/pbs.bak
if(~ $need9fatformat yes){
log Initializing Plan 9 FAT partition.
logprog disk/format -r 2 -d -b /386/pbs $9fat
logprog mount -c /srv/dos /n/9fat $9fat
logprog disk/format -r 2 -d -b /n/newfs/386/pbs $9fat
}
if not {
log Updating bootsector.
logprog dd -if $9fat -of /n/9fat/pbs.bak -bs 512 -count 1
logprog disk/format -b /386/pbs $9fat
logprog disk/format -b /n/newfs/386/pbs $9fat
}
logprog mount -c /srv/dos /n/9fat $9fat
logprog rm -f /n/9fat/^(9bootfat plan9.ini 9pcf 9pccpuf)
logprog cp /n/newfs/386/9bootfat /n/9fat/9bootfat
# make file continous on disk
logprog chmod +al /n/9fat/9bootfat
logprog cp /tmp/plan9.ini /n/9fat/plan9.ini
logprog cp /n/newfs/386/9pcf /n/9fat/9pcf
logprog cp /n/newfs/386/9pccpuf /n/9fat/9pccpuf
# copy in backups
if(test -f /tmp/oldplan9.ini)
logprog cp /tmp/oldplan9.ini /n/9fat
if(test -f /tmp/pbs.bak)
logprog cp /tmp/pbs.bak /n/9fat
logprog unmount /n/9fat
disk=`{basename `{basename -d $9fat}}
if(bootplan9){
didbootsetup=1

View file

@ -23,8 +23,8 @@ tasks=(\
copydist\
ndbsetup nvramsetup\
tzsetup\
bootsetup finish stop\
stopether stopppp\
bootsetup\
finish\
)
# these don't show up in the menu but still matter

View file

@ -1,17 +0,0 @@
#!/bin/rc
# desc: save the current installation state, to be resumed later
# prereq:
# mustdo:
switch($1) {
case checkdone
stop=notdone
export stop
case checkready
if(~ $cdboot yes){
stop=notdone
export stop
}
}

View file

@ -1,20 +0,0 @@
#!/bin/rc
# desc: shut down the ethernet connection
# prereq:
switch($1) {
case checkready
if(! isipdevup /net/ether0) {
stopether=notdone
export stopether
}
case go
ip/ipconfig ether /net/ether0 unbind
case checkdone
stopether=notdone
export stopether
}

View file

@ -1,19 +0,0 @@
#!/bin/rc
# desc: shut down the ppp connection
# prereq:
switch($1) {
case checkready
if(! ~ $#pppdev 1 || ! isipdevup '^pkt[0-9]') {
stopppp=notdone
export stopppp
}
case go
kill ppp | rc
case checkdone
stopppp=notdone
export stopppp
}