Browse Source

Plan 9 from Bell Labs 2013-11-14

David du Colombier 10 years ago
parent
commit
15dec96261
3 changed files with 38 additions and 21 deletions
  1. 3 3
      sys/lib/dist/mkfile
  2. 22 9
      sys/lib/dist/pc/mkfile
  3. 13 9
      sys/lib/dist/setup

+ 3 - 3
sys/lib/dist/mkfile

@@ -11,8 +11,9 @@ ncd:V: $scr/plan9-new.iso.bz2
 ncd-dist:V: $scr/plan9-new.iso.bz2
 	mk $dist/web.protect/plan9-new.iso.bz2
 
-usb-dist:V: 
-	cd pc; mk usbdisk
+$scr/usbdisk.bz2:D: $scr/plan9.iso.bz2
+	cd pc; mk $target
+usb-dist:V: $dist/web.protect/usbdisk.bz2
 
 #contrib-cd:V: $scr/contrib.iso.bz2
 #	mk $dist/web.protect/contrib.iso.bz2
@@ -36,7 +37,6 @@ $scr/%.iso:D: $src9/dist/replica/plan9.log
 	disk/mk9660 -9cj -v $title -s $src9 -B pbsraw -x 9load $target
 
 # copy (compressed) file from scratch space to the distribution, carefully
-# $dist/web.protect/%.iso.bz2:	$scr/%.iso.bz2
 $dist/web.protect/%:		$scr/%
 	>>$target.new
 	chmod +t $target.new		# waste write buf, not venti store

+ 22 - 9
sys/lib/dist/pc/mkfile

@@ -80,20 +80,33 @@ cddisk:D: 9load /sys/src/9/pc/9pcflop.gz plan9.ini.cd /lib/vgadb
 		/sys/src/9/pc/^(9pcflop 9pccd)^.gz subst/plan9.ini /lib/vgadb
 	ls -l $target
 
-usbdisk:D: /n/sources/plan9
+$scr/usbdisk:D: /n/sources/plan9
+	@ {
+	rfork n
 	if (~ $#scr 0 || ~ $scr '') {
 		echo '$scr unset' >[1=2]
 		exit not-set-up
 	}
 	cd $scr
-	mkusbboot -s 1900 -r /n/sources/plan9 && mv image $target
-	rm -f $target.bz2
-	bzip2 $target && rm -f $target
-	pwd
-	ls -l $target*
-	if (test `{ls -s $target.bz2 | awk '{print $1}'} -lt 80000) {
-		echo $target.bz2 implausibly small >[1=2]
-		exit bz2-too-small
+	bind /dev/null /dev/cons
+	bind /dev/null /dev/consctl
+	{ mkusbboot -s 1900 -r /n/sources/plan9; mv image $target } >[2=1] |
+		grep -v 'mkfs: /sys/lib/sysconfig/proto/.*can''t stat'
+	exit ''
+	}
+$scr/usbdisk.bz2:D: $scr/usbdisk
+	@ {
+	rm -f $target
+	bzip2 $prereq && rm -f $prereq
+	ls -l $target
+	targsz = `{{ls -s $target; echo 0} | awk '{print $1; exit}'}
+	if (test $targsz -lt 80000) {
+		echo $target implausibly small:	>[1=2]
+		ls -l $target			>[1=2]
+		rm -f $target
+		exit $target-too-small
+	}
+	exit ''
 	}
 
 clean:V:

+ 13 - 9
sys/lib/dist/setup

@@ -7,19 +7,23 @@
 9fs outfsother
 
 if (test -e /cfg/$sysname/config)
-	. /cfg/$sysname/config
-if not
-	outip=204.178.31.2
+	.   /cfg/$sysname/config
+if not {
+	outsys=outside
+	out=$outsys.cs.bell-labs.com
+	outfs=outfs		# outside is a client of outfs
+}
 
-import -c tcp!$outip!666 $dist/web.protect
-if (! test -e $dist/web.protect/plan9.iso) {
-	echo import web.protect failed: $dist/web.protect/plan9.iso missing \
-		>[1=2]
+# for some reason, -c doesn't actually enable creation
+#import -c tcp!$out!666 $dist/web.protect
+#if (! test -e $dist/web.protect/plan9.iso) {
+#	echo import web.protect failed: $dist/web.protect/plan9.iso missing \
+#		>[1=2]
 
-	bind /n/outfsother/web.protect $dist/web.protect	# HACK
+	bind -c /n/outfsother/web.protect $dist/web.protect	# HACK
 	if (! test -e $dist/web.protect/plan9.iso) {
 		echo bind outfsother failed: $dist/web.protect/plan9.iso \
 			missing >[1=2]
 		exit no-web-protect
 	}
-}
+#}