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!
29 # Automatic SNAP versioning:
32 BUILDNAME?=${BASE}-${DATE}-SNAP
34 #CHROOTDIR=/junk/release
35 # If this is a -stable snapshot, then set
36 #RELEASETAG=RELENG_9_1
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)
359 .if !make(release) && !make(rerelease) && !make(package-split)
360 BINMAKE!= cd ${.CURDIR}/..; ${MAKE} -V BINMAKE
361 WMAKEENV!= cd ${.CURDIR}/..; \
362 ${BINMAKE} ${CROSSENV} -f Makefile.inc1 -V WMAKEENV
363 WMAKE= ${WMAKEENV} ${BINMAKE}
366 SMAKE= ${MAKE} -f ${MAKEFILE}
369 .if defined(RELEASETAG)
370 CVS_SRCARGS+= -r ${RELEASETAG}
374 .if defined(DOCRELEASETAG)
375 CVS_DOCARGS+= -r ${DOCRELEASETAG}
379 .if defined(PORTSRELEASETAG)
380 CVS_PORTSARGS+= -r ${PORTSRELEASETAG}
383 WORLDDIR?= ${.CURDIR}/..
386 .if !defined(CHROOTDIR) || !defined(BUILDNAME)
387 @echo "To make a release you must set CHROOTDIR and BUILDNAME" && false
389 .if !defined(NOPORTSATALL) && !defined(EXTPORTSDIR) && !defined(CVSROOT)
390 @echo "Building ports requires CVSROOT or EXTPORTSDIR" && false
392 .if !defined(NODOC) && !defined(EXTDOCDIR) && !defined(CVSROOT)
393 @echo "Building docs requires CVSROOT or EXTDOCDIR" && false
395 .if !defined(EXTSRCDIR) && !defined(CVSROOT) && !defined(SVNROOT)
396 @echo "The source tree requires SVNROOT, CVSROOT, or EXTSRCDIR" && false
398 .if defined(NOPORTSATALL) && !defined(NODOC)
399 @echo "Ports are required for building the release docs. Either set NODOC or"
400 @echo "unset NOPORTS, or set at least DOMINIMALDOCPORTS to YES!"
403 .if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES)
404 .for p in ${LOCAL_PATCHES}
406 @echo "The patch file ${p} does not exist!"
411 .if defined(LOCAL_SCRIPT) && !exists(${LOCAL_SCRIPT})
412 @echo "The local script ${LOCAL_SCRIPT} does not exist!"
416 .if exists(${CHROOTDIR})
417 # The first command will fail on a handful of files that have their schg
418 # flags set. But it greatly speeds up the next two commands.
419 # NB: clear any vestigial devfs mount, just in case
420 -umount ${CHROOTDIR}/dev > /dev/null 2>&1
421 -rm -rf ${CHROOTDIR} 2>/dev/null
422 -chflags -R 0 ${CHROOTDIR}/.
425 mkdir -p ${CHROOTDIR}
426 @echo ">>> make release for ${TARGET} started on `LC_ALL=C TZ=GMT date`"
427 cd ${WORLDDIR} && ${NATIVEMAKE} -DWITHOUT_GAMES -DWITHOUT_HTML -DWITHOUT_LIB32 \
428 -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_PROFILE installworld DESTDIR=${CHROOTDIR}
429 cd ${WORLDDIR} && ${NATIVEMAKE} distribution DESTDIR=${CHROOTDIR}
430 if [ -f /etc/resolv.conf ]; then \
431 cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \
433 .if defined(EXTLOCALDIR)
434 rm -rf ${CHROOTDIR}/usr/local
435 cd ${CHROOTDIR}/usr && cp -R -H ${EXTLOCALDIR} local
437 rm -rf ${CHROOTDIR}/usr/src
438 .if defined(EXTSRCDIR)
439 cd ${CHROOTDIR}/usr && \
440 cp -R -H ${EXTSRCDIR} src
441 .elif defined(SVNROOT)
442 cd ${CHROOTDIR}/usr && \
443 ${SVNPREFIX} svn co ${SVNCMDARGS} ${SVNROOT}/${SVNBRANCH} \
446 cd ${CHROOTDIR}/usr && \
447 ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
448 co ${CVSCMDARGS} ${CVS_SRCARGS} ${RELEASESRCMODULE}
450 .if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES)
451 .for p in ${LOCAL_PATCHES}
452 patch -d ${CHROOTDIR}/usr/${RELEASESRCMODULE} ${PATCH_FLAGS} < ${p}
455 .if defined(LOCAL_SCRIPT)
456 cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} \
457 RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT}
459 rm -rf ${CHROOTDIR}/usr/ports
460 .if !defined(NOPORTSATALL)
461 .if defined(EXTPORTSDIR)
462 cd ${CHROOTDIR}/usr && cp -R -H ${EXTPORTSDIR} ports
463 # If there are distfiles downloaded removing them
464 rm -rf ports/distfiles/*
466 cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
467 co ${CVSCMDARGS} ${CVS_PORTSARGS} ${RELEASEPORTSMODULE}
471 rm -rf ${CHROOTDIR}/usr/doc
472 .if defined(EXTDOCDIR)
473 cd ${CHROOTDIR}/usr && cp -R -H ${EXTDOCDIR} doc
475 cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
476 co ${CVSCMDARGS} ${CVS_DOCARGS} ${RELEASEDOCMODULE}
478 if [ -d ${RELEASEDISTFILES}/ ]; then \
479 cp -rp ${RELEASEDISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \
481 mkdir -p ${CHROOTDIR}/usr/ports/distfiles; \
483 .if !defined(NO_PREFETCHDISTFILES)
484 @cd ${.CURDIR} && ${SMAKE} fetch-distfiles
489 .if !defined(RELEASENOUPDATE) && !defined(EXTSRCDIR)
491 cd ${CHROOTDIR}/usr/src && ${SVNPREFIX} svn switch ${SVNCMDARGS} \
492 ${SVNROOT}/${SVNBRANCH}
493 .elif !defined(RELEASETAG)
494 cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
495 update ${CVSCMDARGS} -P -d -A
497 cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
498 update ${CVSCMDARGS} -P -d -r ${RELEASETAG}
500 rm -f ${CHROOTDIR}/tmp/.world_done
501 .if !defined(NOPORTS) && !defined(EXTPORTSDIR)
502 cd ${CHROOTDIR}/usr/ports && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
503 update ${CVSCMDARGS} -P -d
504 rm -f ${CHROOTDIR}/tmp/.skip_ports_index
506 .if defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES"
507 for i in ${MINIMALDOCPORTS}; do \
508 ( cd ${CHROOTDIR}/usr/$$i && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
509 update ${CVSCMDARGS} -P -d ) ; \
513 cd ${CHROOTDIR}/usr/doc && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
514 update ${CVSCMDARGS} -P -d
518 # Add version information to those things that need it.
519 if [ ! -f ${CHROOTDIR}/tmp/.world_done ]; then \
520 cd ${CHROOTDIR}/usr/src/sys/conf && \
521 mv newvers.sh foo && \
522 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && \
525 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
526 echo "#!/bin/sh" > ${_MK}
527 echo "set -ex" >> ${_MK}
528 echo "trap 'umount /dev || true' 0" >> ${_MK}
529 echo "_RELTARGET=\$${1:-doRELEASE}" >> ${_MK}
531 AUTO_KEYBOARD_DETECT \
562 echo "export ${var}=\"${${var}}\"" >> ${_MK}
565 # Don't remove this, or the build will fall over!
566 echo "export RELEASEDIR=${_R}" >> ${_MK}
567 echo "export PATH=/bin:/usr/bin:/sbin:/usr/sbin:${LOCALDIR}" >> ${_MK}
568 echo "export MANBUILDCAT=YES" >> ${_MK}
569 # NB: these may fail if the host is running w/o devfs
570 echo "umount /dev >/dev/null 2>&1 || true" >> ${_MK}
571 echo "mount -t devfs devfs /dev >/dev/null 2>&1 || true" >> ${_MK}
572 echo "if [ ! -c /dev/null ]; then" >> ${_MK}
573 echo " echo /dev/null is not a device!" >> ${_MK}
574 echo " exit 1" >> ${_MK}
576 echo "if [ -x /etc/rc.d/ldconfig ]; then" >> ${_MK}
577 echo " /etc/rc.d/ldconfig start" >> ${_MK}
578 echo "else" >> ${_MK}
579 echo " ldconfig /lib /usr/lib /usr/local/lib || true" >> ${_MK}
581 echo "if [ ! -f /tmp/.world_done ]; then" >> ${_MK}
582 echo " cd /usr/src" >> ${_MK}
583 echo " ${CROSSMAKE} ${WORLD_FLAGS} -DNO_CLEAN buildworld && \\" >> ${_MK}
584 echo " touch /tmp/.world_done || exit 1" >> ${_MK}
586 echo "if [ ! -f /tmp/.skip_ports_index ]; then" >> ${_MK}
587 echo " echo \">>> make index started on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
588 echo " for i in ${MAKEINDEXPORTS}" >> ${_MK}
590 echo " cd /usr/ports/\$${i}" >> ${_MK}
591 echo " env -i HTTP_PROXY=$${HTTP_PROXY} FTP_PROXY=$${FTP_PROXY} FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \\" >> ${_MK}
592 echo " make all install clean BATCH=yes FORCE_PKG_REGISTER=yes" >> ${_MK}
593 echo " done" >> ${_MK}
594 echo " cd /usr/ports" >> ${_MK}
595 echo " rm -f INDEX*" >> ${_MK}
596 echo " make index -DINDEX_PRISTINE" >> ${_MK}
597 echo " rm -f INDEX*.tmp" >> ${_MK}
598 echo " touch /tmp/.skip_ports_index" >> ${_MK}
599 echo " echo \">>> make index finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
601 echo "cd /usr/src/release" >> ${_MK}
602 echo "make obj" >> ${_MK}
603 echo "if [ -f Makefile.sysinstall ]; then" >> ${_MK}
604 echo " make -f Makefile.sysinstall \$${_RELTARGET}" >> ${_MK}
605 echo "else" >> ${_MK}
606 echo " make \$${_RELTARGET}" >> ${_MK}
608 echo "echo \">>> make ${.TARGET} for ${TARGET} finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
611 touch ${CHROOTDIR}/tmp/.skip_ports_index
613 # Ensure md.ko is loaded if md(4) is not statically compiled into
615 -mdconfig 2>/dev/null
616 env -i /usr/sbin/chroot `dirname ${_MK}` /`basename ${_MK}`
619 rm -rf ${CRUNCH_TARGETS:S/$/_crunch/} release.[0-8] ${EXTRAS}
622 @for i in ${MAKEINDEXPORTS}; do \
623 cd ${CHROOTDIR}/usr/ports/$$i && \
624 make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \
625 checksum-recursive ; \
627 @for i in ${DOCPORTS}; do \
628 cd ${CHROOTDIR}/usr/ports/$$i && \
629 make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \
630 WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes \
631 checksum-recursive ; \
634 # Clean out ${_R} and make the directory structure.
637 -rm -rf ${_R}/* 2> /dev/null
638 -chflags -R noschg ${_R}/.
641 .if defined(MAKE_FLOPPIES)
645 for i in ${DISTRIBUTIONS}; do \
646 mkdir ${RD}/trees/$$i && \
647 mtree -deU -f ${MTREEFILES}/BSD.root.dist \
648 -p ${RD}/trees/$$i > /dev/null && \
649 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
650 -p ${RD}/trees/$$i/usr > /dev/null && \
651 mtree -deU -f ${MTREEFILES}/BSD.include.dist \
652 -p ${RD}/trees/$$i/usr/include > /dev/null; \
655 for i in ${KERNELS_BASE} ${KERNELS}; do \
656 mkdir -p ${RD}/kernels/$${i}; \
660 # Install the system into the various distributions.
662 cd ${.CURDIR}/.. && ${CROSSMAKE} distrib-dirs DESTDIR=${RD}/trees/base
663 cd ${.CURDIR}/.. && ${CROSSMAKE} ${WORLD_FLAGS} distributeworld \
665 sh ${.CURDIR}/scripts/mm-mtree.sh -F "${CROSSENV}" -D "${RD}/trees/base"
668 # Make and install the generic kernel(s).
670 .for kernel in ${KERNELS_BASE} ${KERNELS}
672 ${CROSSMAKE} ${KERNEL_FLAGS} \
673 KERNCONF=${kernel} kernel \
674 DESTDIR=${RD}/kernels KODIR=/${kernel}
678 # Make and install the three crunched binaries which live on the floppies.
679 # You are not supposed to like this :-)
682 mkdir -p ${RD}/crunch
683 .for j in ${CRUNCH_TARGETS}
684 .if exists(${.CURDIR}/${TARGET}/${j}_crunch.conf)
687 cd ${j}_crunch; ${WMAKEENV} MAKEFLAGS="-m ${.CURDIR}/../share/mk" \
688 NO_WERROR= crunchgen -o \
689 ${.CURDIR}/${TARGET}/${j}_crunch.conf
690 cd ${j}_crunch; ${WMAKE} -f ${j}_crunch.mk subclean
691 cd ${.CURDIR}/..; ${BINMAKE} -f Makefile.inc1 _build-tools
692 cd ${j}_crunch; CFLAGS="-Os -pipe" ${WMAKE} -f ${j}_crunch.mk \
694 ${WMAKEENV} strip -R .comment ${j}_crunch/${j}_crunch
695 mv ${j}_crunch/${j}_crunch ${RD}/crunch/${j}
701 # --==## Fix up the distributions. ##==--
704 # Create any "synthetic dists" now.
705 @for i in ${DISTRIBUTIONS}; do \
706 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
707 echo -n "Running $$i dist creation script... "; \
708 env RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
713 # Remove all the directories we don't need.
715 (find ${OTHER_DISTS} -path '*/var/empty' | xargs chflags noschg; \
716 find ${OTHER_DISTS} -depth -type d -empty -delete)
720 # --==## Package up the tarballs from assembled trees ##==--
725 @for i in ${DISTRIBUTIONS} ; \
727 if [ -d ${RD}/trees/$${i} ] ; then \
728 cd ${.CURDIR} && $(SMAKE) doTARBALL \
729 SD=${RD}/trees/$${i} \
730 TN=$$i TD=$$i ARG="." && \
731 echo "$${i} distribution is finished."; \
734 @for i in ${KERNELS_BASE} ${KERNELS} ; \
736 if [ -d ${RD}/kernels/$${i} ] ; then \
737 cd ${.CURDIR} && $(SMAKE) doTARBALL \
739 TN=$$i TD=kernels ARG="$$i" && \
740 echo "$${i} distribution is finished."; \
743 .if !defined(NOPORTS)
744 # XXX: Inline stripped version of doTARBALL
745 @rm -rf ${RD}/dists/ports/ports*
746 @mkdir -p ${RD}/dists/ports
747 @echo rolling ports/ports tarball
748 @tar --exclude CVS --exclude .svn --exclude 'ports/distfiles/*' \
749 -czf ${RD}/dists/ports/ports.tgz -C /usr ports
750 @cp ${.CURDIR}/scripts/ports-install.sh ${RD}/dists/ports/install.sh
751 @(cd ${RD}/dists/ports; \
752 rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \
753 md5 * > .CHECKSUM.MD5; \
754 sha256 * > .CHECKSUM.SHA256; \
755 mv .CHECKSUM.MD5 CHECKSUM.MD5; \
756 mv .CHECKSUM.SHA256 CHECKSUM.SHA256)
757 @echo "ports distribution is finished."
763 # --==## Make source dists ##==--
767 @cd ${.CURDIR} && $(SMAKE) doTARBALL SD=/usr/src \
768 TD=src TN=sbase ARG="[A-Z]*"
769 @for i in `cd /usr/src && echo [a-z]*` ; do \
770 if [ -d /usr/src/$$i ] ; then \
771 cd ${.CURDIR} && $(SMAKE) doTARBALL \
772 TN=`echo s$$i | tr -d '.' | \
774 -e 's/kerberos5/krb5/'` \
775 SD=/usr/src TD=src ARG="$$i" ; \
778 .if defined(EXTRA_SRC)
779 @set ${EXTRA_SRC} && \
780 while [ $$# -ge 2 ] ; do \
781 if [ -d /usr/src/$$1 ] ; then \
782 cd ${.CURDIR} && $(SMAKE) doTARBALL \
783 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
784 fi && shift && shift ; \
787 (cd ${RD}/dists/src; \
788 rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \
789 md5 * > .CHECKSUM.MD5; \
790 sha256 * > .CHECKSUM.SHA256; \
791 mv .CHECKSUM.MD5 CHECKSUM.MD5; \
792 mv .CHECKSUM.SHA256 CHECKSUM.SHA256)
793 @echo "src distribution is finished."
797 # Build the memory root filesystem.
799 cp ${RD}/trees/base/etc/disktab /etc
803 mkdir -p etc/defaults dev mnt stand/etc/defaults stand/help \
805 @cd ${.CURDIR} && $(SMAKE) installCRUNCH CRUNCH=boot \
806 DIR=${RD}/mfsfd/stand ZIP=false
807 ( cd ${RD}/mfsfd && \
808 for dir in bin sbin ; do \
809 ln -sf /stand $$dir; \
811 cp ${RD}/trees/base/sbin/dhclient-script ${RD}/mfsfd/stand
812 cp ${.CURDIR}/../etc/master.passwd ${RD}/mfsfd/etc/master.passwd
813 cp ${RD}/trees/base/etc/*pwd.db ${RD}/mfsfd/etc/
814 ( for F in defaults/rc.conf netconfig protocols ; do \
815 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \
816 ${RD}/trees/base/etc/$$F > ${RD}/mfsfd/stand/etc/$$F ; \
818 grep -E '^(ftp|nameserver|domain|sunrpc|cmd|nfsd)[^-\w]' \
819 ${RD}/trees/base/etc/services | \
820 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \
821 > ${RD}/mfsfd/stand/etc/services
822 grep 'operator' ${RD}/trees/base/etc/group \
823 > ${RD}/mfsfd/stand/etc/group
824 ln ${RD}/mfsfd/stand/etc/services ${RD}/mfsfd/etc/services
825 ln ${RD}/mfsfd/stand/etc/group ${RD}/mfsfd/etc/group
826 ln ${RD}/mfsfd/stand/etc/netconfig ${RD}/mfsfd/etc/netconfig
827 cp ${RD}/trees/base/COPYRIGHT ${RD}/mfsfd/stand/help/COPYRIGHT.hlp
829 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
830 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
831 ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
833 @for i in ${DIST_DOCS_ARCH_DEP}; do \
834 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
835 ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
838 -test -f ${.CURDIR}/install.cfg \
839 && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
840 @mkdir -p ${RD}/mfsfd/boot
841 .if ${TARGET_ARCH} != "ia64" && ${TARGET_CPUARCH} != "powerpc"
842 @cp ${RD}/trees/base/boot/boot* ${RD}/mfsfd/boot
844 .if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64"
845 @cp ${RD}/trees/base/boot/mbr ${RD}/mfsfd/boot
847 @tar --exclude CVS --exclude .svn -cf - \
848 -C ${.CURDIR}/../usr.sbin/sysinstall help | \
849 tar xf - -C ${RD}/mfsfd/stand
850 @mkdir -p ${RD}/mfsroot
851 sh -e ${DOFS_SH} ${RD}/mfsroot/mfsroot ${RD} ${MNT} \
852 ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL}
853 @${ZIPPER} -fv ${RD}/mfsroot/mfsroot
856 KERNFLOPPYSET= ${RD}/floppyset/kern/kernel.gz
857 .if defined(SMALLFLOPPYSIZE)
858 SMALLKERNFLOPPYSET= ${RD}/floppyset/kern-small/kernel.gz
860 .if defined(SPLIT_MFSROOT)
861 MFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot/mfsroot.gz
862 .if defined(SMALLFLOPPYSIZE)
863 SMALLMFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot-small/mfsroot.gz
867 # Build boot and install floppies.
869 @${ZIPPER} -c ${RD}/kernels/${KERN_GENERIC}/kernel > ${RD}/kernels/kernel.gz
870 @echo "Making the kernel boot floppies..."
871 @cd ${.CURDIR} && ${SMAKE} makeFloppySet FLOPPYBASE=kern \
872 FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz
873 .if defined(SMALLFLOPPYSIZE)
874 @echo "Making the small kernel boot floppies..."
875 @cd ${.CURDIR} && ${SMAKE} makeFloppySet FLOPPYBASE=kern-small \
876 FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz \
879 .if defined(SPLIT_MFSROOT)
880 @echo "Making the mfsroot boot floppies..."
881 @cd ${.CURDIR} && ${SMAKE} makeFloppySet FLOPPYBASE=mfsroot \
882 FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz
883 .if defined(SMALLFLOPPYSIZE)
884 @echo "Making the small mfsroot boot floppies..."
885 @cd ${.CURDIR} && ${SMAKE} makeFloppySet FLOPPYBASE=mfsroot-small \
886 FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz \
889 @cd ${.CURDIR} && ${SMAKE} buildBootFloppy FSIMAGE="boot" \
890 KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \
891 MFSROOTFILE="${MFSROOTFLOPPYSET}.split ${MFSROOTFLOPPYSET}.boot"
892 .if defined(SMALLFLOPPYSIZE)
893 @cd ${.CURDIR} && ${SMAKE} buildBootFloppy FSIMAGE="boot-small" \
894 KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \
895 MFSROOTFILE="${SMALLMFSROOTFLOPPYSET}.split ${SMALLMFSROOTFLOPPYSET}.boot" \
898 .else # !SPLIT_MFSROOT
899 @cd ${.CURDIR} && ${SMAKE} buildBootFloppy FSIMAGE="boot" \
900 KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \
901 MFSROOTFILE=${RD}/mfsroot/mfsroot.gz
902 .if defined(SMALLFLOPPYSIZE)
903 @cd ${.CURDIR} && ${SMAKE} buildBootFloppy FSIMAGE="boot-small" \
904 KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \
905 MFSROOTFILE=${RD}/mfsroot/mfsroot.gz \
908 .endif # SPLIT_MFSROOT
911 # Build fixit floppy.
913 @echo "Making fixit floppy."
914 @rm -rf ${RD}/fixitfd
916 @cd ${RD}/fixitfd && \
917 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
919 @cp ${RD}/trees/base/etc/spwd.db ${RD}/trees/base/etc/group \
921 @sed -e 's/#.*//' ${RD}/trees/base/etc/protocols \
922 > ${RD}/fixitfd/etc/protocols
923 @sed -e 's/#.*//' ${RD}/trees/base/usr/share/misc/scsi_modes \
924 > ${RD}/fixitfd/usr/share/misc/scsi_modes
925 @cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
926 @cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
927 @cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar
928 @chmod 555 ${RD}/fixitfd/stand/tar
929 .if defined(SMALLFLOPPYSIZE)
930 @cd ${.CURDIR} && ${SMAKE} installCRUNCH CRUNCH=fixit-small \
931 DIR=${RD}/fixitfd/stand ZIP=false
932 @sh -e ${DOFS_SH} ${RD}/floppies/fixit-small.flp ${RD} ${MNT} \
933 ${SMALLFLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${SMALLFLOPPYLABEL}
934 @rm -rf ${RD}/fixitfd/stand
935 @mkdir ${RD}/fixitfd/stand
937 @cd ${.CURDIR} && ${SMAKE} installCRUNCH CRUNCH=fixit \
938 DIR=${RD}/fixitfd/stand ZIP=false
939 @sh -e ${DOFS_SH} ${RD}/floppies/fixit.flp ${RD} ${MNT} \
940 ${FLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${FLOPPYLABEL}
943 # Do our last minute floppies directory setup
945 @(cd ${RD}/floppies; md5 *.flp > CHECKSUM.MD5)
946 @(cd ${RD}/floppies; sha256 *.flp > CHECKSUM.SHA256)
950 # --==## Setup a suitable ftp-area ##==--
953 @echo "Setting up FTP distribution area"
955 -@ln -s . ${FD}/${BUILDNAME}
956 .if defined(MAKE_FLOPPIES)
957 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
959 @cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
961 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
962 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
963 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
964 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
965 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
967 @for i in ${DIST_DOCS_ARCH_DEP}; do \
968 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
969 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
970 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
971 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
973 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${FD}
975 @echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
978 # Build a live filesystem cdrom image
980 @echo "Building CDROM live filesystem image"
981 @mkdir -p ${CD_LIVEFS}
982 @for i in ${DISTRIBUTIONS} ; \
984 if [ -d ${RD}/trees/$${i} ] ; then \
985 chflags -R noschg ${RD}/trees/$${i} || true ; \
986 ( cd ${RD}/trees/$${i} && \
987 find . -depth -print | cpio -dumpl ${CD_LIVEFS} ) ; \
990 .if defined(MAKE_DVD)
991 @echo "Building DVD filesystem image as well as CDROM"
992 @mkdir -p ${CD_DVD1}/${BUILDNAME}
993 @for i in ${DISTRIBUTIONS} ; \
995 if [ -d ${RD}/trees/$${i} ] ; then \
996 chflags -R noschg ${RD}/trees/$${i} || true ; \
997 ( cd ${RD}/trees/$${i} && \
998 find . -depth -print | cpio -dumpl ${CD_DVD1} ) ; \
1002 @echo "Copy GENERIC kernel to boot area"
1003 @cp -Rp ${RD}/kernels/${KERN_GENERIC}/ ${CD_LIVEFS}/boot/kernel
1004 @rm -f ${CD_LIVEFS}/boot/kernel/*.symbols
1005 @rm -f ${CD_LIVEFS}/.profile
1006 @cp ${.CURDIR}/fixit.profile ${CD_LIVEFS}/.profile
1007 @ln -sf /rescue ${CD_LIVEFS}/stand
1008 @echo "Setting up CDROM boot area"
1009 @rm -f ${CD_LIVEFS}/boot/loader.conf
1010 @cp ${RD}/mfsroot/mfsroot.gz ${CD_LIVEFS}/boot/mfsroot.gz
1011 @echo 'mfsroot_load="YES"' > ${CD_LIVEFS}/boot/loader.conf
1012 @echo 'mfsroot_type="mfs_root"' >> ${CD_LIVEFS}/boot/loader.conf
1013 @echo 'mfsroot_name="/boot/mfsroot"' >> ${CD_LIVEFS}/boot/loader.conf
1014 .if exists(${RD}/trees/base/boot/device.hints)
1015 # Break the link to device.hints so we can modify it
1016 @rm -f ${CD_LIVEFS}/boot/device.hints
1017 @cp ${RD}/trees/base/boot/device.hints ${CD_LIVEFS}/boot/device.hints
1019 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_LIVEFS}/cdrom.inf
1020 .if defined(MAKE_DVD)
1021 @cp -Rp ${RD}/kernels/${KERN_GENERIC}/ ${CD_DVD1}/boot/kernel
1022 @rm -f ${CD_DVD1}/boot/kernel/*.symbols
1023 @rm -f ${CD_DVD1}/.profile
1024 @cp ${.CURDIR}/fixit.profile ${CD_DVD1}/.profile
1025 @ln -sf /rescue ${CD_DVD1}/stand
1026 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DVD1}/cdrom.inf
1027 @rm -f ${CD_DVD1}/boot/loader.conf
1028 @cp ${RD}/mfsroot/mfsroot.gz ${CD_DVD1}/boot/mfsroot.gz
1029 @echo 'mfsroot_load="YES"' > ${CD_DVD1}/boot/loader.conf
1030 @echo 'mfsroot_type="mfs_root"' >> ${CD_DVD1}/boot/loader.conf
1031 @echo 'mfsroot_name="/boot/mfsroot"' >> ${CD_DVD1}/boot/loader.conf
1032 .if exists(${RD}/trees/base/boot/device.hints)
1033 @rm -f ${CD_DVD1}/boot/device.hints
1034 @cp ${RD}/trees/base/boot/device.hints ${CD_DVD1}/boot/device.hints
1039 # Build disc1 and disc2 cdrom images
1041 @echo "Building CDROM disc1 filesystem image"
1042 @mkdir -p ${CD_DISC1}/${BUILDNAME}
1043 .if defined(MAKE_FLOPPIES)
1044 @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
1046 @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}/${BUILDNAME}
1048 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
1049 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
1050 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
1051 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
1052 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
1054 @for i in ${DIST_DOCS_ARCH_DEP}; do \
1055 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
1056 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
1057 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
1058 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
1060 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DISC1}
1062 .if defined(SEPARATE_LIVEFS)
1063 @cp -Rp ${CD_LIVEFS}/boot ${CD_DISC1}
1064 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
1066 @echo "CD_VOLUME = 1" >> ${CD_DISC1}/cdrom.inf
1067 @echo "Building CDROM disc2 filesystem image"
1068 @mkdir -p ${CD_DISC2}
1069 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
1070 @echo "CD_VOLUME = 2" >> ${CD_DISC2}/cdrom.inf
1071 .if defined(MAKE_DVD)
1072 .if defined(MAKE_FLOPPIES)
1073 @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DVD1}
1075 @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DVD1}/${BUILDNAME}
1077 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
1078 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
1079 ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
1080 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
1081 ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
1083 @for i in ${DIST_DOCS_ARCH_DEP}; do \
1084 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
1085 ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
1086 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
1087 ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
1089 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DVD1}
1091 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DVD1}/cdrom.inf
1092 @echo "CD_VOLUME = 1" >> ${CD_DVD1}/cdrom.inf
1095 @echo "Building CDROM docs filesystem image"
1096 @mkdir -p ${CD_DOCS}
1097 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DOCS}/cdrom.inf
1098 @echo "CD_VOLUME = 3" >> ${CD_DOCS}/cdrom.inf
1103 # --==## Setup a suitable cdrom-area ##==--
1106 .if defined(CD_BOOT)
1107 @echo "Building bootonly CDROM filesystem image"
1108 @mkdir -p ${CD_BOOT}
1109 @cp -Rp ${CD_LIVEFS}/boot ${CD_BOOT}
1110 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_BOOT}/cdrom.inf
1111 .if defined(MINIROOT)
1112 @echo "Building bootonly UFS filesystem image"
1113 @mkdir -p ${FD}/miniroot
1114 @sh -e ${DOFS_SH} ${FD}/miniroot/miniroot.ufs \
1115 ${RD} ${MNT} 0 ${CD_BOOT} 8192 auto
1116 @${ZIPPER} -v ${FD}/miniroot/miniroot.ufs
1122 .if defined(CD_PACKAGE_TREE)
1123 .if exists(${CD_PACKAGE_TREE}/disc1)
1124 CD_DISC1_PKGS= ${CD_PACKAGE_TREE}/disc1
1126 .if exists(${CD_PACKAGE_TREE}/disc2)
1127 CD_DISC2_PKGS= ${CD_PACKAGE_TREE}/disc2
1129 # scripts/package-trees.sh names all discs according to the "discX"
1130 # scheme where X is the number of the disc
1131 .if exists(${CD_PACKAGE_TREE}/disc3)
1132 CD_DOCS_PKGS= ${CD_PACKAGE_TREE}/disc3
1134 .if exists(${CD_PACKAGE_TREE}/dvd1)
1135 CD_DVD1_PKGS= ${CD_PACKAGE_TREE}/dvd1
1141 .if exists(${.CURDIR}/${TARGET}/mkisoimages.sh)
1142 @echo "Creating ISO images..."
1143 .if defined(CD_BOOT)
1144 @sh ${.CURDIR}/${TARGET}/mkisoimages.sh ${BOOTABLE} \
1146 ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-bootonly.iso ${CD_BOOT}
1148 @sh ${.CURDIR}/${TARGET}/mkisoimages.sh ${BOOTABLE} \
1150 ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-disc1.iso ${CD_DISC1} \
1152 @sh ${.CURDIR}/${TARGET}/mkisoimages.sh \
1154 ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-disc2.iso ${CD_DISC2} \
1156 .if defined(MAKE_DVD)
1157 @sh ${.CURDIR}/${TARGET}/mkisoimages.sh ${BOOTABLE} \
1159 ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-dvd1.iso ${CD_DVD1} \
1163 @sh ${.CURDIR}/${TARGET}/mkisoimages.sh \
1164 FreeBSD_Documentation \
1165 ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-disc3.iso ${CD_DOCS} \
1168 .if defined(SEPARATE_LIVEFS)
1169 @sh ${.CURDIR}/${TARGET}/mkisoimages.sh ${BOOTABLE} \
1171 ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-livefs.iso ${CD_LIVEFS}
1173 @echo "Generating MD5 and SHA256 sums..."
1174 @(cd ${CD} && md5 *.iso > FreeBSD-${BUILDNAME}-${TARGET}-iso.CHECKSUM.MD5)
1175 @(cd ${CD} && sha256 *.iso > FreeBSD-${BUILDNAME}-${TARGET}-iso.CHECKSUM.SHA256)
1178 @echo "Do not know how to create an ISO for ${TARGET}."
1182 # --==## Documentation Project tools required to build the release notes ##==--
1185 @echo "Making docproj tools..."
1186 @for i in ${DOCPORTS}; do \
1187 cd /usr/ports/$$i && \
1188 env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \
1189 make all install clean BATCH=yes WITHOUT_X11=yes JADETEX=no \
1190 WITHOUT_PYTHON=yes FORCE_PKG_REGISTER=yes; \
1195 # --==## RELNOTESng: Next-generation replacements for *.TXT files ##==--
1198 @echo "Making release documentation..."
1199 @cd ${.CURDIR}/doc && make all install clean 'FORMATS=html txt' \
1200 INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${RND}
1203 # Various "subroutine" and other supporting targets.
1211 @echo "SD undefined in doTARBALL" && exit 1
1214 @echo "TD undefined in doTARBALL" && exit 1
1217 @echo "ARG undefined in doTARBALL" && exit 1
1219 @rm -rf ${RD}/dists/${TD}/${TN}*
1220 @mkdir -p ${RD}/dists/${TD}
1222 tn=`echo ${TN} | tr 'A-Z' 'a-z'` && \
1223 echo rolling ${TD}/$$tn tarball &&\
1224 tar --exclude CVS --exclude .svn --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
1225 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
1226 sh ${.CURDIR}/scripts/info.sh ${RD}/dists/${TD}/$$tn \
1227 > ${RD}/dists/${TD}/$$tn.inf && \
1228 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
1229 cp -p ${.CURDIR}/scripts/$${TD}-install.sh \
1230 ${RD}/dists/${TD}/install.sh && \
1231 chmod +x ${RD}/dists/${TD}/install.sh; \
1233 if [ "${SD}" != "/usr/src" ]; then \
1234 mtree -c -i -p ${SD}/${ARG} \
1235 -k gname,md5digest,mode,nlink,uname,size,link,type \
1236 > ${RD}/dists/${TD}/$$tn.mtree ; \
1240 ( cd ${RD}/dists/${TD}; \
1241 rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \
1242 md5 * > .CHECKSUM.MD5; \
1243 sha256 * > .CHECKSUM.SHA256; \
1244 mv .CHECKSUM.MD5 CHECKSUM.MD5; \
1245 mv .CHECKSUM.SHA256 CHECKSUM.SHA256) \
1248 doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 \
1249 release.5 release.6 release.7 release.8 ${EXTRAS}
1250 @echo "Release done"
1253 @rm -f release.4 release.8 floppies.[123]
1254 @cd ${.CURDIR} && ${SMAKE} release.4 release.8 floppies.1 floppies.2 \
1256 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
1259 .if !defined(CRUNCH)
1260 @echo "CRUNCH undefined in installCRUNCH" && exit 1
1263 @echo "DIR undefined in installCRUNCH" && exit 1
1266 @echo "ZIP undefined in installCRUNCH" && exit 1
1269 ${ZIPPER} < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
1271 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
1273 @chmod 555 ${DIR}/${CRUNCH}_crunch
1274 @if [ -f ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf ] ; then \
1275 for i in `crunchgen -l ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf` ; do \
1276 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
1279 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
1280 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
1285 # --==## Build a floppy set for a splitfs file ##==--
1287 # FLOPPYBASE - basename of floppy image files
1288 # FLOPPYDESC - description of floppy set
1289 # SPLITFILE - filename of the file to split
1290 # FDSIZE - if specified and "small", small floppy is created
1292 .if make(makeFloppySet)
1293 SPLITDIR= ${RD}/floppyset/${FLOPPYBASE}
1294 .if defined(FDSIZE) && ${FDSIZE} == "SMALL"
1295 FLPSPLITSIZE= ${SMALLFLOPPYSPLITSIZE}
1296 FLPSIZE= ${SMALLFLOPPYSIZE}
1297 FLPLABEL= ${SMALLFLOPPYLABEL}
1299 FLPSPLITSIZE= ${FLOPPYSPLITSIZE}
1300 FLPSIZE= ${FLOPPYSIZE}
1301 FLPLABEL= ${FLOPPYLABEL}
1306 .if !defined(FLOPPYBASE)
1307 @echo "FLOPPYBASE undefined in ${.TARGET}" && exit 1
1309 .if !defined(FLOPPYDESC)
1310 @echo "FLOPPYDESC undefined in ${.TARGET}" && exit 1
1312 .if !defined(SPLITFILE)
1313 @echo "SPLITFILE undefined in ${.TARGET}" && exit 1
1315 sh ${.CURDIR}/scripts/split-file.sh ${SPLITFILE} \
1316 ${RD}/floppyset/${FLOPPYBASE} ${FLPSPLITSIZE} "${FLOPPYDESC}"
1317 ( splitfile=${SPLITDIR}/`basename ${SPLITFILE}`.split ; \
1318 lines=`cat $${splitfile} | wc -l`; \
1319 lines=$$(($$lines - 1)) ; \
1320 for line in `jot $$lines`; do \
1321 file=`head -n $$(($${line} + 1)) $${splitfile} | tail -1 | cut -f 1 -d ' '` ; \
1322 sh -e ${DOFS_SH} ${RD}/floppies/${FLOPPYBASE}$${line}.flp \
1323 ${RD} ${MNT} ${FLPSIZE} ${SPLITDIR}/$${file} \
1324 ${BOOTINODE} ${FLPLABEL}; \
1328 # --==## Build a boot floppy ##==--
1330 # FSIMAGE - base floppy image name
1331 # FDSIZE - if specified and "small", small floppy is created
1332 # KERNFILE - path to kernel split file
1333 # MFSROOTFILE - path to mfsroot split file
1335 .if make(buildBootFloppy)
1336 IMAGEDIR= ${RD}/image.${FSIMAGE}
1337 BOOTDIR= ${RD}/trees/base/boot
1338 HINTSFILE= ${BOOTDIR}/device.hints
1339 ACPI_KO= ${RD}/kernels/${KERN_GENERIC}/acpi.ko
1340 IMAGEFILE= ${RD}/floppies/${FSIMAGE}.flp
1341 .if defined(FDSIZE) && ${FDSIZE} == "SMALL"
1342 FLPSIZE= ${SMALLFLOPPYSIZE}
1343 FLPLABEL= ${SMALLFLOPPYLABEL}
1345 FLPSIZE= ${FLOPPYSIZE}
1346 FLPLABEL= ${FLOPPYLABEL}
1351 .if !defined(FSIMAGE)
1352 @echo "FSIMAGE undefined in ${.TARGET}" && exit 1
1354 .if !defined(KERNFILE)
1355 @echo "KERNFILE undefined in ${.TARGET}" && exit 1
1357 .if !defined(MFSROOTFILE)
1358 @echo "MFSROOTFILE undefined in ${.TARGET}" && exit 1
1360 @echo "Running ${.TARGET} for ${FSIMAGE}"
1363 @echo "Setting up /boot directory for ${FSIMAGE} floppy"
1364 @mkdir -p ${IMAGEDIR}/boot
1365 .if ${TARGET_ARCH} == "i386"
1366 @${WMAKEENV} kgzip -v -l ${RD}/trees/base/usr/lib/kgzldr.o -o \
1367 ${IMAGEDIR}/boot/loader ${BOOTDIR}/loader
1369 @cp ${BOOTDIR}/loader ${IMAGEDIR}/boot
1371 @cp -Rp ${BOOTDIR}/*.4th ${BOOTDIR}/defaults ${BOOTDIR}/loader.help \
1372 ${BOOTDIR}/loader.rc ${IMAGEDIR}/boot
1373 .if exists(${HINTSFILE})
1374 @cp ${HINTSFILE} ${IMAGEDIR}/boot/device.hints
1375 @${ZIPPER} ${IMAGEDIR}/boot/device.hints
1377 @${ZIPPER} ${IMAGEDIR}/boot/*.4th ${IMAGEDIR}/boot/loader.help \
1378 ${IMAGEDIR}/boot/defaults/loader.conf
1379 @echo 'bootfile="/kernel"' > ${IMAGEDIR}/boot/loader.conf
1380 .if exists(${ACPI_KO})
1381 @${ZIPPER} -c ${ACPI_KO} > ${IMAGEDIR}/acpi.ko.gz
1382 @echo 'acpi_load="YES"' >> ${IMAGEDIR}/boot/loader.conf
1383 @echo 'acpi_name="/acpi.ko"' >> ${IMAGEDIR}/boot/loader.conf
1384 @echo 'acpi_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
1386 @echo 'mfsroot_load="YES"' >> ${IMAGEDIR}/boot/loader.conf
1387 @echo 'mfsroot_type="mfs_root"' >> ${IMAGEDIR}/boot/loader.conf
1388 @echo 'mfsroot_name="/mfsroot"' >> ${IMAGEDIR}/boot/loader.conf
1389 .if !exists(${ACPI_KO})
1390 @echo 'mfsroot_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
1392 .if defined(SPLIT_MFSROOT)
1393 @echo 'mfsroot_after="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
1395 .if ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "amd64"
1396 .if ${AUTO_KEYBOARD_DETECT}
1397 @echo "-P" >> ${IMAGEDIR}/boot.config
1401 @cp ${KERNFILE} ${MFSROOTFILE} ${IMAGEDIR}
1402 sh -e ${DOFS_SH} ${IMAGEFILE} ${RD} ${MNT} ${FLPSIZE} ${IMAGEDIR} \
1403 ${BOOTINODE} ${FLPLABEL}
1404 @echo "Created ${RD}/floppies/${FSIMAGE}.flp"
1406 .if make(package-split)
1407 # Targets related to making a package split
1409 # PKG_COPY instructs the script to copy the actual package files rather than
1411 # PKG_TREE is the path to the package tree to be split
1412 # PKG_DEST is the path to the destination tree to create the split in
1413 # PKG_VERBOSE asks for verbose output of the layout process
1414 # PKG_INDEX is the path to the INDEX file. By default ${PKG_TREE}/INDEX.
1416 .if defined(PKG_COPY)
1421 PKG_WRKIDX= ${PKG_DEST}/INDEX.master
1423 .if defined(TARGET_ARCH)
1424 PKG_ENV+= PKG_ARCH=${TARGET_ARCH}
1426 .if defined(PKG_VERBOSE)
1427 PKG_ENV+= PKG_VERBOSE=1
1429 PKG_INDEX?= ${PKG_TREE}/INDEX
1432 .if !defined(PKG_TREE)
1433 @echo "PKG_TREE must be defined" && exit 1
1435 .if !defined(PKG_DEST)
1436 @echo "PKG_DEST must be defined" && exit 1
1438 @env ${PKG_ENV} python ${.CURDIR}/scripts/package-split.py \
1439 ${PKG_INDEX} ${PKG_WRKIDX}
1440 @env ${PKG_ENV} sh ${.CURDIR}/scripts/package-trees.sh ${PKG_DO_COPY} \
1441 ${PKG_WRKIDX} ${PKG_TREE} ${PKG_DEST}
1444 .include <bsd.obj.mk>