mkfile 2.8 KB

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