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=6.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 add other options to the CVS subcommands (co,up), set
39 #CVSCMDARGS="-D '01/01/2002 00:00:00 UTC'"
41 # To add other options to the CVS command, set
44 # To prefix the cvs command
45 #CVSPREFIX="/usr/bin/time"
47 # Where the CVS repository is
50 # Non-zero if ${RELEASETAG} is in the form "RELENG_ver_RELEASE"; we
51 # are building an official release. Otherwise, we are building for
53 .if defined(RELEASETAG)
54 ISRELEASE!= expr "${RELEASETAG}" : '^RELENG_.*_RELEASE$$' || true
56 # Convert "RELENG_ver_RELEASE" to "RELEASE_ver" for ports and doc trees.
57 AUXRELEASETAG!= echo ${RELEASETAG} | sed -e 's/^RELENG_/RELEASE_/' -e 's/_RELEASE$$//'
58 DOCRELEASETAG?= ${AUXRELEASETAG}
59 PORTSRELEASETAG?= ${AUXRELEASETAG}
63 # If you want to pass flags to the world build such as -j X, use
64 # WORLD_FLAGS. Similarly, you can specify make flags for kernel
65 # builds via KERNEL_FLAGS.
69 TARGET_ARCH?= ${MACHINE_ARCH}
70 .if ${TARGET_ARCH} == ${MACHINE_ARCH}
73 TARGET?= ${TARGET_ARCH}
75 CROSSENV= TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}
76 CROSSMAKE= ${MAKE} ${CROSSENV}
77 NATIVEMAKE= ${MAKE} TARGET_ARCH=${MACHINE_ARCH} TARGET=${MACHINE}
79 # If you are using a local CVS repository with components stored in
80 # non-standard modules, override these on the make commandline or
82 RELEASESRCMODULE?= src
83 RELEASEDOCMODULE?= doc
84 RELEASEPORTSMODULE?= ports
86 # Uncomment this to disable the doc.1 target. Docs normally require
87 # the ports tree, so NOPORTS can be set together with NODOC in order
88 # to have neither ports or docs. If only NOPORTS is set to YES, but
89 # docs are still desired, the DOMINIMALDOCPORTS logic below will only
90 # install the ports that are minimally required for the docs. This is
91 # intended as a compromise, less disk space is required than for using
92 # the entire ports collection (and much less time due to the huge number
93 # of directories it would create), but still quite a bit as well as some
94 # CPU cycles (some of the programs are C++, and things like ghostscript
95 # belong to the required ports nevertheless).
97 # Setting this also disables building of release note documentation
102 # When retrieving ports using the pkg_add -r method, set your proxies to these.
103 # src/release/${arch}/mkisoimages.sh can use these.
104 #HTTP_PROXY?= www.example.com
105 #FTP_PROXY?= ftp.example.com
107 # When creating ISO images, point ${CD_PACKAGE_TREE} to a directory containing
108 # the package split by an earlier invocation of the 'package-split' target.
109 #CD_PACKAGE_TREE= /path/to/pkg
111 # Extra source tarballs; each argument is a pair of source dir and
112 # distribution name. The dist name should not exceed 7 characters
113 # (another "s" for "source" will be prepended).
114 #EXTRA_SRC= games/fortune fortune
116 # Modify this definition if you want the release notes
117 # and other release documentation in a language other than English.
118 RELNOTES_LANG?= en_US.ISO8859-1
120 # As an alternative to installing the entire ports collection (which
121 # can take a huge amount of time, in particular on slower disks),
122 # setting ${MINIMALDOCPORTS} allows to install and build just those
123 # ports that are really required for getting the docs up & running.
124 .if defined(NOPORTS) && !defined(NODOC)
125 DOMINIMALDOCPORTS= YES
126 .include "Makefile.inc.docports"
127 RELEASEPORTSMODULE= ${MINIMALDOCPORTS}
132 .if !defined(DOMINIMALDOCPORTS) || ${DOMINIMALDOCPORTS} != "YES"
138 # Doing 'make index' in /usr/ports requires Perl.
139 MAKEINDEXPORTS= lang/perl5.8
140 # By default, documentation (Handbook, FAQ, etc.) is built for all
141 # the languages. To speed up building, set the DOC_LANG to just
142 # the languages you need. (The language for the release notes is
143 # controlled by the RELNOTES_LANG variable above.)
144 #DOC_LANG= en_US.ISO8859-1
145 DOCPORTS= textproc/docproj
146 # Set this to wherever the distfiles required by release procedures.
147 .if defined(DOCDISTFILES)
148 # Respect DOCDISTFILES which is used before.
149 RELEASEDISTFILES?= ${DOCDISTFILES}
151 RELEASEDISTFILES?= ${.CURDIR}/../../ports/distfiles
153 # Set this to 1 if you want -P to be used for automatic keyboard detection
154 # on the boot floppy. WARNING: Breaks on some Athlon (K7) motherboards.
155 AUTO_KEYBOARD_DETECT?= 0
158 DIST_DOCS_ARCH_INDEP= readme errata
159 DIST_DOCS_ARCH_DEP= installation relnotes hardware
162 # Things which without too much trouble can be considered variables
163 # BASE_DISTS are special in that they get full /etc installation sets.
165 OTHER_DISTS?= catpages manpages games proflibs dict info doc
167 DISTRIBUTIONS?= ${BASE_DISTS} ${OTHER_DISTS}
169 # mountpoint for filesystems.
172 # Various floppy image parameters.
176 .if ${TARGET_ARCH} == "i386"
178 .if ${TARGET} == "pc98"
179 SMALLFLOPPYSIZE= 1200
180 SMALLFLOPPYSPLITSIZE= 1152
181 SMALLFLOPPYLABEL= fd1200
185 FLOPPYSPLITSIZE= 1392
192 .elif ${TARGET_ARCH} == "alpha"
195 FLOPPYSPLITSIZE= 1392
203 .elif ${TARGET_ARCH} == "sparc64"
209 .elif ${TARGET_ARCH} == "ia64"
214 .elif ${TARGET_ARCH} == "amd64"
218 .elif ${TARGET_ARCH} == "powerpc"
224 .if defined(NO_FLOPPIES)
228 .if exists(/sbin/bsdlabel)
231 DISKLABEL?= disklabel
234 ZIPNSPLIT= gzip --no-name -9 -c | split -b 1392k -
236 # Things which may get you into trouble if you change them
237 MTREEFILES= ${.CURDIR}/../etc/mtree
240 RND= ${RD}/release.doc
243 .if ${TARGET} != "pc98"
244 CD_BOOT= ${CD}/bootonly
246 CD_DISC1= ${CD}/disc1
247 CD_DISC2= ${CD}/disc2
248 .if defined(SEPARATE_LIVEFS)
249 CD_LIVEFS= ${CD}/livefs
251 CD_LIVEFS= ${CD_DISC1}
253 _MK?= ${CHROOTDIR}/mk
255 # Where the bootstrap ports (see DOCPORTS) get installed.
256 LOCALDIR= /usr/local/bin
258 .if ${TARGET} != ${MACHINE} && ${DISKLABEL} == "bsdlabel"
259 DOFS_SH= ${.CURDIR}/scripts/doFS.sh ${DISKLABEL} ${TARGET}
261 DOFS_SH= ${.CURDIR}/scripts/doFS.sh ${DISKLABEL} ""
265 .if ${TARGET_ARCH} == "i386"
266 CRUNCH_TARGETS+=fixit
267 .if ${TARGET} == "pc98"
268 CRUNCH_TARGETS+=fixit-small
272 .if defined(MAKE_FLOPPIES)
274 .if ${TARGET_ARCH} == "i386"
280 .if !defined(NOCDROM)
281 EXTRAS+= cdrom.1 cdrom.2 cdrom.3
282 .if defined(MAKE_ISOS)
285 .if ${TARGET} == "pc98"
296 .if !make(release) && !make(rerelease) && !make(package-split)
297 BINMAKE!= cd ${.CURDIR}/..; ${MAKE} -V BINMAKE
298 WMAKEENV!= cd ${.CURDIR}/..; \
299 ${BINMAKE} ${CROSSENV} -f Makefile.inc1 -V WMAKEENV
300 WMAKE= ${WMAKEENV} ${BINMAKE}
304 .if defined(RELEASETAG)
305 CVS_SRCARGS+= -r ${RELEASETAG}
309 .if defined(DOCRELEASETAG)
310 CVS_DOCARGS+= -r ${DOCRELEASETAG}
314 .if defined(PORTSRELEASETAG)
315 CVS_PORTSARGS+= -r ${PORTSRELEASETAG}
318 WORLDDIR?= ${.CURDIR}/..
321 .if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT)
322 @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false
324 .if defined(NOPORTSATALL) && !defined(NODOC)
325 @echo "Ports are required for building the docs. Either set NODOC or"
326 @echo "unset NOPORTS, or set at least DOMINIMALDOCPORTS to YES!"
329 .if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES)
330 .for p in ${LOCAL_PATCHES}
332 @echo "The patch file ${p} does not exist!"
337 .if defined(LOCAL_SCRIPT) && !exists(${LOCAL_SCRIPT})
338 @echo "The local script ${LOCAL_SCRIPT} does not exist!"
342 .if exists(${CHROOTDIR})
343 # The first command will fail on a handful of files that have their schg
344 # flags set. But it greatly speeds up the next two commands.
345 # NB: clear any vestigial devfs mount, just in case
346 -umount ${CHROOTDIR}/dev > /dev/null 2>&1
347 -rm -rf ${CHROOTDIR} 2>/dev/null
348 -chflags -R 0 ${CHROOTDIR}/.
351 mkdir -p ${CHROOTDIR}
352 @echo ">>> make release for ${TARGET} started on `LC_ALL=C TZ=GMT date`"
353 cd ${WORLDDIR} && ${NATIVEMAKE} -DNO_GAMES -DNO_HTML -DNO_INFO -DNO_MAN \
354 -DNO_PROFILE installworld DESTDIR=${CHROOTDIR}
355 cd ${WORLDDIR} && ${NATIVEMAKE} distribution DESTDIR=${CHROOTDIR}
356 if [ -f /etc/resolv.conf ]; then \
357 cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \
359 .if defined(EXTLOCALDIR)
360 rm -rf ${CHROOTDIR}/usr/local
361 cd ${CHROOTDIR}/usr && cp -R -H ${EXTLOCALDIR} local
363 rm -rf ${CHROOTDIR}/usr/src
364 .if defined(EXTSRCDIR)
365 cd ${CHROOTDIR}/usr && \
366 cp -R -H ${EXTSRCDIR} src
368 cd ${CHROOTDIR}/usr && \
369 ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
370 co ${CVSCMDARGS} ${CVS_SRCARGS} ${RELEASESRCMODULE}
372 .if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES)
373 .for p in ${LOCAL_PATCHES}
374 patch -d ${CHROOTDIR}/usr/${RELEASESRCMODULE} ${PATCH_FLAGS} < ${p}
377 .if defined(LOCAL_SCRIPT)
378 cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} \
379 RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT}
381 rm -rf ${CHROOTDIR}/usr/ports
382 .if !defined(NOPORTSATALL)
383 cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
384 co ${CVSCMDARGS} ${CVS_PORTSARGS} ${RELEASEPORTSMODULE}
387 rm -rf ${CHROOTDIR}/usr/doc
388 .if defined(EXTDOCDIR)
389 cd ${CHROOTDIR}/usr && cp -R -H ${EXTDOCDIR} doc
391 cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
392 co ${CVSCMDARGS} ${CVS_DOCARGS} ${RELEASEDOCMODULE}
394 if [ -d ${RELEASEDISTFILES}/ ]; then \
395 cp -rp ${RELEASEDISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \
397 mkdir -p ${CHROOTDIR}/usr/ports/distfiles; \
399 .if !defined(NO_PREFETCHDISTFILES)
400 @cd ${.CURDIR} && ${MAKE} fetch-distfiles
405 .if !defined(RELEASENOUPDATE)
406 .if !defined(RELEASETAG)
407 cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
408 update ${CVSCMDARGS} -P -d -A
410 cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
411 update ${CVSCMDARGS} -P -d -r ${RELEASETAG}
413 rm -f ${CHROOTDIR}/tmp/.world_done
414 .if !defined(NOPORTS)
415 cd ${CHROOTDIR}/usr/ports && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
416 update ${CVSCMDARGS} -P -d
417 rm -f ${CHROOTDIR}/tmp/.skip_ports_index
419 .if defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES"
420 for i in ${MINIMALDOCPORTS}; do \
421 ( cd ${CHROOTDIR}/usr/$$i && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
422 update ${CVSCMDARGS} -P -d ) ; \
426 cd ${CHROOTDIR}/usr/doc && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
427 update ${CVSCMDARGS} -P -d
431 # Add version information to those things that need it.
432 if [ ! -f ${CHROOTDIR}/tmp/.world_done ]; then \
433 cd ${CHROOTDIR}/usr/src/sys/conf && \
434 mv newvers.sh foo && \
435 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && \
438 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
439 echo "#!/bin/sh" > ${_MK}
440 echo "set -ex" >> ${_MK}
441 echo "trap 'umount /dev || true' 0" >> ${_MK}
442 echo "_RELTARGET=\$${1:-doRELEASE}" >> ${_MK}
444 AUTO_KEYBOARD_DETECT \
474 echo "export ${var}=\"${${var}}\"" >> ${_MK}
477 # Don't remove this, or the build will fall over!
478 echo "export RELEASEDIR=${_R}" >> ${_MK}
479 echo "export PATH=/bin:/usr/bin:/sbin:/usr/sbin:${LOCALDIR}" >> ${_MK}
480 echo "export MANBUILDCAT=YES" >> ${_MK}
481 # NB: these may fail if the host is running w/o devfs
482 echo "umount /dev >/dev/null 2>&1 || true" >> ${_MK}
483 echo "mount -t devfs devfs /dev >/dev/null 2>&1 || true" >> ${_MK}
484 echo "if [ -x /etc/rc.d/ldconfig ]; then" >> ${_MK}
485 echo " /etc/rc.d/ldconfig start" >> ${_MK}
486 echo "else" >> ${_MK}
487 echo " ldconfig /lib /usr/lib /usr/local/lib || true" >> ${_MK}
489 echo "if [ ! -f /tmp/.world_done ]; then" >> ${_MK}
490 echo " cd /usr/src" >> ${_MK}
491 echo " ${CROSSMAKE} ${WORLD_FLAGS} -DNO_CLEAN buildworld && \\" >> ${_MK}
492 echo " touch /tmp/.world_done || exit 1" >> ${_MK}
494 echo "if [ ! -f /tmp/.skip_ports_index ]; then" >> ${_MK}
495 echo " echo \">>> make index started on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
496 echo " for i in ${MAKEINDEXPORTS}" >> ${_MK}
498 echo " cd /usr/ports/\$${i}" >> ${_MK}
499 echo " env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \\" >> ${_MK}
500 echo " make all install clean BATCH=yes FORCE_PKG_REGISTER=yes" >> ${_MK}
501 echo " done" >> ${_MK}
502 echo " cd /usr/ports" >> ${_MK}
503 echo " rm -f INDEX*" >> ${_MK}
504 echo " make index -DINDEX_PRISTINE" >> ${_MK}
505 echo " rm -f INDEX*.tmp" >> ${_MK}
506 echo " touch /tmp/.skip_ports_index" >> ${_MK}
507 echo " echo \">>> make index finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
509 echo "cd /usr/src/release" >> ${_MK}
510 echo "make obj" >> ${_MK}
511 echo "make \$${_RELTARGET}" >> ${_MK}
512 echo "echo \">>> make ${.TARGET} for ${TARGET} finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
515 touch ${CHROOTDIR}/tmp/.skip_ports_index
517 # Ensure md.ko is loaded if md(4) is not statically compiled into
519 -mdconfig 2>/dev/null
520 env -i /usr/sbin/chroot `dirname ${_MK}` /`basename ${_MK}`
523 rm -rf ${CRUNCH_TARGETS:S/$/_crunch/} release.[0-8] ${EXTRAS}
526 @for i in ${MAKEINDEXPORTS}; do \
527 cd ${CHROOTDIR}/usr/ports/$$i && \
528 make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \
529 checksum-recursive ; \
531 @for i in ${DOCPORTS}; do \
532 cd ${CHROOTDIR}/usr/ports/$$i && \
533 make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \
534 WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes \
535 checksum-recursive ; \
538 # Clean out ${_R} and make the directory structure.
541 -rm -rf ${_R}/* 2> /dev/null
542 -chflags -R noschg ${_R}/.
545 .if defined(MAKE_FLOPPIES)
550 for i in ${DISTRIBUTIONS}; do \
551 mkdir ${RD}/trees/$$i && \
552 mtree -deU -f ${MTREEFILES}/BSD.root.dist \
553 -p ${RD}/trees/$$i > /dev/null && \
554 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
555 -p ${RD}/trees/$$i/usr > /dev/null && \
556 mtree -deU -f ${MTREEFILES}/BSD.include.dist \
557 -p ${RD}/trees/$$i/usr/include > /dev/null && \
558 mtree -deU -f ${MTREEFILES}/BSD.var.dist \
559 -p ${RD}/trees/$$i/var > /dev/null ; \
563 # Install the system into the various distributions.
565 cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/base
566 cd ${.CURDIR}/.. && ${CROSSMAKE} ${WORLD_FLAGS} distributeworld \
570 # Make and install the generic kernel(s).
572 .for kernel in ${KERNELS}
574 ${CROSSMAKE} ${KERNEL_FLAGS} -DNO_MODULES \
575 KERNCONF=${kernel} INSTKERNNAME=${kernel} kernel \
576 DESTDIR=${RD}/trees/base
578 # Install a standard boot kernel+modules.
580 ${CROSSMAKE} ${KERNEL_FLAGS} \
582 DESTDIR=${RD}/trees/base; \
584 ${CROSSMAKE} ${KERNEL_FLAGS} -DNO_MODULES \
585 reinstallkernel -DINSTALL_DEBUG \
586 DESTDIR=${RD}/trees/base
589 # Make and install the three crunched binaries which live on the floppies.
590 # You are not supposed to like this :-)
593 mkdir -p ${RD}/crunch
594 .for j in ${CRUNCH_TARGETS}
595 .if exists(${.CURDIR}/${TARGET}/${j}_crunch.conf)
598 cd ${j}_crunch; ${WMAKEENV} crunchgen -o \
599 ${.CURDIR}/${TARGET}/${j}_crunch.conf
600 cd ${j}_crunch; ${WMAKE} -f ${j}_crunch.mk subclean
601 cd ${.CURDIR}/..; ${BINMAKE} -f Makefile.inc1 _build-tools
602 cd ${j}_crunch; CFLAGS="-Os -pipe" ${WMAKE} -f ${j}_crunch.mk \
604 ${WMAKEENV} strip -R .comment ${j}_crunch/${j}_crunch
605 mv ${j}_crunch/${j}_crunch ${RD}/crunch/${j}
611 # --==## Fix up the distributions. ##==--
614 # Create any "synthetic dists" now.
615 @for i in ${DISTRIBUTIONS}; do \
616 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
617 echo -n "Running $$i dist creation script... "; \
618 env RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
623 # Remove all the directories we don't need.
625 find ${OTHER_DISTS} -depth -type d -print | xargs rmdir
629 # --==## Package up the tarballs from assembled trees ##==--
634 @for i in ${DISTRIBUTIONS} ; \
636 if [ -d ${RD}/trees/$${i} ] ; then \
637 cd ${.CURDIR} && $(MAKE) doTARBALL \
638 SD=${RD}/trees/$${i} \
639 TN=$$i TD=$$i ARG="." && \
640 echo "$${i} distribution is finished."; \
643 .if !defined(NOPORTS)
644 # XXX: Inline stripped version of doTARBALL
645 @rm -rf ${RD}/dists/ports/ports*
646 @mkdir -p ${RD}/dists/ports
647 @echo rolling ports/ports tarball
648 @tar --exclude CVS --exclude 'ports/distfiles/*' \
649 -czf ${RD}/dists/ports/ports.tgz -C /usr ports
650 @cp ${.CURDIR}/scripts/ports-install.sh ${RD}/dists/ports/install.sh
651 @(cd ${RD}/dists/ports; \
652 rm -f CHECKSUM.MD5; \
653 md5 * > CHECKSUM.MD5)
654 @echo "ports distribution is finished."
660 # --==## Make source dists ##==--
664 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \
665 TD=src TN=sbase ARG="[A-Z]*"
666 @for i in `cd /usr/src && echo [a-z]*` ; do \
667 if [ -d /usr/src/$$i ] ; then \
668 cd ${.CURDIR} && $(MAKE) doTARBALL \
669 TN=`echo s$$i | tr -d '.' | \
671 -e 's/kerberos5/krb5/'` \
672 SD=/usr/src TD=src ARG="$$i" ; \
675 .if defined(EXTRA_SRC)
676 @set ${EXTRA_SRC} && \
677 while [ $$# -ge 2 ] ; do \
678 if [ -d /usr/src/$$1 ] ; then \
679 cd ${.CURDIR} && $(MAKE) doTARBALL \
680 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
681 fi && shift && shift ; \
684 (cd ${RD}/dists/src; rm -f CHECKSUM.MD5; md5 * > CHECKSUM.MD5)
685 @echo "src distribution is finished."
689 # Build the memory root filesystem.
691 cp ${RD}/trees/base/etc/disktab /etc
695 mkdir -p etc/defaults dev mnt stand/etc/defaults stand/help
696 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
697 DIR=${RD}/mfsfd/stand ZIP=false
698 ( cd ${RD}/mfsfd && \
699 for dir in bin sbin ; do \
700 ln -sf /stand $$dir; \
702 cp ${RD}/trees/base/sbin/dhclient-script ${RD}/mfsfd/stand
703 .if ${TARGET} == "pc98"
704 cp ${.CURDIR}/../etc/defaults/pccard.conf \
705 ${RD}/mfsfd/etc/defaults/pccard.conf
707 cp ${.CURDIR}/../etc/usbd.conf ${RD}/mfsfd/etc/usbd.conf
708 ( for F in defaults/rc.conf netconfig protocols ; do \
709 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \
710 ${RD}/trees/base/etc/$$F > ${RD}/mfsfd/stand/etc/$$F ; \
712 grep -E '^(ftp|nameserver|domain|sunrpc|cmd|nfsd)[^-\w]' \
713 ${RD}/trees/base/etc/services | \
714 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \
715 > ${RD}/mfsfd/stand/etc/services
716 grep 'operator' ${RD}/trees/base/etc/group \
717 > ${RD}/mfsfd/stand/etc/group
718 ln ${RD}/mfsfd/stand/etc/services ${RD}/mfsfd/etc/services
719 ln ${RD}/mfsfd/stand/etc/group ${RD}/mfsfd/etc/group
720 ln ${RD}/mfsfd/stand/etc/netconfig ${RD}/mfsfd/etc/netconfig
721 cp ${RD}/trees/base/COPYRIGHT ${RD}/mfsfd/stand/help/COPYRIGHT.hlp
723 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
724 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
725 ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
727 @for i in ${DIST_DOCS_ARCH_DEP}; do \
728 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
729 ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
731 @mv ${RD}/mfsfd/stand/help/INSTALLATION.TXT \
732 ${RD}/mfsfd/stand/help/INSTALL.TXT
734 -test -f ${.CURDIR}/install.cfg \
735 && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
736 @mkdir -p ${RD}/mfsfd/boot
737 .if ${TARGET_ARCH} != "ia64" && ${TARGET_ARCH} != "powerpc"
738 @cp ${RD}/trees/base/boot/boot* ${RD}/mfsfd/boot
740 .if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64"
741 @cp ${RD}/trees/base/boot/mbr ${RD}/mfsfd/boot
743 @tar --exclude CVS -cf - -C ${.CURDIR}/../usr.sbin/sysinstall help | \
744 tar xf - -C ${RD}/mfsfd/stand
745 @mkdir -p ${RD}/mfsroot
746 sh -e ${DOFS_SH} ${RD}/mfsroot/mfsroot ${RD} ${MNT} \
747 ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL}
748 @gzip -9fnv ${RD}/mfsroot/mfsroot
751 KERNFLOPPYSET= ${RD}/floppyset/kern/kernel.gz
752 .if defined(SMALLFLOPPYSIZE)
753 SMALLKERNFLOPPYSET= ${RD}/floppyset/kern-small/kernel.gz
755 .if defined(SPLIT_MFSROOT)
756 MFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot/mfsroot.gz
757 .if defined(SMALLFLOPPYSIZE)
758 SMALLMFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot-small/mfsroot.gz
762 # Build boot and install floppies.
764 @gzip -9nc ${RD}/trees/base/boot/kernel/kernel > ${RD}/kernels/kernel.gz
765 @echo "Making the kernel boot floppies..."
766 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern \
767 FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz
768 .if defined(SMALLFLOPPYSIZE)
769 @echo "Making the small kernel boot floppies..."
770 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern-small \
771 FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz \
774 .if defined(SPLIT_MFSROOT)
775 @echo "Making the mfsroot boot floppies..."
776 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot \
777 FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz
778 .if defined(SMALLFLOPPYSIZE)
779 @echo "Making the small mfsroot boot floppies..."
780 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot-small \
781 FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz \
784 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \
785 KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \
786 MFSROOTFILE="${MFSROOTFLOPPYSET}.split ${MFSROOTFLOPPYSET}.boot"
787 .if defined(SMALLFLOPPYSIZE)
788 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \
789 KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \
790 MFSROOTFILE="${SMALLMFSROOTFLOPPYSET}.split ${SMALLMFSROOTFLOPPYSET}.boot" \
793 .else # !SPLIT_MFSROOT
794 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \
795 KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \
796 MFSROOTFILE=${RD}/mfsroot/mfsroot.gz
797 .if defined(SMALLFLOPPYSIZE)
798 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \
799 KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \
800 MFSROOTFILE=${RD}/mfsroot/mfsroot.gz \
803 .endif # SPLIT_MFSROOT
806 # Build fixit floppy.
808 @echo "Making fixit floppy."
809 @rm -rf ${RD}/fixitfd
811 @cd ${RD}/fixitfd && \
812 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
814 @cp ${RD}/trees/base/etc/spwd.db ${RD}/trees/base/etc/group \
816 @sed -e 's/#.*//' ${RD}/trees/base/etc/protocols \
817 > ${RD}/fixitfd/etc/protocols
818 @sed -e 's/#.*//' ${RD}/trees/base/usr/share/misc/scsi_modes \
819 > ${RD}/fixitfd/usr/share/misc/scsi_modes
820 @cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
821 @cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
822 @cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar
823 @chmod 555 ${RD}/fixitfd/stand/tar
824 .if defined(SMALLFLOPPYSIZE)
825 @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit-small \
826 DIR=${RD}/fixitfd/stand ZIP=false
827 @sh -e ${DOFS_SH} ${RD}/floppies/fixit-small.flp ${RD} ${MNT} \
828 ${SMALLFLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${SMALLFLOPPYLABEL}
829 @rm -rf ${RD}/fixitfd/stand
830 @mkdir ${RD}/fixitfd/stand
832 @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit \
833 DIR=${RD}/fixitfd/stand ZIP=false
834 @sh -e ${DOFS_SH} ${RD}/floppies/fixit.flp ${RD} ${MNT} \
835 ${FLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${FLOPPYLABEL}
838 # Do our last minute floppies directory setup
841 @cp ${RND}/${RELNOTES_LANG}/installation/${TARGET}/article.txt \
842 ${RD}/floppies/README.TXT
843 @(cd ${RD}/floppies; md5 README.TXT *.flp > CHECKSUM.MD5)
845 @(cd ${RD}/floppies; md5 *.flp > CHECKSUM.MD5)
850 # --==## Setup a suitable ftp-area ##==--
853 @echo "Setting up FTP distribution area"
855 -@ln -s . ${FD}/${BUILDNAME}
856 .if defined(MAKE_FLOPPIES)
857 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
859 @cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
861 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
862 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
863 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
864 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
865 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
867 @for i in ${DIST_DOCS_ARCH_DEP}; do \
868 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
869 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
870 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
871 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
873 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${FD}
874 @mv ${FD}/INSTALLATION.TXT ${FD}/INSTALL.TXT
875 @mv ${FD}/INSTALLATION.HTM ${FD}/INSTALL.HTM
877 @echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
880 # Build a live filesystem cdrom image
882 @echo "Building CDROM live filesystem image"
883 @mkdir -p ${CD_LIVEFS}
884 @for i in ${DISTRIBUTIONS} ; \
886 if [ -d ${RD}/trees/$${i} ] ; then \
887 chflags -R noschg ${RD}/trees/$${i} || true ; \
888 ( cd ${RD}/trees/$${i} && \
889 find . -depth -print | cpio -dumpl ${CD_LIVEFS} ) ; \
892 @rm -f ${CD_LIVEFS}/.profile
893 @cp ${.CURDIR}/fixit.profile ${CD_LIVEFS}/.profile
894 @ln -sf /rescue ${CD_LIVEFS}/stand
895 .if ${TARGET} != "pc98"
896 @echo "Setting up CDROM boot area"
897 @rm -f ${CD_LIVEFS}/boot/loader.conf
898 @cp ${RD}/mfsroot/mfsroot.gz ${CD_LIVEFS}/boot/mfsroot.gz
899 @echo 'mfsroot_load="YES"' > ${CD_LIVEFS}/boot/loader.conf
900 @echo 'mfsroot_type="mfs_root"' >> ${CD_LIVEFS}/boot/loader.conf
901 @echo 'mfsroot_name="/boot/mfsroot"' >> ${CD_LIVEFS}/boot/loader.conf
902 .if exists(${RD}/trees/base/boot/device.hints)
903 # Break the link to device.hints so we can modify it
904 @rm -f ${CD_LIVEFS}/boot/device.hints
905 @cp ${RD}/trees/base/boot/device.hints ${CD_LIVEFS}/boot/device.hints
906 .if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64"
907 @echo 'hint.atkbd.0.flags="0x1"' >> ${CD_LIVEFS}/boot/device.hints
911 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_LIVEFS}/cdrom.inf
914 # Build disc1 and disc2 cdrom images
916 @echo "Building CDROM disc1 filesystem image"
917 @mkdir -p ${CD_DISC1}/${BUILDNAME}
918 .if defined(MAKE_FLOPPIES)
919 @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
921 @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}/${BUILDNAME}
923 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
924 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
925 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
926 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
927 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
929 @for i in ${DIST_DOCS_ARCH_DEP}; do \
930 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
931 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
932 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
933 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
935 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DISC1}
936 @mv ${CD_DISC1}/INSTALLATION.TXT ${CD_DISC1}/INSTALL.TXT
937 @mv ${CD_DISC1}/INSTALLATION.HTM ${CD_DISC1}/INSTALL.HTM
939 @echo "CD_VOLUME = 1" >> ${CD_DISC1}/cdrom.inf
940 .if defined(SEPARATE_LIVEFS)
941 @cp -Rp ${CD_LIVEFS}/boot ${CD_DISC1}
942 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
944 @echo "Building CDROM disc2 filesystem image"
945 @mkdir -p ${CD_DISC2}
946 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
947 @echo "CD_VOLUME = 2" >> ${CD_DISC2}/cdrom.inf
949 @mkdir -p ${CD_DISC2}/usr/share/doc
950 @for i in `ls ${CD_LIVEFS}/usr/share/doc`; do \
951 if [ -L ${CD_LIVEFS}/usr/share/doc/$$i -o \
952 -d /usr/doc/$$i ]; then \
953 mv ${CD_LIVEFS}/usr/share/doc/$$i \
954 ${CD_DISC2}/usr/share/doc; \
961 # --==## Setup a suitable cdrom-area ##==--
965 @echo "Building bootonly CDROM filesystem image"
967 @cp -Rp ${CD_LIVEFS}/boot ${CD_BOOT}
968 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_BOOT}/cdrom.inf
969 .if defined(MINIROOT)
970 @echo "Building bootonly UFS filesystem image"
971 @mkdir -p ${FD}/miniroot
972 @sh -e ${DOFS_SH} ${FD}/miniroot/miniroot.ufs \
973 ${RD} ${MNT} 0 ${CD_BOOT} 8192 auto
974 @gzip -9v ${FD}/miniroot/miniroot.ufs
980 .if defined(CD_PACKAGE_TREE)
981 .if exists(${CD_PACKAGE_TREE}/disc1)
982 CD_DISC1_PKGS= ${CD_PACKAGE_TREE}/disc1
984 .if exists(${CD_PACKAGE_TREE}/disc2)
985 CD_DISC2_PKGS= ${CD_PACKAGE_TREE}/disc2
991 .if exists(${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh)
992 @echo "Creating ISO images..."
994 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
996 ${CD}/${BUILDNAME}-${TARGET}-bootonly.iso ${CD_BOOT}
998 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
1000 ${CD}/${BUILDNAME}-${TARGET}-disc1.iso ${CD_DISC1} \
1002 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \
1004 ${CD}/${BUILDNAME}-${TARGET}-disc2.iso ${CD_DISC2} \
1006 .if defined(SEPARATE_LIVEFS)
1007 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
1009 ${CD}/${BUILDNAME}-${TARGET}-livefs.iso ${CD_LIVEFS}
1011 @echo "Generating MD5 sums..."
1012 @(cd ${CD} && md5 *.iso > ${BUILDNAME}-${TARGET}-iso.CHECKSUM.MD5)
1015 @echo "Do not know how to create an ISO for ${TARGET_ARCH}."
1019 # --==## Documentation Project files such as the Handbook and FAQ ##==--
1022 @echo "Making docs..."
1023 @for i in ${DOCPORTS}; do \
1024 cd /usr/ports/$$i && \
1025 env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \
1026 make all install clean BATCH=yes WITHOUT_X11=yes JADETEX=no \
1027 WITHOUT_PYTHON=yes FORCE_PKG_REGISTER=yes; \
1029 @cd /usr/doc && make all install 'FORMATS=html html-split txt' \
1030 INSTALL_COMPRESSED='' DOCDIR=${RD}/trees/base/usr/share/doc \
1035 # --==## RELNOTESng: Next-generation replacements for *.TXT files ##==--
1038 @echo "Making release documentation..."
1039 @cd ${.CURDIR}/doc && make all install clean 'FORMATS=html txt' \
1040 INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${RND}
1043 # Various "subroutine" and other supporting targets.
1051 @echo "SD undefined in doTARBALL" && exit 1
1054 @echo "TD undefined in doTARBALL" && exit 1
1057 @echo "ARG undefined in doTARBALL" && exit 1
1059 @rm -rf ${RD}/dists/${TD}/${TN}*
1060 @mkdir -p ${RD}/dists/${TD}
1062 tn=`echo ${TN} | tr 'A-Z' 'a-z' | cut -c1-8` && \
1063 echo rolling ${TD}/$$tn tarball &&\
1064 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
1065 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
1066 sh ${.CURDIR}/scripts/info.sh ${RD}/dists/${TD}/$$tn \
1067 > ${RD}/dists/${TD}/$$tn.inf && \
1068 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
1069 cp -p ${.CURDIR}/scripts/$${TD}-install.sh \
1070 ${RD}/dists/${TD}/install.sh; \
1072 if [ "${SD}" != "/usr/src" ]; then \
1073 mtree -c -i -p ${SD}/${ARG} \
1074 -k gname,md5digest,mode,nlink,uname,size,link,type \
1075 > ${RD}/dists/${TD}/$$tn.mtree ; \
1079 ( cd ${RD}/dists/${TD}; \
1080 rm -f CHECKSUM.MD5; \
1081 md5 * > CHECKSUM.MD5 ) \
1084 doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 \
1085 release.5 release.6 release.7 release.8 ${EXTRAS}
1086 @echo "Release done"
1089 @rm -f release.4 release.8 floppies.[123]
1090 @cd ${.CURDIR} && ${MAKE} release.4 release.8 floppies.1 floppies.2 \
1092 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
1095 .if !defined(CRUNCH)
1096 @echo "CRUNCH undefined in installCRUNCH" && exit 1
1099 @echo "DIR undefined in installCRUNCH" && exit 1
1102 @echo "ZIP undefined in installCRUNCH" && exit 1
1105 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
1107 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
1109 @chmod 555 ${DIR}/${CRUNCH}_crunch
1110 @if [ -f ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf ] ; then \
1111 for i in `crunchgen -l ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf` ; do \
1112 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
1115 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
1116 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
1121 # --==## Build a floppy set for a splitfs file ##==--
1123 # FLOPPYBASE - basename of floppy image files
1124 # FLOPPYDESC - description of floppy set
1125 # SPLITFILE - filename of the file to split
1126 # FDSIZE - if specified and "small", small floppy is created
1128 .if make(makeFloppySet)
1129 SPLITDIR= ${RD}/floppyset/${FLOPPYBASE}
1130 .if defined(FDSIZE) && ${FDSIZE} == "SMALL"
1131 FLPSPLITSIZE= ${SMALLFLOPPYSPLITSIZE}
1132 FLPSIZE= ${SMALLFLOPPYSIZE}
1133 FLPLABEL= ${SMALLFLOPPYLABEL}
1135 FLPSPLITSIZE= ${FLOPPYSPLITSIZE}
1136 FLPSIZE= ${FLOPPYSIZE}
1137 FLPLABEL= ${FLOPPYLABEL}
1142 .if !defined(FLOPPYBASE)
1143 @echo "FLOPPYBASE undefined in ${.TARGET}" && exit 1
1145 .if !defined(FLOPPYDESC)
1146 @echo "FLOPPYDESC undefined in ${.TARGET}" && exit 1
1148 .if !defined(SPLITFILE)
1149 @echo "SPLITFILE undefined in ${.TARGET}" && exit 1
1151 sh ${.CURDIR}/scripts/split-file.sh ${SPLITFILE} \
1152 ${RD}/floppyset/${FLOPPYBASE} ${FLPSPLITSIZE} "${FLOPPYDESC}"
1153 ( splitfile=${SPLITDIR}/`basename ${SPLITFILE}`.split ; \
1154 lines=`cat $${splitfile} | wc -l`; \
1155 lines=$$(($$lines - 1)) ; \
1156 for line in `jot $$lines`; do \
1157 file=`head -n $$(($${line} + 1)) $${splitfile} | tail -1 | cut -f 1 -d ' '` ; \
1158 sh -e ${DOFS_SH} ${RD}/floppies/${FLOPPYBASE}$${line}.flp \
1159 ${RD} ${MNT} ${FLPSIZE} ${SPLITDIR}/$${file} \
1160 ${BOOTINODE} ${FLPLABEL}; \
1164 # --==## Build a boot floppy ##==--
1166 # FSIMAGE - base floppy image name
1167 # FDSIZE - if specified and "small", small floppy is created
1168 # KERNFILE - path to kernel split file
1169 # MFSROOTFILE - path to mfsroot split file
1171 .if make(buildBootFloppy)
1172 IMAGEDIR= ${RD}/image.${FSIMAGE}
1173 BOOTDIR= ${RD}/trees/base/boot
1174 HINTSFILE= ${BOOTDIR}/device.hints
1175 ACPI_KO= ${BOOTDIR}/kernel/acpi.ko
1176 IMAGEFILE= ${RD}/floppies/${FSIMAGE}.flp
1177 .if defined(FDSIZE) && ${FDSIZE} == "SMALL"
1178 FLPSIZE= ${SMALLFLOPPYSIZE}
1179 FLPLABEL= ${SMALLFLOPPYLABEL}
1181 FLPSIZE= ${FLOPPYSIZE}
1182 FLPLABEL= ${FLOPPYLABEL}
1187 .if !defined(FSIMAGE)
1188 @echo "FSIMAGE undefined in ${.TARGET}" && exit 1
1190 .if !defined(KERNFILE)
1191 @echo "KERNFILE undefined in ${.TARGET}" && exit 1
1193 .if !defined(MFSROOTFILE)
1194 @echo "MFSROOTFILE undefined in ${.TARGET}" && exit 1
1196 @echo "Running ${.TARGET} for ${FSIMAGE}"
1199 @echo "Setting up /boot directory for ${FSIMAGE} floppy"
1200 @mkdir -p ${IMAGEDIR}/boot
1201 .if ${TARGET} == "i386"
1202 @${WMAKEENV} kgzip -v -l ${RD}/trees/base/usr/lib/kgzldr.o -o \
1203 ${IMAGEDIR}/boot/loader ${BOOTDIR}/loader
1205 @cp ${BOOTDIR}/loader ${IMAGEDIR}/boot
1207 @cp -Rp ${BOOTDIR}/*.4th ${BOOTDIR}/defaults ${BOOTDIR}/loader.help \
1208 ${BOOTDIR}/loader.rc ${IMAGEDIR}/boot
1209 .if exists(${HINTSFILE})
1210 @cp ${HINTSFILE} ${IMAGEDIR}/boot/device.hints
1211 .if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64"
1212 @echo 'hint.atkbd.0.flags="0x1"' >> ${IMAGEDIR}/boot/device.hints
1214 @gzip -9n ${IMAGEDIR}/boot/device.hints
1216 @gzip -9n ${IMAGEDIR}/boot/*.4th ${IMAGEDIR}/boot/loader.help \
1217 ${IMAGEDIR}/boot/defaults/loader.conf
1218 @echo 'bootfile="/kernel"' > ${IMAGEDIR}/boot/loader.conf
1219 .if exists(${ACPI_KO})
1220 @gzip -9nc ${ACPI_KO} > ${IMAGEDIR}/acpi.ko.gz
1221 @echo 'acpi_load="YES"' >> ${IMAGEDIR}/boot/loader.conf
1222 @echo 'acpi_name="/acpi.ko"' >> ${IMAGEDIR}/boot/loader.conf
1223 @echo 'acpi_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
1225 @echo 'mfsroot_load="YES"' >> ${IMAGEDIR}/boot/loader.conf
1226 @echo 'mfsroot_type="mfs_root"' >> ${IMAGEDIR}/boot/loader.conf
1227 @echo 'mfsroot_name="/mfsroot"' >> ${IMAGEDIR}/boot/loader.conf
1228 .if !exists(${ACPI_KO})
1229 @echo 'mfsroot_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
1231 .if ${TARGET_ARCH} == "i386" && ${AUTO_KEYBOARD_DETECT}
1232 @echo "-P" >> ${IMAGEDIR}/boot.config
1235 @cp ${KERNFILE} ${MFSROOTFILE} ${IMAGEDIR}
1236 sh -e ${DOFS_SH} ${IMAGEFILE} ${RD} ${MNT} ${FLPSIZE} ${IMAGEDIR} \
1237 ${BOOTINODE} ${FLPLABEL}
1238 @echo "Created ${RD}/floppies/${FSIMAGE}.flp"
1240 .if make(package-split)
1241 # Targets related to making a package split
1243 # PKG_COPY instructs the script to copy the actual package files rather than
1245 # PKG_TREE is the path to the package tree to be split
1246 # PKG_DEST is the path to the destination tree to create the split in
1247 # PKG_VERBOSE asks for verbose output of the layout process
1248 # PKG_INDEX is the path to the INDEX file. By default ${PKG_TREE}/INDEX.
1250 .if defined(PKG_COPY)
1255 PKG_WRKIDX= ${PKG_DEST}/INDEX.master
1257 .if defined(TARGET_ARCH)
1258 PKG_ENV+= PKG_ARCH=${TARGET_ARCH}
1260 .if defined(PKG_VERBOSE)
1261 PKG_ENV+= PKG_VERBOSE=1
1263 PKG_INDEX?= ${PKG_TREE}/INDEX
1266 .if !defined(PKG_TREE)
1267 @echo "PKG_TREE must be defined" && exit 1
1269 .if !defined(PKG_DEST)
1270 @echo "PKG_DEST must be defined" && exit 1
1272 @env ${PKG_ENV} python ${.CURDIR}/scripts/package-split.py \
1273 ${PKG_INDEX} ${PKG_WRKIDX}
1274 @env ${PKG_ENV} sh ${.CURDIR}/scripts/package-trees.sh ${PKG_DO_COPY} \
1275 ${PKG_WRKIDX} ${PKG_TREE} ${PKG_DEST}
1278 .include <bsd.obj.mk>