mkfile 5.7 KB

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