1 # $Id: Makefile,v 1.340 1998/02/01 06:35:44 pst Exp $
3 # make release CHROOTDIR=/some/dir BUILDNAME=somename [ RELEASETAG=tag ]
5 # Where "/some/dir" is the pathname of a directory on a some
6 # filesystem with at least 600MB of free space, "somename" is what
7 # you want the release to call itself and, optionally, which CVS "tag"
8 # name should be used when checking out the sources to build the release
11 # Please note: the vn driver must also be compiled into your kernel,
12 # otherwise the target 'release.8' and possibly others will fail.
14 # Set these, release builder!
17 #BUILDNAME=2.2-RELEASE
19 # Automatic SNAP versioning:
22 BUILDNAME?=${BASE}-${DATE}-SNAP
24 #CHROOTDIR=/junk/release
25 # If this is a RELEASE, then set
26 #RELEASETAG=RELENG_2_2
28 # Uncomment this to disable the doc.1 target. It is also an ERROR
29 # to set NOPORTS and not set NODOC since docs depend on ports.
31 DOCPORTS= archivers/unzip lang/perl5 textproc/jade textproc/iso8879 \
32 textproc/linuxdoc textproc/docbook textproc/sgmlformat
34 # Things which without too much trouble can be considered variables
35 # BIN_DISTS are special in that they get full /etc installation sets.
37 COMPAT_DISTS?= compat1x compat20 compat21
38 OTHER_DISTS?= manpages catpages games proflibs dict info doc
39 CRYPTO_DISTS?= krb des
41 DISTRIBUTIONS?= ${BIN_DISTS} ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS}
44 # Extra source tarballs; each argument is a pair of source dir and
45 # distribution name. The dist name should not exceed 7 characters
46 # (another "s" for "source" will be prepended).
47 EXTRA_SRC+= usr.sbin/sendmail/cf smailcf
49 BOOT1= etc/protocols etc/rc.conf
51 # mountpoint for filesystems.
54 # other floppy parameters.
58 ZIPNSPLIT= gzip --no-name -9 -c | split -b 240640 -
60 # Upper size for the mfs in the boot.flp kernel.
61 # These are adjusted down to the minimum needed by doFS.sh.
67 # Things which may get you into trouble if you change them
68 MTREEFILES= ${.CURDIR}/../etc/mtree
75 # Where the bootstrap ports (see DOCPORTS) get installed.
76 LOCALDIR= /usr/local/bin
78 # ${BOOTSTRAPDIR} is for those utilities that refer to the hosting
79 # environment, rather than the target environment. This is specifically
80 # intended for kernel-dependent utilities that are used during the build.
82 # ${BOOTSTRAPDIR} is actually being used by prepending it to the normal
83 # ${PATH}. Thus, it's also available to outside utilities like doFS.sh.
84 BOOTSTRAPDIR= /bootstrap
86 # The mount subsystem has been changed between 2.2 and 3.0 by the
88 BOOTSTRAPUTILS= /sbin/mount /sbin/umount
90 # 3.0 cpio tries to reference lchown(2) which is not available in 2.2
91 BOOTSTRAPUTILS+= /usr/bin/cpio
93 .if !defined(CRUNCH_TARGETS)
94 CRUNCH_TARGETS= boot fixit
104 REDOSED= sed -e 's/dirs/release.1/' -e 's/trees/release.2/' \
105 -e 's/kerns/release.3/' -e 's/sysinstall/release.4/' \
106 -e 's/fixup/release.5/' -e 's/tarbin/release.6/' \
107 -e 's/tarsrc/release.7/' -e 's/boot\.flp/release.8/' \
108 -e 's/fixit\.flp/release.9/' -e 's/ftp/ftp.1/' \
109 -e 's/cdrom/cdrom.1/'
111 REDOREDO!= echo ${REDO} | ${REDOSED}
114 .if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT)
115 @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false
118 .if exists(${CHROOTDIR})
119 chflags -R noschg ${CHROOTDIR}/.
122 -mkdir -p ${CHROOTDIR}
123 cd ${.CURDIR}/../etc && ${MAKE} distrib-dirs DESTDIR=${CHROOTDIR}
124 cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR}
125 cd ${.CURDIR}/.. && ${MAKE} install DESTDIR=${CHROOTDIR} NOMAN=1
126 mkdir ${CHROOTDIR}/${BOOTSTRAPDIR}
127 for i in ${BOOTSTRAPUTILS} ; do \
128 cp -p ${CHROOTDIR}$$i ${CHROOTDIR}/${BOOTSTRAPDIR} ; \
130 .if !defined(RELEASETAG)
131 cd ${CHROOTDIR}/usr && rm -rf src && \
132 cvs -d ${CVSROOT} co -P src
134 cd ${CHROOTDIR}/usr && rm -rf src && \
135 cvs -d ${CVSROOT} co -P -r ${RELEASETAG} src
137 .if defined(LOCAL_PATCHES) && exists(${LOCAL_PATCHES})
138 cd ${CHROOTDIR}/usr/src && patch --silent < ${LOCAL_PATCHES}
140 .if !defined(NOPORTS)
141 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -d ${CVSROOT} co -P ports && cd ports && make readmes
144 cd ${CHROOTDIR}/usr && rm -rf doc && cvs -d ${CVSROOT} co -P doc
145 cd ${CHROOTDIR}/usr/ports && for i in ${DOCPORTS}; do \
146 (cd $$i; make fetch MASTER_SITE_OVERRIDE=file:/usr/ports/distfiles/ \
147 DISTDIR=${CHROOTDIR}/usr/ports/distfiles ); \
152 .if !defined(RELEASENOUPDATE)
153 .if !defined(RELEASETAG)
154 cd ${CHROOTDIR}/usr/src && cvs -q update -P -d
156 cd ${CHROOTDIR}/usr/src && cvs -q update -P -d -r ${RELEASETAG}
158 .if !defined(NOPORTS)
159 cd ${CHROOTDIR}/usr/ports && cvs -q update -P -d
162 cd ${CHROOTDIR}/usr/doc && cvs -q update -P -d
166 # Add version information to those things that need it.
167 ( cd ${CHROOTDIR}/usr/src/sys/conf && \
168 mv newvers.sh foo && \
169 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh&& rm foo )
170 ( cd ${CHROOTDIR}/usr/src/release/sysinstall && \
171 sed "s/__RELEASE/${BUILDNAME}/" version.h > version.h.new && \
172 mv version.h.new version.h && \
174 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
175 echo "#!/bin/sh" > ${CHROOTDIR}/mk
176 echo "set -ex" >> ${CHROOTDIR}/mk
177 echo "export CFLAGS='-O2 -pipe'" >> ${CHROOTDIR}/mk
178 echo "export DISTRIBUTIONS=\"${DISTRIBUTIONS}\"" >> ${CHROOTDIR}/mk
179 echo "export BUILDNAME=${BUILDNAME}" >> ${CHROOTDIR}/mk
180 .if defined(RELEASETAG)
181 echo "export RELEASETAG=${RELEASETAG}" >> ${CHROOTDIR}/mk
184 echo "export NOPORTS=${NOPORTS}" >> ${CHROOTDIR}/mk
187 echo "export NODOC=${NODOC}" >> ${CHROOTDIR}/mk
190 echo "export NOSRC=${NOSRC}" >> ${CHROOTDIR}/mk
192 .if defined(NOSHARED)
193 echo "export NOSHARED=${NOSHARED}" >> ${CHROOTDIR}/mk
195 .if defined(BOOT_CONFIG)
196 echo "export BOOT_CONFIG=\"${BOOT_CONFIG}\"">> ${CHROOTDIR}/mk
198 # Don't remove this, or the build will fall over!
199 echo "export RELEASEDIR=/R" >> ${CHROOTDIR}/mk
200 echo "export PATH=${BOOTSTRAPDIR}:$${PATH}:${LOCALDIR}" >> ${CHROOTDIR}/mk
201 echo "cd /usr/src" >> ${CHROOTDIR}/mk
203 # This eases bootstrapping from a more recent hosting environment:
204 echo "mkdir -p /usr/lib/compat" >> ${CHROOTDIR}/mk
205 echo "chflags noschg /usr/lib/lib*.so.*" >> ${CHROOTDIR}/mk
206 echo "mv /usr/lib/lib*.so.* /usr/lib/compat" >> ${CHROOTDIR}/mk
207 echo "ldconfig /usr/lib /usr/lib/compat" >> ${CHROOTDIR}/mk
208 echo "(cd include; make all install)" >> ${CHROOTDIR}/mk
209 echo "(cd etc; make distrib-dirs distribution)" >> ${CHROOTDIR}/mk
210 echo "make world" >> ${CHROOTDIR}/mk
211 echo "(cd etc; make distribution)" >> ${CHROOTDIR}/mk
212 # Now we've got our own shared libs, remove the bootstrapping
214 echo "rm -f /usr/lib/compat/*" >> ${CHROOTDIR}/mk
215 echo "ldconfig /usr/lib" >> ${CHROOTDIR}/mk
218 echo "make all install" >> ${CHROOTDIR}/mk
220 echo "cd /usr/src/release/sysinstall" >> ${CHROOTDIR}/mk
221 echo "make obj" >> ${CHROOTDIR}/mk
222 echo "cd /usr/src/release" >> ${CHROOTDIR}/mk
223 echo "make objlink" >> ${CHROOTDIR}/mk
224 echo "(cd obj; rm -f ${REDOREDO})" >> ${CHROOTDIR}/mk
225 echo "make doRELEASE" >> ${CHROOTDIR}/mk
226 echo "echo make ${.TARGET} Finished" >> ${CHROOTDIR}/mk
227 chmod 755 ${CHROOTDIR}/mk
228 chroot ${CHROOTDIR} /mk
231 rm -rf boot_crunch release.[0-9]
233 # Clean out /R and make the directory structure.
236 chflags -R noschg /R/.
243 for i in ${DISTRIBUTIONS} ; do \
244 mkdir ${RD}/trees/$$i && \
245 mkdir ${RD}/dists/$$i && \
246 mtree -deU -f ${MTREEFILES}/BSD.root.dist \
247 -p ${RD}/trees/$$i > /dev/null && \
248 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
249 -p ${RD}/trees/$$i/usr > /dev/null && \
250 mtree -deU -f ${MTREEFILES}/BSD.include.dist \
251 -p ${RD}/trees/$$i/usr/include > /dev/null && \
252 mtree -deU -f ${MTREEFILES}/BSD.var.dist \
253 -p ${RD}/trees/$$i/var > /dev/null ; \
257 # Install the system into the various distributions.
259 cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/bin
260 cd ${.CURDIR}/.. && make distribute DISTDIR=${RD}/trees
261 .if exists(${.CURDIR}/../kerberosIV) && !defined(NOKERBEROS)
262 cd ${.CURDIR}/../kerberosIV && ( \
264 make obj all help-distribute DISTDIR=${RD}/trees &&\
268 chflags -R noschg ${RD}/trees
271 # Make and install the generic kernel(s).
273 .for kernel in ${KERNELS}
274 rm -f ${RD}/kernels/${kernel}
275 rm -rf ${.CURDIR}/../sys/compile/${kernel}
276 cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=${kernel}
277 rm -rf ${.CURDIR}/../sys/compile/${kernel}
278 ln -f ${RD}/kernels/${kernel} ${RD}/trees/bin/kernel.${kernel}
282 # Make and install the three crunched binaries which live on the floppies.
283 # You are not supposed to like this :-)
285 # NB: the "RELEASE_BUILD_FIXIT" magic prevents vi from including the
286 # Tcl and Perl APIs. See also /usr/src/usr.bin/vi/Makefile.
289 cd ${.CURDIR}/sysinstall && make obj depend all install
291 mkdir -p ${RD}/crunch
292 export RELEASE_BUILD_FIXIT=noway ; \
293 for j in ${CRUNCH_TARGETS} ; do \
294 rm -rf $${j}_crunch && \
295 mkdir $${j}_crunch && \
296 ( cd $${j}_crunch && \
297 crunchgen ${.CURDIR}/$${j}_crunch.conf && \
298 ${MAKE} -DRELEASE_CRUNCH -f $${j}_crunch.mk subclean all \
299 NOCRYPT=yes "CFLAGS=${CFLAGS} -DCRUNCHED_BINARY") && \
300 mv $${j}_crunch/$${j}_crunch ${RD}/crunch/$${j} && \
301 true || { rm -rf $${j}_crunch ; false ; } ; \
306 # --==## Fix up the distributions. ##==--
309 # Handle some grief caused by the munition braindeadness.
310 for i in sbin/init bin/ed ; do \
311 ( cd ${.CURDIR}/../$$i; \
312 make -DNOCRYPT clean all distribute DISTDIR=${RD}/trees ) ; \
315 # Create any "synthetic dists" now.
316 @for i in ${DISTRIBUTIONS}; do \
317 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
318 echo -n "Running $$i dist creation script... "; \
319 env RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
324 # Create symlinks for the MD5-based crypt lib, too. The
325 # automatically created links still point to the DES stuff,
326 # which went into its own distribution.
327 for i in ${RD}/trees/bin/usr/lib/libscrypt* ; do \
328 c=`echo $$i | sed -e 's/libscrypt/libcrypt/'` ; \
330 ln -s `basename $$i` $$c ; \
333 # Remove all the directories we don't need.
335 find ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} -depth -type d -print | xargs rmdir
339 # --==## Package up the tarballs from assembled trees ##==--
344 @for i in ${DISTRIBUTIONS} ; \
346 if [ -d ${RD}/trees/$${i} ] ; then \
347 cd ${.CURDIR} && $(MAKE) doTARBALL \
348 SD=${RD}/trees/$${i} \
349 TN=$$i TD=$$i ARG="." && \
350 echo "$${i} distribution is finished."; \
353 # More munition braindeadness.
354 ( cd ${RD}/dists && \
355 if [ -f krb/krb.aa ] ; then mv krb/* des && rmdir krb ; fi )
360 # --==## Make source dists ##==--
364 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \
365 TD=src TN=sbase ARG="[A-Z]*"
366 @for i in `cd /usr/src && echo [a-z]*` ; do \
367 if [ -d /usr/src/$$i ] ; then \
368 cd ${.CURDIR} && $(MAKE) doTARBALL \
369 TN=`echo s$$i | tr -d '.' | sed 's/usr/u/'` \
370 SD=/usr/src TD=src ARG="$$i" ; \
373 .if defined(EXTRA_SRC)
374 @set ${EXTRA_SRC} && \
375 while [ $$# -ge 2 ] ; do \
376 if [ -d /usr/src/$$1 ] ; then \
377 cd ${.CURDIR} && $(MAKE) doTARBALL \
378 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
379 fi && shift && shift ; \
382 ( cd ${RD}/dists/src && \
383 if [ -f ssecure.aa ] ; then mv ssecure.* ../des ; fi && \
384 if [ -f scrypto.aa ] ; then mv scrypto.* ../des ; fi && \
385 if [ -f skerbero.aa ] ; then mv skerbero.* ../des ; fi ; )
386 @echo "src distribution is finished."
390 # Complete the bootfd
392 # Now, just to get this picture down once and for all:
394 # +------------------------------------------------------------------------+
396 # +-----+-----+------------------------------------------------------------+
397 # |boot1|boot2|floppy filesystem "bootfd" |
398 # +-----+-----+-+--------------------------------------------------------+-+
400 # +------------+-----------------------------------------+-+
401 # |mfs filesystem "mfsfd" |
402 # +-----------------------------------------+
405 release.8: write_mfs_in_kernel dumpnlist
409 mkdir -p etc dev mnt stand/help
410 @cp ${.CURDIR}/../sys/i386/boot/biosboot/boot.help ${RD}/mfsfd/stand
411 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
412 DIR=${RD}/mfsfd/stand ZIP=false
413 ( cd ${RD}/trees/bin/dev && \
414 ls console tty ttyv0 ttyv1 ttyv2 ttyv3 null zero \
415 *[swo]d* cuaa[01] cuaa[23] fd[01] rfd[01] \
416 cd0a mcd0a scd0a matcd0a wcd0c rst0 rft0 rwt0 | \
417 cpio -dump ${RD}/mfsfd/dev )
418 ( cd ${RD}/mfsfd/dev && rm -f *[swo]d*[bdefgh] )
419 cd ${RD}/trees/bin && ls ${BOOT1} | cpio -dump ${RD}/mfsfd/stand
420 echo "nameserver 42/tcp name" > ${RD}/mfsfd/stand/etc/services
421 echo "ftp 21/tcp" >> ${RD}/mfsfd/stand/etc/services
422 echo "domain 53/tcp nameserver" >> ${RD}/mfsfd/stand/etc/services
423 echo "domain 53/udp nameserver" >> ${RD}/mfsfd/stand/etc/services
424 echo "cmd 514/tcp shell" >> ${RD}/mfsfd/stand/etc/services
425 gzip -c ${.CURDIR}/../COPYRIGHT > ${RD}/mfsfd/stand/help/COPYRIGHT.hlp.gz
426 -test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
427 @echo "Making the regular boot floppy."
428 tar --exclude CVS -cf - -C ${.CURDIR}/sysinstall help | \
429 tar xvf - -C ${RD}/mfsfd/stand
430 @echo "Compressing doc files..."
431 @gzip -9 ${RD}/mfsfd/stand/help/*.hlp
432 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${BOOTMFSSIZE} ${RD}/mfsfd \
434 mv fs-image fs-image.std
435 mv fs-image.size fs-image.std.size
436 cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=std
437 mv ${RD}/floppies/bootstd.flp ${RD}/floppies/boot.flp
438 @echo "Regular boot floppy made."
442 # --==## Create a fixit floppy ##==--
447 cd ${RD}/fixitfd && \
448 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
449 usr/share/misc usr/mdec
450 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=fixit \
451 DIR=${RD}/fixitfd/stand ZIP=false
452 ( cd ${RD}/fixitfd/dev && \
453 sed -e '/^PATH/s/^/#/' ${RD}/trees/bin/dev/MAKEDEV > MAKEDEV && \
454 chmod 755 MAKEDEV && \
456 cp ${RD}/trees/bin/etc/spwd.db ${RD}/trees/bin/etc/group \
457 ${RD}/trees/bin/etc/protocols ${RD}/fixitfd/etc
458 cp ${RD}/trees/bin/usr/share/misc/scsi_modes \
459 ${RD}/fixitfd/usr/share/misc
460 cp ${RD}/trees/bin/usr/mdec/boot[12] ${RD}/fixitfd/usr/mdec
461 for type in fd od sd wd ; do \
462 ( cd ${RD}/fixitfd/usr/mdec && ln -s boot1 $${type}boot && \
463 ln -s boot2 boot$${type} ) ; \
465 cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
466 cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
467 cp ${.CURDIR}/tar.sh ${RD}/fixitfd/stand/tar
468 chmod 555 ${RD}/fixitfd/stand/tar
469 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${FDSIZE} ${RD}/fixitfd \
470 ${FIXITINODE} ${FDLABEL}
471 mv fs-image ${RD}/floppies/fixit.flp
472 # Do our last minute floppies directory setup in a convenient place.
473 cp ${.CURDIR}/README.TXT ${RD}/floppies/README.TXT
474 @(cd ${RD}/floppies; md5 * > CHECKSUM.MD5)
478 # --==## Setup a suitable ftp-area ##==--
482 cd ${RD} && find floppies -print | cpio -dumpl ${FD}
483 cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
484 cp ${.CURDIR}/ABOUT.TXT ${FD}/ABOUT.TXT
485 cp ${.CURDIR}/sysinstall/help/readme.hlp ${FD}/README.TXT
486 cp ${.CURDIR}/sysinstall/help/hardware.hlp ${FD}/HARDWARE.TXT
487 cp ${.CURDIR}/sysinstall/help/install.hlp ${FD}/INSTALL.TXT
488 cp ${.CURDIR}/sysinstall/help/relnotes.hlp ${FD}/RELNOTES.TXT
489 echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
490 .if !defined(NOPORTS)
491 tar -cBf - -C ${CD_DISC1} ports | tar -xBf - -C ${FD}
495 # --==## Setup a suitable cdrom-area ##==--
498 mkdir -p ${CD_DISC1} ${CD_DISC2}
499 cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
500 cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}
501 ln -f ${RD}/kernels/MFSKERNEL.std ${CD_DISC1}/kernel
502 ln -f ${RD}/trees/bin/usr/mdec/fbsdboot.exe ${CD_DISC1}
503 for i in ${DISTRIBUTIONS} ; \
505 if [ -d ${RD}/trees/$${i} ] ; then \
506 chflags -R noschg ${RD}/trees/$${i} ; \
507 ( cd ${RD}/trees/$${i} && \
508 find . -depth -print | cpio -dumpl ${CD_DISC2} ) ; \
511 rm -f ${CD_DISC2}/.profile
512 cp ${.CURDIR}/fixit.profile ${CD_DISC2}/.profile
513 echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
514 echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
515 cp ${.CURDIR}/ABOUT.TXT ${CD_DISC1}/ABOUT.TXT
516 cp ${.CURDIR}/sysinstall/help/readme.hlp ${CD_DISC1}/README.TXT
517 cp ${.CURDIR}/sysinstall/help/hardware.hlp ${CD_DISC1}/HARDWARE.TXT
518 cp ${.CURDIR}/sysinstall/help/install.hlp ${CD_DISC1}/INSTALL.TXT
519 cp ${.CURDIR}/sysinstall/help/relnotes.hlp ${CD_DISC1}/RELNOTES.TXT
520 .if !defined(NOPORTS)
521 tar -cBf - -C /usr ports | tar xBpf - -C ${CD_DISC2} && \
522 mkdir -p ${CD_DISC1}/ports && \
523 tar -czf ${CD_DISC1}/ports/ports.tgz -C /usr ports && \
524 cp ${.CURDIR}/scripts/ports-install.sh ${CD_DISC1}/ports/install.sh && \
525 (cd ${CD_DISC1}/ports; md5 * > CHECKSUM.MD5)
526 ln -s ../ports ${CD_DISC2}/usr/ports
530 for i in ${DOCPORTS}; do \
531 cd /usr/ports/$$i && make all install clean FORCE_PKG_REGISTER=yes; \
533 cd /usr/doc && make all distribute DISTDIR=${RD}/trees
535 # Various "subroutine" and other supporting targets.
539 @echo "SD undefined in doTARBALL" && exit 1
542 @echo "TB undefined in doTARBALL" && exit 1
545 @echo "ARG undefined in doTARBALL" && exit 1
547 rm -rf ${RD}/dists/${TD}/${TN}*
548 mkdir -p ${RD}/dists/${TD}
550 tn=`echo ${TN} | tr '[A-Z]' '[a-z]' | cut -c1-8` && \
551 echo rolling ${TD}/$$tn tarball &&\
552 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
553 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
554 sh ${.CURDIR}/info.sh ${RD}/dists/${TD}/$$tn > \
555 ${RD}/dists/${TD}/$$tn.inf && \
556 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
557 cp -p ${.CURDIR}/scripts/$${TD}-install.sh ${RD}/dists/${TD}/install.sh; \
559 if [ "${SD}" != "/usr/src" ]; then \
560 mtree -c -i -p ${SD}/${ARG} \
561 -k gname,md5digest,mode,nlink,uname,size,link,type \
562 > ${RD}/dists/${TD}/$$tn.mtree ; \
566 (cd ${RD}/dists/${TD}; \
567 rm -f CHECKSUM.MD5; \
568 md5 * > CHECKSUM.MD5) \
571 doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 release.5 \
572 release.6 release.7 release.8 release.9
573 cd ${.CURDIR} && ${MAKE} ${EXTRAS}
577 cd ${.CURDIR} && ${MAKE} boot.flp
578 cd ${.CURDIR} && ${MAKE} fixit.flp
579 cd ${RD} && find floppies -print | cpio -dumpl ${FD}
582 rm -f release.4 release.8
583 cd ${.CURDIR} && ${MAKE} release.4 release.8 CRUNCH_TARGETS=boot
586 rm -f release.4 release.9
587 cd ${.CURDIR} && ${MAKE} release.4 release.9 CRUNCH_TARGETS=fixit
589 write_mfs_in_kernel: ${.CURDIR}/write_mfs_in_kernel.c
590 ${CC} ${CFLAGS} -o write_mfs_in_kernel ${.CURDIR}/write_mfs_in_kernel.c
592 dumpnlist: ${.CURDIR}/dumpnlist.c
593 ${CC} ${CFLAGS} -o dumpnlist ${.CURDIR}/dumpnlist.c
597 @echo "CRUNCH undefined in installCRUNCH" && exit 1
600 @echo "DIR undefined in installCRUNCH" && exit 1
603 @echo "ZIP undefined in installCRUNCH" && exit 1
606 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
608 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
610 chmod 555 ${DIR}/${CRUNCH}_crunch
611 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
612 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
616 # --==## Compile a kernel by name ${KERNEL} ##==--
618 # We don't erase the sys/compile/${KERNEL} directory, since somebody
619 # may want to reuse it (release.8 presently)
622 rm -f ${RD}/kernels/${KERNEL}
623 cd ${.CURDIR}/../sys/i386/conf && config -n ${KERNEL}
624 cd ${.CURDIR}/../sys/compile/${KERNEL} && \
627 cp kernel ${RD}/kernels/${KERNEL}
630 # --==## Put a filesystem into a BOOTMFS kernel ##==--
633 @rm -f ${RD}/kernels/BOOTMFS.${FSIMAGE}
634 @rm -f /sys/compile/BOOTMFS/mfs_vfsops.o
635 @cd ${.CURDIR}/../sys/i386/conf && \
640 -e 's/GENERIC/BOOTMFS/g' \
641 -e '/maxusers/s/10/4/' < GENERIC > BOOTMFS && \
642 echo "options MFS" >> BOOTMFS && \
643 echo "options NFS_NOSERVER" >> BOOTMFS && \
644 echo 'options "MAXCONS=4"' >> BOOTMFS && \
645 echo "options USERCONFIG_BOOT" >> BOOTMFS
646 @echo "options \"MFS_ROOT=`cat fs-image.${FSIMAGE}.size`\"" >> \
647 ${.CURDIR}/../sys/i386/conf/BOOTMFS
648 cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=BOOTMFS
649 @rm -rf ${RD}/boot.${FSIMAGE}
650 @mkdir ${RD}/boot.${FSIMAGE}
651 @mv ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE}
652 @cp ${RD}/kernels/BOOTMFS.${FSIMAGE} ${RD}/boot.${FSIMAGE}/kernel
653 .if defined(BOOT_CONFIG)
654 @echo "${BOOT_CONFIG}" >${RD}/boot.${FSIMAGE}/boot.config
656 @vnconfig /dev/vn0 fs-image.${FSIMAGE}
657 @mkdir -p /tmp/mnt_xx
658 @mount /dev/vn0 /tmp/mnt_xx
659 ./dumpnlist ${RD}/boot.${FSIMAGE}/kernel > /tmp/mnt_xx/stand/symbols
661 @vnconfig -u /dev/vn0
663 ./write_mfs_in_kernel ${RD}/boot.${FSIMAGE}/kernel \
665 kzip -v ${RD}/boot.${FSIMAGE}/kernel
666 @mv ${RD}/boot.${FSIMAGE}/kernel ${RD}/kernels/MFSKERNEL.${FSIMAGE}
667 @mv ${RD}/boot.${FSIMAGE}/kernel.kz ${RD}/boot.${FSIMAGE}/kernel
668 @cp ${.CURDIR}/../sys/i386/boot/biosboot/boot.help ${RD}/boot.${FSIMAGE}
669 @touch ${RD}/boot.${FSIMAGE}/boot.config
670 @touch ${RD}/boot.${FSIMAGE}/kernel.config
671 @rm -f ${RD}/floppies/boot${FSIMAGE}.flp
672 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${FDSIZE} ${RD}/boot.${FSIMAGE} \
673 ${BOOTINODE} ${FDLABEL}
674 mv fs-image ${RD}/floppies/boot${FSIMAGE}.flp
676 .include <bsd.prog.mk>