1# /sys/lib/dist/pc/mkfile 2out=outside # outside web server 3s=/sys/lib/dist/pc 4x=`{bind -b /sys/lib/dist/bin/$cputype /bin} 5 6default:V: cddisk 7 8SUB=`{ls sub inst} 9boot.raw:DQ: proto $SUB 10 rfork n 11 rm -rf boot 12 mkdir boot 13 bind /dev/null /sys/log/timesync 14 # make files writable for now. 15 sed 's!d000!d775!;s!000!664!;s!555!775!;s!444!664!' proto >proto.cp 16 disk/mkfs -a proto.cp | disk/mkext -d boot 17 @{ 18 cd boot/386 19 strip init 20 cd bin 21 strip * */* >[2]/dev/null || status='' 22 } 23 sed 's!/.*!!' proto >proto.cp 24 disk/mkfs -a -s boot proto.cp | tee >{wc -c >[1=2]} | 25 touchfs 1000000000 >$target 26 27boot.bz2:DQ: boot.raw 28 ls -l boot.raw 29 bflz -n 32 <boot.raw >boot.bflz 30 bzip2 -9 <boot.bflz >$target 31 ls -l boot.bflz $target 32 33root.bz2:DQ: boot.bz2 34 { 35 echo bzfilesystem 36 cat boot.bz2 37 dd -if /dev/zero -bs 1024 -count 1 >[2]/dev/null 38 } >$target 39 ls -l $target 40 41/sys/src/9/pc/9pcflop.gz: root.bz2 42 @{ 43 rfork n 44 cd /sys/src/9/pc 45 mk 'CONF=pcflop' 9pcflop.gz 46 } 47 48/sys/src/9/pc/9pccd.gz: 49 @{ 50 cd /sys/src/9/pc 51 mk 'CONF=pccd' 9pccd.gz 52 } 53 54# disk/format apparently uses stat to obtain a file's real name, so 55# binding 9loadusb onto 9load will store the name 9loadusb in the 56# generated fat filesystem. the same is true for plan9.ini.cd and plan9.ini. 57 589load: /386/9load 59 cp $prereq $target 60 cp /386/9loaddebug 9loaddebug 61 62# 9load no longer loads from floppies, and even if it did, this 63# no longer works, since 9load+9pcflop.gz won't fit on a floppy: 64# disk/format: data does not fit on disk (2849 2849) 65#ndisk: 9load /sys/src/9/pc/9pcflop.gz plan9.ini /lib/vgadb 66# dd -if /dev/zero -of ndisk -bs 1024 -count 1440 >[2]/dev/null 67# disk/format -f -b /386/pbs -d ndisk \ 68# 9load /sys/src/9/pc/9pcflop.gz plan9.ini /lib/vgadb 69# ls -l ndisk 70 71# cannot list both 9pcflop.gz and 9pccd.gz because they cannot be built 72# in parallel. stupid mk 73cddisk:D: 9load /sys/src/9/pc/9pcflop.gz plan9.ini.cd /lib/vgadb 74 mk -a /sys/src/9/pc/9pccd.gz 75 mk -a /sys/src/9/pc/9pcflop.gz 76 rfork n 77 cp -x plan9.ini.cd subst/plan9.ini 78 dd -if /dev/zero -of $target -bs 1024 -count 2880 >[2]/dev/null 79 disk/format -t 3½QD -f -b /386/pbs -d $target \ 80 /sys/src/9/pc/^(9pcflop 9pccd)^.gz subst/plan9.ini /lib/vgadb 81 ls -l $target 82 83usbdisk:D: /n/sources/plan9 84 cd $scr 85 mkusbboot -s 1900 -r /n/sources/plan9 && mv image $target 86 rm -f $target.bz2 87 bzip2 $target && rm -f $target 88 pwd 89 ls -l $target* 90 91clean:V: 92 if (! unmount 9load >[2]/dev/null) 93 ; 94 rm -rf boot boot.bz2 boot.bflz boot.raw root.bz2 9pcflop ndisk 9load cddisk proto.cp 9loaddebug 95 96install:V: 9loaddebug # ndisk 97 9fs $out 98 dst=/n/$out/sys/lib/dist/web.protect 99 cp 9loaddebug $dst 100 # gzip -9 <ndisk > $dst/plan9.flp.gz 101 # mk clean 102 103test:V: 9loaddebug # ndisk 104 cp 9loaddebug ../web.protect2/n9loaddebug 105 # cp ndisk ../web.protect2/ndisk 106 107cd0:D: cddisk 108 rm -f cd0 109 disk/mk9660 -9cj -v 'Plan 9 4th Edition' -s . -p cd0.proto -b cddisk cd0 110