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