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