inst: cleanup installer making it not rely on path containing .

always explicitely execute installer modules with ./name instead
of relying that the path contians the dot.
This commit is contained in:
cinap_lenrek 2013-10-26 20:17:56 +02:00
parent 744dbd6bb8
commit 0d378e905e
14 changed files with 19 additions and 103 deletions

View file

@ -101,7 +101,7 @@ case go
logprog unmount /n/9fat
disk=`{basename `{basename -d $9fat}}
if(bootplan9){
if(./bootplan9){
didbootsetup=1
export didbootsetup
}

View file

@ -23,7 +23,7 @@ case go
export ipaddr ipmask gwaddr
}
export ethermethod gwaddr ipaddr ipmask dhcphost
exec startether go
exec ./startether go
case checkdone
if(! ~ $ethermethod manual dhcp) {

View file

@ -12,7 +12,7 @@ case checkready checkdone
if(~ $netisfrom ppp ether){
x=config$netisfrom
$x=done
config$netisfrom checkdone
./config$netisfrom checkdone
confignet=$$x
export confignet
exit
@ -60,7 +60,7 @@ case go
export netisfrom
if(~ $netisfrom ether ppp)
exec config$netisfrom go
exec ./config$netisfrom go
if(! test -f /srv/cs && ! test -f /net/cs)
ndb/cs

View file

@ -53,7 +53,7 @@ case go
}
export pppdev pppmethod pppphone ppppasswd pppuser pppbaud
exec startppp go
exec ./startppp go
case checkdone
if(! ~ $#pppmethod 1 || ! test -f /dev/$pppdev){

View file

@ -12,5 +12,5 @@ case checkdone
case go
echo 'Congratulations; you''ve completed the install.'
echo
halt
exec ./halt
}

View file

@ -1,7 +0,0 @@
#!/bin/rc
if(! ~ $#* 1) {
echo 'usage: hdrs file.9gz' >[1=2]
exit usage
}
gunzip < $1 | disk/mkext -h

View file

@ -1,6 +1,6 @@
#!/bin/rc
. defs
. ./defs
while()
{
@ -57,7 +57,7 @@ for(i in $tasks) {
$i=notdone
if(~ $$i done) {
export $i
$i checkdone
./$i checkdone
$i=`{grep '^'$i^'=' /tmp/vars | sed -n '$p' | sed 's/.*=//'}
}
@ -70,7 +70,7 @@ for(i in $tasks) {
case yes
$i=ready
export $i
$i checkready
./$i checkready
$i=`{grep '^'$i^'=' /tmp/vars | sed -n '$p' | sed 's/.*=//'}
case no
$i=notdone
@ -108,7 +108,7 @@ prompt -d $ready(1) -w '' 'Task to do' $done $ready
echo
echo $div
$rd go
./$rd go
$rd=done # if it's not, the check will figure that out
export $rd
}

View file

@ -1,7 +1,7 @@
#!/bin/rc
cd /bin/inst
. defs
. ./defs
fn sigint { }
coherence
@ -11,4 +11,4 @@ coherence
# continually reexecing from here.
while()
main
./main

View file

@ -1,59 +0,0 @@
BEGIN{
m = "common"
haveold = 0;
while(getline <"/n/9fat/plan9-3e.ini" > 0){
haveold = 1
if($0 ~ /\[.*\]/){
m = substr($0, 2, length($0)-2)
continue
}
if(m=="menu" && $0 ~ /^menuitem=4e,/)
continue
a[m] = a[m] $0 "\n"
}
a["4e"] = ""
while(getline <"/tmp/plan9.ini" > 0)
a["4e"] = a["4e"] $0 "\n"
if(a["menu"] == "" && haveold){
a["menu"] = "menuitem=3e, Plan 9 Third Edition\n"
a["3e"] = ""
}
if(a["common"] != ""){
for(i in a)
if(i != "4e" && i != "common" && i != "menu")
a[i] = a["common"] a[i]
delete a["common"]
}
bootdisk4e=ENVIRON["fs"]
gsub("/dev/", "boot(args|disk|file)=local!#S/", bootdisk4e)
if(!haveold)
print a["4e"]
else{
print "[menu]"
print "menuitem=4e, Plan 9 Fourth Edition"
print a["menu"]
print ""
delete a["menu"]
print "[4e]"
print a["4e"]
print ""
delete a["4e"]
for(i in a){
# BUG: if rootdir is already there we should rewrite it
# sometimes into /3e/whatwasthere
if(a[i] ~ bootdisk4e && !(a[i] ~ /rootdir=/))
a[i] = "rootdir=/root/3e\n" a[i]
print "[" i "]"
gsub(/9fat!9pcdisk/, "9fat!9pc3e", a[i])
print a[i]
print ""
}
}
}

View file

@ -56,7 +56,7 @@ case checkready
if(domount){
mountdist=done
export mountdist
if(mountdist checkdone)
if(./mountdist checkdone)
exit
}
srvmedia=()

View file

@ -5,9 +5,9 @@
switch($fstype){
case cwfs cwfs64 cwfs64x
exec mountcwfs $*
exec ./mountcwfs $*
case hjfs
exec mounthjfs $*
exec ./mounthjfs $*
case *
mountfs=notdone
export mountfs

View file

@ -31,7 +31,7 @@ case go
prompt $default 'Disk to partition' $disks
disk=$rd
if(! hasmbr /dev/$disk/data) {
if(! ./hasmbr /dev/$disk/data) {
echo 'The disk you selected HAS NO master boot record on its first sector.'
echo '(Perhaps it is a completely blank disk.)'
echo 'You need a master boot record to use the disk.'
@ -63,7 +63,7 @@ case checkdone
mbrandplan9=0
disks=`{ls /dev/sd*/plan9 >[2]/dev/null | sed 's!/dev/(sd.*)/plan9!\1!'}
for(disk in $disks) {
if(hasmbr /dev/$disk/data)
if(./hasmbr /dev/$disk/data)
mbrandplan9=1
}
if(~ $mbrandplan9 0){

View file

@ -4,7 +4,7 @@ if(test -w /dev/wctl)
echo scroll > /dev/wctl
cd /bin/inst
. defs
. ./defs
textinst=1
export textinst
@ -13,5 +13,4 @@ export textinst
rm -f /srv/log
echo 2 >/srv/log
log `{date} Installation process started
inst/mainloop
exec ./mainloop

View file

@ -1,17 +0,0 @@
#!/bin/rc
p=`{ps | grep $1 | sed 's/[^ ]* +([^ ]+) .*/\1/' }
while(! ~ $#p 1) {
sleep 1
p=`{ps | grep $1 | sed 's/[^ ]* +([^ ]+) .*/\1/'}
}
p=$p(1)
baropt='-w 145,129,445,168'
if(~ $textinst 1)
baropt=-t
{
while(test -f /proc/$p/fd)
grep '^ *'^$2^' ' /proc/$p/fd >[2]/dev/null
} | awk '{print $9 " '^$3^'"; fflush("/dev/stdout")}' | aux/statusbar $baropt $4