shithub: riscv

Download patch

ref: 0d378e905e4df6266d9fc9243e7ed735e12d839b
parent: 744dbd6bb8532d6add6b00a16a794fd037caadbf
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Sat Oct 26 16:17:56 EDT 2013

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.

--- a/rc/bin/inst/bootsetup
+++ b/rc/bin/inst/bootsetup
@@ -101,7 +101,7 @@
 	logprog unmount /n/9fat
 
 	disk=`{basename `{basename -d $9fat}}
-	if(bootplan9){
+	if(./bootplan9){
 		didbootsetup=1
 		export didbootsetup
 	}
--- a/rc/bin/inst/configether
+++ b/rc/bin/inst/configether
@@ -23,7 +23,7 @@
 		export ipaddr ipmask gwaddr
 	}
 	export ethermethod gwaddr ipaddr ipmask dhcphost
-	exec startether go
+	exec ./startether go
 
 case checkdone
 	if(! ~ $ethermethod manual dhcp) {
--- a/rc/bin/inst/confignet
+++ b/rc/bin/inst/confignet
@@ -12,7 +12,7 @@
 	if(~ $netisfrom ppp ether){
 		x=config$netisfrom
 		$x=done
-		config$netisfrom checkdone
+		./config$netisfrom checkdone
 		confignet=$$x
 		export confignet
 		exit
@@ -60,7 +60,7 @@
 	
 	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
--- a/rc/bin/inst/configppp
+++ b/rc/bin/inst/configppp
@@ -53,7 +53,7 @@
 	}
 	
 	export pppdev pppmethod pppphone ppppasswd pppuser pppbaud
-	exec startppp go
+	exec ./startppp go
 
 case checkdone
 	if(! ~ $#pppmethod 1 || ! test -f /dev/$pppdev){
--- a/rc/bin/inst/finish
+++ b/rc/bin/inst/finish
@@ -12,5 +12,5 @@
 case go
 	echo 'Congratulations; you''ve completed the install.'
 	echo
-	halt
+	exec ./halt
 }
--- a/rc/bin/inst/hdrs
+++ /dev/null
@@ -1,7 +1,0 @@
-#!/bin/rc
-
-if(! ~ $#* 1) {
-	echo 'usage: hdrs file.9gz' >[1=2]
-	exit usage
-}
-gunzip < $1 | disk/mkext -h 
--- a/rc/bin/inst/main
+++ b/rc/bin/inst/main
@@ -1,6 +1,6 @@
 #!/bin/rc
 
-. defs
+. ./defs
 
 while()
 {
@@ -57,7 +57,7 @@
 			$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 @@
 		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 @@
 echo
 echo $div
 
-$rd go
+./$rd go
 $rd=done		# if it's not, the check will figure that out
 export $rd
 }
--- a/rc/bin/inst/mainloop
+++ b/rc/bin/inst/mainloop
@@ -1,7 +1,7 @@
 #!/bin/rc
 
 cd /bin/inst
-. defs
+. ./defs
 fn sigint { }
 
 coherence
@@ -11,4 +11,4 @@
 # continually reexecing from here.
 
 while()
-	main
+	./main
--- a/rc/bin/inst/mkini.awk
+++ /dev/null
@@ -1,59 +1,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 ""
-		}
-	}
-}
--- a/rc/bin/inst/mountdist
+++ b/rc/bin/inst/mountdist
@@ -56,7 +56,7 @@
 		if(domount){
 			mountdist=done
 			export mountdist
-			if(mountdist checkdone)
+			if(./mountdist checkdone)
 				exit
 		}
 		srvmedia=()
--- a/rc/bin/inst/mountfs
+++ b/rc/bin/inst/mountfs
@@ -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
--- a/rc/bin/inst/partdisk
+++ b/rc/bin/inst/partdisk
@@ -31,7 +31,7 @@
 	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 @@
 	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){
--- a/rc/bin/inst/start
+++ b/rc/bin/inst/start
@@ -4,7 +4,7 @@
 	echo scroll > /dev/wctl
 
 cd /bin/inst
-. defs
+. ./defs
 
 textinst=1
 export textinst
@@ -13,5 +13,4 @@
 rm -f /srv/log
 echo 2 >/srv/log
 log `{date} Installation process started
-inst/mainloop
-
+exec ./mainloop
--- a/rc/bin/inst/watchfd
+++ /dev/null
@@ -1,17 +1,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
--