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!
21 #BUILDNAME=7.0-CURRENT
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= readme relnotes errata
163 DIST_DOCS_ARCH_DEP= installation hardware
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"
195 .if ${TARGET} == "pc98"
196 SMALLFLOPPYSIZE= 1200
197 SMALLFLOPPYSPLITSIZE= 1152
198 SMALLFLOPPYLABEL= fd1200
202 FLOPPYSPLITSIZE= 1392
209 .elif ${TARGET_ARCH} == "sparc64"
215 .elif ${TARGET_ARCH} == "ia64"
220 .elif ${TARGET_ARCH} == "amd64"
223 FLOPPYSPLITSIZE= 1392
231 .elif ${TARGET_ARCH} == "powerpc"
238 .if defined(NO_FLOPPIES)
242 .if exists(/sbin/bsdlabel)
245 DISKLABEL?= disklabel
248 ZIPNSPLIT= gzip --no-name -9 -c | split -b 1392k -
250 # Things which may get you into trouble if you change them
251 MTREEFILES= ${.CURDIR}/../etc/mtree
254 RND= ${RD}/release.doc
257 CD_BOOT= ${CD}/bootonly
258 CD_DISC1= ${CD}/disc1
259 CD_DISC2= ${CD}/disc2
263 .if defined(SEPARATE_LIVEFS)
264 CD_LIVEFS= ${CD}/livefs
266 CD_LIVEFS= ${CD_DISC1}
268 _MK?= ${CHROOTDIR}/mk
270 # Where the bootstrap ports (see DOCPORTS) get installed.
271 LOCALDIR= /usr/local/bin
273 .if ${TARGET} != ${MACHINE} && ${DISKLABEL} == "bsdlabel"
274 DOFS_SH= ${.CURDIR}/scripts/doFS.sh ${DISKLABEL} ${TARGET}
276 DOFS_SH= ${.CURDIR}/scripts/doFS.sh ${DISKLABEL} ""
280 .if ${TARGET_ARCH} == "i386"
281 CRUNCH_TARGETS+=fixit
282 .if ${TARGET} == "pc98"
283 CRUNCH_TARGETS+=fixit-small
287 .if defined(MAKE_FLOPPIES)
289 .if ${TARGET_ARCH} == "i386"
295 .if !defined(NOCDROM)
296 EXTRAS+= cdrom.1 cdrom.2 cdrom.3
297 .if defined(MAKE_ISOS)
300 .if ${TARGET} == "pc98"
311 .if !make(release) && !make(rerelease) && !make(package-split)
312 BINMAKE!= cd ${.CURDIR}/..; ${MAKE} -V BINMAKE
313 WMAKEENV!= cd ${.CURDIR}/..; \
314 ${BINMAKE} ${CROSSENV} -f Makefile.inc1 -V WMAKEENV
315 WMAKE= ${WMAKEENV} ${BINMAKE}
319 .if defined(RELEASETAG)
320 CVS_SRCARGS+= -r ${RELEASETAG}
324 .if defined(DOCRELEASETAG)
325 CVS_DOCARGS+= -r ${DOCRELEASETAG}
329 .if defined(PORTSRELEASETAG)
330 CVS_PORTSARGS+= -r ${PORTSRELEASETAG}
333 WORLDDIR?= ${.CURDIR}/..
336 .if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT)
337 @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false
339 .if defined(NOPORTSATALL) && !defined(NODOC)
340 @echo "Ports are required for building the docs. Either set NODOC or"
341 @echo "unset NOPORTS, or set at least DOMINIMALDOCPORTS to YES!"
344 .if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES)
345 .for p in ${LOCAL_PATCHES}
347 @echo "The patch file ${p} does not exist!"
352 .if defined(LOCAL_SCRIPT) && !exists(${LOCAL_SCRIPT})
353 @echo "The local script ${LOCAL_SCRIPT} does not exist!"
357 .if exists(${CHROOTDIR})
358 # The first command will fail on a handful of files that have their schg
359 # flags set. But it greatly speeds up the next two commands.
360 # NB: clear any vestigial devfs mount, just in case
361 -umount ${CHROOTDIR}/dev > /dev/null 2>&1
362 -rm -rf ${CHROOTDIR} 2>/dev/null
363 -chflags -R 0 ${CHROOTDIR}/.
366 mkdir -p ${CHROOTDIR}
367 @echo ">>> make release for ${TARGET} started on `LC_ALL=C TZ=GMT date`"
368 cd ${WORLDDIR} && ${NATIVEMAKE} -DWITHOUT_GAMES -DWITHOUT_HTML -DWITHOUT_LIB32 \
369 -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_PROFILE installworld DESTDIR=${CHROOTDIR}
370 cd ${WORLDDIR} && ${NATIVEMAKE} distribution DESTDIR=${CHROOTDIR}
371 if [ -f /etc/resolv.conf ]; then \
372 cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \
374 .if defined(EXTLOCALDIR)
375 rm -rf ${CHROOTDIR}/usr/local
376 cd ${CHROOTDIR}/usr && cp -R -H ${EXTLOCALDIR} local
378 rm -rf ${CHROOTDIR}/usr/src
379 .if defined(EXTSRCDIR)
380 cd ${CHROOTDIR}/usr && \
381 cp -R -H ${EXTSRCDIR} src
383 cd ${CHROOTDIR}/usr && \
384 ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
385 co ${CVSCMDARGS} ${CVS_SRCARGS} ${RELEASESRCMODULE}
387 .if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES)
388 .for p in ${LOCAL_PATCHES}
389 patch -d ${CHROOTDIR}/usr/${RELEASESRCMODULE} ${PATCH_FLAGS} < ${p}
392 .if defined(LOCAL_SCRIPT)
393 cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} \
394 RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT}
396 rm -rf ${CHROOTDIR}/usr/ports
397 .if !defined(NOPORTSATALL)
398 .if defined(EXTPORTSDIR)
399 cd ${CHROOTDIR}/usr && cp -R -H ${EXTPORTSDIR} ports
400 # If there are distfiles downloaded removing them
401 rm -rf ports/distfiles/*
403 cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
404 co ${CVSCMDARGS} ${CVS_PORTSARGS} ${RELEASEPORTSMODULE}
408 rm -rf ${CHROOTDIR}/usr/doc
409 .if defined(EXTDOCDIR)
410 cd ${CHROOTDIR}/usr && cp -R -H ${EXTDOCDIR} doc
412 cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
413 co ${CVSCMDARGS} ${CVS_DOCARGS} ${RELEASEDOCMODULE}
415 if [ -d ${RELEASEDISTFILES}/ ]; then \
416 cp -rp ${RELEASEDISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \
418 mkdir -p ${CHROOTDIR}/usr/ports/distfiles; \
420 .if !defined(NO_PREFETCHDISTFILES)
421 @cd ${.CURDIR} && ${MAKE} fetch-distfiles
426 .if !defined(RELEASENOUPDATE) && !defined(EXTSRCDIR)
427 .if !defined(RELEASETAG)
428 cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
429 update ${CVSCMDARGS} -P -d -A
431 cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
432 update ${CVSCMDARGS} -P -d -r ${RELEASETAG}
434 rm -f ${CHROOTDIR}/tmp/.world_done
435 .if !defined(NOPORTS) && !defined(EXTPORTSDIR)
436 cd ${CHROOTDIR}/usr/ports && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
437 update ${CVSCMDARGS} -P -d
438 rm -f ${CHROOTDIR}/tmp/.skip_ports_index
440 .if defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES"
441 for i in ${MINIMALDOCPORTS}; do \
442 ( cd ${CHROOTDIR}/usr/$$i && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
443 update ${CVSCMDARGS} -P -d ) ; \
447 cd ${CHROOTDIR}/usr/doc && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
448 update ${CVSCMDARGS} -P -d
452 # Add version information to those things that need it.
453 if [ ! -f ${CHROOTDIR}/tmp/.world_done ]; then \
454 cd ${CHROOTDIR}/usr/src/sys/conf && \
455 mv newvers.sh foo && \
456 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && \
459 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
460 echo "#!/bin/sh" > ${_MK}
461 echo "set -ex" >> ${_MK}
462 echo "trap 'umount /dev || true' 0" >> ${_MK}
463 echo "_RELTARGET=\$${1:-doRELEASE}" >> ${_MK}
465 AUTO_KEYBOARD_DETECT \
495 echo "export ${var}=\"${${var}}\"" >> ${_MK}
498 # Don't remove this, or the build will fall over!
499 echo "export RELEASEDIR=${_R}" >> ${_MK}
500 echo "export PATH=/bin:/usr/bin:/sbin:/usr/sbin:${LOCALDIR}" >> ${_MK}
501 echo "export MANBUILDCAT=YES" >> ${_MK}
502 # NB: these may fail if the host is running w/o devfs
503 echo "umount /dev >/dev/null 2>&1 || true" >> ${_MK}
504 echo "mount -t devfs devfs /dev >/dev/null 2>&1 || true" >> ${_MK}
505 echo "if [ ! -c /dev/null ]; then" >> ${_MK}
506 echo " echo /dev/null is not a device!" >> ${_MK}
507 echo " exit 1" >> ${_MK}
509 echo "if [ -x /etc/rc.d/ldconfig ]; then" >> ${_MK}
510 echo " /etc/rc.d/ldconfig start" >> ${_MK}
511 echo "else" >> ${_MK}
512 echo " ldconfig /lib /usr/lib /usr/local/lib || true" >> ${_MK}
514 echo "if [ ! -f /tmp/.world_done ]; then" >> ${_MK}
515 echo " cd /usr/src" >> ${_MK}
516 echo " ${CROSSMAKE} ${WORLD_FLAGS} -DNO_CLEAN buildworld && \\" >> ${_MK}
517 echo " touch /tmp/.world_done || exit 1" >> ${_MK}
519 echo "if [ ! -f /tmp/.skip_ports_index ]; then" >> ${_MK}
520 echo " echo \">>> make index started on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
521 echo " for i in ${MAKEINDEXPORTS}" >> ${_MK}
523 echo " cd /usr/ports/\$${i}" >> ${_MK}
524 echo " env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \\" >> ${_MK}
525 echo " make all install clean BATCH=yes FORCE_PKG_REGISTER=yes" >> ${_MK}
526 echo " done" >> ${_MK}
527 echo " cd /usr/ports" >> ${_MK}
528 echo " rm -f INDEX*" >> ${_MK}
529 echo " make index -DINDEX_PRISTINE" >> ${_MK}
530 echo " rm -f INDEX*.tmp" >> ${_MK}
531 echo " touch /tmp/.skip_ports_index" >> ${_MK}
532 echo " echo \">>> make index finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
534 echo "cd /usr/src/release" >> ${_MK}
535 echo "make obj" >> ${_MK}
536 echo "make \$${_RELTARGET}" >> ${_MK}
537 echo "echo \">>> make ${.TARGET} for ${TARGET} finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
540 touch ${CHROOTDIR}/tmp/.skip_ports_index
542 # Ensure md.ko is loaded if md(4) is not statically compiled into
544 -mdconfig 2>/dev/null
545 env -i /usr/sbin/chroot `dirname ${_MK}` /`basename ${_MK}`
548 rm -rf ${CRUNCH_TARGETS:S/$/_crunch/} release.[0-8] ${EXTRAS}
551 @for i in ${MAKEINDEXPORTS}; do \
552 cd ${CHROOTDIR}/usr/ports/$$i && \
553 make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \
554 checksum-recursive ; \
556 @for i in ${DOCPORTS}; do \
557 cd ${CHROOTDIR}/usr/ports/$$i && \
558 make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \
559 WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes \
560 checksum-recursive ; \
563 # Clean out ${_R} and make the directory structure.
566 -rm -rf ${_R}/* 2> /dev/null
567 -chflags -R noschg ${_R}/.
570 .if defined(MAKE_FLOPPIES)
574 for i in ${DISTRIBUTIONS}; do \
575 mkdir ${RD}/trees/$$i && \
576 mtree -deU -f ${MTREEFILES}/BSD.root.dist \
577 -p ${RD}/trees/$$i > /dev/null && \
578 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
579 -p ${RD}/trees/$$i/usr > /dev/null && \
580 mtree -deU -f ${MTREEFILES}/BSD.include.dist \
581 -p ${RD}/trees/$$i/usr/include > /dev/null && \
582 mtree -deU -f ${MTREEFILES}/BSD.var.dist \
583 -p ${RD}/trees/$$i/var > /dev/null ; \
586 for i in ${KERNELS_BASE} ${KERNELS}; do \
587 mkdir -p ${RD}/kernels/$${i}; \
591 # Install the system into the various distributions.
593 cd ${.CURDIR}/.. && ${CROSSMAKE} distrib-dirs DESTDIR=${RD}/trees/base
594 cd ${.CURDIR}/.. && ${CROSSMAKE} ${WORLD_FLAGS} distributeworld \
598 # Make and install the generic kernel(s).
600 .for kernel in ${KERNELS_BASE} ${KERNELS}
602 ${CROSSMAKE} ${KERNEL_FLAGS} \
603 KERNCONF=${kernel} kernel \
604 DESTDIR=${RD}/kernels KODIR=/${kernel}
608 # Make and install the three crunched binaries which live on the floppies.
609 # You are not supposed to like this :-)
612 mkdir -p ${RD}/crunch
613 .for j in ${CRUNCH_TARGETS}
614 .if exists(${.CURDIR}/${TARGET}/${j}_crunch.conf)
617 cd ${j}_crunch; ${WMAKEENV} MAKEFLAGS="-m ${.CURDIR}/../share/mk" \
619 ${.CURDIR}/${TARGET}/${j}_crunch.conf
620 cd ${j}_crunch; ${WMAKE} -f ${j}_crunch.mk subclean
621 cd ${.CURDIR}/..; ${BINMAKE} -f Makefile.inc1 _build-tools
622 cd ${j}_crunch; CFLAGS="-Os -pipe" ${WMAKE} -f ${j}_crunch.mk \
624 ${WMAKEENV} strip -R .comment ${j}_crunch/${j}_crunch
625 mv ${j}_crunch/${j}_crunch ${RD}/crunch/${j}
631 # --==## Fix up the distributions. ##==--
634 # Create any "synthetic dists" now.
635 @for i in ${DISTRIBUTIONS}; do \
636 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
637 echo -n "Running $$i dist creation script... "; \
638 env RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
643 # Remove all the directories we don't need.
645 (find ${OTHER_DISTS} -path '*/var/empty' | xargs chflags noschg; \
646 find ${OTHER_DISTS} -depth -type d -empty -print | xargs rmdir)
650 # --==## Package up the tarballs from assembled trees ##==--
655 @for i in ${DISTRIBUTIONS} ; \
657 if [ -d ${RD}/trees/$${i} ] ; then \
658 cd ${.CURDIR} && $(MAKE) doTARBALL \
659 SD=${RD}/trees/$${i} \
660 TN=$$i TD=$$i ARG="." && \
661 echo "$${i} distribution is finished."; \
664 @for i in ${KERNELS_BASE} ${KERNELS} ; \
666 if [ -d ${RD}/kernels/$${i} ] ; then \
667 cd ${.CURDIR} && $(MAKE) doTARBALL \
669 TN=$$i TD=kernels ARG="$$i" && \
670 echo "$${i} distribution is finished."; \
673 .if !defined(NOPORTS)
674 # XXX: Inline stripped version of doTARBALL
675 @rm -rf ${RD}/dists/ports/ports*
676 @mkdir -p ${RD}/dists/ports
677 @echo rolling ports/ports tarball
678 @tar --exclude CVS --exclude 'ports/distfiles/*' \
679 -czf ${RD}/dists/ports/ports.tgz -C /usr ports
680 @cp ${.CURDIR}/scripts/ports-install.sh ${RD}/dists/ports/install.sh
681 @(cd ${RD}/dists/ports; \
682 rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \
683 md5 * > .CHECKSUM.MD5; \
684 sha256 * > .CHECKSUM.SHA256; \
685 mv .CHECKSUM.MD5 CHECKSUM.MD5; \
686 mv .CHECKSUM.SHA256 CHECKSUM.SHA256)
687 @echo "ports distribution is finished."
693 # --==## Make source dists ##==--
697 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \
698 TD=src TN=sbase ARG="[A-Z]*"
699 @for i in `cd /usr/src && echo [a-z]*` ; do \
700 if [ -d /usr/src/$$i ] ; then \
701 cd ${.CURDIR} && $(MAKE) doTARBALL \
702 TN=`echo s$$i | tr -d '.' | \
704 -e 's/kerberos5/krb5/'` \
705 SD=/usr/src TD=src ARG="$$i" ; \
708 .if defined(EXTRA_SRC)
709 @set ${EXTRA_SRC} && \
710 while [ $$# -ge 2 ] ; do \
711 if [ -d /usr/src/$$1 ] ; then \
712 cd ${.CURDIR} && $(MAKE) doTARBALL \
713 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
714 fi && shift && shift ; \
717 (cd ${RD}/dists/src; \
718 rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \
719 md5 * > .CHECKSUM.MD5; \
720 sha256 * > .CHECKSUM.SHA256; \
721 mv .CHECKSUM.MD5 CHECKSUM.MD5; \
722 mv .CHECKSUM.SHA256 CHECKSUM.SHA256)
723 @echo "src distribution is finished."
727 # Build the memory root filesystem.
729 cp ${RD}/trees/base/etc/disktab /etc
733 mkdir -p etc/defaults dev mnt stand/etc/defaults stand/help \
735 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
736 DIR=${RD}/mfsfd/stand ZIP=false
737 ( cd ${RD}/mfsfd && \
738 for dir in bin sbin ; do \
739 ln -sf /stand $$dir; \
741 cp ${RD}/trees/base/sbin/dhclient-script ${RD}/mfsfd/stand
742 .if ${TARGET} == "pc98"
743 cp ${.CURDIR}/../etc/defaults/pccard.conf \
744 ${RD}/mfsfd/etc/defaults/pccard.conf
746 cp ${.CURDIR}/../etc/master.passwd ${RD}/mfsfd/etc/master.passwd
747 cp ${RD}/trees/base/etc/*pwd.db ${RD}/mfsfd/etc/
748 ( for F in defaults/rc.conf netconfig protocols ; do \
749 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \
750 ${RD}/trees/base/etc/$$F > ${RD}/mfsfd/stand/etc/$$F ; \
752 grep -E '^(ftp|nameserver|domain|sunrpc|cmd|nfsd)[^-\w]' \
753 ${RD}/trees/base/etc/services | \
754 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \
755 > ${RD}/mfsfd/stand/etc/services
756 grep 'operator' ${RD}/trees/base/etc/group \
757 > ${RD}/mfsfd/stand/etc/group
758 ln ${RD}/mfsfd/stand/etc/services ${RD}/mfsfd/etc/services
759 ln ${RD}/mfsfd/stand/etc/group ${RD}/mfsfd/etc/group
760 ln ${RD}/mfsfd/stand/etc/netconfig ${RD}/mfsfd/etc/netconfig
761 cp ${RD}/trees/base/COPYRIGHT ${RD}/mfsfd/stand/help/COPYRIGHT.hlp
763 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
764 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
765 ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
767 @for i in ${DIST_DOCS_ARCH_DEP}; do \
768 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
769 ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
771 @mv ${RD}/mfsfd/stand/help/INSTALLATION.TXT \
772 ${RD}/mfsfd/stand/help/INSTALL.TXT
774 -test -f ${.CURDIR}/install.cfg \
775 && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
776 @mkdir -p ${RD}/mfsfd/boot
777 .if ${TARGET_ARCH} != "ia64" && ${TARGET_ARCH} != "powerpc"
778 @cp ${RD}/trees/base/boot/boot* ${RD}/mfsfd/boot
780 .if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64"
781 @cp ${RD}/trees/base/boot/mbr ${RD}/mfsfd/boot
783 @tar --exclude CVS -cf - -C ${.CURDIR}/../usr.sbin/sysinstall help | \
784 tar xf - -C ${RD}/mfsfd/stand
785 @mkdir -p ${RD}/mfsroot
786 sh -e ${DOFS_SH} ${RD}/mfsroot/mfsroot ${RD} ${MNT} \
787 ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL}
788 @gzip -9fnv ${RD}/mfsroot/mfsroot
791 KERNFLOPPYSET= ${RD}/floppyset/kern/kernel.gz
792 .if defined(SMALLFLOPPYSIZE)
793 SMALLKERNFLOPPYSET= ${RD}/floppyset/kern-small/kernel.gz
795 .if defined(SPLIT_MFSROOT)
796 MFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot/mfsroot.gz
797 .if defined(SMALLFLOPPYSIZE)
798 SMALLMFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot-small/mfsroot.gz
802 # Build boot and install floppies.
804 @gzip -9nc ${RD}/kernels/GENERIC/kernel > ${RD}/kernels/kernel.gz
805 @echo "Making the kernel boot floppies..."
806 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern \
807 FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz
808 .if defined(SMALLFLOPPYSIZE)
809 @echo "Making the small kernel boot floppies..."
810 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern-small \
811 FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz \
814 .if defined(SPLIT_MFSROOT)
815 @echo "Making the mfsroot boot floppies..."
816 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot \
817 FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz
818 .if defined(SMALLFLOPPYSIZE)
819 @echo "Making the small mfsroot boot floppies..."
820 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot-small \
821 FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz \
824 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \
825 KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \
826 MFSROOTFILE="${MFSROOTFLOPPYSET}.split ${MFSROOTFLOPPYSET}.boot"
827 .if defined(SMALLFLOPPYSIZE)
828 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \
829 KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \
830 MFSROOTFILE="${SMALLMFSROOTFLOPPYSET}.split ${SMALLMFSROOTFLOPPYSET}.boot" \
833 .else # !SPLIT_MFSROOT
834 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \
835 KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \
836 MFSROOTFILE=${RD}/mfsroot/mfsroot.gz
837 .if defined(SMALLFLOPPYSIZE)
838 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \
839 KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \
840 MFSROOTFILE=${RD}/mfsroot/mfsroot.gz \
843 .endif # SPLIT_MFSROOT
846 # Build fixit floppy.
848 @echo "Making fixit floppy."
849 @rm -rf ${RD}/fixitfd
851 @cd ${RD}/fixitfd && \
852 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
854 @cp ${RD}/trees/base/etc/spwd.db ${RD}/trees/base/etc/group \
856 @sed -e 's/#.*//' ${RD}/trees/base/etc/protocols \
857 > ${RD}/fixitfd/etc/protocols
858 @sed -e 's/#.*//' ${RD}/trees/base/usr/share/misc/scsi_modes \
859 > ${RD}/fixitfd/usr/share/misc/scsi_modes
860 @cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
861 @cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
862 @cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar
863 @chmod 555 ${RD}/fixitfd/stand/tar
864 .if defined(SMALLFLOPPYSIZE)
865 @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit-small \
866 DIR=${RD}/fixitfd/stand ZIP=false
867 @sh -e ${DOFS_SH} ${RD}/floppies/fixit-small.flp ${RD} ${MNT} \
868 ${SMALLFLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${SMALLFLOPPYLABEL}
869 @rm -rf ${RD}/fixitfd/stand
870 @mkdir ${RD}/fixitfd/stand
872 @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit \
873 DIR=${RD}/fixitfd/stand ZIP=false
874 @sh -e ${DOFS_SH} ${RD}/floppies/fixit.flp ${RD} ${MNT} \
875 ${FLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${FLOPPYLABEL}
878 # Do our last minute floppies directory setup
881 @cp ${RND}/${RELNOTES_LANG}/installation/${TARGET}/article.txt \
882 ${RD}/floppies/README.TXT
883 @(cd ${RD}/floppies; md5 README.TXT *.flp > CHECKSUM.MD5)
884 @(cd ${RD}/floppies; sha256 README.TXT *.flp > CHECKSUM.SHA256)
886 @(cd ${RD}/floppies; md5 *.flp > CHECKSUM.MD5)
887 @(cd ${RD}/floppies; sha256 *.flp > CHECKSUM.SHA256)
892 # --==## Setup a suitable ftp-area ##==--
895 @echo "Setting up FTP distribution area"
897 -@ln -s . ${FD}/${BUILDNAME}
898 .if defined(MAKE_FLOPPIES)
899 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
901 @cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
903 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
904 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
905 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
906 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
907 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
909 @for i in ${DIST_DOCS_ARCH_DEP}; do \
910 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
911 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
912 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
913 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
915 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${FD}
916 @mv ${FD}/INSTALLATION.TXT ${FD}/INSTALL.TXT
917 @mv ${FD}/INSTALLATION.HTM ${FD}/INSTALL.HTM
919 @echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
922 # Build a live filesystem cdrom image
924 @echo "Building CDROM live filesystem image"
925 @mkdir -p ${CD_LIVEFS}
926 @for i in ${DISTRIBUTIONS} ; \
928 if [ -d ${RD}/trees/$${i} ] ; then \
929 chflags -R noschg ${RD}/trees/$${i} || true ; \
930 ( cd ${RD}/trees/$${i} && \
931 find . -depth -print | cpio -dumpl ${CD_LIVEFS} ) ; \
934 @echo "Copy GENERIC kernel to boot area"
935 @cp -Rp ${RD}/kernels/GENERIC/ ${CD_LIVEFS}/boot/kernel
936 @rm -f ${CD_LIVEFS}/.profile
937 @cp ${.CURDIR}/fixit.profile ${CD_LIVEFS}/.profile
938 @ln -sf /rescue ${CD_LIVEFS}/stand
939 @echo "Setting up CDROM boot area"
940 @rm -f ${CD_LIVEFS}/boot/loader.conf
941 @cp ${RD}/mfsroot/mfsroot.gz ${CD_LIVEFS}/boot/mfsroot.gz
942 @echo 'mfsroot_load="YES"' > ${CD_LIVEFS}/boot/loader.conf
943 @echo 'mfsroot_type="mfs_root"' >> ${CD_LIVEFS}/boot/loader.conf
944 @echo 'mfsroot_name="/boot/mfsroot"' >> ${CD_LIVEFS}/boot/loader.conf
945 .if exists(${RD}/trees/base/boot/device.hints)
946 # Break the link to device.hints so we can modify it
947 @rm -f ${CD_LIVEFS}/boot/device.hints
948 @cp ${RD}/trees/base/boot/device.hints ${CD_LIVEFS}/boot/device.hints
950 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_LIVEFS}/cdrom.inf
953 # Build disc1 and disc2 cdrom images
955 @echo "Building CDROM disc1 filesystem image"
956 @mkdir -p ${CD_DISC1}/${BUILDNAME}
957 .if defined(MAKE_FLOPPIES)
958 @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
960 @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}/${BUILDNAME}
962 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
963 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
964 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
965 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
966 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
968 @for i in ${DIST_DOCS_ARCH_DEP}; do \
969 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
970 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
971 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
972 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
974 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DISC1}
975 @mv ${CD_DISC1}/INSTALLATION.TXT ${CD_DISC1}/INSTALL.TXT
976 @mv ${CD_DISC1}/INSTALLATION.HTM ${CD_DISC1}/INSTALL.HTM
978 .if defined(SEPARATE_LIVEFS)
979 @cp -Rp ${CD_LIVEFS}/boot ${CD_DISC1}
980 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
982 @echo "CD_VOLUME = 1" >> ${CD_DISC1}/cdrom.inf
983 @echo "Building CDROM disc2 filesystem image"
984 @mkdir -p ${CD_DISC2}
985 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
986 @echo "CD_VOLUME = 2" >> ${CD_DISC2}/cdrom.inf
988 echo "Building CDROM docs filesystem image"
990 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DOCS}/cdrom.inf
991 @mkdir -p ${CD_DOCS}/usr/share/doc
992 @for i in `ls ${CD_LIVEFS}/usr/share/doc`; do \
993 if [ -L ${CD_LIVEFS}/usr/share/doc/$$i -o \
994 -d /usr/doc/$$i ]; then \
995 mv ${CD_LIVEFS}/usr/share/doc/$$i \
996 ${CD_DOCS}/usr/share/doc; \
1003 # --==## Setup a suitable cdrom-area ##==--
1006 .if defined(CD_BOOT)
1007 @echo "Building bootonly CDROM filesystem image"
1008 @mkdir -p ${CD_BOOT}
1009 @cp -Rp ${CD_LIVEFS}/boot ${CD_BOOT}
1010 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_BOOT}/cdrom.inf
1011 .if defined(MINIROOT)
1012 @echo "Building bootonly UFS filesystem image"
1013 @mkdir -p ${FD}/miniroot
1014 @sh -e ${DOFS_SH} ${FD}/miniroot/miniroot.ufs \
1015 ${RD} ${MNT} 0 ${CD_BOOT} 8192 auto
1016 @gzip -9v ${FD}/miniroot/miniroot.ufs
1022 .if defined(CD_PACKAGE_TREE)
1023 .if exists(${CD_PACKAGE_TREE}/disc1)
1024 CD_DISC1_PKGS= ${CD_PACKAGE_TREE}/disc1
1026 .if exists(${CD_PACKAGE_TREE}/disc2)
1027 CD_DISC2_PKGS= ${CD_PACKAGE_TREE}/disc2
1033 .if exists(${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh)
1034 @echo "Creating ISO images..."
1035 .if defined(CD_BOOT)
1036 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
1038 ${CD}/${BUILDNAME}-${TARGET}-bootonly.iso ${CD_BOOT}
1040 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
1042 ${CD}/${BUILDNAME}-${TARGET}-disc1.iso ${CD_DISC1} \
1044 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \
1046 ${CD}/${BUILDNAME}-${TARGET}-disc2.iso ${CD_DISC2} \
1049 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \
1050 FreeBSD_Documentation \
1051 ${CD}/${BUILDNAME}-${TARGET}-docs.iso ${CD_DOCS}
1053 .if defined(SEPARATE_LIVEFS)
1054 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
1056 ${CD}/${BUILDNAME}-${TARGET}-livefs.iso ${CD_LIVEFS}
1058 @echo "Generating MD5 and SHA256 sums..."
1059 @(cd ${CD} && md5 *.iso > ${BUILDNAME}-${TARGET}-iso.CHECKSUM.MD5)
1060 @(cd ${CD} && sha256 *.iso > ${BUILDNAME}-${TARGET}-iso.CHECKSUM.SHA256)
1063 @echo "Do not know how to create an ISO for ${TARGET_ARCH}."
1067 # --==## Documentation Project files such as the Handbook and FAQ ##==--
1070 @echo "Making docs..."
1071 @for i in ${DOCPORTS}; do \
1072 cd /usr/ports/$$i && \
1073 env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \
1074 make all install clean BATCH=yes WITHOUT_X11=yes JADETEX=no \
1075 WITHOUT_PYTHON=yes FORCE_PKG_REGISTER=yes; \
1077 @cd /usr/doc && make all install 'FORMATS=html html-split txt' \
1078 INSTALL_COMPRESSED='' DOCDIR=${RD}/trees/base/usr/share/doc \
1083 # --==## RELNOTESng: Next-generation replacements for *.TXT files ##==--
1086 @echo "Making release documentation..."
1087 @cd ${.CURDIR}/doc && make all install clean 'FORMATS=html txt' \
1088 INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${RND}
1091 # Various "subroutine" and other supporting targets.
1099 @echo "SD undefined in doTARBALL" && exit 1
1102 @echo "TD undefined in doTARBALL" && exit 1
1105 @echo "ARG undefined in doTARBALL" && exit 1
1107 @rm -rf ${RD}/dists/${TD}/${TN}*
1108 @mkdir -p ${RD}/dists/${TD}
1110 tn=`echo ${TN} | tr 'A-Z' 'a-z'` && \
1111 echo rolling ${TD}/$$tn tarball &&\
1112 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
1113 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
1114 sh ${.CURDIR}/scripts/info.sh ${RD}/dists/${TD}/$$tn \
1115 > ${RD}/dists/${TD}/$$tn.inf && \
1116 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
1117 cp -p ${.CURDIR}/scripts/$${TD}-install.sh \
1118 ${RD}/dists/${TD}/install.sh && \
1119 chmod +x ${RD}/dists/${TD}/install.sh; \
1121 if [ "${SD}" != "/usr/src" ]; then \
1122 mtree -c -i -p ${SD}/${ARG} \
1123 -k gname,md5digest,mode,nlink,uname,size,link,type \
1124 > ${RD}/dists/${TD}/$$tn.mtree ; \
1128 ( cd ${RD}/dists/${TD}; \
1129 rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \
1130 md5 * > .CHECKSUM.MD5; \
1131 sha256 * > .CHECKSUM.SHA256; \
1132 mv .CHECKSUM.MD5 CHECKSUM.MD5; \
1133 mv .CHECKSUM.SHA256 CHECKSUM.SHA256) \
1136 doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 \
1137 release.5 release.6 release.7 release.8 ${EXTRAS}
1138 @echo "Release done"
1141 @rm -f release.4 release.8 floppies.[123]
1142 @cd ${.CURDIR} && ${MAKE} release.4 release.8 floppies.1 floppies.2 \
1144 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
1147 .if !defined(CRUNCH)
1148 @echo "CRUNCH undefined in installCRUNCH" && exit 1
1151 @echo "DIR undefined in installCRUNCH" && exit 1
1154 @echo "ZIP undefined in installCRUNCH" && exit 1
1157 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
1159 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
1161 @chmod 555 ${DIR}/${CRUNCH}_crunch
1162 @if [ -f ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf ] ; then \
1163 for i in `crunchgen -l ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf` ; do \
1164 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
1167 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
1168 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
1173 # --==## Build a floppy set for a splitfs file ##==--
1175 # FLOPPYBASE - basename of floppy image files
1176 # FLOPPYDESC - description of floppy set
1177 # SPLITFILE - filename of the file to split
1178 # FDSIZE - if specified and "small", small floppy is created
1180 .if make(makeFloppySet)
1181 SPLITDIR= ${RD}/floppyset/${FLOPPYBASE}
1182 .if defined(FDSIZE) && ${FDSIZE} == "SMALL"
1183 FLPSPLITSIZE= ${SMALLFLOPPYSPLITSIZE}
1184 FLPSIZE= ${SMALLFLOPPYSIZE}
1185 FLPLABEL= ${SMALLFLOPPYLABEL}
1187 FLPSPLITSIZE= ${FLOPPYSPLITSIZE}
1188 FLPSIZE= ${FLOPPYSIZE}
1189 FLPLABEL= ${FLOPPYLABEL}
1194 .if !defined(FLOPPYBASE)
1195 @echo "FLOPPYBASE undefined in ${.TARGET}" && exit 1
1197 .if !defined(FLOPPYDESC)
1198 @echo "FLOPPYDESC undefined in ${.TARGET}" && exit 1
1200 .if !defined(SPLITFILE)
1201 @echo "SPLITFILE undefined in ${.TARGET}" && exit 1
1203 sh ${.CURDIR}/scripts/split-file.sh ${SPLITFILE} \
1204 ${RD}/floppyset/${FLOPPYBASE} ${FLPSPLITSIZE} "${FLOPPYDESC}"
1205 ( splitfile=${SPLITDIR}/`basename ${SPLITFILE}`.split ; \
1206 lines=`cat $${splitfile} | wc -l`; \
1207 lines=$$(($$lines - 1)) ; \
1208 for line in `jot $$lines`; do \
1209 file=`head -n $$(($${line} + 1)) $${splitfile} | tail -1 | cut -f 1 -d ' '` ; \
1210 sh -e ${DOFS_SH} ${RD}/floppies/${FLOPPYBASE}$${line}.flp \
1211 ${RD} ${MNT} ${FLPSIZE} ${SPLITDIR}/$${file} \
1212 ${BOOTINODE} ${FLPLABEL}; \
1216 # --==## Build a boot floppy ##==--
1218 # FSIMAGE - base floppy image name
1219 # FDSIZE - if specified and "small", small floppy is created
1220 # KERNFILE - path to kernel split file
1221 # MFSROOTFILE - path to mfsroot split file
1223 .if make(buildBootFloppy)
1224 IMAGEDIR= ${RD}/image.${FSIMAGE}
1225 BOOTDIR= ${RD}/trees/base/boot
1226 HINTSFILE= ${BOOTDIR}/device.hints
1227 ACPI_KO= ${RD}/kernels/GENERIC/acpi.ko
1228 IMAGEFILE= ${RD}/floppies/${FSIMAGE}.flp
1229 .if defined(FDSIZE) && ${FDSIZE} == "SMALL"
1230 FLPSIZE= ${SMALLFLOPPYSIZE}
1231 FLPLABEL= ${SMALLFLOPPYLABEL}
1233 FLPSIZE= ${FLOPPYSIZE}
1234 FLPLABEL= ${FLOPPYLABEL}
1239 .if !defined(FSIMAGE)
1240 @echo "FSIMAGE undefined in ${.TARGET}" && exit 1
1242 .if !defined(KERNFILE)
1243 @echo "KERNFILE undefined in ${.TARGET}" && exit 1
1245 .if !defined(MFSROOTFILE)
1246 @echo "MFSROOTFILE undefined in ${.TARGET}" && exit 1
1248 @echo "Running ${.TARGET} for ${FSIMAGE}"
1251 @echo "Setting up /boot directory for ${FSIMAGE} floppy"
1252 @mkdir -p ${IMAGEDIR}/boot
1253 .if ${TARGET} == "i386"
1254 @${WMAKEENV} kgzip -v -l ${RD}/trees/base/usr/lib/kgzldr.o -o \
1255 ${IMAGEDIR}/boot/loader ${BOOTDIR}/loader
1257 @cp ${BOOTDIR}/loader ${IMAGEDIR}/boot
1259 @cp -Rp ${BOOTDIR}/*.4th ${BOOTDIR}/defaults ${BOOTDIR}/loader.help \
1260 ${BOOTDIR}/loader.rc ${IMAGEDIR}/boot
1261 .if exists(${HINTSFILE})
1262 @cp ${HINTSFILE} ${IMAGEDIR}/boot/device.hints
1263 @gzip -9n ${IMAGEDIR}/boot/device.hints
1265 @gzip -9n ${IMAGEDIR}/boot/*.4th ${IMAGEDIR}/boot/loader.help \
1266 ${IMAGEDIR}/boot/defaults/loader.conf
1267 @echo 'bootfile="/kernel"' > ${IMAGEDIR}/boot/loader.conf
1268 .if exists(${ACPI_KO})
1269 @gzip -9nc ${ACPI_KO} > ${IMAGEDIR}/acpi.ko.gz
1270 @echo 'acpi_load="YES"' >> ${IMAGEDIR}/boot/loader.conf
1271 @echo 'acpi_name="/acpi.ko"' >> ${IMAGEDIR}/boot/loader.conf
1272 @echo 'acpi_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
1274 @echo 'mfsroot_load="YES"' >> ${IMAGEDIR}/boot/loader.conf
1275 @echo 'mfsroot_type="mfs_root"' >> ${IMAGEDIR}/boot/loader.conf
1276 @echo 'mfsroot_name="/mfsroot"' >> ${IMAGEDIR}/boot/loader.conf
1277 .if !exists(${ACPI_KO})
1278 @echo 'mfsroot_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
1280 .if defined(SPLIT_MFSROOT)
1281 @echo 'mfsroot_after="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
1283 .if ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "amd64"
1284 .if ${AUTO_KEYBOARD_DETECT}
1285 @echo "-P" >> ${IMAGEDIR}/boot.config
1289 @cp ${KERNFILE} ${MFSROOTFILE} ${IMAGEDIR}
1290 sh -e ${DOFS_SH} ${IMAGEFILE} ${RD} ${MNT} ${FLPSIZE} ${IMAGEDIR} \
1291 ${BOOTINODE} ${FLPLABEL}
1292 @echo "Created ${RD}/floppies/${FSIMAGE}.flp"
1294 .if make(package-split)
1295 # Targets related to making a package split
1297 # PKG_COPY instructs the script to copy the actual package files rather than
1299 # PKG_TREE is the path to the package tree to be split
1300 # PKG_DEST is the path to the destination tree to create the split in
1301 # PKG_VERBOSE asks for verbose output of the layout process
1302 # PKG_INDEX is the path to the INDEX file. By default ${PKG_TREE}/INDEX.
1304 .if defined(PKG_COPY)
1309 PKG_WRKIDX= ${PKG_DEST}/INDEX.master
1311 .if defined(TARGET_ARCH)
1312 PKG_ENV+= PKG_ARCH=${TARGET_ARCH}
1314 .if defined(PKG_VERBOSE)
1315 PKG_ENV+= PKG_VERBOSE=1
1317 PKG_INDEX?= ${PKG_TREE}/INDEX
1320 .if !defined(PKG_TREE)
1321 @echo "PKG_TREE must be defined" && exit 1
1323 .if !defined(PKG_DEST)
1324 @echo "PKG_DEST must be defined" && exit 1
1326 @env ${PKG_ENV} python ${.CURDIR}/scripts/package-split.py \
1327 ${PKG_INDEX} ${PKG_WRKIDX}
1328 @env ${PKG_ENV} sh ${.CURDIR}/scripts/package-trees.sh ${PKG_DO_COPY} \
1329 ${PKG_WRKIDX} ${PKG_TREE} ${PKG_DEST}
1332 .include <bsd.obj.mk>