3 # make release [BUILDNAME=somename] CHROOTDIR=/some/dir CVSROOT=/cvs/dir \
4 # [RELEASETAG=tag] [SVNROOT=svn://svn.freebsd.org/base] \
5 # [SVNBRANCH=some/branch]
7 # Where "/some/dir" is the pathname of a directory on a some filesystem with
8 # at least 1000MB of free space, "somename" is what you want the release to
9 # call itself, "/cvs/dir" is where our source repo resides and, optionally,
10 # which CVS "tag" name should be used when checking out the sources to build
11 # the release (default is HEAD).
13 # Please note the support for building from SVN is preliminary and there
14 # are still questions about things like how to handle updates of
15 # /usr/src on production systems (csup(1) replacement). It is a work
16 # in progress and may change as the other issues get worked out.
18 # Please note: the md(4) driver must be present in the kernel
19 # (either by being compiled in or available as a kld(4) module),
20 # otherwise the target 'release.8' and possibly others will fail.
22 # Note: If you add options to this file, please keep release(7) updated!
24 # Set these, release builder!
27 #BUILDNAME=9.0-CURRENT
29 # Automatic SNAP versioning:
32 BUILDNAME?=${BASE}-${DATE}-SNAP
34 #CHROOTDIR=/junk/release
35 # If this is a -stable snapshot, then set
38 # To test a release with a source tree containing patches and
39 # other work. This tree will get copied instead of getting the
40 # src/ tree from a CVS checkout. For "rerelease", this will NOT
41 # be copied; cvs update will be used instead.
44 # To use a checked-out ports collection directory instead of
45 # checking out from a local CVS repository, set this option.
46 #EXTPORTSDIR=/usr/ports
48 # To use a checked-out doc/ directory instead of
49 # checking out from a local CVS repository, set this option.
52 # To add other options to the CVS subcommands (co,up), set
53 #CVSCMDARGS="-D '01/01/2002 00:00:00 UTC'"
55 # To add other options to the CVS command, set
58 # To prefix the CVS command
59 #CVSPREFIX="/usr/bin/time"
61 # Where the CVS repository is
64 # To add other options to the Subversion subcommands (co,up), set
65 #SVNCMDARGS="-r '{ 01/01/2002 00:00:00 UTC }'"
67 # To prefix the Subversion command
68 #SVNPREFIX="/usr/bin/time"
70 # Where the Subversion repository is
71 #SVNROOT=svn://svn.freebsd.org/base
73 # Subversion branch to build for src. If this is not set then it is
74 # automatically computed from RELEASETAG.
77 # Non-zero if ${RELEASETAG} is in the form "RELENG_ver_RELEASE"; we
78 # are building an official release. Otherwise, we are building for
80 .if defined(RELEASETAG)
81 ISRELEASE!= expr "${RELEASETAG}" : '^RELENG_.*_RELEASE$$' || true
83 # Convert "RELENG_ver_RELEASE" to "RELEASE_ver" for ports and doc trees.
84 AUXRELEASETAG!= echo ${RELEASETAG} | sed -e 's/^RELENG_/RELEASE_/' -e 's/_RELEASE$$//'
85 DOCRELEASETAG?= ${AUXRELEASETAG}
86 PORTSRELEASETAG?= ${AUXRELEASETAG}
90 # Determine the Subversion source branch that corresponds to the requested
92 .if !defined(SVNBRANCH)
93 .if defined(RELEASETAG)
94 SVNBRANCH!= echo "${RELEASETAG}" | awk -f ${.CURDIR}/svnbranch.awk
100 # If you want to pass flags to the world build such as -j X, use
101 # WORLD_FLAGS. Similarly, you can specify make flags for kernel
102 # builds via KERNEL_FLAGS.
106 TARGET_ARCH?= ${MACHINE_ARCH}
107 .if ${TARGET_ARCH} == ${MACHINE_ARCH}
110 TARGET?= ${TARGET_ARCH}
112 CROSSENV= TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}
113 CROSSMAKE= ${MAKE} ${CROSSENV}
114 NATIVEMAKE= ${MAKE} TARGET_ARCH=${MACHINE_ARCH} TARGET=${MACHINE}
116 # If you are using a local CVS repository with components stored in
117 # non-standard modules, override these on the make commandline or
118 # in the environment.
119 RELEASESRCMODULE?= src
120 RELEASEDOCMODULE?= doc
121 RELEASEPORTSMODULE?= ports
123 # Uncomment this to disable the doc.1 target. Docs normally require
124 # the ports tree, so NOPORTS can be set together with NODOC in order
125 # to have neither ports or docs. If only NOPORTS is set to YES, but
126 # docs are still desired, the DOMINIMALDOCPORTS logic below will only
127 # install the ports that are minimally required for the release note documentation. This is
128 # intended as a compromise, less disk space is required than for using
129 # the entire ports collection (and much less time due to the huge number
130 # of directories it would create), but still quite a bit as well as some
131 # CPU cycles (some of the programs are C++, and things like ghostscript
132 # belong to the required ports nevertheless).
137 # When retrieving ports using the pkg_add -r method, set your proxies to these.
138 # src/release/${arch}/mkisoimages.sh can use these.
139 #HTTP_PROXY?= www.example.com
140 #FTP_PROXY?= ftp.example.com
142 # When creating ISO images, point ${CD_PACKAGE_TREE} to a directory containing
143 # the package split by an earlier invocation of the 'package-split' target.
144 #CD_PACKAGE_TREE= /path/to/pkg
146 # Extra source tarballs; each argument is a pair of source dir and
147 # distribution name. The dist name should not exceed 7 characters
148 # (another "s" for "source" will be prepended).
149 #EXTRA_SRC= games/fortune fortune
151 # Modify this definition if you want the release notes
152 # and other release documentation in a language other than English.
153 RELNOTES_LANG?= en_US.ISO8859-1
155 # As an alternative to installing the entire ports collection (which
156 # can take a huge amount of time, in particular on slower disks),
157 # setting ${MINIMALDOCPORTS} allows to install and build just those
158 # ports that are really required for getting the docs up & running.
159 .if defined(NOPORTS) && !defined(NODOC)
160 DOMINIMALDOCPORTS= YES
161 .include "Makefile.inc.docports"
162 RELEASEPORTSMODULE= ${MINIMALDOCPORTS} ports/sysutils/cdrtools
167 .if !defined(DOMINIMALDOCPORTS) || ${DOMINIMALDOCPORTS} != "YES"
173 # Doing 'make index' in /usr/ports requires Perl.
174 MAKEINDEXPORTS= lang/perl5.8
175 DOCPORTS= textproc/docproj
176 # Set this to wherever the distfiles required by release procedures.
177 .if defined(DOCDISTFILES)
178 # Respect DOCDISTFILES which is used before.
179 RELEASEDISTFILES?= ${DOCDISTFILES}
181 RELEASEDISTFILES?= ${.CURDIR}/../../ports/distfiles
183 # Set this to 1 if you want -P to be used for automatic keyboard detection
184 # on the boot floppy. WARNING: Breaks on some Athlon (K7) motherboards.
185 AUTO_KEYBOARD_DETECT?= 0
188 DIST_DOCS_ARCH_INDEP= hardware readme relnotes errata
192 # Things which without too much trouble can be considered variables
193 # BASE_DISTS are special in that they get full /etc installation sets.
195 OTHER_DISTS?= catpages manpages games proflibs dict info doc ${ARCH_DISTS}
197 .if ${TARGET_ARCH} == "amd64"
200 DISTRIBUTIONS?= ${BASE_DISTS} ${OTHER_DISTS}
203 # Build and package both GENERIC and SMP kernels if the target
204 # has both configuration files. Otherwise only GENERIC is done.
206 .if exists(${.CURDIR}/../sys/${TARGET}/conf/SMP)
207 KERNELS_BASE?= GENERIC SMP
209 KERNELS_BASE?= GENERIC
212 # mountpoint for filesystems.
215 # Various floppy image parameters.
219 .if ${TARGET_ARCH} == "i386"
223 .if ${TARGET} == "pc98"
225 SMALLFLOPPYSIZE= 1200
226 SMALLFLOPPYSPLITSIZE= 1152
227 SMALLFLOPPYLABEL= fd1200
231 FLOPPYSPLITSIZE= 1392
238 .elif ${TARGET_ARCH} == "sparc64"
245 .elif ${TARGET_ARCH} == "ia64"
252 .elif ${TARGET_ARCH} == "amd64"
255 FLOPPYSPLITSIZE= 1392
264 .elif ${TARGET_ARCH} == "powerpc"
271 .if defined(NO_FLOPPIES)
275 .if exists(/sbin/bsdlabel)
278 DISKLABEL?= disklabel
281 ZIPPER= gzip -9 --no-name
282 ZIPNSPLIT= ${ZIPPER} -c | split -b 1392k -
284 # Things which may get you into trouble if you change them
285 MTREEFILES= ${.CURDIR}/../etc/mtree
288 RND= ${RD}/release.doc
291 CD_BOOT= ${CD}/bootonly
292 CD_DISC1= ${CD}/disc1
293 CD_DISC2= ${CD}/disc2
294 .if defined(MAKE_DVD)
300 .if defined(SEPARATE_LIVEFS)
301 CD_LIVEFS= ${CD}/livefs
303 CD_LIVEFS= ${CD_DISC1}
305 _MK?= ${CHROOTDIR}/mk
307 # Where the bootstrap ports (see DOCPORTS) get installed.
308 LOCALDIR= /usr/local/bin
310 .if ${TARGET} != ${MACHINE} && ${DISKLABEL} == "bsdlabel"
311 DOFS_SH= ${.CURDIR}/scripts/doFS.sh ${DISKLABEL} ${TARGET}
313 DOFS_SH= ${.CURDIR}/scripts/doFS.sh ${DISKLABEL} ""
317 .if ${TARGET_ARCH} == "i386"
318 CRUNCH_TARGETS+=fixit
319 .if ${TARGET} == "pc98"
320 CRUNCH_TARGETS+=fixit-small
324 .if defined(MAKE_FLOPPIES)
326 .if ${TARGET_ARCH} == "i386"
332 .if !defined(NOCDROM)
333 EXTRAS+= cdrom.1 cdrom.2 cdrom.3
334 .if defined(MAKE_ISOS)
337 .if ${TARGET} == "pc98"
348 .if !make(release) && !make(rerelease) && !make(package-split)
349 BINMAKE!= cd ${.CURDIR}/..; ${MAKE} -V BINMAKE
350 WMAKEENV!= cd ${.CURDIR}/..; \
351 ${BINMAKE} ${CROSSENV} -f Makefile.inc1 -V WMAKEENV
352 WMAKE= ${WMAKEENV} ${BINMAKE}
356 .if defined(RELEASETAG)
357 CVS_SRCARGS+= -r ${RELEASETAG}
361 .if defined(DOCRELEASETAG)
362 CVS_DOCARGS+= -r ${DOCRELEASETAG}
366 .if defined(PORTSRELEASETAG)
367 CVS_PORTSARGS+= -r ${PORTSRELEASETAG}
370 WORLDDIR?= ${.CURDIR}/..
373 .if !defined(CHROOTDIR) || !defined(BUILDNAME)
374 @echo "To make a release you must set CHROOTDIR and BUILDNAME" && false
376 .if !defined(NOPORTSATALL) && !defined(EXTPORTSDIR) && !defined(CVSROOT)
377 @echo "Building ports requires CVSROOT or EXTPORTSDIR" && false
379 .if !defined(NODOC) && !defined(EXTDOCDIR) && !defined(CVSROOT)
380 @echo "Building docs requires CVSROOT or EXTDOCDIR" && false
382 .if !defined(EXTSRCDIR) && !defined(CVSROOT) && !defined(SVNROOT)
383 @echo "The source tree requires SVNROOT, CVSROOT, or EXTSRCDIR" && false
385 .if defined(NOPORTSATALL) && !defined(NODOC)
386 @echo "Ports are required for building the release docs. Either set NODOC or"
387 @echo "unset NOPORTS, or set at least DOMINIMALDOCPORTS to YES!"
390 .if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES)
391 .for p in ${LOCAL_PATCHES}
393 @echo "The patch file ${p} does not exist!"
398 .if defined(LOCAL_SCRIPT) && !exists(${LOCAL_SCRIPT})
399 @echo "The local script ${LOCAL_SCRIPT} does not exist!"
403 .if exists(${CHROOTDIR})
404 # The first command will fail on a handful of files that have their schg
405 # flags set. But it greatly speeds up the next two commands.
406 # NB: clear any vestigial devfs mount, just in case
407 -umount ${CHROOTDIR}/dev > /dev/null 2>&1
408 -rm -rf ${CHROOTDIR} 2>/dev/null
409 -chflags -R 0 ${CHROOTDIR}/.
412 mkdir -p ${CHROOTDIR}
413 @echo ">>> make release for ${TARGET} started on `LC_ALL=C TZ=GMT date`"
414 cd ${WORLDDIR} && ${NATIVEMAKE} -DWITHOUT_GAMES -DWITHOUT_HTML -DWITHOUT_LIB32 \
415 -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_PROFILE installworld DESTDIR=${CHROOTDIR}
416 cd ${WORLDDIR} && ${NATIVEMAKE} distribution DESTDIR=${CHROOTDIR}
417 if [ -f /etc/resolv.conf ]; then \
418 cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \
420 .if defined(EXTLOCALDIR)
421 rm -rf ${CHROOTDIR}/usr/local
422 cd ${CHROOTDIR}/usr && cp -R -H ${EXTLOCALDIR} local
424 rm -rf ${CHROOTDIR}/usr/src
425 .if defined(EXTSRCDIR)
426 cd ${CHROOTDIR}/usr && \
427 cp -R -H ${EXTSRCDIR} src
428 .elif defined(SVNROOT)
429 cd ${CHROOTDIR}/usr && \
430 ${SVNPREFIX} svn co ${SVNCMDARGS} ${SVNROOT}/${SVNBRANCH} \
433 cd ${CHROOTDIR}/usr && \
434 ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
435 co ${CVSCMDARGS} ${CVS_SRCARGS} ${RELEASESRCMODULE}
437 .if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES)
438 .for p in ${LOCAL_PATCHES}
439 patch -d ${CHROOTDIR}/usr/${RELEASESRCMODULE} ${PATCH_FLAGS} < ${p}
442 .if defined(LOCAL_SCRIPT)
443 cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} \
444 RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT}
446 rm -rf ${CHROOTDIR}/usr/ports
447 .if !defined(NOPORTSATALL)
448 .if defined(EXTPORTSDIR)
449 cd ${CHROOTDIR}/usr && cp -R -H ${EXTPORTSDIR} ports
450 # If there are distfiles downloaded removing them
451 rm -rf ports/distfiles/*
453 cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
454 co ${CVSCMDARGS} ${CVS_PORTSARGS} ${RELEASEPORTSMODULE}
458 rm -rf ${CHROOTDIR}/usr/doc
459 .if defined(EXTDOCDIR)
460 cd ${CHROOTDIR}/usr && cp -R -H ${EXTDOCDIR} doc
462 cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
463 co ${CVSCMDARGS} ${CVS_DOCARGS} ${RELEASEDOCMODULE}
465 if [ -d ${RELEASEDISTFILES}/ ]; then \
466 cp -rp ${RELEASEDISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \
468 mkdir -p ${CHROOTDIR}/usr/ports/distfiles; \
470 .if !defined(NO_PREFETCHDISTFILES)
471 @cd ${.CURDIR} && ${MAKE} fetch-distfiles
476 .if !defined(RELEASENOUPDATE) && !defined(EXTSRCDIR)
478 cd ${CHROOTDIR}/usr/src && ${SVNPREFIX} svn switch ${SVNCMDARGS} \
479 ${SVNROOT}/${SVNBRANCH}
480 .elif !defined(RELEASETAG)
481 cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
482 update ${CVSCMDARGS} -P -d -A
484 cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
485 update ${CVSCMDARGS} -P -d -r ${RELEASETAG}
487 rm -f ${CHROOTDIR}/tmp/.world_done
488 .if !defined(NOPORTS) && !defined(EXTPORTSDIR)
489 cd ${CHROOTDIR}/usr/ports && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
490 update ${CVSCMDARGS} -P -d
491 rm -f ${CHROOTDIR}/tmp/.skip_ports_index
493 .if defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES"
494 for i in ${MINIMALDOCPORTS}; do \
495 ( cd ${CHROOTDIR}/usr/$$i && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
496 update ${CVSCMDARGS} -P -d ) ; \
500 cd ${CHROOTDIR}/usr/doc && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
501 update ${CVSCMDARGS} -P -d
505 # Add version information to those things that need it.
506 if [ ! -f ${CHROOTDIR}/tmp/.world_done ]; then \
507 cd ${CHROOTDIR}/usr/src/sys/conf && \
508 mv newvers.sh foo && \
509 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && \
512 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
513 echo "#!/bin/sh" > ${_MK}
514 echo "set -ex" >> ${_MK}
515 echo "trap 'umount /dev || true' 0" >> ${_MK}
516 echo "_RELTARGET=\$${1:-doRELEASE}" >> ${_MK}
518 AUTO_KEYBOARD_DETECT \
548 echo "export ${var}=\"${${var}}\"" >> ${_MK}
551 # Don't remove this, or the build will fall over!
552 echo "export RELEASEDIR=${_R}" >> ${_MK}
553 echo "export PATH=/bin:/usr/bin:/sbin:/usr/sbin:${LOCALDIR}" >> ${_MK}
554 echo "export MANBUILDCAT=YES" >> ${_MK}
555 # NB: these may fail if the host is running w/o devfs
556 echo "umount /dev >/dev/null 2>&1 || true" >> ${_MK}
557 echo "mount -t devfs devfs /dev >/dev/null 2>&1 || true" >> ${_MK}
558 echo "if [ ! -c /dev/null ]; then" >> ${_MK}
559 echo " echo /dev/null is not a device!" >> ${_MK}
560 echo " exit 1" >> ${_MK}
562 echo "if [ -x /etc/rc.d/ldconfig ]; then" >> ${_MK}
563 echo " /etc/rc.d/ldconfig start" >> ${_MK}
564 echo "else" >> ${_MK}
565 echo " ldconfig /lib /usr/lib /usr/local/lib || true" >> ${_MK}
567 echo "if [ ! -f /tmp/.world_done ]; then" >> ${_MK}
568 echo " cd /usr/src" >> ${_MK}
569 echo " ${CROSSMAKE} ${WORLD_FLAGS} -DNO_CLEAN buildworld && \\" >> ${_MK}
570 echo " touch /tmp/.world_done || exit 1" >> ${_MK}
572 echo "if [ ! -f /tmp/.skip_ports_index ]; then" >> ${_MK}
573 echo " echo \">>> make index started on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
574 echo " for i in ${MAKEINDEXPORTS}" >> ${_MK}
576 echo " cd /usr/ports/\$${i}" >> ${_MK}
577 echo " env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \\" >> ${_MK}
578 echo " make all install clean BATCH=yes FORCE_PKG_REGISTER=yes" >> ${_MK}
579 echo " done" >> ${_MK}
580 echo " cd /usr/ports" >> ${_MK}
581 echo " rm -f INDEX*" >> ${_MK}
582 echo " make index -DINDEX_PRISTINE" >> ${_MK}
583 echo " rm -f INDEX*.tmp" >> ${_MK}
584 echo " touch /tmp/.skip_ports_index" >> ${_MK}
585 echo " echo \">>> make index finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
587 echo "cd /usr/src/release" >> ${_MK}
588 echo "make obj" >> ${_MK}
589 echo "make \$${_RELTARGET}" >> ${_MK}
590 echo "echo \">>> make ${.TARGET} for ${TARGET} finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
593 touch ${CHROOTDIR}/tmp/.skip_ports_index
595 # Ensure md.ko is loaded if md(4) is not statically compiled into
597 -mdconfig 2>/dev/null
598 env -i /usr/sbin/chroot `dirname ${_MK}` /`basename ${_MK}`
601 rm -rf ${CRUNCH_TARGETS:S/$/_crunch/} release.[0-8] ${EXTRAS}
604 @for i in ${MAKEINDEXPORTS}; do \
605 cd ${CHROOTDIR}/usr/ports/$$i && \
606 make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \
607 checksum-recursive ; \
609 @for i in ${DOCPORTS}; do \
610 cd ${CHROOTDIR}/usr/ports/$$i && \
611 make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \
612 WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes \
613 checksum-recursive ; \
616 # Clean out ${_R} and make the directory structure.
619 -rm -rf ${_R}/* 2> /dev/null
620 -chflags -R noschg ${_R}/.
623 .if defined(MAKE_FLOPPIES)
627 for i in ${DISTRIBUTIONS}; do \
628 mkdir ${RD}/trees/$$i && \
629 mtree -deU -f ${MTREEFILES}/BSD.root.dist \
630 -p ${RD}/trees/$$i > /dev/null && \
631 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
632 -p ${RD}/trees/$$i/usr > /dev/null && \
633 mtree -deU -f ${MTREEFILES}/BSD.include.dist \
634 -p ${RD}/trees/$$i/usr/include > /dev/null && \
635 mtree -deU -f ${MTREEFILES}/BSD.var.dist \
636 -p ${RD}/trees/$$i/var > /dev/null ; \
639 for i in ${KERNELS_BASE} ${KERNELS}; do \
640 mkdir -p ${RD}/kernels/$${i}; \
644 # Install the system into the various distributions.
646 cd ${.CURDIR}/.. && ${CROSSMAKE} distrib-dirs DESTDIR=${RD}/trees/base
647 cd ${.CURDIR}/.. && ${CROSSMAKE} ${WORLD_FLAGS} distributeworld \
651 # Make and install the generic kernel(s).
653 .for kernel in ${KERNELS_BASE} ${KERNELS}
655 ${CROSSMAKE} ${KERNEL_FLAGS} \
656 KERNCONF=${kernel} kernel \
657 DESTDIR=${RD}/kernels KODIR=/${kernel}
661 # Make and install the three crunched binaries which live on the floppies.
662 # You are not supposed to like this :-)
665 mkdir -p ${RD}/crunch
666 .for j in ${CRUNCH_TARGETS}
667 .if exists(${.CURDIR}/${TARGET}/${j}_crunch.conf)
670 cd ${j}_crunch; ${WMAKEENV} MAKEFLAGS="-m ${.CURDIR}/../share/mk" \
671 NO_WERROR= crunchgen -o \
672 ${.CURDIR}/${TARGET}/${j}_crunch.conf
673 cd ${j}_crunch; ${WMAKE} -f ${j}_crunch.mk subclean
674 cd ${.CURDIR}/..; ${BINMAKE} -f Makefile.inc1 _build-tools
675 cd ${j}_crunch; CFLAGS="-Os -pipe" ${WMAKE} -f ${j}_crunch.mk \
677 ${WMAKEENV} strip -R .comment ${j}_crunch/${j}_crunch
678 mv ${j}_crunch/${j}_crunch ${RD}/crunch/${j}
684 # --==## Fix up the distributions. ##==--
687 # Create any "synthetic dists" now.
688 @for i in ${DISTRIBUTIONS}; do \
689 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
690 echo -n "Running $$i dist creation script... "; \
691 env RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
696 # Remove all the directories we don't need.
698 (find ${OTHER_DISTS} -path '*/var/empty' | xargs chflags noschg; \
699 find ${OTHER_DISTS} -depth -type d -empty -delete)
703 # --==## Package up the tarballs from assembled trees ##==--
708 @for i in ${DISTRIBUTIONS} ; \
710 if [ -d ${RD}/trees/$${i} ] ; then \
711 cd ${.CURDIR} && $(MAKE) doTARBALL \
712 SD=${RD}/trees/$${i} \
713 TN=$$i TD=$$i ARG="." && \
714 echo "$${i} distribution is finished."; \
717 @for i in ${KERNELS_BASE} ${KERNELS} ; \
719 if [ -d ${RD}/kernels/$${i} ] ; then \
720 cd ${.CURDIR} && $(MAKE) doTARBALL \
722 TN=$$i TD=kernels ARG="$$i" && \
723 echo "$${i} distribution is finished."; \
726 .if !defined(NOPORTS)
727 # XXX: Inline stripped version of doTARBALL
728 @rm -rf ${RD}/dists/ports/ports*
729 @mkdir -p ${RD}/dists/ports
730 @echo rolling ports/ports tarball
731 @tar --exclude CVS --exclude .svn --exclude 'ports/distfiles/*' \
732 -czf ${RD}/dists/ports/ports.tgz -C /usr ports
733 @cp ${.CURDIR}/scripts/ports-install.sh ${RD}/dists/ports/install.sh
734 @(cd ${RD}/dists/ports; \
735 rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \
736 md5 * > .CHECKSUM.MD5; \
737 sha256 * > .CHECKSUM.SHA256; \
738 mv .CHECKSUM.MD5 CHECKSUM.MD5; \
739 mv .CHECKSUM.SHA256 CHECKSUM.SHA256)
740 @echo "ports distribution is finished."
746 # --==## Make source dists ##==--
750 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \
751 TD=src TN=sbase ARG="[A-Z]*"
752 @for i in `cd /usr/src && echo [a-z]*` ; do \
753 if [ -d /usr/src/$$i ] ; then \
754 cd ${.CURDIR} && $(MAKE) doTARBALL \
755 TN=`echo s$$i | tr -d '.' | \
757 -e 's/kerberos5/krb5/'` \
758 SD=/usr/src TD=src ARG="$$i" ; \
761 .if defined(EXTRA_SRC)
762 @set ${EXTRA_SRC} && \
763 while [ $$# -ge 2 ] ; do \
764 if [ -d /usr/src/$$1 ] ; then \
765 cd ${.CURDIR} && $(MAKE) doTARBALL \
766 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
767 fi && shift && shift ; \
770 (cd ${RD}/dists/src; \
771 rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \
772 md5 * > .CHECKSUM.MD5; \
773 sha256 * > .CHECKSUM.SHA256; \
774 mv .CHECKSUM.MD5 CHECKSUM.MD5; \
775 mv .CHECKSUM.SHA256 CHECKSUM.SHA256)
776 @echo "src distribution is finished."
780 # Build the memory root filesystem.
782 cp ${RD}/trees/base/etc/disktab /etc
786 mkdir -p etc/defaults dev mnt stand/etc/defaults stand/help \
788 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
789 DIR=${RD}/mfsfd/stand ZIP=false
790 ( cd ${RD}/mfsfd && \
791 for dir in bin sbin ; do \
792 ln -sf /stand $$dir; \
794 cp ${RD}/trees/base/sbin/dhclient-script ${RD}/mfsfd/stand
795 cp ${.CURDIR}/../etc/master.passwd ${RD}/mfsfd/etc/master.passwd
796 cp ${RD}/trees/base/etc/*pwd.db ${RD}/mfsfd/etc/
797 ( for F in defaults/rc.conf netconfig protocols ; do \
798 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \
799 ${RD}/trees/base/etc/$$F > ${RD}/mfsfd/stand/etc/$$F ; \
801 grep -E '^(ftp|nameserver|domain|sunrpc|cmd|nfsd)[^-\w]' \
802 ${RD}/trees/base/etc/services | \
803 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \
804 > ${RD}/mfsfd/stand/etc/services
805 grep 'operator' ${RD}/trees/base/etc/group \
806 > ${RD}/mfsfd/stand/etc/group
807 ln ${RD}/mfsfd/stand/etc/services ${RD}/mfsfd/etc/services
808 ln ${RD}/mfsfd/stand/etc/group ${RD}/mfsfd/etc/group
809 ln ${RD}/mfsfd/stand/etc/netconfig ${RD}/mfsfd/etc/netconfig
810 cp ${RD}/trees/base/COPYRIGHT ${RD}/mfsfd/stand/help/COPYRIGHT.hlp
812 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
813 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
814 ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
816 @for i in ${DIST_DOCS_ARCH_DEP}; do \
817 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
818 ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
821 -test -f ${.CURDIR}/install.cfg \
822 && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
823 @mkdir -p ${RD}/mfsfd/boot
824 .if ${TARGET_ARCH} != "ia64" && ${TARGET_ARCH} != "powerpc"
825 @cp ${RD}/trees/base/boot/boot* ${RD}/mfsfd/boot
827 .if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64"
828 @cp ${RD}/trees/base/boot/mbr ${RD}/mfsfd/boot
830 @tar --exclude CVS --exclude .svn -cf - \
831 -C ${.CURDIR}/../usr.sbin/sysinstall help | \
832 tar xf - -C ${RD}/mfsfd/stand
833 @mkdir -p ${RD}/mfsroot
834 sh -e ${DOFS_SH} ${RD}/mfsroot/mfsroot ${RD} ${MNT} \
835 ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL}
836 @${ZIPPER} -fv ${RD}/mfsroot/mfsroot
839 KERNFLOPPYSET= ${RD}/floppyset/kern/kernel.gz
840 .if defined(SMALLFLOPPYSIZE)
841 SMALLKERNFLOPPYSET= ${RD}/floppyset/kern-small/kernel.gz
843 .if defined(SPLIT_MFSROOT)
844 MFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot/mfsroot.gz
845 .if defined(SMALLFLOPPYSIZE)
846 SMALLMFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot-small/mfsroot.gz
850 # Build boot and install floppies.
852 @${ZIPPER} -c ${RD}/kernels/GENERIC/kernel > ${RD}/kernels/kernel.gz
853 @echo "Making the kernel boot floppies..."
854 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern \
855 FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz
856 .if defined(SMALLFLOPPYSIZE)
857 @echo "Making the small kernel boot floppies..."
858 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern-small \
859 FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz \
862 .if defined(SPLIT_MFSROOT)
863 @echo "Making the mfsroot boot floppies..."
864 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot \
865 FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz
866 .if defined(SMALLFLOPPYSIZE)
867 @echo "Making the small mfsroot boot floppies..."
868 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot-small \
869 FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz \
872 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \
873 KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \
874 MFSROOTFILE="${MFSROOTFLOPPYSET}.split ${MFSROOTFLOPPYSET}.boot"
875 .if defined(SMALLFLOPPYSIZE)
876 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \
877 KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \
878 MFSROOTFILE="${SMALLMFSROOTFLOPPYSET}.split ${SMALLMFSROOTFLOPPYSET}.boot" \
881 .else # !SPLIT_MFSROOT
882 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \
883 KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \
884 MFSROOTFILE=${RD}/mfsroot/mfsroot.gz
885 .if defined(SMALLFLOPPYSIZE)
886 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \
887 KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \
888 MFSROOTFILE=${RD}/mfsroot/mfsroot.gz \
891 .endif # SPLIT_MFSROOT
894 # Build fixit floppy.
896 @echo "Making fixit floppy."
897 @rm -rf ${RD}/fixitfd
899 @cd ${RD}/fixitfd && \
900 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
902 @cp ${RD}/trees/base/etc/spwd.db ${RD}/trees/base/etc/group \
904 @sed -e 's/#.*//' ${RD}/trees/base/etc/protocols \
905 > ${RD}/fixitfd/etc/protocols
906 @sed -e 's/#.*//' ${RD}/trees/base/usr/share/misc/scsi_modes \
907 > ${RD}/fixitfd/usr/share/misc/scsi_modes
908 @cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
909 @cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
910 @cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar
911 @chmod 555 ${RD}/fixitfd/stand/tar
912 .if defined(SMALLFLOPPYSIZE)
913 @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit-small \
914 DIR=${RD}/fixitfd/stand ZIP=false
915 @sh -e ${DOFS_SH} ${RD}/floppies/fixit-small.flp ${RD} ${MNT} \
916 ${SMALLFLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${SMALLFLOPPYLABEL}
917 @rm -rf ${RD}/fixitfd/stand
918 @mkdir ${RD}/fixitfd/stand
920 @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit \
921 DIR=${RD}/fixitfd/stand ZIP=false
922 @sh -e ${DOFS_SH} ${RD}/floppies/fixit.flp ${RD} ${MNT} \
923 ${FLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${FLOPPYLABEL}
926 # Do our last minute floppies directory setup
928 @(cd ${RD}/floppies; md5 *.flp > CHECKSUM.MD5)
929 @(cd ${RD}/floppies; sha256 *.flp > CHECKSUM.SHA256)
933 # --==## Setup a suitable ftp-area ##==--
936 @echo "Setting up FTP distribution area"
938 -@ln -s . ${FD}/${BUILDNAME}
939 .if defined(MAKE_FLOPPIES)
940 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
942 @cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
944 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
945 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
946 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
947 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
948 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
950 @for i in ${DIST_DOCS_ARCH_DEP}; do \
951 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
952 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
953 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
954 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
956 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${FD}
958 @echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
961 # Build a live filesystem cdrom image
963 @echo "Building CDROM live filesystem image"
964 @mkdir -p ${CD_LIVEFS}
965 @for i in ${DISTRIBUTIONS} ; \
967 if [ -d ${RD}/trees/$${i} ] ; then \
968 chflags -R noschg ${RD}/trees/$${i} || true ; \
969 ( cd ${RD}/trees/$${i} && \
970 find . -depth -print | cpio -dumpl ${CD_LIVEFS} ) ; \
973 .if defined(MAKE_DVD)
974 @echo "Building DVD filesystem image as well as CDROM"
975 @mkdir -p ${CD_DVD1}/${BUILDNAME}
976 @for i in ${DISTRIBUTIONS} ; \
978 if [ -d ${RD}/trees/$${i} ] ; then \
979 chflags -R noschg ${RD}/trees/$${i} || true ; \
980 ( cd ${RD}/trees/$${i} && \
981 find . -depth -print | cpio -dumpl ${CD_DVD1} ) ; \
985 @echo "Copy GENERIC kernel to boot area"
986 @cp -Rp ${RD}/kernels/GENERIC/ ${CD_LIVEFS}/boot/kernel
987 @rm -f ${CD_LIVEFS}/boot/kernel/*.symbols
988 @rm -f ${CD_LIVEFS}/.profile
989 @cp ${.CURDIR}/fixit.profile ${CD_LIVEFS}/.profile
990 @ln -sf /rescue ${CD_LIVEFS}/stand
991 @echo "Setting up CDROM boot area"
992 @rm -f ${CD_LIVEFS}/boot/loader.conf
993 @cp ${RD}/mfsroot/mfsroot.gz ${CD_LIVEFS}/boot/mfsroot.gz
994 @echo 'mfsroot_load="YES"' > ${CD_LIVEFS}/boot/loader.conf
995 @echo 'mfsroot_type="mfs_root"' >> ${CD_LIVEFS}/boot/loader.conf
996 @echo 'mfsroot_name="/boot/mfsroot"' >> ${CD_LIVEFS}/boot/loader.conf
997 .if exists(${RD}/trees/base/boot/device.hints)
998 # Break the link to device.hints so we can modify it
999 @rm -f ${CD_LIVEFS}/boot/device.hints
1000 @cp ${RD}/trees/base/boot/device.hints ${CD_LIVEFS}/boot/device.hints
1002 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_LIVEFS}/cdrom.inf
1003 .if defined(MAKE_DVD)
1004 @cp -Rp ${RD}/kernels/GENERIC/ ${CD_DVD1}/boot/kernel
1005 @rm -f ${CD_DVD1}/boot/kernel/*.symbols
1006 @rm -f ${CD_DVD1}/.profile
1007 @cp ${.CURDIR}/fixit.profile ${CD_DVD1}/.profile
1008 @ln -sf /rescue ${CD_DVD1}/stand
1009 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DVD1}/cdrom.inf
1010 @rm -f ${CD_DVD1}/boot/loader.conf
1011 @cp ${RD}/mfsroot/mfsroot.gz ${CD_DVD1}/boot/mfsroot.gz
1012 @echo 'mfsroot_load="YES"' > ${CD_DVD1}/boot/loader.conf
1013 @echo 'mfsroot_type="mfs_root"' >> ${CD_DVD1}/boot/loader.conf
1014 @echo 'mfsroot_name="/boot/mfsroot"' >> ${CD_DVD1}/boot/loader.conf
1015 .if exists(${RD}/trees/base/boot/device.hints)
1016 @rm -f ${CD_DVD1}/boot/device.hints
1017 @cp ${RD}/trees/base/boot/device.hints ${CD_DVD1}/boot/device.hints
1022 # Build disc1 and disc2 cdrom images
1024 @echo "Building CDROM disc1 filesystem image"
1025 @mkdir -p ${CD_DISC1}/${BUILDNAME}
1026 .if defined(MAKE_FLOPPIES)
1027 @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
1029 @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}/${BUILDNAME}
1031 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
1032 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
1033 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
1034 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
1035 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
1037 @for i in ${DIST_DOCS_ARCH_DEP}; do \
1038 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
1039 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
1040 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
1041 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
1043 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DISC1}
1045 .if defined(SEPARATE_LIVEFS)
1046 @cp -Rp ${CD_LIVEFS}/boot ${CD_DISC1}
1047 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
1049 @echo "CD_VOLUME = 1" >> ${CD_DISC1}/cdrom.inf
1050 @echo "Building CDROM disc2 filesystem image"
1051 @mkdir -p ${CD_DISC2}
1052 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
1053 @echo "CD_VOLUME = 2" >> ${CD_DISC2}/cdrom.inf
1054 .if defined(MAKE_DVD)
1055 .if defined(MAKE_FLOPPIES)
1056 @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DVD1}
1058 @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DVD1}/${BUILDNAME}
1060 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
1061 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
1062 ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
1063 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
1064 ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
1066 @for i in ${DIST_DOCS_ARCH_DEP}; do \
1067 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
1068 ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
1069 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
1070 ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
1072 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DVD1}
1074 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DVD1}/cdrom.inf
1075 @echo "CD_VOLUME = 1" >> ${CD_DVD1}/cdrom.inf
1078 @echo "Building CDROM docs filesystem image"
1079 @mkdir -p ${CD_DOCS}
1080 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DOCS}/cdrom.inf
1081 @echo "CD_VOLUME = 3" >> ${CD_DOCS}/cdrom.inf
1086 # --==## Setup a suitable cdrom-area ##==--
1089 .if defined(CD_BOOT)
1090 @echo "Building bootonly CDROM filesystem image"
1091 @mkdir -p ${CD_BOOT}
1092 @cp -Rp ${CD_LIVEFS}/boot ${CD_BOOT}
1093 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_BOOT}/cdrom.inf
1094 .if defined(MINIROOT)
1095 @echo "Building bootonly UFS filesystem image"
1096 @mkdir -p ${FD}/miniroot
1097 @sh -e ${DOFS_SH} ${FD}/miniroot/miniroot.ufs \
1098 ${RD} ${MNT} 0 ${CD_BOOT} 8192 auto
1099 @${ZIPPER} -v ${FD}/miniroot/miniroot.ufs
1105 .if defined(CD_PACKAGE_TREE)
1106 .if exists(${CD_PACKAGE_TREE}/disc1)
1107 CD_DISC1_PKGS= ${CD_PACKAGE_TREE}/disc1
1109 .if exists(${CD_PACKAGE_TREE}/disc2)
1110 CD_DISC2_PKGS= ${CD_PACKAGE_TREE}/disc2
1112 # scripts/package-trees.sh names all discs according to the "discX"
1113 # scheme where X is the number of the disc
1114 .if exists(${CD_PACKAGE_TREE}/disc3)
1115 CD_DOCS_PKGS= ${CD_PACKAGE_TREE}/disc3
1117 .if exists(${CD_PACKAGE_TREE}/dvd1)
1118 CD_DVD1_PKGS= ${CD_PACKAGE_TREE}/dvd1
1124 .if exists(${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh)
1125 @echo "Creating ISO images..."
1126 .if defined(CD_BOOT)
1127 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
1129 ${CD}/${BUILDNAME}-${TARGET}-bootonly.iso ${CD_BOOT}
1131 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
1133 ${CD}/${BUILDNAME}-${TARGET}-disc1.iso ${CD_DISC1} \
1135 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \
1137 ${CD}/${BUILDNAME}-${TARGET}-disc2.iso ${CD_DISC2} \
1139 .if defined(MAKE_DVD)
1140 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
1142 ${CD}/${BUILDNAME}-${TARGET}-dvd1.iso ${CD_DVD1} \
1146 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \
1147 FreeBSD_Documentation \
1148 ${CD}/${BUILDNAME}-${TARGET}-disc3.iso ${CD_DOCS} \
1151 .if defined(SEPARATE_LIVEFS)
1152 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
1154 ${CD}/${BUILDNAME}-${TARGET}-livefs.iso ${CD_LIVEFS}
1156 @echo "Generating MD5 and SHA256 sums..."
1157 @(cd ${CD} && md5 *.iso > ${BUILDNAME}-${TARGET}-iso.CHECKSUM.MD5)
1158 @(cd ${CD} && sha256 *.iso > ${BUILDNAME}-${TARGET}-iso.CHECKSUM.SHA256)
1161 @echo "Do not know how to create an ISO for ${TARGET_ARCH}."
1165 # --==## Documentation Project files such as the Handbook and FAQ ##==--
1168 @echo "Making docs..."
1169 @for i in ${DOCPORTS}; do \
1170 cd /usr/ports/$$i && \
1171 env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \
1172 make all install clean BATCH=yes WITHOUT_X11=yes JADETEX=no \
1173 WITHOUT_PYTHON=yes FORCE_PKG_REGISTER=yes; \
1178 # --==## RELNOTESng: Next-generation replacements for *.TXT files ##==--
1181 @echo "Making release documentation..."
1182 @cd ${.CURDIR}/doc && make all install clean 'FORMATS=html txt' \
1183 INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${RND}
1186 # Various "subroutine" and other supporting targets.
1194 @echo "SD undefined in doTARBALL" && exit 1
1197 @echo "TD undefined in doTARBALL" && exit 1
1200 @echo "ARG undefined in doTARBALL" && exit 1
1202 @rm -rf ${RD}/dists/${TD}/${TN}*
1203 @mkdir -p ${RD}/dists/${TD}
1205 tn=`echo ${TN} | tr 'A-Z' 'a-z'` && \
1206 echo rolling ${TD}/$$tn tarball &&\
1207 tar --exclude CVS --exclude .svn --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
1208 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
1209 sh ${.CURDIR}/scripts/info.sh ${RD}/dists/${TD}/$$tn \
1210 > ${RD}/dists/${TD}/$$tn.inf && \
1211 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
1212 cp -p ${.CURDIR}/scripts/$${TD}-install.sh \
1213 ${RD}/dists/${TD}/install.sh && \
1214 chmod +x ${RD}/dists/${TD}/install.sh; \
1216 if [ "${SD}" != "/usr/src" ]; then \
1217 mtree -c -i -p ${SD}/${ARG} \
1218 -k gname,md5digest,mode,nlink,uname,size,link,type \
1219 > ${RD}/dists/${TD}/$$tn.mtree ; \
1223 ( cd ${RD}/dists/${TD}; \
1224 rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \
1225 md5 * > .CHECKSUM.MD5; \
1226 sha256 * > .CHECKSUM.SHA256; \
1227 mv .CHECKSUM.MD5 CHECKSUM.MD5; \
1228 mv .CHECKSUM.SHA256 CHECKSUM.SHA256) \
1231 doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 \
1232 release.5 release.6 release.7 release.8 ${EXTRAS}
1233 @echo "Release done"
1236 @rm -f release.4 release.8 floppies.[123]
1237 @cd ${.CURDIR} && ${MAKE} release.4 release.8 floppies.1 floppies.2 \
1239 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
1242 .if !defined(CRUNCH)
1243 @echo "CRUNCH undefined in installCRUNCH" && exit 1
1246 @echo "DIR undefined in installCRUNCH" && exit 1
1249 @echo "ZIP undefined in installCRUNCH" && exit 1
1252 ${ZIPPER} < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
1254 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
1256 @chmod 555 ${DIR}/${CRUNCH}_crunch
1257 @if [ -f ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf ] ; then \
1258 for i in `crunchgen -l ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf` ; do \
1259 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
1262 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
1263 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
1268 # --==## Build a floppy set for a splitfs file ##==--
1270 # FLOPPYBASE - basename of floppy image files
1271 # FLOPPYDESC - description of floppy set
1272 # SPLITFILE - filename of the file to split
1273 # FDSIZE - if specified and "small", small floppy is created
1275 .if make(makeFloppySet)
1276 SPLITDIR= ${RD}/floppyset/${FLOPPYBASE}
1277 .if defined(FDSIZE) && ${FDSIZE} == "SMALL"
1278 FLPSPLITSIZE= ${SMALLFLOPPYSPLITSIZE}
1279 FLPSIZE= ${SMALLFLOPPYSIZE}
1280 FLPLABEL= ${SMALLFLOPPYLABEL}
1282 FLPSPLITSIZE= ${FLOPPYSPLITSIZE}
1283 FLPSIZE= ${FLOPPYSIZE}
1284 FLPLABEL= ${FLOPPYLABEL}
1289 .if !defined(FLOPPYBASE)
1290 @echo "FLOPPYBASE undefined in ${.TARGET}" && exit 1
1292 .if !defined(FLOPPYDESC)
1293 @echo "FLOPPYDESC undefined in ${.TARGET}" && exit 1
1295 .if !defined(SPLITFILE)
1296 @echo "SPLITFILE undefined in ${.TARGET}" && exit 1
1298 sh ${.CURDIR}/scripts/split-file.sh ${SPLITFILE} \
1299 ${RD}/floppyset/${FLOPPYBASE} ${FLPSPLITSIZE} "${FLOPPYDESC}"
1300 ( splitfile=${SPLITDIR}/`basename ${SPLITFILE}`.split ; \
1301 lines=`cat $${splitfile} | wc -l`; \
1302 lines=$$(($$lines - 1)) ; \
1303 for line in `jot $$lines`; do \
1304 file=`head -n $$(($${line} + 1)) $${splitfile} | tail -1 | cut -f 1 -d ' '` ; \
1305 sh -e ${DOFS_SH} ${RD}/floppies/${FLOPPYBASE}$${line}.flp \
1306 ${RD} ${MNT} ${FLPSIZE} ${SPLITDIR}/$${file} \
1307 ${BOOTINODE} ${FLPLABEL}; \
1311 # --==## Build a boot floppy ##==--
1313 # FSIMAGE - base floppy image name
1314 # FDSIZE - if specified and "small", small floppy is created
1315 # KERNFILE - path to kernel split file
1316 # MFSROOTFILE - path to mfsroot split file
1318 .if make(buildBootFloppy)
1319 IMAGEDIR= ${RD}/image.${FSIMAGE}
1320 BOOTDIR= ${RD}/trees/base/boot
1321 HINTSFILE= ${BOOTDIR}/device.hints
1322 ACPI_KO= ${RD}/kernels/GENERIC/acpi.ko
1323 IMAGEFILE= ${RD}/floppies/${FSIMAGE}.flp
1324 .if defined(FDSIZE) && ${FDSIZE} == "SMALL"
1325 FLPSIZE= ${SMALLFLOPPYSIZE}
1326 FLPLABEL= ${SMALLFLOPPYLABEL}
1328 FLPSIZE= ${FLOPPYSIZE}
1329 FLPLABEL= ${FLOPPYLABEL}
1334 .if !defined(FSIMAGE)
1335 @echo "FSIMAGE undefined in ${.TARGET}" && exit 1
1337 .if !defined(KERNFILE)
1338 @echo "KERNFILE undefined in ${.TARGET}" && exit 1
1340 .if !defined(MFSROOTFILE)
1341 @echo "MFSROOTFILE undefined in ${.TARGET}" && exit 1
1343 @echo "Running ${.TARGET} for ${FSIMAGE}"
1346 @echo "Setting up /boot directory for ${FSIMAGE} floppy"
1347 @mkdir -p ${IMAGEDIR}/boot
1348 .if ${TARGET} == "i386"
1349 @${WMAKEENV} kgzip -v -l ${RD}/trees/base/usr/lib/kgzldr.o -o \
1350 ${IMAGEDIR}/boot/loader ${BOOTDIR}/loader
1352 @cp ${BOOTDIR}/loader ${IMAGEDIR}/boot
1354 @cp -Rp ${BOOTDIR}/*.4th ${BOOTDIR}/defaults ${BOOTDIR}/loader.help \
1355 ${BOOTDIR}/loader.rc ${IMAGEDIR}/boot
1356 .if exists(${HINTSFILE})
1357 @cp ${HINTSFILE} ${IMAGEDIR}/boot/device.hints
1358 @${ZIPPER} ${IMAGEDIR}/boot/device.hints
1360 @${ZIPPER} ${IMAGEDIR}/boot/*.4th ${IMAGEDIR}/boot/loader.help \
1361 ${IMAGEDIR}/boot/defaults/loader.conf
1362 @echo 'bootfile="/kernel"' > ${IMAGEDIR}/boot/loader.conf
1363 .if exists(${ACPI_KO})
1364 @${ZIPPER} -c ${ACPI_KO} > ${IMAGEDIR}/acpi.ko.gz
1365 @echo 'acpi_load="YES"' >> ${IMAGEDIR}/boot/loader.conf
1366 @echo 'acpi_name="/acpi.ko"' >> ${IMAGEDIR}/boot/loader.conf
1367 @echo 'acpi_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
1369 @echo 'mfsroot_load="YES"' >> ${IMAGEDIR}/boot/loader.conf
1370 @echo 'mfsroot_type="mfs_root"' >> ${IMAGEDIR}/boot/loader.conf
1371 @echo 'mfsroot_name="/mfsroot"' >> ${IMAGEDIR}/boot/loader.conf
1372 .if !exists(${ACPI_KO})
1373 @echo 'mfsroot_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
1375 .if defined(SPLIT_MFSROOT)
1376 @echo 'mfsroot_after="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
1378 .if ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "amd64"
1379 .if ${AUTO_KEYBOARD_DETECT}
1380 @echo "-P" >> ${IMAGEDIR}/boot.config
1384 @cp ${KERNFILE} ${MFSROOTFILE} ${IMAGEDIR}
1385 sh -e ${DOFS_SH} ${IMAGEFILE} ${RD} ${MNT} ${FLPSIZE} ${IMAGEDIR} \
1386 ${BOOTINODE} ${FLPLABEL}
1387 @echo "Created ${RD}/floppies/${FSIMAGE}.flp"
1389 .if make(package-split)
1390 # Targets related to making a package split
1392 # PKG_COPY instructs the script to copy the actual package files rather than
1394 # PKG_TREE is the path to the package tree to be split
1395 # PKG_DEST is the path to the destination tree to create the split in
1396 # PKG_VERBOSE asks for verbose output of the layout process
1397 # PKG_INDEX is the path to the INDEX file. By default ${PKG_TREE}/INDEX.
1399 .if defined(PKG_COPY)
1404 PKG_WRKIDX= ${PKG_DEST}/INDEX.master
1406 .if defined(TARGET_ARCH)
1407 PKG_ENV+= PKG_ARCH=${TARGET_ARCH}
1409 .if defined(PKG_VERBOSE)
1410 PKG_ENV+= PKG_VERBOSE=1
1412 PKG_INDEX?= ${PKG_TREE}/INDEX
1415 .if !defined(PKG_TREE)
1416 @echo "PKG_TREE must be defined" && exit 1
1418 .if !defined(PKG_DEST)
1419 @echo "PKG_DEST must be defined" && exit 1
1421 @env ${PKG_ENV} python ${.CURDIR}/scripts/package-split.py \
1422 ${PKG_INDEX} ${PKG_WRKIDX}
1423 @env ${PKG_ENV} sh ${.CURDIR}/scripts/package-trees.sh ${PKG_DO_COPY} \
1424 ${PKG_WRKIDX} ${PKG_TREE} ${PKG_DEST}
1427 .include <bsd.obj.mk>