3 # make release [BUILDNAME=somename] CHROOTDIR=/some/dir CVSROOT=/cvs/dir \
6 # Where "/some/dir" is the pathname of a directory on a some filesystem with
7 # at least 1000MB of free space, "somename" is what you want the release to
8 # call itself, "/cvs/dir" is where our source repo resides and, optionally,
9 # which CVS "tag" name should be used when checking out the sources to build
10 # the release (default is HEAD).
12 # Please note: the md(4) driver must be present in the kernel
13 # (either by being compiled in or available as a kld(4) module),
14 # otherwise the target 'release.8' and possibly others will fail.
16 # Note: If you add options to this file, please keep release(7) updated!
18 # Set these, release builder!
23 # Automatic SNAP versioning:
26 BUILDNAME?=${BASE}-${DATE}-SNAP
28 #CHROOTDIR=/junk/release
29 # If this is a -stable snapshot, then set
32 # To test a release with a source tree containing patches and
33 # other work. This tree will get copied instead of getting the
34 # src/ tree from a CVS checkout. For "rerelease", this will NOT
35 # be copied; cvs update will be used instead.
38 # To use a checked-out ports collection directory instead of
39 # checking out from a local CVS repository, set this option.
40 #EXTPORTSDIR=/usr/ports
42 # To add other options to the CVS subcommands (co,up), set
43 #CVSCMDARGS="-D '01/01/2002 00:00:00 UTC'"
45 # To add other options to the CVS command, set
48 # To prefix the cvs command
49 #CVSPREFIX="/usr/bin/time"
51 # Where the CVS repository is
54 # Non-zero if ${RELEASETAG} is in the form "RELENG_ver_RELEASE"; we
55 # are building an official release. Otherwise, we are building for
57 .if defined(RELEASETAG)
58 ISRELEASE!= expr "${RELEASETAG}" : '^RELENG_.*_RELEASE$$' || true
60 # Convert "RELENG_ver_RELEASE" to "RELEASE_ver" for ports and doc trees.
61 AUXRELEASETAG!= echo ${RELEASETAG} | sed -e 's/^RELENG_/RELEASE_/' -e 's/_RELEASE$$//'
62 DOCRELEASETAG?= ${AUXRELEASETAG}
63 PORTSRELEASETAG?= ${AUXRELEASETAG}
67 # If you want to pass flags to the world build such as -j X, use
68 # WORLD_FLAGS. Similarly, you can specify make flags for kernel
69 # builds via KERNEL_FLAGS.
73 TARGET_ARCH?= ${MACHINE_ARCH}
74 .if ${TARGET_ARCH} == ${MACHINE_ARCH}
77 TARGET?= ${TARGET_ARCH}
79 CROSSENV= TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}
80 CROSSMAKE= ${MAKE} ${CROSSENV}
81 NATIVEMAKE= ${MAKE} TARGET_ARCH=${MACHINE_ARCH} TARGET=${MACHINE}
83 # If you are using a local CVS repository with components stored in
84 # non-standard modules, override these on the make commandline or
86 RELEASESRCMODULE?= src
87 RELEASEDOCMODULE?= doc
88 RELEASEPORTSMODULE?= ports
90 # Uncomment this to disable the doc.1 target. Docs normally require
91 # the ports tree, so NOPORTS can be set together with NODOC in order
92 # to have neither ports or docs. If only NOPORTS is set to YES, but
93 # docs are still desired, the DOMINIMALDOCPORTS logic below will only
94 # install the ports that are minimally required for the docs. This is
95 # intended as a compromise, less disk space is required than for using
96 # the entire ports collection (and much less time due to the huge number
97 # of directories it would create), but still quite a bit as well as some
98 # CPU cycles (some of the programs are C++, and things like ghostscript
99 # belong to the required ports nevertheless).
101 # Setting this also disables building of release note documentation
106 # When retrieving ports using the pkg_add -r method, set your proxies to these.
107 # src/release/${arch}/mkisoimages.sh can use these.
108 #HTTP_PROXY?= www.example.com
109 #FTP_PROXY?= ftp.example.com
111 # When creating ISO images, point ${CD_PACKAGE_TREE} to a directory containing
112 # the package split by an earlier invocation of the 'package-split' target.
113 #CD_PACKAGE_TREE= /path/to/pkg
115 # Extra source tarballs; each argument is a pair of source dir and
116 # distribution name. The dist name should not exceed 7 characters
117 # (another "s" for "source" will be prepended).
118 #EXTRA_SRC= games/fortune fortune
120 # Modify this definition if you want the release notes
121 # and other release documentation in a language other than English.
122 RELNOTES_LANG?= en_US.ISO8859-1
124 # As an alternative to installing the entire ports collection (which
125 # can take a huge amount of time, in particular on slower disks),
126 # setting ${MINIMALDOCPORTS} allows to install and build just those
127 # ports that are really required for getting the docs up & running.
128 .if defined(NOPORTS) && !defined(NODOC)
129 DOMINIMALDOCPORTS= YES
130 .include "Makefile.inc.docports"
131 RELEASEPORTSMODULE= ${MINIMALDOCPORTS}
136 .if !defined(DOMINIMALDOCPORTS) || ${DOMINIMALDOCPORTS} != "YES"
142 # Doing 'make index' in /usr/ports requires Perl.
143 MAKEINDEXPORTS= lang/perl5.8
144 # By default, documentation (Handbook, FAQ, etc.) is built for all
145 # the languages. To speed up building, set the DOC_LANG to just
146 # the languages you need. (The language for the release notes is
147 # controlled by the RELNOTES_LANG variable above.)
148 #DOC_LANG= en_US.ISO8859-1
149 DOCPORTS= textproc/docproj
150 # Set this to wherever the distfiles required by release procedures.
151 .if defined(DOCDISTFILES)
152 # Respect DOCDISTFILES which is used before.
153 RELEASEDISTFILES?= ${DOCDISTFILES}
155 RELEASEDISTFILES?= ${.CURDIR}/../../ports/distfiles
157 # Set this to 1 if you want -P to be used for automatic keyboard detection
158 # on the boot floppy. WARNING: Breaks on some Athlon (K7) motherboards.
159 AUTO_KEYBOARD_DETECT?= 0
162 DIST_DOCS_ARCH_INDEP= hardware readme relnotes errata
166 # Things which without too much trouble can be considered variables
167 # BASE_DISTS are special in that they get full /etc installation sets.
169 OTHER_DISTS?= catpages manpages games proflibs dict info doc ${ARCH_DISTS}
171 .if ${TARGET_ARCH} == "amd64"
174 DISTRIBUTIONS?= ${BASE_DISTS} ${OTHER_DISTS}
177 # Build and package both GENERIC and SMP kernels if the target
178 # has both configuration files. Otherwise only GENERIC is done.
180 .if exists(${.CURDIR}/../sys/${TARGET}/conf/SMP)
181 KERNELS_BASE?= GENERIC SMP
183 KERNELS_BASE?= GENERIC
186 # mountpoint for filesystems.
189 # Various floppy image parameters.
193 .if ${TARGET_ARCH} == "i386"
198 .if ${TARGET} == "pc98"
199 SMALLFLOPPYSIZE= 1200
200 SMALLFLOPPYSPLITSIZE= 1152
201 SMALLFLOPPYLABEL= fd1200
205 FLOPPYSPLITSIZE= 1392
212 .elif ${TARGET_ARCH} == "sparc64"
218 .elif ${TARGET_ARCH} == "ia64"
223 .elif ${TARGET_ARCH} == "amd64"
227 FLOPPYSPLITSIZE= 1392
236 .elif ${TARGET_ARCH} == "powerpc"
243 .if defined(NO_FLOPPIES)
247 .if exists(/sbin/bsdlabel)
250 DISKLABEL?= disklabel
253 ZIPNSPLIT= gzip --no-name -9 -c | split -b 1392k -
255 # Things which may get you into trouble if you change them
256 MTREEFILES= ${.CURDIR}/../etc/mtree
259 RND= ${RD}/release.doc
262 CD_BOOT= ${CD}/bootonly
263 CD_DISC1= ${CD}/disc1
264 CD_DISC2= ${CD}/disc2
265 CD_DISC3= ${CD}/disc3
266 .if defined(MAKE_DVD)
272 .if defined(SEPARATE_LIVEFS)
273 CD_LIVEFS= ${CD}/livefs
275 CD_LIVEFS= ${CD_DISC1}
277 _MK?= ${CHROOTDIR}/mk
279 # Where the bootstrap ports (see DOCPORTS) get installed.
280 LOCALDIR= /usr/local/bin
282 .if ${TARGET} != ${MACHINE} && ${DISKLABEL} == "bsdlabel"
283 DOFS_SH= ${.CURDIR}/scripts/doFS.sh ${DISKLABEL} ${TARGET}
285 DOFS_SH= ${.CURDIR}/scripts/doFS.sh ${DISKLABEL} ""
289 .if ${TARGET_ARCH} == "i386"
290 CRUNCH_TARGETS+=fixit
291 .if ${TARGET} == "pc98"
292 CRUNCH_TARGETS+=fixit-small
296 .if defined(MAKE_FLOPPIES)
298 .if ${TARGET_ARCH} == "i386"
304 .if !defined(NOCDROM)
305 EXTRAS+= cdrom.1 cdrom.2 cdrom.3
306 .if defined(MAKE_ISOS)
309 .if ${TARGET} == "pc98"
320 .if !make(release) && !make(rerelease) && !make(package-split)
321 BINMAKE!= cd ${.CURDIR}/..; ${MAKE} -V BINMAKE
322 WMAKEENV!= cd ${.CURDIR}/..; \
323 ${BINMAKE} ${CROSSENV} -f Makefile.inc1 -V WMAKEENV
324 WMAKE= ${WMAKEENV} ${BINMAKE}
328 .if defined(RELEASETAG)
329 CVS_SRCARGS+= -r ${RELEASETAG}
333 .if defined(DOCRELEASETAG)
334 CVS_DOCARGS+= -r ${DOCRELEASETAG}
338 .if defined(PORTSRELEASETAG)
339 CVS_PORTSARGS+= -r ${PORTSRELEASETAG}
342 WORLDDIR?= ${.CURDIR}/..
345 .if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT)
346 @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false
348 .if defined(NOPORTSATALL) && !defined(NODOC)
349 @echo "Ports are required for building the docs. Either set NODOC or"
350 @echo "unset NOPORTS, or set at least DOMINIMALDOCPORTS to YES!"
353 .if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES)
354 .for p in ${LOCAL_PATCHES}
356 @echo "The patch file ${p} does not exist!"
361 .if defined(LOCAL_SCRIPT) && !exists(${LOCAL_SCRIPT})
362 @echo "The local script ${LOCAL_SCRIPT} does not exist!"
366 .if exists(${CHROOTDIR})
367 # The first command will fail on a handful of files that have their schg
368 # flags set. But it greatly speeds up the next two commands.
369 # NB: clear any vestigial devfs mount, just in case
370 -umount ${CHROOTDIR}/dev > /dev/null 2>&1
371 -rm -rf ${CHROOTDIR} 2>/dev/null
372 -chflags -R 0 ${CHROOTDIR}/.
375 mkdir -p ${CHROOTDIR}
376 @echo ">>> make release for ${TARGET} started on `LC_ALL=C TZ=GMT date`"
377 cd ${WORLDDIR} && ${NATIVEMAKE} -DWITHOUT_GAMES -DWITHOUT_HTML -DWITHOUT_LIB32 \
378 -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_PROFILE installworld DESTDIR=${CHROOTDIR}
379 cd ${WORLDDIR} && ${NATIVEMAKE} distribution DESTDIR=${CHROOTDIR}
380 if [ -f /etc/resolv.conf ]; then \
381 cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \
383 .if defined(EXTLOCALDIR)
384 rm -rf ${CHROOTDIR}/usr/local
385 cd ${CHROOTDIR}/usr && cp -R -H ${EXTLOCALDIR} local
387 rm -rf ${CHROOTDIR}/usr/src
388 .if defined(EXTSRCDIR)
389 cd ${CHROOTDIR}/usr && \
390 cp -R -H ${EXTSRCDIR} src
392 cd ${CHROOTDIR}/usr && \
393 ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
394 co ${CVSCMDARGS} ${CVS_SRCARGS} ${RELEASESRCMODULE}
396 .if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES)
397 .for p in ${LOCAL_PATCHES}
398 patch -d ${CHROOTDIR}/usr/${RELEASESRCMODULE} ${PATCH_FLAGS} < ${p}
401 .if defined(LOCAL_SCRIPT)
402 cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} \
403 RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT}
405 rm -rf ${CHROOTDIR}/usr/ports
406 .if !defined(NOPORTSATALL)
407 .if defined(EXTPORTSDIR)
408 cd ${CHROOTDIR}/usr && cp -R -H ${EXTPORTSDIR} ports
409 # If there are distfiles downloaded removing them
410 rm -rf ports/distfiles/*
412 cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
413 co ${CVSCMDARGS} ${CVS_PORTSARGS} ${RELEASEPORTSMODULE}
417 rm -rf ${CHROOTDIR}/usr/doc
418 .if defined(EXTDOCDIR)
419 cd ${CHROOTDIR}/usr && cp -R -H ${EXTDOCDIR} doc
421 cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
422 co ${CVSCMDARGS} ${CVS_DOCARGS} ${RELEASEDOCMODULE}
424 if [ -d ${RELEASEDISTFILES}/ ]; then \
425 cp -rp ${RELEASEDISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \
427 mkdir -p ${CHROOTDIR}/usr/ports/distfiles; \
429 .if !defined(NO_PREFETCHDISTFILES)
430 @cd ${.CURDIR} && ${MAKE} fetch-distfiles
435 .if !defined(RELEASENOUPDATE) && !defined(EXTSRCDIR)
436 .if !defined(RELEASETAG)
437 cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
438 update ${CVSCMDARGS} -P -d -A
440 cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
441 update ${CVSCMDARGS} -P -d -r ${RELEASETAG}
443 rm -f ${CHROOTDIR}/tmp/.world_done
444 .if !defined(NOPORTS) && !defined(EXTPORTSDIR)
445 cd ${CHROOTDIR}/usr/ports && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
446 update ${CVSCMDARGS} -P -d
447 rm -f ${CHROOTDIR}/tmp/.skip_ports_index
449 .if defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES"
450 for i in ${MINIMALDOCPORTS}; do \
451 ( cd ${CHROOTDIR}/usr/$$i && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
452 update ${CVSCMDARGS} -P -d ) ; \
456 cd ${CHROOTDIR}/usr/doc && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
457 update ${CVSCMDARGS} -P -d
461 # Add version information to those things that need it.
462 if [ ! -f ${CHROOTDIR}/tmp/.world_done ]; then \
463 cd ${CHROOTDIR}/usr/src/sys/conf && \
464 mv newvers.sh foo && \
465 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && \
468 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
469 echo "#!/bin/sh" > ${_MK}
470 echo "set -ex" >> ${_MK}
471 echo "trap 'umount /dev || true' 0" >> ${_MK}
472 echo "_RELTARGET=\$${1:-doRELEASE}" >> ${_MK}
474 AUTO_KEYBOARD_DETECT \
505 echo "export ${var}=\"${${var}}\"" >> ${_MK}
508 # Don't remove this, or the build will fall over!
509 echo "export RELEASEDIR=${_R}" >> ${_MK}
510 echo "export PATH=/bin:/usr/bin:/sbin:/usr/sbin:${LOCALDIR}" >> ${_MK}
511 echo "export MANBUILDCAT=YES" >> ${_MK}
512 # NB: these may fail if the host is running w/o devfs
513 echo "umount /dev >/dev/null 2>&1 || true" >> ${_MK}
514 echo "mount -t devfs devfs /dev >/dev/null 2>&1 || true" >> ${_MK}
515 echo "if [ ! -c /dev/null ]; then" >> ${_MK}
516 echo " echo /dev/null is not a device!" >> ${_MK}
517 echo " exit 1" >> ${_MK}
519 echo "if [ -x /etc/rc.d/ldconfig ]; then" >> ${_MK}
520 echo " /etc/rc.d/ldconfig start" >> ${_MK}
521 echo "else" >> ${_MK}
522 echo " ldconfig /lib /usr/lib /usr/local/lib || true" >> ${_MK}
524 echo "if [ ! -f /tmp/.world_done ]; then" >> ${_MK}
525 echo " cd /usr/src" >> ${_MK}
526 echo " ${CROSSMAKE} ${WORLD_FLAGS} -DNO_CLEAN buildworld && \\" >> ${_MK}
527 echo " touch /tmp/.world_done || exit 1" >> ${_MK}
529 echo "if [ ! -f /tmp/.skip_ports_index ]; then" >> ${_MK}
530 echo " echo \">>> make index started on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
531 echo " for i in ${MAKEINDEXPORTS}" >> ${_MK}
533 echo " cd /usr/ports/\$${i}" >> ${_MK}
534 echo " env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \\" >> ${_MK}
535 echo " make all install clean BATCH=yes FORCE_PKG_REGISTER=yes" >> ${_MK}
536 echo " done" >> ${_MK}
537 echo " cd /usr/ports" >> ${_MK}
538 echo " rm -f INDEX*" >> ${_MK}
539 echo " make index -DINDEX_PRISTINE" >> ${_MK}
540 echo " rm -f INDEX*.tmp" >> ${_MK}
541 echo " touch /tmp/.skip_ports_index" >> ${_MK}
542 echo " echo \">>> make index finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
544 echo "cd /usr/src/release" >> ${_MK}
545 echo "make obj" >> ${_MK}
546 echo "make \$${_RELTARGET}" >> ${_MK}
547 echo "echo \">>> make ${.TARGET} for ${TARGET} finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
550 touch ${CHROOTDIR}/tmp/.skip_ports_index
552 # Ensure md.ko is loaded if md(4) is not statically compiled into
554 -mdconfig 2>/dev/null
555 env -i /usr/sbin/chroot `dirname ${_MK}` /`basename ${_MK}`
558 rm -rf ${CRUNCH_TARGETS:S/$/_crunch/} release.[0-8] ${EXTRAS}
561 @for i in ${MAKEINDEXPORTS}; do \
562 cd ${CHROOTDIR}/usr/ports/$$i && \
563 make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \
564 checksum-recursive ; \
566 @for i in ${DOCPORTS}; do \
567 cd ${CHROOTDIR}/usr/ports/$$i && \
568 make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \
569 WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes \
570 checksum-recursive ; \
573 # Clean out ${_R} and make the directory structure.
576 -rm -rf ${_R}/* 2> /dev/null
577 -chflags -R noschg ${_R}/.
580 .if defined(MAKE_FLOPPIES)
584 for i in ${DISTRIBUTIONS}; do \
585 mkdir ${RD}/trees/$$i && \
586 mtree -deU -f ${MTREEFILES}/BSD.root.dist \
587 -p ${RD}/trees/$$i > /dev/null && \
588 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
589 -p ${RD}/trees/$$i/usr > /dev/null && \
590 mtree -deU -f ${MTREEFILES}/BSD.include.dist \
591 -p ${RD}/trees/$$i/usr/include > /dev/null && \
592 mtree -deU -f ${MTREEFILES}/BSD.var.dist \
593 -p ${RD}/trees/$$i/var > /dev/null ; \
596 for i in ${KERNELS_BASE} ${KERNELS}; do \
597 mkdir -p ${RD}/kernels/$${i}; \
601 # Install the system into the various distributions.
603 cd ${.CURDIR}/.. && ${CROSSMAKE} distrib-dirs DESTDIR=${RD}/trees/base
604 cd ${.CURDIR}/.. && ${CROSSMAKE} ${WORLD_FLAGS} distributeworld \
608 # Make and install the generic kernel(s).
610 .for kernel in ${KERNELS_BASE} ${KERNELS}
612 ${CROSSMAKE} ${KERNEL_FLAGS} \
613 KERNCONF=${kernel} kernel \
614 DESTDIR=${RD}/kernels KODIR=/${kernel}
618 # Make and install the three crunched binaries which live on the floppies.
619 # You are not supposed to like this :-)
622 mkdir -p ${RD}/crunch
623 .for j in ${CRUNCH_TARGETS}
624 .if exists(${.CURDIR}/${TARGET}/${j}_crunch.conf)
627 cd ${j}_crunch; ${WMAKEENV} MAKEFLAGS="-m ${.CURDIR}/../share/mk" \
629 ${.CURDIR}/${TARGET}/${j}_crunch.conf
630 cd ${j}_crunch; ${WMAKE} -f ${j}_crunch.mk subclean
631 cd ${.CURDIR}/..; ${BINMAKE} -f Makefile.inc1 _build-tools
632 cd ${j}_crunch; CFLAGS="-Os -pipe" ${WMAKE} -f ${j}_crunch.mk \
634 ${WMAKEENV} strip -R .comment ${j}_crunch/${j}_crunch
635 mv ${j}_crunch/${j}_crunch ${RD}/crunch/${j}
641 # --==## Fix up the distributions. ##==--
644 # Create any "synthetic dists" now.
645 @for i in ${DISTRIBUTIONS}; do \
646 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
647 echo -n "Running $$i dist creation script... "; \
648 env RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
653 # Remove all the directories we don't need.
655 (find ${OTHER_DISTS} -path '*/var/empty' | xargs chflags noschg; \
656 find ${OTHER_DISTS} -depth -type d -empty -print | xargs rmdir)
660 # --==## Package up the tarballs from assembled trees ##==--
665 @for i in ${DISTRIBUTIONS} ; \
667 if [ -d ${RD}/trees/$${i} ] ; then \
668 cd ${.CURDIR} && $(MAKE) doTARBALL \
669 SD=${RD}/trees/$${i} \
670 TN=$$i TD=$$i ARG="." && \
671 echo "$${i} distribution is finished."; \
674 @for i in ${KERNELS_BASE} ${KERNELS} ; \
676 if [ -d ${RD}/kernels/$${i} ] ; then \
677 cd ${.CURDIR} && $(MAKE) doTARBALL \
679 TN=$$i TD=kernels ARG="$$i" && \
680 echo "$${i} distribution is finished."; \
683 .if !defined(NOPORTS)
684 # XXX: Inline stripped version of doTARBALL
685 @rm -rf ${RD}/dists/ports/ports*
686 @mkdir -p ${RD}/dists/ports
687 @echo rolling ports/ports tarball
688 @tar --exclude CVS --exclude 'ports/distfiles/*' \
689 -czf ${RD}/dists/ports/ports.tgz -C /usr ports
690 @cp ${.CURDIR}/scripts/ports-install.sh ${RD}/dists/ports/install.sh
691 @(cd ${RD}/dists/ports; \
692 rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \
693 md5 * > .CHECKSUM.MD5; \
694 sha256 * > .CHECKSUM.SHA256; \
695 mv .CHECKSUM.MD5 CHECKSUM.MD5; \
696 mv .CHECKSUM.SHA256 CHECKSUM.SHA256)
697 @echo "ports distribution is finished."
703 # --==## Make source dists ##==--
707 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \
708 TD=src TN=sbase ARG="[A-Z]*"
709 @for i in `cd /usr/src && echo [a-z]*` ; do \
710 if [ -d /usr/src/$$i ] ; then \
711 cd ${.CURDIR} && $(MAKE) doTARBALL \
712 TN=`echo s$$i | tr -d '.' | \
714 -e 's/kerberos5/krb5/'` \
715 SD=/usr/src TD=src ARG="$$i" ; \
718 .if defined(EXTRA_SRC)
719 @set ${EXTRA_SRC} && \
720 while [ $$# -ge 2 ] ; do \
721 if [ -d /usr/src/$$1 ] ; then \
722 cd ${.CURDIR} && $(MAKE) doTARBALL \
723 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
724 fi && shift && shift ; \
727 (cd ${RD}/dists/src; \
728 rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \
729 md5 * > .CHECKSUM.MD5; \
730 sha256 * > .CHECKSUM.SHA256; \
731 mv .CHECKSUM.MD5 CHECKSUM.MD5; \
732 mv .CHECKSUM.SHA256 CHECKSUM.SHA256)
733 @echo "src distribution is finished."
737 # Build the memory root filesystem.
739 cp ${RD}/trees/base/etc/disktab /etc
743 mkdir -p etc/defaults dev mnt stand/etc/defaults stand/help \
745 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
746 DIR=${RD}/mfsfd/stand ZIP=false
747 ( cd ${RD}/mfsfd && \
748 for dir in bin sbin ; do \
749 ln -sf /stand $$dir; \
751 cp ${RD}/trees/base/sbin/dhclient-script ${RD}/mfsfd/stand
752 .if ${TARGET} == "pc98"
753 cp ${.CURDIR}/../etc/defaults/pccard.conf \
754 ${RD}/mfsfd/etc/defaults/pccard.conf
756 cp ${.CURDIR}/../etc/master.passwd ${RD}/mfsfd/etc/master.passwd
757 cp ${RD}/trees/base/etc/*pwd.db ${RD}/mfsfd/etc/
758 ( for F in defaults/rc.conf netconfig protocols ; do \
759 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \
760 ${RD}/trees/base/etc/$$F > ${RD}/mfsfd/stand/etc/$$F ; \
762 grep -E '^(ftp|nameserver|domain|sunrpc|cmd|nfsd)[^-\w]' \
763 ${RD}/trees/base/etc/services | \
764 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \
765 > ${RD}/mfsfd/stand/etc/services
766 grep 'operator' ${RD}/trees/base/etc/group \
767 > ${RD}/mfsfd/stand/etc/group
768 ln ${RD}/mfsfd/stand/etc/services ${RD}/mfsfd/etc/services
769 ln ${RD}/mfsfd/stand/etc/group ${RD}/mfsfd/etc/group
770 ln ${RD}/mfsfd/stand/etc/netconfig ${RD}/mfsfd/etc/netconfig
771 cp ${RD}/trees/base/COPYRIGHT ${RD}/mfsfd/stand/help/COPYRIGHT.hlp
773 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
774 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
775 ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
777 @for i in ${DIST_DOCS_ARCH_DEP}; do \
778 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
779 ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
782 -test -f ${.CURDIR}/install.cfg \
783 && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
784 @mkdir -p ${RD}/mfsfd/boot
785 .if ${TARGET_ARCH} != "ia64" && ${TARGET_ARCH} != "powerpc"
786 @cp ${RD}/trees/base/boot/boot* ${RD}/mfsfd/boot
788 .if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64"
789 @cp ${RD}/trees/base/boot/mbr ${RD}/mfsfd/boot
791 @tar --exclude CVS -cf - -C ${.CURDIR}/../usr.sbin/sysinstall help | \
792 tar xf - -C ${RD}/mfsfd/stand
793 @mkdir -p ${RD}/mfsroot
794 sh -e ${DOFS_SH} ${RD}/mfsroot/mfsroot ${RD} ${MNT} \
795 ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL}
796 @gzip -9fnv ${RD}/mfsroot/mfsroot
799 KERNFLOPPYSET= ${RD}/floppyset/kern/kernel.gz
800 .if defined(SMALLFLOPPYSIZE)
801 SMALLKERNFLOPPYSET= ${RD}/floppyset/kern-small/kernel.gz
803 .if defined(SPLIT_MFSROOT)
804 MFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot/mfsroot.gz
805 .if defined(SMALLFLOPPYSIZE)
806 SMALLMFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot-small/mfsroot.gz
810 # Build boot and install floppies.
812 @gzip -9nc ${RD}/kernels/GENERIC/kernel > ${RD}/kernels/kernel.gz
813 @echo "Making the kernel boot floppies..."
814 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern \
815 FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz
816 .if defined(SMALLFLOPPYSIZE)
817 @echo "Making the small kernel boot floppies..."
818 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern-small \
819 FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz \
822 .if defined(SPLIT_MFSROOT)
823 @echo "Making the mfsroot boot floppies..."
824 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot \
825 FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz
826 .if defined(SMALLFLOPPYSIZE)
827 @echo "Making the small mfsroot boot floppies..."
828 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot-small \
829 FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz \
832 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \
833 KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \
834 MFSROOTFILE="${MFSROOTFLOPPYSET}.split ${MFSROOTFLOPPYSET}.boot"
835 .if defined(SMALLFLOPPYSIZE)
836 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \
837 KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \
838 MFSROOTFILE="${SMALLMFSROOTFLOPPYSET}.split ${SMALLMFSROOTFLOPPYSET}.boot" \
841 .else # !SPLIT_MFSROOT
842 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \
843 KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \
844 MFSROOTFILE=${RD}/mfsroot/mfsroot.gz
845 .if defined(SMALLFLOPPYSIZE)
846 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \
847 KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \
848 MFSROOTFILE=${RD}/mfsroot/mfsroot.gz \
851 .endif # SPLIT_MFSROOT
854 # Build fixit floppy.
856 @echo "Making fixit floppy."
857 @rm -rf ${RD}/fixitfd
859 @cd ${RD}/fixitfd && \
860 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
862 @cp ${RD}/trees/base/etc/spwd.db ${RD}/trees/base/etc/group \
864 @sed -e 's/#.*//' ${RD}/trees/base/etc/protocols \
865 > ${RD}/fixitfd/etc/protocols
866 @sed -e 's/#.*//' ${RD}/trees/base/usr/share/misc/scsi_modes \
867 > ${RD}/fixitfd/usr/share/misc/scsi_modes
868 @cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
869 @cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
870 @cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar
871 @chmod 555 ${RD}/fixitfd/stand/tar
872 .if defined(SMALLFLOPPYSIZE)
873 @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit-small \
874 DIR=${RD}/fixitfd/stand ZIP=false
875 @sh -e ${DOFS_SH} ${RD}/floppies/fixit-small.flp ${RD} ${MNT} \
876 ${SMALLFLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${SMALLFLOPPYLABEL}
877 @rm -rf ${RD}/fixitfd/stand
878 @mkdir ${RD}/fixitfd/stand
880 @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit \
881 DIR=${RD}/fixitfd/stand ZIP=false
882 @sh -e ${DOFS_SH} ${RD}/floppies/fixit.flp ${RD} ${MNT} \
883 ${FLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${FLOPPYLABEL}
886 # Do our last minute floppies directory setup
888 @(cd ${RD}/floppies; md5 *.flp > CHECKSUM.MD5)
889 @(cd ${RD}/floppies; sha256 *.flp > CHECKSUM.SHA256)
893 # --==## Setup a suitable ftp-area ##==--
896 @echo "Setting up FTP distribution area"
898 -@ln -s . ${FD}/${BUILDNAME}
899 .if defined(MAKE_FLOPPIES)
900 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
902 @cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
904 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
905 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
906 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
907 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
908 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
910 @for i in ${DIST_DOCS_ARCH_DEP}; do \
911 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
912 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
913 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
914 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
916 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${FD}
918 @echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
921 # Build a live filesystem cdrom image
923 @echo "Building CDROM live filesystem image"
924 @mkdir -p ${CD_LIVEFS}
925 @for i in ${DISTRIBUTIONS} ; \
927 if [ -d ${RD}/trees/$${i} ] ; then \
928 chflags -R noschg ${RD}/trees/$${i} || true ; \
929 ( cd ${RD}/trees/$${i} && \
930 find . -depth -print | cpio -dumpl ${CD_LIVEFS} ) ; \
933 .if defined(MAKE_DVD)
934 @echo "Building DVD filesystem image as well as CDROM"
935 @mkdir -p ${CD_DVD1}/${BUILDNAME}
936 @for i in ${DISTRIBUTIONS} ; \
938 if [ -d ${RD}/trees/$${i} ] ; then \
939 chflags -R noschg ${RD}/trees/$${i} || true ; \
940 ( cd ${RD}/trees/$${i} && \
941 find . -depth -print | cpio -dumpl ${CD_DVD1} ) ; \
945 @echo "Copy GENERIC kernel to boot area"
946 @cp -Rp ${RD}/kernels/GENERIC/ ${CD_LIVEFS}/boot/kernel
947 @rm -f ${CD_LIVEFS}/boot/kernel/*.symbols
948 @rm -f ${CD_LIVEFS}/.profile
949 @cp ${.CURDIR}/fixit.profile ${CD_LIVEFS}/.profile
950 @ln -sf /rescue ${CD_LIVEFS}/stand
951 @echo "Setting up CDROM boot area"
952 @rm -f ${CD_LIVEFS}/boot/loader.conf
953 @cp ${RD}/mfsroot/mfsroot.gz ${CD_LIVEFS}/boot/mfsroot.gz
954 @echo 'mfsroot_load="YES"' > ${CD_LIVEFS}/boot/loader.conf
955 @echo 'mfsroot_type="mfs_root"' >> ${CD_LIVEFS}/boot/loader.conf
956 @echo 'mfsroot_name="/boot/mfsroot"' >> ${CD_LIVEFS}/boot/loader.conf
957 .if exists(${RD}/trees/base/boot/device.hints)
958 # Break the link to device.hints so we can modify it
959 @rm -f ${CD_LIVEFS}/boot/device.hints
960 @cp ${RD}/trees/base/boot/device.hints ${CD_LIVEFS}/boot/device.hints
962 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_LIVEFS}/cdrom.inf
963 .if defined(MAKE_DVD)
964 @cp -Rp ${RD}/kernels/GENERIC/ ${CD_DVD1}/boot/kernel
965 @rm -f ${CD_DVD1}/boot/kernel/*.symbols
966 @rm -f ${CD_DVD1}/.profile
967 @cp ${.CURDIR}/fixit.profile ${CD_DVD1}/.profile
968 @ln -sf /rescue ${CD_DVD1}/stand
969 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DVD1}/cdrom.inf
970 @rm -f ${CD_DVD1}/boot/loader.conf
971 @cp ${RD}/mfsroot/mfsroot.gz ${CD_DVD1}/boot/mfsroot.gz
972 @echo 'mfsroot_load="YES"' > ${CD_DVD1}/boot/loader.conf
973 @echo 'mfsroot_type="mfs_root"' >> ${CD_DVD1}/boot/loader.conf
974 @echo 'mfsroot_name="/boot/mfsroot"' >> ${CD_DVD1}/boot/loader.conf
975 .if exists(${RD}/trees/base/boot/device.hints)
976 @rm -f ${CD_DVD1}/boot/device.hints
977 @cp ${RD}/trees/base/boot/device.hints ${CD_DVD1}/boot/device.hints
982 # Build disc1, disc2 and disc3 cdrom images
984 @echo "Building CDROM disc1 filesystem image"
985 @mkdir -p ${CD_DISC1}/${BUILDNAME}
986 .if defined(MAKE_FLOPPIES)
987 @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
989 @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}/${BUILDNAME}
991 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
992 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
993 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
994 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
995 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
997 @for i in ${DIST_DOCS_ARCH_DEP}; do \
998 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
999 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
1000 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
1001 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
1003 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DISC1}
1005 .if defined(SEPARATE_LIVEFS)
1006 @cp -Rp ${CD_LIVEFS}/boot ${CD_DISC1}
1007 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
1009 @echo "CD_VOLUME = 1" >> ${CD_DISC1}/cdrom.inf
1010 @echo "Building CDROM disc2 filesystem image"
1011 @mkdir -p ${CD_DISC2}
1012 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
1013 @echo "CD_VOLUME = 2" >> ${CD_DISC2}/cdrom.inf
1014 @echo "Building CDROM disc3 filesystem image"
1015 @mkdir -p ${CD_DISC3}
1016 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC3}/cdrom.inf
1017 @echo "CD_VOLUME = 3" >> ${CD_DISC3}/cdrom.inf
1018 .if defined(MAKE_DVD)
1019 .if defined(MAKE_FLOPPIES)
1020 @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DVD1}
1022 @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DVD1}/${BUILDNAME}
1024 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
1025 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
1026 ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
1027 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
1028 ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
1030 @for i in ${DIST_DOCS_ARCH_DEP}; do \
1031 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
1032 ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
1033 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
1034 ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
1036 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DVD1}
1038 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DVD1}/cdrom.inf
1039 @echo "CD_VOLUME = 1" >> ${CD_DVD1}/cdrom.inf
1042 @echo "Building CDROM docs filesystem image"
1043 @mkdir -p ${CD_DOCS}
1044 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DOCS}/cdrom.inf
1045 @mkdir -p ${CD_DOCS}/usr/share/doc
1046 .if defined(MAKE_DVD)
1047 @mkdir -p ${CD_DVD1}/usr/share/doc
1049 @for i in `ls ${CD_LIVEFS}/usr/share/doc`; do \
1050 if [ -L ${CD_LIVEFS}/usr/share/doc/$$i -o \
1051 -d /usr/doc/$$i ]; then \
1052 mv ${CD_LIVEFS}/usr/share/doc/$$i \
1053 ${CD_DOCS}/usr/share/doc; \
1056 .if defined(MAKE_DVD)
1057 @cd ${CD_DOCS}/usr/share/doc && find . -print | \
1058 cpio -dumpl ${CD_DVD1}/usr/share/doc
1064 # --==## Setup a suitable cdrom-area ##==--
1067 .if defined(CD_BOOT)
1068 @echo "Building bootonly CDROM filesystem image"
1069 @mkdir -p ${CD_BOOT}
1070 @cp -Rp ${CD_LIVEFS}/boot ${CD_BOOT}
1071 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_BOOT}/cdrom.inf
1072 .if defined(MINIROOT)
1073 @echo "Building bootonly UFS filesystem image"
1074 @mkdir -p ${FD}/miniroot
1075 @sh -e ${DOFS_SH} ${FD}/miniroot/miniroot.ufs \
1076 ${RD} ${MNT} 0 ${CD_BOOT} 8192 auto
1077 @gzip -9v ${FD}/miniroot/miniroot.ufs
1083 .if defined(CD_PACKAGE_TREE)
1084 .if exists(${CD_PACKAGE_TREE}/disc1)
1085 CD_DISC1_PKGS= ${CD_PACKAGE_TREE}/disc1
1087 .if exists(${CD_PACKAGE_TREE}/disc2)
1088 CD_DISC2_PKGS= ${CD_PACKAGE_TREE}/disc2
1090 .if exists(${CD_PACKAGE_TREE}/disc3)
1091 CD_DISC3_PKGS= ${CD_PACKAGE_TREE}/disc3
1093 .if exists(${CD_PACKAGE_TREE}/dvd1)
1094 CD_DVD1_PKGS= ${CD_PACKAGE_TREE}/dvd1
1100 .if exists(${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh)
1101 @echo "Creating ISO images..."
1102 .if defined(CD_BOOT)
1103 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
1105 ${CD}/${BUILDNAME}-${TARGET}-bootonly.iso ${CD_BOOT}
1107 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
1109 ${CD}/${BUILDNAME}-${TARGET}-disc1.iso ${CD_DISC1} \
1111 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \
1113 ${CD}/${BUILDNAME}-${TARGET}-disc2.iso ${CD_DISC2} \
1115 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \
1116 FreeBSD_Packages_2 \
1117 ${CD}/${BUILDNAME}-${TARGET}-disc3.iso ${CD_DISC3} \
1119 .if defined(MAKE_DVD)
1120 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
1122 ${CD}/${BUILDNAME}-${TARGET}-dvd1.iso ${CD_DVD1} \
1126 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \
1127 FreeBSD_Documentation \
1128 ${CD}/${BUILDNAME}-${TARGET}-docs.iso ${CD_DOCS}
1130 .if defined(SEPARATE_LIVEFS)
1131 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
1133 ${CD}/${BUILDNAME}-${TARGET}-livefs.iso ${CD_LIVEFS}
1135 @echo "Generating MD5 and SHA256 sums..."
1136 @(cd ${CD} && md5 *.iso > ${BUILDNAME}-${TARGET}-iso.CHECKSUM.MD5)
1137 @(cd ${CD} && sha256 *.iso > ${BUILDNAME}-${TARGET}-iso.CHECKSUM.SHA256)
1140 @echo "Do not know how to create an ISO for ${TARGET_ARCH}."
1144 # --==## Documentation Project files such as the Handbook and FAQ ##==--
1147 @echo "Making docs..."
1148 @for i in ${DOCPORTS}; do \
1149 cd /usr/ports/$$i && \
1150 env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \
1151 make all install clean BATCH=yes WITHOUT_X11=yes JADETEX=no \
1152 WITHOUT_PYTHON=yes FORCE_PKG_REGISTER=yes; \
1154 @cd /usr/doc && make all install 'FORMATS=html html-split txt' \
1155 INSTALL_COMPRESSED='' DOCDIR=${RD}/trees/base/usr/share/doc \
1160 # --==## RELNOTESng: Next-generation replacements for *.TXT files ##==--
1163 @echo "Making release documentation..."
1164 @cd ${.CURDIR}/doc && make all install clean 'FORMATS=html txt' \
1165 INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${RND}
1168 # Various "subroutine" and other supporting targets.
1176 @echo "SD undefined in doTARBALL" && exit 1
1179 @echo "TD undefined in doTARBALL" && exit 1
1182 @echo "ARG undefined in doTARBALL" && exit 1
1184 @rm -rf ${RD}/dists/${TD}/${TN}*
1185 @mkdir -p ${RD}/dists/${TD}
1187 tn=`echo ${TN} | tr 'A-Z' 'a-z'` && \
1188 echo rolling ${TD}/$$tn tarball &&\
1189 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
1190 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
1191 sh ${.CURDIR}/scripts/info.sh ${RD}/dists/${TD}/$$tn \
1192 > ${RD}/dists/${TD}/$$tn.inf && \
1193 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
1194 cp -p ${.CURDIR}/scripts/$${TD}-install.sh \
1195 ${RD}/dists/${TD}/install.sh && \
1196 chmod +x ${RD}/dists/${TD}/install.sh; \
1198 if [ "${SD}" != "/usr/src" ]; then \
1199 mtree -c -i -p ${SD}/${ARG} \
1200 -k gname,md5digest,mode,nlink,uname,size,link,type \
1201 > ${RD}/dists/${TD}/$$tn.mtree ; \
1205 ( cd ${RD}/dists/${TD}; \
1206 rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \
1207 md5 * > .CHECKSUM.MD5; \
1208 sha256 * > .CHECKSUM.SHA256; \
1209 mv .CHECKSUM.MD5 CHECKSUM.MD5; \
1210 mv .CHECKSUM.SHA256 CHECKSUM.SHA256) \
1213 doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 \
1214 release.5 release.6 release.7 release.8 ${EXTRAS}
1215 @echo "Release done"
1218 @rm -f release.4 release.8 floppies.[123]
1219 @cd ${.CURDIR} && ${MAKE} release.4 release.8 floppies.1 floppies.2 \
1221 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
1224 .if !defined(CRUNCH)
1225 @echo "CRUNCH undefined in installCRUNCH" && exit 1
1228 @echo "DIR undefined in installCRUNCH" && exit 1
1231 @echo "ZIP undefined in installCRUNCH" && exit 1
1234 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
1236 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
1238 @chmod 555 ${DIR}/${CRUNCH}_crunch
1239 @if [ -f ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf ] ; then \
1240 for i in `crunchgen -l ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf` ; do \
1241 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
1244 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
1245 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
1250 # --==## Build a floppy set for a splitfs file ##==--
1252 # FLOPPYBASE - basename of floppy image files
1253 # FLOPPYDESC - description of floppy set
1254 # SPLITFILE - filename of the file to split
1255 # FDSIZE - if specified and "small", small floppy is created
1257 .if make(makeFloppySet)
1258 SPLITDIR= ${RD}/floppyset/${FLOPPYBASE}
1259 .if defined(FDSIZE) && ${FDSIZE} == "SMALL"
1260 FLPSPLITSIZE= ${SMALLFLOPPYSPLITSIZE}
1261 FLPSIZE= ${SMALLFLOPPYSIZE}
1262 FLPLABEL= ${SMALLFLOPPYLABEL}
1264 FLPSPLITSIZE= ${FLOPPYSPLITSIZE}
1265 FLPSIZE= ${FLOPPYSIZE}
1266 FLPLABEL= ${FLOPPYLABEL}
1271 .if !defined(FLOPPYBASE)
1272 @echo "FLOPPYBASE undefined in ${.TARGET}" && exit 1
1274 .if !defined(FLOPPYDESC)
1275 @echo "FLOPPYDESC undefined in ${.TARGET}" && exit 1
1277 .if !defined(SPLITFILE)
1278 @echo "SPLITFILE undefined in ${.TARGET}" && exit 1
1280 sh ${.CURDIR}/scripts/split-file.sh ${SPLITFILE} \
1281 ${RD}/floppyset/${FLOPPYBASE} ${FLPSPLITSIZE} "${FLOPPYDESC}"
1282 ( splitfile=${SPLITDIR}/`basename ${SPLITFILE}`.split ; \
1283 lines=`cat $${splitfile} | wc -l`; \
1284 lines=$$(($$lines - 1)) ; \
1285 for line in `jot $$lines`; do \
1286 file=`head -n $$(($${line} + 1)) $${splitfile} | tail -1 | cut -f 1 -d ' '` ; \
1287 sh -e ${DOFS_SH} ${RD}/floppies/${FLOPPYBASE}$${line}.flp \
1288 ${RD} ${MNT} ${FLPSIZE} ${SPLITDIR}/$${file} \
1289 ${BOOTINODE} ${FLPLABEL}; \
1293 # --==## Build a boot floppy ##==--
1295 # FSIMAGE - base floppy image name
1296 # FDSIZE - if specified and "small", small floppy is created
1297 # KERNFILE - path to kernel split file
1298 # MFSROOTFILE - path to mfsroot split file
1300 .if make(buildBootFloppy)
1301 IMAGEDIR= ${RD}/image.${FSIMAGE}
1302 BOOTDIR= ${RD}/trees/base/boot
1303 HINTSFILE= ${BOOTDIR}/device.hints
1304 ACPI_KO= ${RD}/kernels/GENERIC/acpi.ko
1305 IMAGEFILE= ${RD}/floppies/${FSIMAGE}.flp
1306 .if defined(FDSIZE) && ${FDSIZE} == "SMALL"
1307 FLPSIZE= ${SMALLFLOPPYSIZE}
1308 FLPLABEL= ${SMALLFLOPPYLABEL}
1310 FLPSIZE= ${FLOPPYSIZE}
1311 FLPLABEL= ${FLOPPYLABEL}
1316 .if !defined(FSIMAGE)
1317 @echo "FSIMAGE undefined in ${.TARGET}" && exit 1
1319 .if !defined(KERNFILE)
1320 @echo "KERNFILE undefined in ${.TARGET}" && exit 1
1322 .if !defined(MFSROOTFILE)
1323 @echo "MFSROOTFILE undefined in ${.TARGET}" && exit 1
1325 @echo "Running ${.TARGET} for ${FSIMAGE}"
1328 @echo "Setting up /boot directory for ${FSIMAGE} floppy"
1329 @mkdir -p ${IMAGEDIR}/boot
1330 .if ${TARGET} == "i386"
1331 @${WMAKEENV} kgzip -v -l ${RD}/trees/base/usr/lib/kgzldr.o -o \
1332 ${IMAGEDIR}/boot/loader ${BOOTDIR}/loader
1334 @cp ${BOOTDIR}/loader ${IMAGEDIR}/boot
1336 @cp -Rp ${BOOTDIR}/*.4th ${BOOTDIR}/defaults ${BOOTDIR}/loader.help \
1337 ${BOOTDIR}/loader.rc ${IMAGEDIR}/boot
1338 .if exists(${HINTSFILE})
1339 @cp ${HINTSFILE} ${IMAGEDIR}/boot/device.hints
1340 @gzip -9n ${IMAGEDIR}/boot/device.hints
1342 @gzip -9n ${IMAGEDIR}/boot/*.4th ${IMAGEDIR}/boot/loader.help \
1343 ${IMAGEDIR}/boot/defaults/loader.conf
1344 @echo 'bootfile="/kernel"' > ${IMAGEDIR}/boot/loader.conf
1345 .if exists(${ACPI_KO})
1346 @gzip -9nc ${ACPI_KO} > ${IMAGEDIR}/acpi.ko.gz
1347 @echo 'acpi_load="YES"' >> ${IMAGEDIR}/boot/loader.conf
1348 @echo 'acpi_name="/acpi.ko"' >> ${IMAGEDIR}/boot/loader.conf
1349 @echo 'acpi_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
1351 @echo 'mfsroot_load="YES"' >> ${IMAGEDIR}/boot/loader.conf
1352 @echo 'mfsroot_type="mfs_root"' >> ${IMAGEDIR}/boot/loader.conf
1353 @echo 'mfsroot_name="/mfsroot"' >> ${IMAGEDIR}/boot/loader.conf
1354 .if !exists(${ACPI_KO})
1355 @echo 'mfsroot_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
1357 .if defined(SPLIT_MFSROOT)
1358 @echo 'mfsroot_after="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
1360 .if ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "amd64"
1361 .if ${AUTO_KEYBOARD_DETECT}
1362 @echo "-P" >> ${IMAGEDIR}/boot.config
1366 @cp ${KERNFILE} ${MFSROOTFILE} ${IMAGEDIR}
1367 sh -e ${DOFS_SH} ${IMAGEFILE} ${RD} ${MNT} ${FLPSIZE} ${IMAGEDIR} \
1368 ${BOOTINODE} ${FLPLABEL}
1369 @echo "Created ${RD}/floppies/${FSIMAGE}.flp"
1371 .if make(package-split)
1372 # Targets related to making a package split
1374 # PKG_COPY instructs the script to copy the actual package files rather than
1376 # PKG_TREE is the path to the package tree to be split
1377 # PKG_DEST is the path to the destination tree to create the split in
1378 # PKG_VERBOSE asks for verbose output of the layout process
1379 # PKG_INDEX is the path to the INDEX file. By default ${PKG_TREE}/INDEX.
1381 .if defined(PKG_COPY)
1386 PKG_WRKIDX= ${PKG_DEST}/INDEX.master
1388 .if defined(TARGET_ARCH)
1389 PKG_ENV+= PKG_ARCH=${TARGET_ARCH}
1391 .if defined(PKG_VERBOSE)
1392 PKG_ENV+= PKG_VERBOSE=1
1394 PKG_INDEX?= ${PKG_TREE}/INDEX
1397 .if !defined(PKG_TREE)
1398 @echo "PKG_TREE must be defined" && exit 1
1400 .if !defined(PKG_DEST)
1401 @echo "PKG_DEST must be defined" && exit 1
1403 @env ${PKG_ENV} python ${.CURDIR}/scripts/package-split.py \
1404 ${PKG_INDEX} ${PKG_WRKIDX}
1405 @env ${PKG_ENV} sh ${.CURDIR}/scripts/package-trees.sh ${PKG_DO_COPY} \
1406 ${PKG_WRKIDX} ${PKG_TREE} ${PKG_DEST}
1409 .include <bsd.obj.mk>