Cleanups to /sys/lib/dist previous to efforts to make bootable usb/iso distribution files. These are syncs wrt 9. Reference: /n/patches.lsub.org/patch/distfixes Date: Mon Apr 23 13:52:21 CES 2012 Signed-off-by: nemo@lsub.org --- /rc/bin/pc/setup.9fat Thu Jan 1 00:00:00 1970 +++ /rc/bin/pc/setup.9fat Tue Jun 13 02:50:47 2000 @@ -0,0 +1,33 @@ +#!/bin/rc + +rfork e +if(! ~ $#* 2) { + echo 'usage: setup.9fat /dev/sdC0/9fat plan9.ini' >[1=2] + exit usage +} + +. /rc/bin/pc/defs +fat=$1 +ini=$2 +if(! test -f $fat) { + echo fat partition not found >[1=2] + exit fat +} +if(! test -f $ini) { + echo plan9.ini not found >[1=2] + exit ini +} + +if(pc/isfat $fat) { + echo 'Already a FAT partition in '^$fat^'; ream it?' + prompt 'ream 9fat' y n + switch($rd) { + case n + exit + } +} + +disk/format -r 2 -d -b /386/pbs $fat /386/9load /386/9pcdisk +mount -c /srv/dos /n/9fat $fat +cp $ini /n/9fat/plan9.ini +unmount /n/9fat --- /sys/lib/dist/defs Thu Jan 1 00:00:00 1970 +++ /sys/lib/dist/defs Sun Apr 8 00:26:20 2012 @@ -0,0 +1,9 @@ +#!/bin/rc +# defs - definitions for the mkfile +src9=/n/sources/plan9 # what to export +dist=/sys/lib/dist # where this machinery lives +scr=/n/other/dist # scratch space before copying to web.protect + +srccpy=/n/other/srcs.copy +srcbin=/n/other/srcs.bin +srcs=/n/sources/plan9 --- /sys/lib/dist/pc/inst/copydist Thu Apr 12 12:24:42 2012 +++ /sys/lib/dist/pc/inst/copydist Tue Apr 18 00:28:47 2006 @@ -16,7 +16,7 @@ exit } case go - inst/watchfd applylog 0 `{ls -l /n/dist/dist/replica/nix.log | awk '{print $6}'} 'Installing file system' & + inst/watchfd applylog 0 `{ls -l /n/dist/dist/replica/plan9.log | awk '{print $6}'} 'Installing file system' & replica/pull -c / /rc/bin/inst/replcfg if(~ $status '' *conflicts || test -f /n/newfs/dist/replica/didplan9witherrors) >/n/newfs/dist/replica/didplan9 --- /sys/lib/dist/pc/inst/replcfg Thu Apr 12 12:24:42 2012 +++ /sys/lib/dist/pc/inst/replcfg Fri Apr 1 15:10:39 2005 @@ -2,8 +2,8 @@ s=/n/dist/dist/replica serverroot=/n/dist -serverlog=$s/nix.log -serverproto=$s/nix.proto +serverlog=$s/plan9.log +serverproto=$s/plan9.proto fn servermount { status='' } fn serverupdate { status='' } --- /sys/lib/dist/pc/mkfile Thu Apr 12 12:24:43 2012 +++ /sys/lib/dist/pc/mkfile Mon Apr 11 21:08:20 2011 @@ -1,3 +1,50 @@ +out=outside # outside web server +s=/sys/lib/dist/pc +x=`{bind -b /sys/lib/dist/bin/$cputype /bin} + +default:V: ndisk + ls -l ndisk + +SUB=`{ls sub inst} +boot.raw:Q: proto $SUB + rm -rf boot + mkdir boot + bind /dev/null /sys/log/timesync + # make files writable for now. + cat proto | sed 's!d000!d775!;s!000!664!;s!555!775!;s!444!664!' >proto.cp + disk/mkfs -a proto.cp | disk/mkext -d boot + @{ + cd boot/386 + strip init + cd bin + strip * */* >[2]/dev/null || status='' + } + cat proto | sed 's!/.*!!' >proto.cp + disk/mkfs -a -s boot proto.cp | tee >{wc -c >[1=2]} | + touchfs 1000000000 >boot.raw + +boot.bz2:Q: boot.raw + ls -l boot.raw + bflz -n 32 < boot.raw >boot.bflz + ls -l boot.bflz + bzip2 -9 < boot.bflz >$target + ls -l $target + +root.bz2:Q: boot.bz2 + { + echo bzfilesystem + cat boot.bz2 + dd -if /dev/zero -bs 1024 -count 1 >[2]/dev/null + } >$target + ls -l $target + +/sys/src/9/pc/9pcflop.gz: root.bz2 + @{ + rfork n + cd /sys/src/9/pc + mk 'CONF=pcflop' 9pcflop.gz + } + /sys/src/9/pc/9pccd.gz: @{ cd /sys/src/9/pc @@ -14,23 +61,40 @@ # cp /386/9loadnousb $target # cater to old bioses cp /386/9loadlitedebug 9loaddebug +ndisk: 9load /sys/src/9/pc/9pcflop.gz plan9.ini /lib/vgadb + dd -if /dev/zero -of ndisk -bs 1024 -count 1440 >[2]/dev/null + disk/format -f -b /386/pbs -d ndisk \ + 9load /sys/src/9/pc/9pcflop.gz plan9.ini /lib/vgadb + ls -l ndisk + # cannot list both 9pcflop.gz and 9pccd.gz because they cannot be built # in parallel. stupid mk -cddisk:DV: 9load /sys/src/9/pc/9pccd.gz plan9.ini.cd /lib/vgadb +cddisk:DV: 9load /sys/src/9/pc/9pcflop.gz plan9.ini.cd /lib/vgadb mk -a /sys/src/9/pc/9pccd.gz -# mk -a /sys/src/9/pc/9pcflop.gz + mk -a /sys/src/9/pc/9pcflop.gz rfork n cp -x plan9.ini.cd subst/plan9.ini dd -if /dev/zero -of cddisk -bs 1024 -count 2880 >[2]/dev/null disk/format -t 3½QD -f -b /386/pbs -d cddisk \ - 9load /sys/src/9/pc/9pccd.gz \ + 9load /sys/src/9/pc/^(9pcflop.gz 9pccd.gz) \ subst/plan9.ini /lib/vgadb ls -l cddisk clean:V: if (! unmount 9load >[2]/dev/null) ; - rm -rf boot boot.bz2 boot.bflz boot.raw root.bz2 9pcflop 9load cddisk proto.cp 9loaddebug + rm -rf boot boot.bz2 boot.bflz boot.raw root.bz2 9pcflop ndisk 9load cddisk proto.cp 9loaddebug + +install:V: ndisk 9loaddebug + 9fs $out + dst=/n/$out/sys/lib/dist/web.protect + cp 9loaddebug $dst + gzip -9 < ndisk > $dst/plan9.flp.gz + # mk clean + +test:V: ndisk 9loaddebug + cp 9loaddebug ../web.protect2/n9loaddebug + cp ndisk ../web.protect2/ndisk cd0:D: cddisk rm -f cd0 --- /sys/lib/dist/pc/plan9.ini.cd Thu Apr 12 12:24:43 2012 +++ /sys/lib/dist/pc/plan9.ini.cd Wed Apr 13 23:19:21 2011 @@ -1,5 +1,11 @@ # config for initial cd booting +[menu] +menuitem=install, Install Plan 9 from this CD +menuitem=cdboot, Boot Plan 9 from this CD +# menuitem=debug, Boot Plan 9 from this CD and debug 9load + +[common] # very cautious settings to get started. # will defeat booting from usb devices. *nomp=1 @@ -21,6 +27,11 @@ # console=0 # baud=9600 +[install] +nobootprompt=local!/boot/bzroot +bootfile=sdD0!cdboot!9pcflop.gz + +[cdboot] bootargs=local!#S/sdD0/data bootfile=sdD0!cdboot!9pccd.gz --- /sys/lib/dist/pc/subst/plan9.ini Thu Apr 12 12:24:43 2012 +++ /sys/lib/dist/pc/subst/plan9.ini Wed Apr 13 23:19:25 2011 @@ -1,5 +1,11 @@ # config for initial cd booting +[menu] +menuitem=install, Install Plan 9 from this CD +menuitem=cdboot, Boot Plan 9 from this CD +# menuitem=debug, Boot Plan 9 from this CD and debug 9load + +[common] # very cautious settings to get started. # will defeat booting from usb devices. *nomp=1 @@ -21,6 +27,11 @@ # console=0 # baud=9600 +[install] +nobootprompt=local!/boot/bzroot +bootfile=sdD0!cdboot!9pcflop.gz + +[cdboot] bootargs=local!#S/sdD0/data bootfile=sdD0!cdboot!9pccd.gz --- /sys/lib/dist/setup Thu Apr 12 12:24:43 2012 +++ /sys/lib/dist/setup Sun Apr 8 00:26:20 2012 @@ -1,16 +1,13 @@ #!/bin/rc # setup - prep for the mkfile -#9fs sources -#9fs other -#9fs outfsother -#if (test -e /cfg/$sysname/config) -# . /cfg/$sysname/config -#if not -# outip=204.178.31.2 -#import -c tcp!$outip!666 $dist/web.protect +. ./defs -# we want to build a kernel from the NIX repo eventually, but -# for right now just use the stock one in your root. -# But don't make a mess. -mkdir -p /tmp/dist/pc -bind -bc /tmp/dist/pc /sys/src/9/pc +9fs sources +9fs other +9fs outfsother + +if (test -e /cfg/$sysname/config) + . /cfg/$sysname/config +if not + outip=204.178.31.2 +import -c tcp!$outip!666 $dist/web.protect