mkfile 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. # /sys/lib/dist/mkfile
  2. <defs
  3. x=`{setup} # import /sys/lib/dist/web.protect from the outside
  4. cd:V: $scr/plan9.iso
  5. ncd:V: $scr/plan9-new.iso.bz2
  6. ncd-dist:V: $scr/plan9-new.iso.bz2
  7. mk $dist/web.protect/plan9-new.iso.bz2
  8. $scr/usbdisk.bz2:D: $scr/plan9.iso.bz2
  9. cd pc; mk $target
  10. usb-dist:V: $scr/usbdisk.bz2
  11. mk $dist/web.protect/usbdisk.bz2
  12. #contrib-cd:V: $scr/contrib.iso.bz2
  13. # mk $dist/web.protect/contrib.iso.bz2
  14. #$scr/contrib.iso:DV:
  15. # rm -f $target
  16. # disk/mk9660 -9cj -v 'Plan 9 Extras' -s /n/sources \
  17. # -p ./contrib.proto $target
  18. $scr/%.iso:D: $src9/dist/replica/plan9.log
  19. rfork n
  20. @ { cd pc; mk cddisk }
  21. rm -f $target
  22. bind pc/cddisk cdstub/bootdisk.img
  23. bind /386/9load cdstub/9load
  24. bind /386/pbsraw cdstub/pbsraw
  25. if(! test -f $src9/bootdisk.img)
  26. bind -a cdstub $src9
  27. title=`{date | sed 's/(...) (...) (..) (..:..):.. (...) (....)/Plan 9 - \2 \3 \6 \4/'}
  28. title=$"title
  29. echo 'CD:' $title
  30. disk/mk9660 -9cj -v $title -s $src9 -B pbsraw -x 9load $target
  31. # copy (compressed) file from scratch space to the distribution, carefully
  32. $dist/web.protect/%: $scr/%
  33. >>$target.new
  34. chmod +t $target.new # waste write buf, not venti store
  35. cp $prereq $target.new
  36. # replace previous version with a flash cut
  37. if (test -e $target)
  38. mv $target $target.old # try to not clobber downloads in progress
  39. mv $target.new $target
  40. cd-cleanup:V:
  41. rm -f $dist/web.protect/*.iso.bz2.old # remove old versions after a delay
  42. # generate replica log & db for $src9 only
  43. scan:V:
  44. test -d $scr # make sure other was mounted above
  45. test -d $src9
  46. test -d $dist/web.protect
  47. lock scan.lock replica/scan $dist/sources.replica
  48. chmod +t $src9/dist/replica/*.^(db log)
  49. # generate replica log & db for all of /n/sources
  50. scanall:V:
  51. @ {
  52. rfork ne
  53. d=/n/sources
  54. test -d $src9
  55. lock scanall.lock replica/scan $dist/sourcesall.replica
  56. chmod +t $src9/dist/replica/*.^(db log)
  57. }
  58. compresslog:V:
  59. {
  60. awk -f logcompress.awk $src9/dist/replica/plan9.log |
  61. awk -f logtime.awk -v 't='^`{date -n} >/tmp/plan9.log
  62. rm -f $src9/dist/replica/plan9.new.log
  63. cp /tmp/plan9.log $src9/dist/replica/plan9.new.log &&
  64. mv $src9/dist/replica/plan9.new.log $src9/dist/replica/plan9.log
  65. } <scan.lock
  66. #restart:V:
  67. # rm -f $src9/dist/replica/plan9.db
  68. # rm -f $src9/dist/replica/plan9.log
  69. # chmod 664 $src9/dist/replica/plan9.db >$src9/dist/replica/plan9.db
  70. # chmod 664 $src9/dist/replica/plan9.log >$src9/dist/replica/plan9.log
  71. # chmod +a $src9/dist/replica/plan9.log
  72. # mk scan
  73. odump:V:
  74. disk/dump9660 -9cj -v 'Plan 9 4e Dumps' -s $src9 \
  75. -p /sys/lib/sysconfig/proto/allproto $scr/distdump.iso
  76. cd.install:DV:
  77. bzip2 -9 <$scr/plan9.iso >web.protect/nplan9.iso.bz2
  78. D.install:V:
  79. D=/n/roro/usr/rob/testplan9
  80. 9fs roro
  81. test -d $D
  82. cp $D$dist/pc/ndisk $dist/web.protect/ndisk
  83. cp $D$dist/pc/9loaddebug $dist/web.protect/n9loaddebug
  84. reallyinstall:V:
  85. if(! ~ $sysname achille){
  86. echo; echo; echo '*** this needs to run on achille.'
  87. exit bad
  88. }
  89. cd web.protect
  90. for (i in plan9.iso.bz2 disk 9loaddebug vmware.zip)
  91. if(test -f n$i){
  92. mv $i _$i && { mv n$i $i || mv _$i $i }
  93. }
  94. rm /srv/ramfs.9down4e
  95. $dist/startcache
  96. dump:V:
  97. rm -f /srv/9660.xxx
  98. 9660srv 9660.xxx
  99. mount /srv/9660.xxx /n/kremvax $scr/plan9.iso
  100. now=`{mtime $dist/web.protect/plan9.iso.bz2 | awk '{print $1}'}
  101. ls -l /rls/plan9/4e.iso
  102. disk/dump9660 -9cj -s /n/kremvax -n $now /rls/plan9/4e.iso
  103. ls -l /rls/plan9/4e.iso
  104. rm /srv/9660.xxx
  105. reencode:V:
  106. rm -f $scr/nplan9.iso
  107. rm -f /srv/9660.xxx
  108. 9660srv 9660.xxx
  109. mount /srv/9660.xxx /n/kremvax $scr/plan9.iso
  110. disk/mk9660 -9cj -v 'Plan 9 4th Edition' -s /n/kremvax \
  111. -b bootdisk.img $scr/nplan9.iso
  112. rm /srv/9660.xxx
  113. # compress a cd image in scratch space
  114. $scr/%.iso.bz2:D: $scr/%.iso
  115. @ {
  116. cd $scr
  117. bzip2 -9 <$stem.iso >n$stem.iso.bz2 &&
  118. {
  119. if (test -e $stem.iso.bz2)
  120. mv $stem.iso.bz2 _$stem.iso.bz2
  121. mv n$stem.iso.bz2 $stem.iso.bz2
  122. }
  123. echo `{date} md5 `{md5sum <$stem.iso.bz2} \
  124. sha1 `{sha1sum <$stem.iso.bz2} \
  125. $stem.iso.bz2 >>/usr/web/plan9checksums.txt
  126. }
  127. rebuild:V:
  128. chmod +l build.lock >>build.lock
  129. lock build.lock rebuild
  130. rebuild-mail:V:
  131. chmod +l build.lock >>build.lock
  132. lock build.lock rebuild
  133. datemail 'nightly build errors' 9trouble <buildit.out
  134. datemail 'nightly build differences' 9trouble <checkbuild.out
  135. status=''
  136. scansources-mail:V:
  137. scansources | datemail 'nightly fs vs. sources scan' 9trouble
  138. worldwritable-mail:V:
  139. test -e $src9
  140. @ {cd /n/sources; /sys/lib/dist/rsc/bin/$cputype/lsr -t -d} |
  141. awk '$2 ~ /[2367]$/' | grep -vf ok-writable |
  142. datemail 'WRITABLE FILES ON SOURCES' 9trouble || status=''
  143. status=''
  144. @ {
  145. cd $src9
  146. /sys/lib/dist/rsc/bin/$cputype/lsr -t -d $src9
  147. } |
  148. awk '$2 ~ /[2367][^2367].$/' |
  149. datemail 'non-group-writable files on sources' 9trouble
  150. status=''
  151. # use /n/boot to avoid walking the archives mounted under
  152. # /lib/vac, or other mounts or binds.
  153. rfork n
  154. 9fs boot
  155. test -e /n/boot/sys
  156. /sys/lib/dist/rsc/bin/$cputype/lsr -t -d /n/boot/sys /n/boot/lib |
  157. grep -v '/lib/audio/|/sys/src/cmd/vac/test/' | # give us a break
  158. awk '$2 ~ /[2367][^2367].$/' |
  159. datemail 'non-group-writable files on fs' 9trouble
  160. status=''
  161. 9.tar.gz:V:
  162. @{
  163. rfork n
  164. 9fs sources
  165. test -e $src9
  166. bind -a $src9 $src9/sys/src
  167. cd $src9/sys/src
  168. tar c LICENSE NOTICE 9
  169. } | gzip >$target
  170. 9-export:V: 9.tar.gz
  171. 9fs sources
  172. cp 9.tar.gz /n/sources/extra/9.tgz
  173. chmod +t /n/sources/extra/9.tgz
  174. plan9.tar.bz2:V:
  175. @{
  176. rfork n
  177. 9fs sources
  178. cd /n/sources
  179. test -e $src9
  180. bind /n/empty $src9/lib/font
  181. bind /n/empty $src9/sys/lib/postscript/font
  182. bind /n/empty $src9/sys/lib/ghostscript
  183. bind /n/empty $src9/sys/src/cmd/gs
  184. tar c plan9/LICENSE* plan9/NOTICE plan9/*/mkfile plan9/*/include \
  185. plan9/acme/*/src plan9/acme/bin/source \
  186. plan9/^(adm cron lib lp mail rc sys tmp usr)
  187. } | bzip2 >$target
  188. plan9-export:V: plan9.tar.bz2
  189. 9fs sources
  190. chmod +t plan9.tar.bz2
  191. mv plan9.tar.bz2 /n/sources/extra/plan9.tar.bz2