1 # $Id: Makefile,v 1.352 1998/05/29 19:36:12 jkh 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 # If you are using a local CVS repository with components stored in
29 # non-standard modules, override these on the make commandline or
31 RELEASESRCMODULE?= src
32 RELEASEDOCMODULE?= doc
33 RELEASEPORTSMODULE?= ports
35 # Uncomment this to disable the doc.1 target. It is also an ERROR
36 # to set NOPORTS and not set NODOC since docs depend on ports.
38 DOCPORTS= archivers/unzip lang/perl5 textproc/jade textproc/iso8879 \
39 textproc/linuxdoc textproc/docbook textproc/sgmlformat
41 # Things which without too much trouble can be considered variables
42 # BIN_DISTS are special in that they get full /etc installation sets.
44 COMPAT_DISTS?= compat1x compat20 compat21
45 OTHER_DISTS?= manpages catpages games proflibs dict info doc
46 CRYPTO_DISTS?= krb des
48 DISTRIBUTIONS?= ${BIN_DISTS} ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS}
51 # Extra source tarballs; each argument is a pair of source dir and
52 # distribution name. The dist name should not exceed 7 characters
53 # (another "s" for "source" will be prepended).
54 EXTRA_SRC+= usr.sbin/sendmail/cf smailcf
56 BOOT1= etc/protocols etc/rc.conf
58 # mountpoint for filesystems.
61 # other floppy parameters.
65 ZIPNSPLIT= gzip --no-name -9 -c | split -b 240640 -
67 # Upper size for the mfs in the boot.flp kernel.
68 # These are adjusted down to the minimum needed by doFS.sh.
76 # Things which may get you into trouble if you change them
77 MTREEFILES= ${.CURDIR}/../etc/mtree
84 # Where the bootstrap ports (see DOCPORTS) get installed.
85 LOCALDIR= /usr/local/bin
87 # ${BOOTSTRAPDIR} is for those utilities that refer to the hosting
88 # environment, rather than the target environment. This is specifically
89 # intended for kernel-dependent utilities that are used during the build.
91 # ${BOOTSTRAPDIR} is actually being used by prepending it to the normal
92 # ${PATH}. Thus, it's also available to outside utilities like doFS.sh.
93 BOOTSTRAPDIR= /bootstrap
95 # The mount subsystem has been changed between 2.2 and 3.0 by the
97 BOOTSTRAPUTILS= /sbin/mount /sbin/umount
99 # 3.0 cpio tries to reference lchown(2) which is not available in 2.2
100 BOOTSTRAPUTILS+= /usr/bin/cpio
102 .if !defined(CRUNCH_TARGETS)
103 CRUNCH_TARGETS= boot fixit
106 EXTRAS= cdrom.1 ftp.1
113 REDOSED= sed -e 's/dirs/release.1/' -e 's/trees/release.2/' \
114 -e 's/kerns/release.3/' -e 's/sysinstall/release.4/' \
115 -e 's/fixup/release.5/' -e 's/tarbin/release.6/' \
116 -e 's/tarsrc/release.7/' -e 's/boot\.flp/release.8/' \
117 -e 's/fixit\.flp/release.9/' -e 's/ftp/ftp.1/' \
118 -e 's/cdrom/cdrom.1/'
120 REDOREDO!= echo ${REDO} | ${REDOSED}
123 .if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT)
124 @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false
127 .if exists(${CHROOTDIR})
128 chflags -R noschg ${CHROOTDIR}/.
131 -mkdir -p ${CHROOTDIR}
132 cd ${.CURDIR}/../etc && ${MAKE} distrib-dirs DESTDIR=${CHROOTDIR}
133 cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR}
134 cd ${.CURDIR}/.. && ${MAKE} install DESTDIR=${CHROOTDIR} NOMAN=1
135 mkdir ${CHROOTDIR}/${BOOTSTRAPDIR}
136 for i in ${BOOTSTRAPUTILS} ; do \
137 cp -p ${CHROOTDIR}$$i ${CHROOTDIR}/${BOOTSTRAPDIR} ; \
139 .if !defined(RELEASETAG)
140 cd ${CHROOTDIR}/usr && rm -rf src && \
141 cvs -d ${CVSROOT} co -P ${RELEASESRCMODULE}
143 cd ${CHROOTDIR}/usr && rm -rf src && \
144 cvs -d ${CVSROOT} co -P -r ${RELEASETAG} ${RELEASESRCMODULE}
146 .if defined(LOCAL_PATCHES) && exists(${LOCAL_PATCHES})
147 cd ${CHROOTDIR}/usr/src && patch --silent < ${LOCAL_PATCHES}
149 .if !defined(NOPORTS)
150 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -d ${CVSROOT} co -P ${RELEASEPORTSMODULE} && cd ports && make readmes PORTSDIR=${CHROOTDIR}/usr/ports
153 cd ${CHROOTDIR}/usr && rm -rf doc && cvs -d ${CVSROOT} co -P ${RELEASEDOCMODULE}
154 cd ${CHROOTDIR}/usr/ports && for i in ${DOCPORTS}; do \
155 (cd $$i; make fetch MASTER_SITE_OVERRIDE=file:/usr/ports/distfiles/ \
156 DISTDIR=${CHROOTDIR}/usr/ports/distfiles ); \
161 .if !defined(RELEASENOUPDATE)
162 .if !defined(RELEASETAG)
163 cd ${CHROOTDIR}/usr/src && cvs -q update -P -d
165 cd ${CHROOTDIR}/usr/src && cvs -q update -P -d -r ${RELEASETAG}
167 .if !defined(NOPORTS)
168 cd ${CHROOTDIR}/usr/ports && cvs -q update -P -d
171 cd ${CHROOTDIR}/usr/doc && cvs -q update -P -d
175 # Add version information to those things that need it.
176 ( cd ${CHROOTDIR}/usr/src/sys/conf && \
177 mv newvers.sh foo && \
178 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh&& rm foo )
179 ( cd ${CHROOTDIR}/usr/src/release/sysinstall && \
180 sed "s/__RELEASE/${BUILDNAME}/" version.h > version.h.new && \
181 mv version.h.new version.h && \
183 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
184 echo "#!/bin/sh" > ${CHROOTDIR}/mk
185 echo "set -ex" >> ${CHROOTDIR}/mk
186 echo "export CFLAGS='-O2 -pipe'" >> ${CHROOTDIR}/mk
187 echo "export DISTRIBUTIONS=\"${DISTRIBUTIONS}\"" >> ${CHROOTDIR}/mk
188 echo "export BUILDNAME=${BUILDNAME}" >> ${CHROOTDIR}/mk
189 echo "export VNDEVICE=${VNDEVICE}" >> ${CHROOTDIR}/mk
190 .if defined(RELEASETAG)
191 echo "export RELEASETAG=${RELEASETAG}" >> ${CHROOTDIR}/mk
194 echo "export NOPORTS=${NOPORTS}" >> ${CHROOTDIR}/mk
197 echo "export NODOC=${NODOC}" >> ${CHROOTDIR}/mk
200 echo "export NOSRC=${NOSRC}" >> ${CHROOTDIR}/mk
202 .if defined(NOSHARED)
203 echo "export NOSHARED=${NOSHARED}" >> ${CHROOTDIR}/mk
205 .if defined(BOOT_CONFIG)
206 echo "export BOOT_CONFIG=\"${BOOT_CONFIG}\"">> ${CHROOTDIR}/mk
208 # Don't remove this, or the build will fall over!
209 echo "export RELEASEDIR=/R" >> ${CHROOTDIR}/mk
210 echo "export PATH=${BOOTSTRAPDIR}:$${PATH}:${LOCALDIR}" >> ${CHROOTDIR}/mk
211 echo "cd /usr/src" >> ${CHROOTDIR}/mk
213 # This eases bootstrapping from a more recent hosting environment:
214 .if exists(/usr/lib/aout/)
215 echo "mkdir -p /usr/lib/compat/aout" >> ${CHROOTDIR}/mk
216 echo "chflags noschg /usr/lib/aout/lib*.so.*" >> ${CHROOTDIR}/mk
217 echo "mv /usr/lib/aout/lib*.so.* /usr/lib/compat/aout" >> ${CHROOTDIR}/mk
218 echo "ldconfig /usr/lib/compat/aout" >> ${CHROOTDIR}/mk
220 echo "mkdir -p /usr/lib/compat" >> ${CHROOTDIR}/mk
221 echo "chflags noschg /usr/lib/lib*.so.*" >> ${CHROOTDIR}/mk
222 echo "mv /usr/lib/lib*.so.* /usr/lib/compat" >> ${CHROOTDIR}/mk
223 echo "ldconfig /usr/lib /usr/lib/compat" >> ${CHROOTDIR}/mk
225 echo "(cd include; make all install)" >> ${CHROOTDIR}/mk
226 echo "(cd etc; make distrib-dirs distribution)" >> ${CHROOTDIR}/mk
227 echo "make world" >> ${CHROOTDIR}/mk
228 echo "(cd etc; make distribution)" >> ${CHROOTDIR}/mk
229 # Now we've got our own shared libs, remove the bootstrapping
231 .if !exists(/usr/lib/aout/)
232 echo "rm -f /usr/lib/compat/*" >> ${CHROOTDIR}/mk
233 echo "ldconfig /usr/lib" >> ${CHROOTDIR}/mk
237 echo "make all install" >> ${CHROOTDIR}/mk
239 echo "cd /usr/src/release/sysinstall" >> ${CHROOTDIR}/mk
240 echo "make obj" >> ${CHROOTDIR}/mk
241 echo "cd /usr/src/release" >> ${CHROOTDIR}/mk
242 echo "make objlink" >> ${CHROOTDIR}/mk
243 echo "(cd obj; rm -f ${REDOREDO})" >> ${CHROOTDIR}/mk
244 echo "make doRELEASE" >> ${CHROOTDIR}/mk
245 echo "echo make ${.TARGET} Finished" >> ${CHROOTDIR}/mk
246 chmod 755 ${CHROOTDIR}/mk
247 chroot ${CHROOTDIR} /mk
250 rm -rf boot_crunch release.[0-9]
252 # Clean out /R and make the directory structure.
255 chflags -R noschg /R/.
262 for i in ${DISTRIBUTIONS} ; do \
263 mkdir ${RD}/trees/$$i && \
264 mkdir ${RD}/dists/$$i && \
265 mtree -deU -f ${MTREEFILES}/BSD.root.dist \
266 -p ${RD}/trees/$$i > /dev/null && \
267 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
268 -p ${RD}/trees/$$i/usr > /dev/null && \
269 mtree -deU -f ${MTREEFILES}/BSD.include.dist \
270 -p ${RD}/trees/$$i/usr/include > /dev/null && \
271 mtree -deU -f ${MTREEFILES}/BSD.var.dist \
272 -p ${RD}/trees/$$i/var > /dev/null ; \
276 # Install the system into the various distributions.
278 cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/bin
279 cd ${.CURDIR}/.. && make distribute DISTDIR=${RD}/trees
280 .if exists(${.CURDIR}/../kerberosIV) && !defined(NOKERBEROS)
281 cd ${.CURDIR}/../kerberosIV && ( \
283 make obj all help-distribute DISTDIR=${RD}/trees &&\
287 chflags -R noschg ${RD}/trees
290 # Make and install the generic kernel(s).
292 .for kernel in ${KERNELS}
293 rm -f ${RD}/kernels/${kernel}
294 rm -rf ${.CURDIR}/../sys/compile/${kernel}
295 cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=${kernel}
296 rm -rf ${.CURDIR}/../sys/compile/${kernel}
297 ln -f ${RD}/kernels/${kernel} ${RD}/trees/bin/kernel.${kernel}
301 # Make and install the three crunched binaries which live on the floppies.
302 # You are not supposed to like this :-)
304 # NB: the "RELEASE_BUILD_FIXIT" magic prevents vi from including the
305 # Tcl and Perl APIs. See also /usr/src/usr.bin/vi/Makefile.
308 cd ${.CURDIR}/sysinstall && make obj depend all install
310 mkdir -p ${RD}/crunch
311 export RELEASE_BUILD_FIXIT=noway ; \
312 for j in ${CRUNCH_TARGETS} ; do \
313 rm -rf $${j}_crunch && \
314 mkdir $${j}_crunch && \
315 ( cd $${j}_crunch && \
316 crunchgen ${.CURDIR}/$${j}_crunch.conf && \
317 ${MAKE} -DRELEASE_CRUNCH -f $${j}_crunch.mk subclean all \
318 NOCRYPT=yes "CFLAGS=${CFLAGS} -DCRUNCHED_BINARY") && \
319 mv $${j}_crunch/$${j}_crunch ${RD}/crunch/$${j} && \
320 true || { rm -rf $${j}_crunch ; false ; } ; \
325 # --==## Fix up the distributions. ##==--
328 # Handle some grief caused by the munition braindeadness.
329 for i in sbin/init bin/ed ; do \
330 ( cd ${.CURDIR}/../$$i; \
331 make -DNOCRYPT clean all distribute DISTDIR=${RD}/trees ) ; \
334 # Create any "synthetic dists" now.
335 @for i in ${DISTRIBUTIONS}; do \
336 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
337 echo -n "Running $$i dist creation script... "; \
338 env RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
343 # Create symlinks for the MD5-based crypt lib, too. The
344 # automatically created links still point to the DES stuff,
345 # which went into its own distribution.
346 for i in ${RD}/trees/bin/usr/lib/libscrypt* ; do \
347 c=`echo $$i | sed -e 's/libscrypt/libcrypt/'` ; \
349 ln -s `basename $$i` $$c ; \
352 # Remove all the directories we don't need.
354 find ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} -depth -type d -print | xargs rmdir
358 # --==## Package up the tarballs from assembled trees ##==--
363 @for i in ${DISTRIBUTIONS} ; \
365 if [ -d ${RD}/trees/$${i} ] ; then \
366 cd ${.CURDIR} && $(MAKE) doTARBALL \
367 SD=${RD}/trees/$${i} \
368 TN=$$i TD=$$i ARG="." && \
369 echo "$${i} distribution is finished."; \
372 # More munition braindeadness.
373 ( cd ${RD}/dists && \
374 if [ -f krb/krb.aa ] ; then mv krb/* des && rmdir krb ; fi )
379 # --==## Make source dists ##==--
383 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \
384 TD=src TN=sbase ARG="[A-Z]*"
385 @for i in `cd /usr/src && echo [a-z]*` ; do \
386 if [ -d /usr/src/$$i ] ; then \
387 cd ${.CURDIR} && $(MAKE) doTARBALL \
388 TN=`echo s$$i | tr -d '.' | sed 's/usr/u/'` \
389 SD=/usr/src TD=src ARG="$$i" ; \
392 .if defined(EXTRA_SRC)
393 @set ${EXTRA_SRC} && \
394 while [ $$# -ge 2 ] ; do \
395 if [ -d /usr/src/$$1 ] ; then \
396 cd ${.CURDIR} && $(MAKE) doTARBALL \
397 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
398 fi && shift && shift ; \
401 ( cd ${RD}/dists/src && \
402 if [ -f ssecure.aa ] ; then mv ssecure.* ../des ; fi && \
403 if [ -f scrypto.aa ] ; then mv scrypto.* ../des ; fi && \
404 if [ -f skerbero.aa ] ; then mv skerbero.* ../des ; fi ; )
405 @echo "src distribution is finished."
409 # Complete the bootfd
411 # Now, just to get this picture down once and for all:
413 # +------------------------------------------------------------------------+
415 # +-----+-----+------------------------------------------------------------+
416 # |boot1|boot2|floppy filesystem "bootfd" |
417 # +-----+-----+-+--------------------------------------------------------+-+
419 # +------------+-----------------------------------------+-+
420 # |mfs filesystem "mfsfd" |
421 # +-----------------------------------------+
424 release.8: write_mfs_in_kernel dumpnlist
428 mkdir -p etc dev mnt stand/help
429 @cp ${.CURDIR}/../sys/i386/boot/biosboot/boot.help ${RD}/mfsfd/stand
430 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
431 DIR=${RD}/mfsfd/stand ZIP=false
432 ( cd ${RD}/trees/bin/dev && \
433 ls console tty ttyv0 ttyv1 ttyv2 ttyv3 null zero | \
434 cpio -dump ${RD}/mfsfd/dev )
435 ( cd ${RD}/mfsfd/dev && rm -f *[swo]d*[bdefgh] )
436 cd ${RD}/trees/bin && ls ${BOOT1} | cpio -dump ${RD}/mfsfd/stand
437 echo "nameserver 42/tcp name" > ${RD}/mfsfd/stand/etc/services
438 echo "ftp 21/tcp" >> ${RD}/mfsfd/stand/etc/services
439 echo "domain 53/tcp nameserver" >> ${RD}/mfsfd/stand/etc/services
440 echo "domain 53/udp nameserver" >> ${RD}/mfsfd/stand/etc/services
441 echo "cmd 514/tcp shell" >> ${RD}/mfsfd/stand/etc/services
442 gzip -c ${.CURDIR}/../COPYRIGHT > ${RD}/mfsfd/stand/help/COPYRIGHT.hlp.gz
443 -test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
444 @echo "Making the regular boot floppy."
445 tar --exclude CVS -cf - -C ${.CURDIR}/sysinstall help | \
446 tar xvf - -C ${RD}/mfsfd/stand
447 @echo "Compressing doc files..."
448 @gzip -9 ${RD}/mfsfd/stand/help/*.hlp
449 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${BOOTMFSSIZE} ${RD}/mfsfd \
451 mv fs-image fs-image.std
452 mv fs-image.size fs-image.std.size
453 cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=std
454 mv ${RD}/floppies/bootstd.flp ${RD}/floppies/boot.flp
455 @echo "Regular boot floppy made."
459 # --==## Create a fixit floppy ##==--
464 cd ${RD}/fixitfd && \
465 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
466 usr/share/misc usr/mdec
467 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=fixit \
468 DIR=${RD}/fixitfd/stand ZIP=false
469 ( cd ${RD}/fixitfd/dev && \
470 sed -e '/^PATH/s/^/#/' ${RD}/trees/bin/dev/MAKEDEV > MAKEDEV && \
471 chmod 755 MAKEDEV && \
473 cp ${RD}/trees/bin/etc/spwd.db ${RD}/trees/bin/etc/group \
474 ${RD}/trees/bin/etc/protocols ${RD}/fixitfd/etc
475 cp ${RD}/trees/bin/usr/share/misc/scsi_modes \
476 ${RD}/fixitfd/usr/share/misc
477 cp ${RD}/trees/bin/usr/mdec/boot[12] ${RD}/fixitfd/usr/mdec
478 for type in fd od sd wd ; do \
479 ( cd ${RD}/fixitfd/usr/mdec && ln -s boot1 $${type}boot && \
480 ln -s boot2 boot$${type} ) ; \
482 cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
483 cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
484 cp ${.CURDIR}/tar.sh ${RD}/fixitfd/stand/tar
485 chmod 555 ${RD}/fixitfd/stand/tar
486 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${FDSIZE} ${RD}/fixitfd \
487 ${FIXITINODE} ${FDLABEL}
488 mv fs-image ${RD}/floppies/fixit.flp
489 # Do our last minute floppies directory setup in a convenient place.
490 cp ${.CURDIR}/README.TXT ${RD}/floppies/README.TXT
491 @(cd ${RD}/floppies; md5 * > CHECKSUM.MD5)
495 # --==## Setup a suitable ftp-area ##==--
499 cd ${RD} && find floppies -print | cpio -dumpl ${FD}
500 cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
501 cp ${.CURDIR}/ABOUT.TXT ${FD}/ABOUT.TXT
502 cp ${.CURDIR}/sysinstall/help/readme.hlp ${FD}/README.TXT
503 cp ${.CURDIR}/sysinstall/help/hardware.hlp ${FD}/HARDWARE.TXT
504 cp ${.CURDIR}/sysinstall/help/install.hlp ${FD}/INSTALL.TXT
505 cp ${.CURDIR}/sysinstall/help/relnotes.hlp ${FD}/RELNOTES.TXT
506 echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
507 .if !defined(NOPORTS)
508 tar -cBf - -C ${CD_DISC1} ports | tar -xBf - -C ${FD}
512 # --==## Setup a suitable cdrom-area ##==--
515 mkdir -p ${CD_DISC1} ${CD_DISC2}
516 cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
517 cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}
518 ln -f ${RD}/kernels/MFSKERNEL.std ${CD_DISC1}/kernel
519 ln -f ${RD}/trees/bin/usr/mdec/fbsdboot.exe ${CD_DISC1}
520 for i in ${DISTRIBUTIONS} ; \
522 if [ -d ${RD}/trees/$${i} ] ; then \
523 chflags -R noschg ${RD}/trees/$${i} ; \
524 ( cd ${RD}/trees/$${i} && \
525 find . -depth -print | cpio -dumpl ${CD_DISC2} ) ; \
528 rm -f ${CD_DISC2}/.profile
529 cp ${.CURDIR}/fixit.profile ${CD_DISC2}/.profile
530 echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
531 echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
532 cp ${.CURDIR}/ABOUT.TXT ${CD_DISC1}/ABOUT.TXT
533 cp ${.CURDIR}/sysinstall/help/readme.hlp ${CD_DISC1}/README.TXT
534 cp ${.CURDIR}/sysinstall/help/hardware.hlp ${CD_DISC1}/HARDWARE.TXT
535 cp ${.CURDIR}/sysinstall/help/install.hlp ${CD_DISC1}/INSTALL.TXT
536 cp ${.CURDIR}/sysinstall/help/relnotes.hlp ${CD_DISC1}/RELNOTES.TXT
537 .if !defined(NOPORTS)
538 -rm -rf /usr/ports/distfiles/*
539 tar -cBf - -C /usr ports | tar xBpf - -C ${CD_DISC2} && \
540 mkdir -p ${CD_DISC1}/ports && \
541 tar -czf ${CD_DISC1}/ports/ports.tgz -C /usr ports && \
542 cp ${.CURDIR}/scripts/ports-install.sh ${CD_DISC1}/ports/install.sh && \
543 (cd ${CD_DISC1}/ports; md5 * > CHECKSUM.MD5)
544 ln -s ../ports ${CD_DISC2}/usr/ports
548 for i in ${DOCPORTS}; do \
549 cd /usr/ports/$$i && make all install clean FORCE_PKG_REGISTER=yes; \
551 cd /usr/doc && make all distribute DISTDIR=${RD}/trees
553 # Various "subroutine" and other supporting targets.
557 @echo "SD undefined in doTARBALL" && exit 1
560 @echo "TB undefined in doTARBALL" && exit 1
563 @echo "ARG undefined in doTARBALL" && exit 1
565 rm -rf ${RD}/dists/${TD}/${TN}*
566 mkdir -p ${RD}/dists/${TD}
568 tn=`echo ${TN} | tr '[A-Z]' '[a-z]' | cut -c1-8` && \
569 echo rolling ${TD}/$$tn tarball &&\
570 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
571 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
572 sh ${.CURDIR}/info.sh ${RD}/dists/${TD}/$$tn > \
573 ${RD}/dists/${TD}/$$tn.inf && \
574 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
575 cp -p ${.CURDIR}/scripts/$${TD}-install.sh ${RD}/dists/${TD}/install.sh; \
577 if [ "${SD}" != "/usr/src" ]; then \
578 mtree -c -i -p ${SD}/${ARG} \
579 -k gname,md5digest,mode,nlink,uname,size,link,type \
580 > ${RD}/dists/${TD}/$$tn.mtree ; \
584 (cd ${RD}/dists/${TD}; \
585 rm -f CHECKSUM.MD5; \
586 md5 * > CHECKSUM.MD5) \
589 doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 release.5 \
590 release.6 release.7 release.8 release.9
591 cd ${.CURDIR} && ${MAKE} ${EXTRAS}
595 cd ${.CURDIR} && ${MAKE} boot.flp
596 cd ${.CURDIR} && ${MAKE} fixit.flp
597 cd ${RD} && find floppies -print | cpio -dumpl ${FD}
600 rm -f release.4 release.8
601 cd ${.CURDIR} && ${MAKE} release.4 release.8 CRUNCH_TARGETS=boot
604 rm -f release.4 release.9
605 cd ${.CURDIR} && ${MAKE} release.4 release.9 CRUNCH_TARGETS=fixit
607 write_mfs_in_kernel: ${.CURDIR}/write_mfs_in_kernel.c
608 ${CC} ${CFLAGS} -o write_mfs_in_kernel ${.CURDIR}/write_mfs_in_kernel.c
610 dumpnlist: ${.CURDIR}/dumpnlist.c
611 ${CC} ${CFLAGS} -o dumpnlist ${.CURDIR}/dumpnlist.c
615 @echo "CRUNCH undefined in installCRUNCH" && exit 1
618 @echo "DIR undefined in installCRUNCH" && exit 1
621 @echo "ZIP undefined in installCRUNCH" && exit 1
624 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
626 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
628 chmod 555 ${DIR}/${CRUNCH}_crunch
629 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
630 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
634 # --==## Compile a kernel by name ${KERNEL} ##==--
636 # We don't erase the sys/compile/${KERNEL} directory, since somebody
637 # may want to reuse it (release.8 presently)
640 rm -f ${RD}/kernels/${KERNEL}
641 cd ${.CURDIR}/../sys/i386/conf && config ${KERNEL}
642 cd ${.CURDIR}/../sys/compile/${KERNEL} && \
645 cp kernel ${RD}/kernels/${KERNEL}
648 # --==## Put a filesystem into a BOOTMFS kernel ##==--
651 @rm -f ${RD}/kernels/BOOTMFS.${FSIMAGE}
652 @rm -f /sys/compile/BOOTMFS/mfs_vfsops.o
653 @cd ${.CURDIR}/../sys/i386/conf && \
657 -e 's/GENERIC/BOOTMFS/g' \
658 -e '/maxusers/s/10/4/' < GENERIC > BOOTMFS && \
659 echo "options MFS" >> BOOTMFS && \
660 echo "options NFS_NOSERVER" >> BOOTMFS && \
661 echo 'options "MAXCONS=4"' >> BOOTMFS && \
662 echo "options USERCONFIG_BOOT" >> BOOTMFS
663 @echo "options \"MFS_ROOT=`cat fs-image.${FSIMAGE}.size`\"" >> \
664 ${.CURDIR}/../sys/i386/conf/BOOTMFS
665 cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=BOOTMFS
666 @rm -rf ${RD}/boot.${FSIMAGE}
667 @mkdir ${RD}/boot.${FSIMAGE}
668 @mv ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE}
669 @cp ${RD}/kernels/BOOTMFS.${FSIMAGE} ${RD}/boot.${FSIMAGE}/kernel
670 .if defined(BOOT_CONFIG)
671 @echo "${BOOT_CONFIG}" >${RD}/boot.${FSIMAGE}/boot.config
673 @vnconfig /dev/${VNDEVICE} fs-image.${FSIMAGE}
674 @mkdir -p /tmp/mnt_xx
675 @mount /dev/${VNDEVICE} /tmp/mnt_xx
676 ./dumpnlist ${RD}/boot.${FSIMAGE}/kernel > /tmp/mnt_xx/stand/symbols
678 @vnconfig -u /dev/${VNDEVICE}
680 ./write_mfs_in_kernel ${RD}/boot.${FSIMAGE}/kernel \
682 kzip -v ${RD}/boot.${FSIMAGE}/kernel
683 @mv ${RD}/boot.${FSIMAGE}/kernel ${RD}/kernels/MFSKERNEL.${FSIMAGE}
684 @mv ${RD}/boot.${FSIMAGE}/kernel.kz ${RD}/boot.${FSIMAGE}/kernel
685 @cp ${.CURDIR}/../sys/i386/boot/biosboot/boot.help ${RD}/boot.${FSIMAGE}
686 @touch ${RD}/boot.${FSIMAGE}/boot.config
687 @touch ${RD}/boot.${FSIMAGE}/kernel.config
688 @rm -f ${RD}/floppies/boot${FSIMAGE}.flp
689 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${FDSIZE} ${RD}/boot.${FSIMAGE} \
690 ${BOOTINODE} ${FDLABEL}
691 mv fs-image ${RD}/floppies/boot${FSIMAGE}.flp
693 .include <bsd.prog.mk>