summaryrefslogtreecommitdiff
path: root/rc/bin/inst/download
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@localhost>2011-04-12 15:53:55 +0000
committercinap_lenrek <cinap_lenrek@localhost>2011-04-12 15:53:55 +0000
commit67e93d6a0a4f15192638e131413b9d64c4269c76 (patch)
tree88fd1d17c4be283683a96ced44159e3ce6b6f2f7 /rc/bin/inst/download
parent7208d528bd42f981f2535403f72e4c0d7d8df643 (diff)
downloadplan9front-67e93d6a0a4f15192638e131413b9d64c4269c76.tar.xz
updating cwfs and moving installer in /rc/bin
Diffstat (limited to 'rc/bin/inst/download')
-rwxr-xr-xrc/bin/inst/download56
1 files changed, 56 insertions, 0 deletions
diff --git a/rc/bin/inst/download b/rc/bin/inst/download
new file mode 100755
index 000000000..70d7f5ba7
--- /dev/null
+++ b/rc/bin/inst/download
@@ -0,0 +1,56 @@
+#!/bin/rc
+
+# prereq: mountfs
+# desc: download or continue to download the distribution archives
+
+switch($1) {
+case checkready
+ devs=(`{cat /net/ipifc/*/status >[2]/dev/null |
+ grep -v '127\.0\.0\.1' |
+ sed 's/ .*//'})
+ if(~ $#devs 0) {
+ download=notdone
+ export download
+ }
+ if(~ $mountdist done){
+ download=notdone
+ export download
+ }
+
+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'
+ if(~ $textinst 1)
+ baropt=-t
+ if(! hget -vo /n/newfs/dist/_plan9.iso.bz2 $installurl/plan9.iso.bz2 |[2] bargraph $baropt 'downloading '^plan9.iso.bz2)
+ exit
+ mv /n/newfs/dist/_plan9.iso.bz2 /n/newfs/dist/plan9.iso.bz2
+ if(~ $fstype fossil){
+ echo fsys main sync >>/srv/fscons
+ }
+
+ echo 'The distribution is downloaded.'
+
+ srvmedia=()
+ mountmedia=(mount /srv/fossil /n/distmedia)
+ distmediadir=/dist
+ export distmediadir mountmedia distmedia
+
+case checkdone
+ if(! test -f /n/newfs/dist/plan9.iso.bz2) {
+ download=notdone
+ export download
+ }
+}
+