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}
109 TARGET_CPUARCH?= ${MACHINE_CPUARCH}
111 TARGET?= ${TARGET_ARCH}
112 TARGET_CPUARCH?= ${TARGET_ARCH}
114 CROSSENV= TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}
115 CROSSMAKE= ${MAKE} ${CROSSENV}
116 NATIVEMAKE= ${MAKE} TARGET_ARCH=${MACHINE_ARCH} TARGET=${MACHINE}
118 # If you are using a local CVS repository with components stored in
119 # non-standard modules, override these on the make commandline or
120 # in the environment.
121 RELEASESRCMODULE?= src
122 RELEASEDOCMODULE?= doc
123 RELEASEPORTSMODULE?= ports
125 # Uncomment this to disable the doc.1 target. Docs normally require
126 # the ports tree, so NOPORTS can be set together with NODOC in order
127 # to have neither ports or docs. If only NOPORTS is set to YES, but
128 # docs are still desired, the DOMINIMALDOCPORTS logic below will only
129 # install the ports that are minimally required for the release note documentation. This is
130 # intended as a compromise, less disk space is required than for using
131 # the entire ports collection (and much less time due to the huge number
132 # of directories it would create), but still quite a bit as well as some
133 # CPU cycles (some of the programs are C++, and things like ghostscript
134 # belong to the required ports nevertheless).
139 # When retrieving ports using the pkg_add -r method, set your proxies to these.
140 # src/release/${arch}/mkisoimages.sh can use these.
141 #HTTP_PROXY?= www.example.com
142 #FTP_PROXY?= ftp.example.com
144 # When creating ISO images, point ${CD_PACKAGE_TREE} to a directory containing
145 # the package split by an earlier invocation of the 'package-split' target.
146 #CD_PACKAGE_TREE= /path/to/pkg
148 # Extra source tarballs; each argument is a pair of source dir and
149 # distribution name. The dist name should not exceed 7 characters
150 # (another "s" for "source" will be prepended).
151 #EXTRA_SRC= games/fortune fortune
153 # Modify this definition if you want the release notes
154 # and other release documentation in a language other than English.
155 RELNOTES_LANG?= en_US.ISO8859-1
157 # As an alternative to installing the entire ports collection (which
158 # can take a huge amount of time, in particular on slower disks),
159 # setting ${MINIMALDOCPORTS} allows to install and build just those
160 # ports that are really required for getting the docs up & running.
161 .if defined(NOPORTS) && !defined(NODOC)
162 DOMINIMALDOCPORTS= YES
163 .include "Makefile.inc.docports"
164 RELEASEPORTSMODULE= ${MINIMALDOCPORTS} ports/sysutils/cdrtools
169 .if !defined(DOMINIMALDOCPORTS) || ${DOMINIMALDOCPORTS} != "YES"
175 # Doing 'make index' in /usr/ports requires Perl.
176 MAKEINDEXPORTS= lang/perl5.10
177 DOCPORTS= textproc/docproj
178 # Set this to wherever the distfiles required by release procedures.
179 .if defined(DOCDISTFILES)
180 # Respect DOCDISTFILES which is used before.
181 RELEASEDISTFILES?= ${DOCDISTFILES}
183 RELEASEDISTFILES?= ${.CURDIR}/../../ports/distfiles
185 # Set this to 1 if you want -P to be used for automatic keyboard detection
186 # on the boot floppy. WARNING: Breaks on some Athlon (K7) motherboards.
187 AUTO_KEYBOARD_DETECT?= 0
190 DIST_DOCS_ARCH_INDEP= hardware readme relnotes errata
194 # Things which without too much trouble can be considered variables
195 # BASE_DISTS are special in that they get full /etc installation sets.
197 OTHER_DISTS?= catpages manpages proflibs dict info
198 BASE_DISTS?= base doc games ${ARCH_DISTS}
199 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64"
202 DISTRIBUTIONS?= ${BASE_DISTS} ${OTHER_DISTS}
205 # Build and package both GENERIC and SMP kernels if the target
206 # has both configuration files. Otherwise only GENERIC is done.
208 .if ${TARGET_ARCH} == "powerpc64"
209 KERN_GENERIC?= GENERIC64
211 KERN_GENERIC?= GENERIC
214 .if exists(${.CURDIR}/../sys/${TARGET}/conf/SMP)
215 KERNELS_BASE?= ${KERN_GENERIC} SMP
217 KERNELS_BASE?= ${KERN_GENERIC}
220 # mountpoint for filesystems.
223 # Various floppy image parameters.
227 .if ${TARGET_ARCH} == "i386"
231 .if ${TARGET} == "pc98"
233 SMALLFLOPPYSIZE= 1200
234 SMALLFLOPPYSPLITSIZE= 1152
235 SMALLFLOPPYLABEL= fd1200
239 FLOPPYSPLITSIZE= 1392
246 .elif ${TARGET_ARCH} == "sparc64"
254 .elif ${TARGET_ARCH} == "ia64"
261 .elif ${TARGET_ARCH} == "amd64"
264 FLOPPYSPLITSIZE= 1392
273 .elif ${TARGET_ARCH} == "powerpc"
279 .elif ${TARGET_ARCH} == "powerpc64"
286 .if defined(NO_FLOPPIES)
290 .if exists(/sbin/bsdlabel)
293 DISKLABEL?= disklabel
296 ZIPPER= gzip -9 --no-name
297 ZIPNSPLIT= ${ZIPPER} -c | split -b 1392k -
299 # Things which may get you into trouble if you change them
300 MTREEFILES= ${.CURDIR}/../etc/mtree
303 RND= ${RD}/release.doc
306 CD_BOOT= ${CD}/bootonly
307 CD_DISC1= ${CD}/disc1
308 CD_DISC2= ${CD}/disc2
309 .if defined(MAKE_DVD)
315 .if defined(SEPARATE_LIVEFS)
316 CD_LIVEFS= ${CD}/livefs
318 CD_LIVEFS= ${CD_DISC1}
320 _MK?= ${CHROOTDIR}/mk
322 # Where the bootstrap ports (see DOCPORTS) get installed.
323 LOCALDIR= /usr/local/bin
325 .if ${TARGET} != ${MACHINE} && ${DISKLABEL} == "bsdlabel"
326 DOFS_SH= ${.CURDIR}/scripts/doFS.sh ${DISKLABEL} ${TARGET}
328 DOFS_SH= ${.CURDIR}/scripts/doFS.sh ${DISKLABEL} ""
332 .if ${TARGET_ARCH} == "i386"
333 CRUNCH_TARGETS+=fixit
334 .if ${TARGET} == "pc98"
335 CRUNCH_TARGETS+=fixit-small
339 .if defined(MAKE_FLOPPIES)
341 .if ${TARGET_ARCH} == "i386"
347 .if !defined(NOCDROM)
348 EXTRAS+= cdrom.1 cdrom.2 cdrom.3
349 .if defined(MAKE_ISOS)
352 .if ${TARGET} == "pc98"
363 .if !make(release) && !make(rerelease) && !make(package-split)
364 BINMAKE!= cd ${.CURDIR}/..; ${MAKE} -V BINMAKE
365 WMAKEENV!= cd ${.CURDIR}/..; \
366 ${BINMAKE} ${CROSSENV} -f Makefile.inc1 -V WMAKEENV
367 WMAKE= ${WMAKEENV} ${BINMAKE}
371 .if defined(RELEASETAG)
372 CVS_SRCARGS+= -r ${RELEASETAG}
376 .if defined(DOCRELEASETAG)
377 CVS_DOCARGS+= -r ${DOCRELEASETAG}
381 .if defined(PORTSRELEASETAG)
382 CVS_PORTSARGS+= -r ${PORTSRELEASETAG}
385 WORLDDIR?= ${.CURDIR}/..
388 .if !defined(CHROOTDIR) || !defined(BUILDNAME)
389 @echo "To make a release you must set CHROOTDIR and BUILDNAME" && false
391 .if !defined(NOPORTSATALL) && !defined(EXTPORTSDIR) && !defined(CVSROOT)
392 @echo "Building ports requires CVSROOT or EXTPORTSDIR" && false
394 .if !defined(NODOC) && !defined(EXTDOCDIR) && !defined(CVSROOT)
395 @echo "Building docs requires CVSROOT or EXTDOCDIR" && false
397 .if !defined(EXTSRCDIR) && !defined(CVSROOT) && !defined(SVNROOT)
398 @echo "The source tree requires SVNROOT, CVSROOT, or EXTSRCDIR" && false
400 .if defined(NOPORTSATALL) && !defined(NODOC)
401 @echo "Ports are required for building the release docs. Either set NODOC or"
402 @echo "unset NOPORTS, or set at least DOMINIMALDOCPORTS to YES!"
405 .if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES)
406 .for p in ${LOCAL_PATCHES}
408 @echo "The patch file ${p} does not exist!"
413 .if defined(LOCAL_SCRIPT) && !exists(${LOCAL_SCRIPT})
414 @echo "The local script ${LOCAL_SCRIPT} does not exist!"
418 .if exists(${CHROOTDIR})
419 # The first command will fail on a handful of files that have their schg
420 # flags set. But it greatly speeds up the next two commands.
421 # NB: clear any vestigial devfs mount, just in case
422 -umount ${CHROOTDIR}/dev > /dev/null 2>&1
423 -rm -rf ${CHROOTDIR} 2>/dev/null
424 -chflags -R 0 ${CHROOTDIR}/.
427 mkdir -p ${CHROOTDIR}
428 @echo ">>> make release for ${TARGET} started on `LC_ALL=C TZ=GMT date`"
429 cd ${WORLDDIR} && ${NATIVEMAKE} -DWITHOUT_GAMES -DWITHOUT_HTML -DWITHOUT_LIB32 \
430 -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_PROFILE installworld DESTDIR=${CHROOTDIR}
431 cd ${WORLDDIR} && ${NATIVEMAKE} distribution DESTDIR=${CHROOTDIR}
432 if [ -f /etc/resolv.conf ]; then \
433 cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \
435 .if defined(EXTLOCALDIR)
436 rm -rf ${CHROOTDIR}/usr/local
437 cd ${CHROOTDIR}/usr && cp -R -H ${EXTLOCALDIR} local
439 rm -rf ${CHROOTDIR}/usr/src
440 .if defined(EXTSRCDIR)
441 cd ${CHROOTDIR}/usr && \
442 cp -R -H ${EXTSRCDIR} src
443 .elif defined(SVNROOT)
444 cd ${CHROOTDIR}/usr && \
445 ${SVNPREFIX} svn co ${SVNCMDARGS} ${SVNROOT}/${SVNBRANCH} \
448 cd ${CHROOTDIR}/usr && \
449 ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
450 co ${CVSCMDARGS} ${CVS_SRCARGS} ${RELEASESRCMODULE}
452 .if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES)
453 .for p in ${LOCAL_PATCHES}
454 patch -d ${CHROOTDIR}/usr/${RELEASESRCMODULE} ${PATCH_FLAGS} < ${p}
457 .if defined(LOCAL_SCRIPT)
458 cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} \
459 RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT}
461 rm -rf ${CHROOTDIR}/usr/ports
462 .if !defined(NOPORTSATALL)
463 .if defined(EXTPORTSDIR)
464 cd ${CHROOTDIR}/usr && cp -R -H ${EXTPORTSDIR} ports
465 # If there are distfiles downloaded removing them
466 rm -rf ports/distfiles/*
468 cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
469 co ${CVSCMDARGS} ${CVS_PORTSARGS} ${RELEASEPORTSMODULE}
473 rm -rf ${CHROOTDIR}/usr/doc
474 .if defined(EXTDOCDIR)
475 cd ${CHROOTDIR}/usr && cp -R -H ${EXTDOCDIR} doc
477 cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
478 co ${CVSCMDARGS} ${CVS_DOCARGS} ${RELEASEDOCMODULE}
480 if [ -d ${RELEASEDISTFILES}/ ]; then \
481 cp -rp ${RELEASEDISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \
483 mkdir -p ${CHROOTDIR}/usr/ports/distfiles; \
485 .if !defined(NO_PREFETCHDISTFILES)
486 @cd ${.CURDIR} && ${MAKE} fetch-distfiles
491 .if !defined(RELEASENOUPDATE) && !defined(EXTSRCDIR)
493 cd ${CHROOTDIR}/usr/src && ${SVNPREFIX} svn switch ${SVNCMDARGS} \
494 ${SVNROOT}/${SVNBRANCH}
495 .elif !defined(RELEASETAG)
496 cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
497 update ${CVSCMDARGS} -P -d -A
499 cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
500 update ${CVSCMDARGS} -P -d -r ${RELEASETAG}
502 rm -f ${CHROOTDIR}/tmp/.world_done
503 .if !defined(NOPORTS) && !defined(EXTPORTSDIR)
504 cd ${CHROOTDIR}/usr/ports && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
505 update ${CVSCMDARGS} -P -d
506 rm -f ${CHROOTDIR}/tmp/.skip_ports_index
508 .if defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES"
509 for i in ${MINIMALDOCPORTS}; do \
510 ( cd ${CHROOTDIR}/usr/$$i && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
511 update ${CVSCMDARGS} -P -d ) ; \
515 cd ${CHROOTDIR}/usr/doc && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
516 update ${CVSCMDARGS} -P -d
520 # Add version information to those things that need it.
521 if [ ! -f ${CHROOTDIR}/tmp/.world_done ]; then \
522 cd ${CHROOTDIR}/usr/src/sys/conf && \
523 mv newvers.sh foo && \
524 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && \
527 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
528 echo "#!/bin/sh" > ${_MK}
529 echo "set -ex" >> ${_MK}
530 echo "trap 'umount /dev || true' 0" >> ${_MK}
531 echo "_RELTARGET=\$${1:-doRELEASE}" >> ${_MK}
533 AUTO_KEYBOARD_DETECT \
564 echo "export ${var}=\"${${var}}\"" >> ${_MK}
567 # Don't remove this, or the build will fall over!
568 echo "export RELEASEDIR=${_R}" >> ${_MK}
569 echo "export PATH=/bin:/usr/bin:/sbin:/usr/sbin:${LOCALDIR}" >> ${_MK}
570 echo "export MANBUILDCAT=YES" >> ${_MK}
571 # NB: these may fail if the host is running w/o devfs
572 echo "umount /dev >/dev/null 2>&1 || true" >> ${_MK}
573 echo "mount -t devfs devfs /dev >/dev/null 2>&1 || true" >> ${_MK}
574 echo "if [ ! -c /dev/null ]; then" >> ${_MK}
575 echo " echo /dev/null is not a device!" >> ${_MK}
576 echo " exit 1" >> ${_MK}
578 echo "if [ -x /etc/rc.d/ldconfig ]; then" >> ${_MK}
579 echo " /etc/rc.d/ldconfig start" >> ${_MK}
580 echo "else" >> ${_MK}
581 echo " ldconfig /lib /usr/lib /usr/local/lib || true" >> ${_MK}
583 echo "if [ ! -f /tmp/.world_done ]; then" >> ${_MK}
584 echo " cd /usr/src" >> ${_MK}
585 echo " ${CROSSMAKE} ${WORLD_FLAGS} -DNO_CLEAN buildworld && \\" >> ${_MK}
586 echo " touch /tmp/.world_done || exit 1" >> ${_MK}
588 echo "if [ ! -f /tmp/.skip_ports_index ]; then" >> ${_MK}
589 echo " echo \">>> make index started on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
590 echo " for i in ${MAKEINDEXPORTS}" >> ${_MK}
592 echo " cd /usr/ports/\$${i}" >> ${_MK}
593 echo " env -i HTTP_PROXY=$${HTTP_PROXY} FTP_PROXY=$${FTP_PROXY} FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \\" >> ${_MK}
594 echo " make all install clean BATCH=yes FORCE_PKG_REGISTER=yes" >> ${_MK}
595 echo " done" >> ${_MK}
596 echo " cd /usr/ports" >> ${_MK}
597 echo " rm -f INDEX*" >> ${_MK}
598 echo " make index -DINDEX_PRISTINE" >> ${_MK}
599 echo " rm -f INDEX*.tmp" >> ${_MK}
600 echo " touch /tmp/.skip_ports_index" >> ${_MK}
601 echo " echo \">>> make index finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
603 echo "cd /usr/src/release" >> ${_MK}
604 echo "make obj" >> ${_MK}
605 echo "make -f Makefile.sysinstall \$${_RELTARGET}" >> ${_MK}
606 echo "echo \">>> make ${.TARGET} for ${TARGET} finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
609 touch ${CHROOTDIR}/tmp/.skip_ports_index
611 # Ensure md.ko is loaded if md(4) is not statically compiled into
613 -mdconfig 2>/dev/null
614 env -i /usr/sbin/chroot `dirname ${_MK}` /`basename ${_MK}`
617 rm -rf ${CRUNCH_TARGETS:S/$/_crunch/} release.[0-8] ${EXTRAS}
620 @for i in ${MAKEINDEXPORTS}; do \
621 cd ${CHROOTDIR}/usr/ports/$$i && \
622 make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \
623 checksum-recursive ; \
625 @for i in ${DOCPORTS}; do \
626 cd ${CHROOTDIR}/usr/ports/$$i && \
627 make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \
628 WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes \
629 checksum-recursive ; \
632 # Clean out ${_R} and make the directory structure.
635 -rm -rf ${_R}/* 2> /dev/null
636 -chflags -R noschg ${_R}/.
639 .if defined(MAKE_FLOPPIES)
643 for i in ${DISTRIBUTIONS}; do \
644 mkdir ${RD}/trees/$$i && \
645 mtree -deU -f ${MTREEFILES}/BSD.root.dist \
646 -p ${RD}/trees/$$i > /dev/null && \
647 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
648 -p ${RD}/trees/$$i/usr > /dev/null && \
649 mtree -deU -f ${MTREEFILES}/BSD.include.dist \
650 -p ${RD}/trees/$$i/usr/include > /dev/null; \
653 for i in ${KERNELS_BASE} ${KERNELS}; do \
654 mkdir -p ${RD}/kernels/$${i}; \
658 # Install the system into the various distributions.
660 cd ${.CURDIR}/.. && ${CROSSMAKE} distrib-dirs DESTDIR=${RD}/trees/base
661 cd ${.CURDIR}/.. && ${CROSSMAKE} ${WORLD_FLAGS} distributeworld \
663 sh ${.CURDIR}/scripts/mm-mtree.sh -F "${CROSSENV}" -D "${RD}/trees/base"
666 # Make and install the generic kernel(s).
668 .for kernel in ${KERNELS_BASE} ${KERNELS}
670 ${CROSSMAKE} ${KERNEL_FLAGS} \
671 KERNCONF=${kernel} kernel \
672 DESTDIR=${RD}/kernels KODIR=/${kernel}
676 # Make and install the three crunched binaries which live on the floppies.
677 # You are not supposed to like this :-)
680 mkdir -p ${RD}/crunch
681 .for j in ${CRUNCH_TARGETS}
682 .if exists(${.CURDIR}/${TARGET}/${j}_crunch.conf)
685 cd ${j}_crunch; ${WMAKEENV} MAKEFLAGS="-m ${.CURDIR}/../share/mk" \
686 NO_WERROR= crunchgen -o \
687 ${.CURDIR}/${TARGET}/${j}_crunch.conf
688 cd ${j}_crunch; ${WMAKE} -f ${j}_crunch.mk subclean
689 cd ${.CURDIR}/..; ${BINMAKE} -f Makefile.inc1 _build-tools
690 cd ${j}_crunch; CFLAGS="-Os -pipe" ${WMAKE} -f ${j}_crunch.mk \
692 ${WMAKEENV} strip -R .comment ${j}_crunch/${j}_crunch
693 mv ${j}_crunch/${j}_crunch ${RD}/crunch/${j}
699 # --==## Fix up the distributions. ##==--
702 # Create any "synthetic dists" now.
703 @for i in ${DISTRIBUTIONS}; do \
704 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
705 echo -n "Running $$i dist creation script... "; \
706 env RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
711 # Remove all the directories we don't need.
713 (find ${OTHER_DISTS} -path '*/var/empty' | xargs chflags noschg; \
714 find ${OTHER_DISTS} -depth -type d -empty -delete)
718 # --==## Package up the tarballs from assembled trees ##==--
723 @for i in ${DISTRIBUTIONS} ; \
725 if [ -d ${RD}/trees/$${i} ] ; then \
726 cd ${.CURDIR} && $(MAKE) doTARBALL \
727 SD=${RD}/trees/$${i} \
728 TN=$$i TD=$$i ARG="." && \
729 echo "$${i} distribution is finished."; \
732 @for i in ${KERNELS_BASE} ${KERNELS} ; \
734 if [ -d ${RD}/kernels/$${i} ] ; then \
735 cd ${.CURDIR} && $(MAKE) doTARBALL \
737 TN=$$i TD=kernels ARG="$$i" && \
738 echo "$${i} distribution is finished."; \
741 .if !defined(NOPORTS)
742 # XXX: Inline stripped version of doTARBALL
743 @rm -rf ${RD}/dists/ports/ports*
744 @mkdir -p ${RD}/dists/ports
745 @echo rolling ports/ports tarball
746 @tar --exclude CVS --exclude .svn --exclude 'ports/distfiles/*' \
747 -czf ${RD}/dists/ports/ports.tgz -C /usr ports
748 @cp ${.CURDIR}/scripts/ports-install.sh ${RD}/dists/ports/install.sh
749 @(cd ${RD}/dists/ports; \
750 rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \
751 md5 * > .CHECKSUM.MD5; \
752 sha256 * > .CHECKSUM.SHA256; \
753 mv .CHECKSUM.MD5 CHECKSUM.MD5; \
754 mv .CHECKSUM.SHA256 CHECKSUM.SHA256)
755 @echo "ports distribution is finished."
761 # --==## Make source dists ##==--
765 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \
766 TD=src TN=sbase ARG="[A-Z]*"
767 @for i in `cd /usr/src && echo [a-z]*` ; do \
768 if [ -d /usr/src/$$i ] ; then \
769 cd ${.CURDIR} && $(MAKE) doTARBALL \
770 TN=`echo s$$i | tr -d '.' | \
772 -e 's/kerberos5/krb5/'` \
773 SD=/usr/src TD=src ARG="$$i" ; \
776 .if defined(EXTRA_SRC)
777 @set ${EXTRA_SRC} && \
778 while [ $$# -ge 2 ] ; do \
779 if [ -d /usr/src/$$1 ] ; then \
780 cd ${.CURDIR} && $(MAKE) doTARBALL \
781 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
782 fi && shift && shift ; \
785 (cd ${RD}/dists/src; \
786 rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \
787 md5 * > .CHECKSUM.MD5; \
788 sha256 * > .CHECKSUM.SHA256; \
789 mv .CHECKSUM.MD5 CHECKSUM.MD5; \
790 mv .CHECKSUM.SHA256 CHECKSUM.SHA256)
791 @echo "src distribution is finished."
795 # Build the memory root filesystem.
797 cp ${RD}/trees/base/etc/disktab /etc
801 mkdir -p etc/defaults dev mnt stand/etc/defaults stand/help \
803 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
804 DIR=${RD}/mfsfd/stand ZIP=false
805 ( cd ${RD}/mfsfd && \
806 for dir in bin sbin ; do \
807 ln -sf /stand $$dir; \
809 cp ${RD}/trees/base/sbin/dhclient-script ${RD}/mfsfd/stand
810 cp ${.CURDIR}/../etc/master.passwd ${RD}/mfsfd/etc/master.passwd
811 cp ${RD}/trees/base/etc/*pwd.db ${RD}/mfsfd/etc/
812 ( for F in defaults/rc.conf netconfig protocols ; do \
813 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \
814 ${RD}/trees/base/etc/$$F > ${RD}/mfsfd/stand/etc/$$F ; \
816 grep -E '^(ftp|nameserver|domain|sunrpc|cmd|nfsd)[^-\w]' \
817 ${RD}/trees/base/etc/services | \
818 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \
819 > ${RD}/mfsfd/stand/etc/services
820 grep 'operator' ${RD}/trees/base/etc/group \
821 > ${RD}/mfsfd/stand/etc/group
822 ln ${RD}/mfsfd/stand/etc/services ${RD}/mfsfd/etc/services
823 ln ${RD}/mfsfd/stand/etc/group ${RD}/mfsfd/etc/group
824 ln ${RD}/mfsfd/stand/etc/netconfig ${RD}/mfsfd/etc/netconfig
825 cp ${RD}/trees/base/COPYRIGHT ${RD}/mfsfd/stand/help/COPYRIGHT.hlp
827 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
828 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
829 ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
831 @for i in ${DIST_DOCS_ARCH_DEP}; do \
832 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
833 ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
836 -test -f ${.CURDIR}/install.cfg \
837 && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
838 @mkdir -p ${RD}/mfsfd/boot
839 .if ${TARGET_ARCH} != "ia64" && ${TARGET_CPUARCH} != "powerpc"
840 @cp ${RD}/trees/base/boot/boot* ${RD}/mfsfd/boot
842 .if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64"
843 @cp ${RD}/trees/base/boot/mbr ${RD}/mfsfd/boot
845 @tar --exclude CVS --exclude .svn -cf - \
846 -C ${.CURDIR}/../usr.sbin/sysinstall help | \
847 tar xf - -C ${RD}/mfsfd/stand
848 @mkdir -p ${RD}/mfsroot
849 sh -e ${DOFS_SH} ${RD}/mfsroot/mfsroot ${RD} ${MNT} \
850 ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL}
851 @${ZIPPER} -fv ${RD}/mfsroot/mfsroot
854 KERNFLOPPYSET= ${RD}/floppyset/kern/kernel.gz
855 .if defined(SMALLFLOPPYSIZE)
856 SMALLKERNFLOPPYSET= ${RD}/floppyset/kern-small/kernel.gz
858 .if defined(SPLIT_MFSROOT)
859 MFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot/mfsroot.gz
860 .if defined(SMALLFLOPPYSIZE)
861 SMALLMFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot-small/mfsroot.gz
865 # Build boot and install floppies.
867 @${ZIPPER} -c ${RD}/kernels/${KERN_GENERIC}/kernel > ${RD}/kernels/kernel.gz
868 @echo "Making the kernel boot floppies..."
869 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern \
870 FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz
871 .if defined(SMALLFLOPPYSIZE)
872 @echo "Making the small kernel boot floppies..."
873 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern-small \
874 FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz \
877 .if defined(SPLIT_MFSROOT)
878 @echo "Making the mfsroot boot floppies..."
879 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot \
880 FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz
881 .if defined(SMALLFLOPPYSIZE)
882 @echo "Making the small mfsroot boot floppies..."
883 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot-small \
884 FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz \
887 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \
888 KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \
889 MFSROOTFILE="${MFSROOTFLOPPYSET}.split ${MFSROOTFLOPPYSET}.boot"
890 .if defined(SMALLFLOPPYSIZE)
891 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \
892 KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \
893 MFSROOTFILE="${SMALLMFSROOTFLOPPYSET}.split ${SMALLMFSROOTFLOPPYSET}.boot" \
896 .else # !SPLIT_MFSROOT
897 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \
898 KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \
899 MFSROOTFILE=${RD}/mfsroot/mfsroot.gz
900 .if defined(SMALLFLOPPYSIZE)
901 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \
902 KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \
903 MFSROOTFILE=${RD}/mfsroot/mfsroot.gz \
906 .endif # SPLIT_MFSROOT
909 # Build fixit floppy.
911 @echo "Making fixit floppy."
912 @rm -rf ${RD}/fixitfd
914 @cd ${RD}/fixitfd && \
915 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
917 @cp ${RD}/trees/base/etc/spwd.db ${RD}/trees/base/etc/group \
919 @sed -e 's/#.*//' ${RD}/trees/base/etc/protocols \
920 > ${RD}/fixitfd/etc/protocols
921 @sed -e 's/#.*//' ${RD}/trees/base/usr/share/misc/scsi_modes \
922 > ${RD}/fixitfd/usr/share/misc/scsi_modes
923 @cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
924 @cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
925 @cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar
926 @chmod 555 ${RD}/fixitfd/stand/tar
927 .if defined(SMALLFLOPPYSIZE)
928 @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit-small \
929 DIR=${RD}/fixitfd/stand ZIP=false
930 @sh -e ${DOFS_SH} ${RD}/floppies/fixit-small.flp ${RD} ${MNT} \
931 ${SMALLFLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${SMALLFLOPPYLABEL}
932 @rm -rf ${RD}/fixitfd/stand
933 @mkdir ${RD}/fixitfd/stand
935 @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit \
936 DIR=${RD}/fixitfd/stand ZIP=false
937 @sh -e ${DOFS_SH} ${RD}/floppies/fixit.flp ${RD} ${MNT} \
938 ${FLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${FLOPPYLABEL}
941 # Do our last minute floppies directory setup
943 @(cd ${RD}/floppies; md5 *.flp > CHECKSUM.MD5)
944 @(cd ${RD}/floppies; sha256 *.flp > CHECKSUM.SHA256)
948 # --==## Setup a suitable ftp-area ##==--
951 @echo "Setting up FTP distribution area"
953 -@ln -s . ${FD}/${BUILDNAME}
954 .if defined(MAKE_FLOPPIES)
955 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
957 @cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
959 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
960 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
961 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
962 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
963 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
965 @for i in ${DIST_DOCS_ARCH_DEP}; do \
966 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
967 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
968 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
969 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
971 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${FD}
973 @echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
976 # Build a live filesystem cdrom image
978 @echo "Building CDROM live filesystem image"
979 @mkdir -p ${CD_LIVEFS}
980 @for i in ${DISTRIBUTIONS} ; \
982 if [ -d ${RD}/trees/$${i} ] ; then \
983 chflags -R noschg ${RD}/trees/$${i} || true ; \
984 ( cd ${RD}/trees/$${i} && \
985 find . -depth -print | cpio -dumpl ${CD_LIVEFS} ) ; \
988 .if defined(MAKE_DVD)
989 @echo "Building DVD filesystem image as well as CDROM"
990 @mkdir -p ${CD_DVD1}/${BUILDNAME}
991 @for i in ${DISTRIBUTIONS} ; \
993 if [ -d ${RD}/trees/$${i} ] ; then \
994 chflags -R noschg ${RD}/trees/$${i} || true ; \
995 ( cd ${RD}/trees/$${i} && \
996 find . -depth -print | cpio -dumpl ${CD_DVD1} ) ; \
1000 @echo "Copy GENERIC kernel to boot area"
1001 @cp -Rp ${RD}/kernels/${KERN_GENERIC}/ ${CD_LIVEFS}/boot/kernel
1002 @rm -f ${CD_LIVEFS}/boot/kernel/*.symbols
1003 @rm -f ${CD_LIVEFS}/.profile
1004 @cp ${.CURDIR}/fixit.profile ${CD_LIVEFS}/.profile
1005 @ln -sf /rescue ${CD_LIVEFS}/stand
1006 @echo "Setting up CDROM boot area"
1007 @rm -f ${CD_LIVEFS}/boot/loader.conf
1008 @cp ${RD}/mfsroot/mfsroot.gz ${CD_LIVEFS}/boot/mfsroot.gz
1009 @echo 'mfsroot_load="YES"' > ${CD_LIVEFS}/boot/loader.conf
1010 @echo 'mfsroot_type="mfs_root"' >> ${CD_LIVEFS}/boot/loader.conf
1011 @echo 'mfsroot_name="/boot/mfsroot"' >> ${CD_LIVEFS}/boot/loader.conf
1012 .if exists(${RD}/trees/base/boot/device.hints)
1013 # Break the link to device.hints so we can modify it
1014 @rm -f ${CD_LIVEFS}/boot/device.hints
1015 @cp ${RD}/trees/base/boot/device.hints ${CD_LIVEFS}/boot/device.hints
1017 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_LIVEFS}/cdrom.inf
1018 .if defined(MAKE_DVD)
1019 @cp -Rp ${RD}/kernels/${KERN_GENERIC}/ ${CD_DVD1}/boot/kernel
1020 @rm -f ${CD_DVD1}/boot/kernel/*.symbols
1021 @rm -f ${CD_DVD1}/.profile
1022 @cp ${.CURDIR}/fixit.profile ${CD_DVD1}/.profile
1023 @ln -sf /rescue ${CD_DVD1}/stand
1024 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DVD1}/cdrom.inf
1025 @rm -f ${CD_DVD1}/boot/loader.conf
1026 @cp ${RD}/mfsroot/mfsroot.gz ${CD_DVD1}/boot/mfsroot.gz
1027 @echo 'mfsroot_load="YES"' > ${CD_DVD1}/boot/loader.conf
1028 @echo 'mfsroot_type="mfs_root"' >> ${CD_DVD1}/boot/loader.conf
1029 @echo 'mfsroot_name="/boot/mfsroot"' >> ${CD_DVD1}/boot/loader.conf
1030 .if exists(${RD}/trees/base/boot/device.hints)
1031 @rm -f ${CD_DVD1}/boot/device.hints
1032 @cp ${RD}/trees/base/boot/device.hints ${CD_DVD1}/boot/device.hints
1037 # Build disc1 and disc2 cdrom images
1039 @echo "Building CDROM disc1 filesystem image"
1040 @mkdir -p ${CD_DISC1}/${BUILDNAME}
1041 .if defined(MAKE_FLOPPIES)
1042 @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
1044 @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}/${BUILDNAME}
1046 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
1047 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
1048 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
1049 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
1050 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
1052 @for i in ${DIST_DOCS_ARCH_DEP}; do \
1053 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
1054 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
1055 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
1056 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
1058 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DISC1}
1060 .if defined(SEPARATE_LIVEFS)
1061 @cp -Rp ${CD_LIVEFS}/boot ${CD_DISC1}
1062 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
1064 @echo "CD_VOLUME = 1" >> ${CD_DISC1}/cdrom.inf
1065 @echo "Building CDROM disc2 filesystem image"
1066 @mkdir -p ${CD_DISC2}
1067 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
1068 @echo "CD_VOLUME = 2" >> ${CD_DISC2}/cdrom.inf
1069 .if defined(MAKE_DVD)
1070 .if defined(MAKE_FLOPPIES)
1071 @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DVD1}
1073 @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DVD1}/${BUILDNAME}
1075 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
1076 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
1077 ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
1078 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
1079 ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
1081 @for i in ${DIST_DOCS_ARCH_DEP}; do \
1082 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
1083 ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
1084 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
1085 ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
1087 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DVD1}
1089 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DVD1}/cdrom.inf
1090 @echo "CD_VOLUME = 1" >> ${CD_DVD1}/cdrom.inf
1093 @echo "Building CDROM docs filesystem image"
1094 @mkdir -p ${CD_DOCS}
1095 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DOCS}/cdrom.inf
1096 @echo "CD_VOLUME = 3" >> ${CD_DOCS}/cdrom.inf
1101 # --==## Setup a suitable cdrom-area ##==--
1104 .if defined(CD_BOOT)
1105 @echo "Building bootonly CDROM filesystem image"
1106 @mkdir -p ${CD_BOOT}
1107 @cp -Rp ${CD_LIVEFS}/boot ${CD_BOOT}
1108 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_BOOT}/cdrom.inf
1109 .if defined(MINIROOT)
1110 @echo "Building bootonly UFS filesystem image"
1111 @mkdir -p ${FD}/miniroot
1112 @sh -e ${DOFS_SH} ${FD}/miniroot/miniroot.ufs \
1113 ${RD} ${MNT} 0 ${CD_BOOT} 8192 auto
1114 @${ZIPPER} -v ${FD}/miniroot/miniroot.ufs
1120 .if defined(CD_PACKAGE_TREE)
1121 .if exists(${CD_PACKAGE_TREE}/disc1)
1122 CD_DISC1_PKGS= ${CD_PACKAGE_TREE}/disc1
1124 .if exists(${CD_PACKAGE_TREE}/disc2)
1125 CD_DISC2_PKGS= ${CD_PACKAGE_TREE}/disc2
1127 # scripts/package-trees.sh names all discs according to the "discX"
1128 # scheme where X is the number of the disc
1129 .if exists(${CD_PACKAGE_TREE}/disc3)
1130 CD_DOCS_PKGS= ${CD_PACKAGE_TREE}/disc3
1132 .if exists(${CD_PACKAGE_TREE}/dvd1)
1133 CD_DVD1_PKGS= ${CD_PACKAGE_TREE}/dvd1
1139 .if exists(${.CURDIR}/${TARGET_CPUARCH}/mkisoimages.sh)
1140 @echo "Creating ISO images..."
1141 .if defined(CD_BOOT)
1142 @sh ${.CURDIR}/${TARGET_CPUARCH}/mkisoimages.sh ${BOOTABLE} \
1144 ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-bootonly.iso ${CD_BOOT}
1146 @sh ${.CURDIR}/${TARGET_CPUARCH}/mkisoimages.sh ${BOOTABLE} \
1148 ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-disc1.iso ${CD_DISC1} \
1150 @sh ${.CURDIR}/${TARGET_CPUARCH}/mkisoimages.sh \
1152 ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-disc2.iso ${CD_DISC2} \
1154 .if defined(MAKE_DVD)
1155 @sh ${.CURDIR}/${TARGET_CPUARCH}/mkisoimages.sh ${BOOTABLE} \
1157 ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-dvd1.iso ${CD_DVD1} \
1161 @sh ${.CURDIR}/${TARGET_CPUARCH}/mkisoimages.sh \
1162 FreeBSD_Documentation \
1163 ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-disc3.iso ${CD_DOCS} \
1166 .if defined(SEPARATE_LIVEFS)
1167 @sh ${.CURDIR}/${TARGET_CPUARCH}/mkisoimages.sh ${BOOTABLE} \
1169 ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-livefs.iso ${CD_LIVEFS}
1171 @echo "Generating MD5 and SHA256 sums..."
1172 @(cd ${CD} && md5 *.iso > FreeBSD-${BUILDNAME}-${TARGET}-iso.CHECKSUM.MD5)
1173 @(cd ${CD} && sha256 *.iso > FreeBSD-${BUILDNAME}-${TARGET}-iso.CHECKSUM.SHA256)
1176 @echo "Do not know how to create an ISO for ${TARGET_CPUARCH}."
1180 # --==## Documentation Project tools required to build the release notes ##==--
1183 @echo "Making docproj tools..."
1184 @for i in ${DOCPORTS}; do \
1185 cd /usr/ports/$$i && \
1186 env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \
1187 make all install clean BATCH=yes WITHOUT_X11=yes JADETEX=no \
1188 WITHOUT_PYTHON=yes FORCE_PKG_REGISTER=yes; \
1193 # --==## RELNOTESng: Next-generation replacements for *.TXT files ##==--
1196 @echo "Making release documentation..."
1197 @cd ${.CURDIR}/doc && make all install clean 'FORMATS=html txt' \
1198 INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${RND}
1201 # Various "subroutine" and other supporting targets.
1209 @echo "SD undefined in doTARBALL" && exit 1
1212 @echo "TD undefined in doTARBALL" && exit 1
1215 @echo "ARG undefined in doTARBALL" && exit 1
1217 @rm -rf ${RD}/dists/${TD}/${TN}*
1218 @mkdir -p ${RD}/dists/${TD}
1220 tn=`echo ${TN} | tr 'A-Z' 'a-z'` && \
1221 echo rolling ${TD}/$$tn tarball &&\
1222 tar --exclude CVS --exclude .svn --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
1223 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
1224 sh ${.CURDIR}/scripts/info.sh ${RD}/dists/${TD}/$$tn \
1225 > ${RD}/dists/${TD}/$$tn.inf && \
1226 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
1227 cp -p ${.CURDIR}/scripts/$${TD}-install.sh \
1228 ${RD}/dists/${TD}/install.sh && \
1229 chmod +x ${RD}/dists/${TD}/install.sh; \
1231 if [ "${SD}" != "/usr/src" ]; then \
1232 mtree -c -i -p ${SD}/${ARG} \
1233 -k gname,md5digest,mode,nlink,uname,size,link,type \
1234 > ${RD}/dists/${TD}/$$tn.mtree ; \
1238 ( cd ${RD}/dists/${TD}; \
1239 rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \
1240 md5 * > .CHECKSUM.MD5; \
1241 sha256 * > .CHECKSUM.SHA256; \
1242 mv .CHECKSUM.MD5 CHECKSUM.MD5; \
1243 mv .CHECKSUM.SHA256 CHECKSUM.SHA256) \
1246 doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 \
1247 release.5 release.6 release.7 release.8 ${EXTRAS}
1248 @echo "Release done"
1251 @rm -f release.4 release.8 floppies.[123]
1252 @cd ${.CURDIR} && ${MAKE} release.4 release.8 floppies.1 floppies.2 \
1254 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
1257 .if !defined(CRUNCH)
1258 @echo "CRUNCH undefined in installCRUNCH" && exit 1
1261 @echo "DIR undefined in installCRUNCH" && exit 1
1264 @echo "ZIP undefined in installCRUNCH" && exit 1
1267 ${ZIPPER} < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
1269 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
1271 @chmod 555 ${DIR}/${CRUNCH}_crunch
1272 @if [ -f ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf ] ; then \
1273 for i in `crunchgen -l ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf` ; do \
1274 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
1277 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
1278 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
1283 # --==## Build a floppy set for a splitfs file ##==--
1285 # FLOPPYBASE - basename of floppy image files
1286 # FLOPPYDESC - description of floppy set
1287 # SPLITFILE - filename of the file to split
1288 # FDSIZE - if specified and "small", small floppy is created
1290 .if make(makeFloppySet)
1291 SPLITDIR= ${RD}/floppyset/${FLOPPYBASE}
1292 .if defined(FDSIZE) && ${FDSIZE} == "SMALL"
1293 FLPSPLITSIZE= ${SMALLFLOPPYSPLITSIZE}
1294 FLPSIZE= ${SMALLFLOPPYSIZE}
1295 FLPLABEL= ${SMALLFLOPPYLABEL}
1297 FLPSPLITSIZE= ${FLOPPYSPLITSIZE}
1298 FLPSIZE= ${FLOPPYSIZE}
1299 FLPLABEL= ${FLOPPYLABEL}
1304 .if !defined(FLOPPYBASE)
1305 @echo "FLOPPYBASE undefined in ${.TARGET}" && exit 1
1307 .if !defined(FLOPPYDESC)
1308 @echo "FLOPPYDESC undefined in ${.TARGET}" && exit 1
1310 .if !defined(SPLITFILE)
1311 @echo "SPLITFILE undefined in ${.TARGET}" && exit 1
1313 sh ${.CURDIR}/scripts/split-file.sh ${SPLITFILE} \
1314 ${RD}/floppyset/${FLOPPYBASE} ${FLPSPLITSIZE} "${FLOPPYDESC}"
1315 ( splitfile=${SPLITDIR}/`basename ${SPLITFILE}`.split ; \
1316 lines=`cat $${splitfile} | wc -l`; \
1317 lines=$$(($$lines - 1)) ; \
1318 for line in `jot $$lines`; do \
1319 file=`head -n $$(($${line} + 1)) $${splitfile} | tail -1 | cut -f 1 -d ' '` ; \
1320 sh -e ${DOFS_SH} ${RD}/floppies/${FLOPPYBASE}$${line}.flp \
1321 ${RD} ${MNT} ${FLPSIZE} ${SPLITDIR}/$${file} \
1322 ${BOOTINODE} ${FLPLABEL}; \
1326 # --==## Build a boot floppy ##==--
1328 # FSIMAGE - base floppy image name
1329 # FDSIZE - if specified and "small", small floppy is created
1330 # KERNFILE - path to kernel split file
1331 # MFSROOTFILE - path to mfsroot split file
1333 .if make(buildBootFloppy)
1334 IMAGEDIR= ${RD}/image.${FSIMAGE}
1335 BOOTDIR= ${RD}/trees/base/boot
1336 HINTSFILE= ${BOOTDIR}/device.hints
1337 ACPI_KO= ${RD}/kernels/${KERN_GENERIC}/acpi.ko
1338 IMAGEFILE= ${RD}/floppies/${FSIMAGE}.flp
1339 .if defined(FDSIZE) && ${FDSIZE} == "SMALL"
1340 FLPSIZE= ${SMALLFLOPPYSIZE}
1341 FLPLABEL= ${SMALLFLOPPYLABEL}
1343 FLPSIZE= ${FLOPPYSIZE}
1344 FLPLABEL= ${FLOPPYLABEL}
1349 .if !defined(FSIMAGE)
1350 @echo "FSIMAGE undefined in ${.TARGET}" && exit 1
1352 .if !defined(KERNFILE)
1353 @echo "KERNFILE undefined in ${.TARGET}" && exit 1
1355 .if !defined(MFSROOTFILE)
1356 @echo "MFSROOTFILE undefined in ${.TARGET}" && exit 1
1358 @echo "Running ${.TARGET} for ${FSIMAGE}"
1361 @echo "Setting up /boot directory for ${FSIMAGE} floppy"
1362 @mkdir -p ${IMAGEDIR}/boot
1363 .if ${TARGET_ARCH} == "i386"
1364 @${WMAKEENV} kgzip -v -l ${RD}/trees/base/usr/lib/kgzldr.o -o \
1365 ${IMAGEDIR}/boot/loader ${BOOTDIR}/loader
1367 @cp ${BOOTDIR}/loader ${IMAGEDIR}/boot
1369 @cp -Rp ${BOOTDIR}/*.4th ${BOOTDIR}/defaults ${BOOTDIR}/loader.help \
1370 ${BOOTDIR}/loader.rc ${IMAGEDIR}/boot
1371 .if exists(${HINTSFILE})
1372 @cp ${HINTSFILE} ${IMAGEDIR}/boot/device.hints
1373 @${ZIPPER} ${IMAGEDIR}/boot/device.hints
1375 @${ZIPPER} ${IMAGEDIR}/boot/*.4th ${IMAGEDIR}/boot/loader.help \
1376 ${IMAGEDIR}/boot/defaults/loader.conf
1377 @echo 'bootfile="/kernel"' > ${IMAGEDIR}/boot/loader.conf
1378 .if exists(${ACPI_KO})
1379 @${ZIPPER} -c ${ACPI_KO} > ${IMAGEDIR}/acpi.ko.gz
1380 @echo 'acpi_load="YES"' >> ${IMAGEDIR}/boot/loader.conf
1381 @echo 'acpi_name="/acpi.ko"' >> ${IMAGEDIR}/boot/loader.conf
1382 @echo 'acpi_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
1384 @echo 'mfsroot_load="YES"' >> ${IMAGEDIR}/boot/loader.conf
1385 @echo 'mfsroot_type="mfs_root"' >> ${IMAGEDIR}/boot/loader.conf
1386 @echo 'mfsroot_name="/mfsroot"' >> ${IMAGEDIR}/boot/loader.conf
1387 .if !exists(${ACPI_KO})
1388 @echo 'mfsroot_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
1390 .if defined(SPLIT_MFSROOT)
1391 @echo 'mfsroot_after="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
1393 .if ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "amd64"
1394 .if ${AUTO_KEYBOARD_DETECT}
1395 @echo "-P" >> ${IMAGEDIR}/boot.config
1399 @cp ${KERNFILE} ${MFSROOTFILE} ${IMAGEDIR}
1400 sh -e ${DOFS_SH} ${IMAGEFILE} ${RD} ${MNT} ${FLPSIZE} ${IMAGEDIR} \
1401 ${BOOTINODE} ${FLPLABEL}
1402 @echo "Created ${RD}/floppies/${FSIMAGE}.flp"
1404 .if make(package-split)
1405 # Targets related to making a package split
1407 # PKG_COPY instructs the script to copy the actual package files rather than
1409 # PKG_TREE is the path to the package tree to be split
1410 # PKG_DEST is the path to the destination tree to create the split in
1411 # PKG_VERBOSE asks for verbose output of the layout process
1412 # PKG_INDEX is the path to the INDEX file. By default ${PKG_TREE}/INDEX.
1414 .if defined(PKG_COPY)
1419 PKG_WRKIDX= ${PKG_DEST}/INDEX.master
1421 .if defined(TARGET_ARCH)
1422 PKG_ENV+= PKG_ARCH=${TARGET_ARCH}
1424 .if defined(PKG_VERBOSE)
1425 PKG_ENV+= PKG_VERBOSE=1
1427 PKG_INDEX?= ${PKG_TREE}/INDEX
1430 .if !defined(PKG_TREE)
1431 @echo "PKG_TREE must be defined" && exit 1
1433 .if !defined(PKG_DEST)
1434 @echo "PKG_DEST must be defined" && exit 1
1436 @env ${PKG_ENV} python ${.CURDIR}/scripts/package-split.py \
1437 ${PKG_INDEX} ${PKG_WRKIDX}
1438 @env ${PKG_ENV} sh ${.CURDIR}/scripts/package-trees.sh ${PKG_DO_COPY} \
1439 ${PKG_WRKIDX} ${PKG_TREE} ${PKG_DEST}
1442 .include <bsd.obj.mk>