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"
225 .if defined(NO_FLOPPIES)
229 .if exists(/sbin/bsdlabel)
232 DISKLABEL?= disklabel
235 ZIPNSPLIT= gzip --no-name -9 -c | split -b 1392k -
237 # Things which may get you into trouble if you change them
238 MTREEFILES= ${.CURDIR}/../etc/mtree
241 RND= ${RD}/release.doc
244 .if ${TARGET} != "pc98"
245 CD_BOOT= ${CD}/bootonly
247 CD_DISC1= ${CD}/disc1
248 CD_DISC2= ${CD}/disc2
249 .if defined(SEPARATE_LIVEFS)
250 CD_LIVEFS= ${CD}/livefs
252 CD_LIVEFS= ${CD_DISC1}
254 _MK?= ${CHROOTDIR}/mk
256 # Where the bootstrap ports (see DOCPORTS) get installed.
257 LOCALDIR= /usr/local/bin
259 .if ${TARGET} != ${MACHINE} && ${DISKLABEL} == "bsdlabel"
260 DOFS_SH= ${.CURDIR}/scripts/doFS.sh ${DISKLABEL} ${TARGET}
262 DOFS_SH= ${.CURDIR}/scripts/doFS.sh ${DISKLABEL} ""
266 .if ${TARGET_ARCH} == "i386"
267 CRUNCH_TARGETS+=fixit
268 .if ${TARGET} == "pc98"
269 CRUNCH_TARGETS+=fixit-small
273 .if defined(MAKE_FLOPPIES)
275 .if ${TARGET_ARCH} == "i386"
281 .if !defined(NOCDROM)
282 EXTRAS+= cdrom.1 cdrom.2 cdrom.3
283 .if defined(MAKE_ISOS)
286 .if ${TARGET} == "pc98"
297 .if !make(release) && !make(rerelease) && !make(package-split)
298 BINMAKE!= cd ${.CURDIR}/..; ${MAKE} -V BINMAKE
299 WMAKEENV!= cd ${.CURDIR}/..; \
300 ${BINMAKE} ${CROSSENV} -f Makefile.inc1 -V WMAKEENV
301 WMAKE= ${WMAKEENV} ${BINMAKE}
305 .if defined(RELEASETAG)
306 CVS_SRCARGS+= -r ${RELEASETAG}
310 .if defined(DOCRELEASETAG)
311 CVS_DOCARGS+= -r ${DOCRELEASETAG}
315 .if defined(PORTSRELEASETAG)
316 CVS_PORTSARGS+= -r ${PORTSRELEASETAG}
319 WORLDDIR?= ${.CURDIR}/..
322 .if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT)
323 @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false
325 .if defined(NOPORTSATALL) && !defined(NODOC)
326 @echo "Ports are required for building the docs. Either set NODOC or"
327 @echo "unset NOPORTS, or set at least DOMINIMALDOCPORTS to YES!"
330 .if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES)
331 .for p in ${LOCAL_PATCHES}
333 @echo "The patch file ${p} does not exist!"
338 .if defined(LOCAL_SCRIPT) && !exists(${LOCAL_SCRIPT})
339 @echo "The local script ${LOCAL_SCRIPT} does not exist!"
343 .if exists(${CHROOTDIR})
344 # The first command will fail on a handful of files that have their schg
345 # flags set. But it greatly speeds up the next two commands.
346 # NB: clear any vestigial devfs mount, just in case
347 -umount ${CHROOTDIR}/dev > /dev/null 2>&1
348 -rm -rf ${CHROOTDIR} 2>/dev/null
349 -chflags -R 0 ${CHROOTDIR}/.
352 mkdir -p ${CHROOTDIR}
353 @echo ">>> make release for ${TARGET} started on `LC_ALL=C TZ=GMT date`"
354 cd ${WORLDDIR} && ${NATIVEMAKE} -DNO_GAMES -DNO_HTML -DNO_INFO -DNO_MAN \
355 -DNO_NLS -DNO_PROFILE installworld DESTDIR=${CHROOTDIR}
356 cd ${WORLDDIR} && ${NATIVEMAKE} distribution DESTDIR=${CHROOTDIR}
357 if [ -f /etc/resolv.conf ]; then \
358 cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \
360 .if defined(EXTLOCALDIR)
361 rm -rf ${CHROOTDIR}/usr/local
362 cd ${CHROOTDIR}/usr && cp -R -H ${EXTLOCALDIR} local
364 rm -rf ${CHROOTDIR}/usr/src
365 .if defined(EXTSRCDIR)
366 cd ${CHROOTDIR}/usr && \
367 cp -R -H ${EXTSRCDIR} src
369 cd ${CHROOTDIR}/usr && \
370 ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
371 co ${CVSCMDARGS} ${CVS_SRCARGS} ${RELEASESRCMODULE}
373 .if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES)
374 .for p in ${LOCAL_PATCHES}
375 patch -d ${CHROOTDIR}/usr/${RELEASESRCMODULE} ${PATCH_FLAGS} < ${p}
378 .if defined(LOCAL_SCRIPT)
379 cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} \
380 RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT}
382 rm -rf ${CHROOTDIR}/usr/ports
383 .if !defined(NOPORTSATALL)
384 cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
385 co ${CVSCMDARGS} ${CVS_PORTSARGS} ${RELEASEPORTSMODULE}
388 rm -rf ${CHROOTDIR}/usr/doc
389 .if defined(EXTDOCDIR)
390 cd ${CHROOTDIR}/usr && cp -R -H ${EXTDOCDIR} doc
392 cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
393 co ${CVSCMDARGS} ${CVS_DOCARGS} ${RELEASEDOCMODULE}
395 if [ -d ${RELEASEDISTFILES}/ ]; then \
396 cp -rp ${RELEASEDISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \
398 mkdir -p ${CHROOTDIR}/usr/ports/distfiles; \
400 .if !defined(NO_PREFETCHDISTFILES)
401 @cd ${.CURDIR} && ${MAKE} fetch-distfiles
406 .if !defined(RELEASENOUPDATE)
407 .if !defined(RELEASETAG)
408 cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
409 update ${CVSCMDARGS} -P -d -A
411 cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
412 update ${CVSCMDARGS} -P -d -r ${RELEASETAG}
414 rm -f ${CHROOTDIR}/tmp/.world_done
415 .if !defined(NOPORTS)
416 cd ${CHROOTDIR}/usr/ports && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
417 update ${CVSCMDARGS} -P -d
418 rm -f ${CHROOTDIR}/tmp/.skip_ports_index
420 .if defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES"
421 for i in ${MINIMALDOCPORTS}; do \
422 ( cd ${CHROOTDIR}/usr/$$i && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
423 update ${CVSCMDARGS} -P -d ) ; \
427 cd ${CHROOTDIR}/usr/doc && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
428 update ${CVSCMDARGS} -P -d
432 # Add version information to those things that need it.
433 if [ ! -f ${CHROOTDIR}/tmp/.world_done ]; then \
434 cd ${CHROOTDIR}/usr/src/sys/conf && \
435 mv newvers.sh foo && \
436 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && \
439 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
440 echo "#!/bin/sh" > ${_MK}
441 echo "set -ex" >> ${_MK}
442 echo "trap 'umount /dev || true' 0" >> ${_MK}
443 echo "_RELTARGET=\$${1:-doRELEASE}" >> ${_MK}
445 AUTO_KEYBOARD_DETECT \
475 echo "export ${var}=\"${${var}}\"" >> ${_MK}
478 # Don't remove this, or the build will fall over!
479 echo "export RELEASEDIR=${_R}" >> ${_MK}
480 echo "export PATH=/bin:/usr/bin:/sbin:/usr/sbin:${LOCALDIR}" >> ${_MK}
481 echo "export MANBUILDCAT=YES" >> ${_MK}
482 # NB: these may fail if the host is running w/o devfs
483 echo "umount /dev >/dev/null 2>&1 || true" >> ${_MK}
484 echo "mount -t devfs devfs /dev >/dev/null 2>&1 || true" >> ${_MK}
485 echo "if [ -x /etc/rc.d/ldconfig ]; then" >> ${_MK}
486 echo " /etc/rc.d/ldconfig start" >> ${_MK}
487 echo "else" >> ${_MK}
488 echo " ldconfig /lib /usr/lib /usr/local/lib || true" >> ${_MK}
490 echo "if [ ! -f /tmp/.world_done ]; then" >> ${_MK}
491 echo " cd /usr/src" >> ${_MK}
492 echo " ${CROSSMAKE} ${WORLD_FLAGS} -DNO_CLEAN buildworld && \\" >> ${_MK}
493 echo " touch /tmp/.world_done || exit 1" >> ${_MK}
495 echo "if [ ! -f /tmp/.skip_ports_index ]; then" >> ${_MK}
496 echo " echo \">>> make index started on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
497 echo " for i in ${MAKEINDEXPORTS}" >> ${_MK}
499 echo " cd /usr/ports/\$${i}" >> ${_MK}
500 echo " env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \\" >> ${_MK}
501 echo " make all install clean BATCH=yes FORCE_PKG_REGISTER=yes" >> ${_MK}
502 echo " done" >> ${_MK}
503 echo " cd /usr/ports" >> ${_MK}
504 echo " rm -f INDEX*" >> ${_MK}
505 echo " make index -DINDEX_PRISTINE" >> ${_MK}
506 echo " rm -f INDEX*.tmp" >> ${_MK}
507 echo " touch /tmp/.skip_ports_index" >> ${_MK}
508 echo " echo \">>> make index finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
510 echo "cd /usr/src/release" >> ${_MK}
511 echo "make obj" >> ${_MK}
512 echo "make \$${_RELTARGET}" >> ${_MK}
513 echo "echo \">>> make ${.TARGET} for ${TARGET} finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
516 touch ${CHROOTDIR}/tmp/.skip_ports_index
518 # Ensure md.ko is loaded if md(4) is not statically compiled into
520 -mdconfig 2>/dev/null
521 env -i /usr/sbin/chroot `dirname ${_MK}` /`basename ${_MK}`
524 rm -rf ${CRUNCH_TARGETS:S/$/_crunch/} release.[0-8] ${EXTRAS}
527 @for i in ${MAKEINDEXPORTS}; do \
528 cd ${CHROOTDIR}/usr/ports/$$i && \
529 make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \
530 checksum-recursive ; \
532 @for i in ${DOCPORTS}; do \
533 cd ${CHROOTDIR}/usr/ports/$$i && \
534 make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \
535 WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes \
536 checksum-recursive ; \
539 # Clean out ${_R} and make the directory structure.
542 -rm -rf ${_R}/* 2> /dev/null
543 -chflags -R noschg ${_R}/.
546 .if defined(MAKE_FLOPPIES)
551 for i in ${DISTRIBUTIONS}; do \
552 mkdir ${RD}/trees/$$i && \
553 mtree -deU -f ${MTREEFILES}/BSD.root.dist \
554 -p ${RD}/trees/$$i > /dev/null && \
555 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
556 -p ${RD}/trees/$$i/usr > /dev/null && \
557 mtree -deU -f ${MTREEFILES}/BSD.include.dist \
558 -p ${RD}/trees/$$i/usr/include > /dev/null && \
559 mtree -deU -f ${MTREEFILES}/BSD.var.dist \
560 -p ${RD}/trees/$$i/var > /dev/null ; \
564 # Install the system into the various distributions.
566 cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/base
567 cd ${.CURDIR}/.. && ${CROSSMAKE} ${WORLD_FLAGS} distributeworld \
571 # Make and install the generic kernel(s).
573 .for kernel in ${KERNELS}
575 ${CROSSMAKE} ${KERNEL_FLAGS} -DNO_MODULES \
576 KERNCONF=${kernel} INSTKERNNAME=${kernel} kernel \
577 DESTDIR=${RD}/trees/base
579 # Install a standard boot kernel+modules.
581 ${CROSSMAKE} ${KERNEL_FLAGS} \
583 DESTDIR=${RD}/trees/base; \
585 ${CROSSMAKE} ${KERNEL_FLAGS} -DNO_MODULES \
586 reinstallkernel -DINSTALL_DEBUG \
587 DESTDIR=${RD}/trees/base
590 # Make and install the three crunched binaries which live on the floppies.
591 # You are not supposed to like this :-)
594 mkdir -p ${RD}/crunch
595 .for j in ${CRUNCH_TARGETS}
596 .if exists(${.CURDIR}/${TARGET}/${j}_crunch.conf)
599 cd ${j}_crunch; ${WMAKEENV} crunchgen -o \
600 ${.CURDIR}/${TARGET}/${j}_crunch.conf
601 cd ${j}_crunch; ${WMAKE} -f ${j}_crunch.mk subclean
602 cd ${.CURDIR}/..; ${BINMAKE} -f Makefile.inc1 _build-tools
603 cd ${j}_crunch; CFLAGS="-Os -pipe" ${WMAKE} -f ${j}_crunch.mk \
605 ${WMAKEENV} strip -R .comment ${j}_crunch/${j}_crunch
606 mv ${j}_crunch/${j}_crunch ${RD}/crunch/${j}
612 # --==## Fix up the distributions. ##==--
615 # Create any "synthetic dists" now.
616 @for i in ${DISTRIBUTIONS}; do \
617 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
618 echo -n "Running $$i dist creation script... "; \
619 env RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
624 # Remove all the directories we don't need.
626 find ${OTHER_DISTS} -depth -type d -print | xargs rmdir
630 # --==## Package up the tarballs from assembled trees ##==--
635 @for i in ${DISTRIBUTIONS} ; \
637 if [ -d ${RD}/trees/$${i} ] ; then \
638 cd ${.CURDIR} && $(MAKE) doTARBALL \
639 SD=${RD}/trees/$${i} \
640 TN=$$i TD=$$i ARG="." && \
641 echo "$${i} distribution is finished."; \
644 .if !defined(NOPORTS)
645 # XXX: Inline stripped version of doTARBALL
646 @rm -rf ${RD}/dists/ports/ports*
647 @mkdir -p ${RD}/dists/ports
648 @echo rolling ports/ports tarball
649 @tar --exclude CVS --exclude 'ports/distfiles/*' \
650 -czf ${RD}/dists/ports/ports.tgz -C /usr ports
651 @cp ${.CURDIR}/scripts/ports-install.sh ${RD}/dists/ports/install.sh
652 @(cd ${RD}/dists/ports; \
653 rm -f CHECKSUM.MD5; \
654 md5 * > CHECKSUM.MD5)
655 @echo "ports distribution is finished."
661 # --==## Make source dists ##==--
665 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \
666 TD=src TN=sbase ARG="[A-Z]*"
667 @for i in `cd /usr/src && echo [a-z]*` ; do \
668 if [ -d /usr/src/$$i ] ; then \
669 cd ${.CURDIR} && $(MAKE) doTARBALL \
670 TN=`echo s$$i | tr -d '.' | \
672 -e 's/kerberos5/krb5/'` \
673 SD=/usr/src TD=src ARG="$$i" ; \
676 .if defined(EXTRA_SRC)
677 @set ${EXTRA_SRC} && \
678 while [ $$# -ge 2 ] ; do \
679 if [ -d /usr/src/$$1 ] ; then \
680 cd ${.CURDIR} && $(MAKE) doTARBALL \
681 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
682 fi && shift && shift ; \
685 (cd ${RD}/dists/src; rm -f CHECKSUM.MD5; md5 * > CHECKSUM.MD5)
686 @echo "src distribution is finished."
690 # Build the memory root filesystem.
692 cp ${RD}/trees/base/etc/disktab /etc
696 mkdir -p etc/defaults dev mnt stand/etc/defaults stand/help
697 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
698 DIR=${RD}/mfsfd/stand ZIP=false
699 ( cd ${RD}/mfsfd && \
700 for dir in bin sbin ; do \
701 ln -sf /stand $$dir; \
703 cp ${RD}/trees/base/sbin/dhclient-script ${RD}/mfsfd/stand
704 .if ${TARGET} == "pc98"
705 cp ${.CURDIR}/../etc/defaults/pccard.conf \
706 ${RD}/mfsfd/etc/defaults/pccard.conf
708 cp ${.CURDIR}/../etc/usbd.conf ${RD}/mfsfd/etc/usbd.conf
709 ( for F in defaults/rc.conf netconfig protocols ; do \
710 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \
711 ${RD}/trees/base/etc/$$F > ${RD}/mfsfd/stand/etc/$$F ; \
713 grep -E '^(ftp|nameserver|domain|sunrpc|cmd|nfsd)[^-\w]' \
714 ${RD}/trees/base/etc/services | \
715 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \
716 > ${RD}/mfsfd/stand/etc/services
717 grep 'operator' ${RD}/trees/base/etc/group \
718 > ${RD}/mfsfd/stand/etc/group
719 ln ${RD}/mfsfd/stand/etc/services ${RD}/mfsfd/etc/services
720 ln ${RD}/mfsfd/stand/etc/group ${RD}/mfsfd/etc/group
721 ln ${RD}/mfsfd/stand/etc/netconfig ${RD}/mfsfd/etc/netconfig
722 cp ${RD}/trees/base/COPYRIGHT ${RD}/mfsfd/stand/help/COPYRIGHT.hlp
724 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
725 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
726 ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
728 @for i in ${DIST_DOCS_ARCH_DEP}; do \
729 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
730 ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
732 @mv ${RD}/mfsfd/stand/help/INSTALLATION.TXT \
733 ${RD}/mfsfd/stand/help/INSTALL.TXT
735 -test -f ${.CURDIR}/install.cfg \
736 && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
737 @mkdir -p ${RD}/mfsfd/boot
738 .if ${TARGET_ARCH} != "ia64" && ${TARGET_ARCH} != "powerpc"
739 @cp ${RD}/trees/base/boot/boot* ${RD}/mfsfd/boot
741 .if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64"
742 @cp ${RD}/trees/base/boot/mbr ${RD}/mfsfd/boot
744 @tar --exclude CVS -cf - -C ${.CURDIR}/../usr.sbin/sysinstall help | \
745 tar xf - -C ${RD}/mfsfd/stand
746 @mkdir -p ${RD}/mfsroot
747 sh -e ${DOFS_SH} ${RD}/mfsroot/mfsroot ${RD} ${MNT} \
748 ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL}
749 @gzip -9fnv ${RD}/mfsroot/mfsroot
752 KERNFLOPPYSET= ${RD}/floppyset/kern/kernel.gz
753 .if defined(SMALLFLOPPYSIZE)
754 SMALLKERNFLOPPYSET= ${RD}/floppyset/kern-small/kernel.gz
756 .if defined(SPLIT_MFSROOT)
757 MFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot/mfsroot.gz
758 .if defined(SMALLFLOPPYSIZE)
759 SMALLMFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot-small/mfsroot.gz
763 # Build boot and install floppies.
765 @gzip -9nc ${RD}/trees/base/boot/kernel/kernel > ${RD}/kernels/kernel.gz
766 @echo "Making the kernel boot floppies..."
767 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern \
768 FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz
769 .if defined(SMALLFLOPPYSIZE)
770 @echo "Making the small kernel boot floppies..."
771 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern-small \
772 FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz \
775 .if defined(SPLIT_MFSROOT)
776 @echo "Making the mfsroot boot floppies..."
777 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot \
778 FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz
779 .if defined(SMALLFLOPPYSIZE)
780 @echo "Making the small mfsroot boot floppies..."
781 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot-small \
782 FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz \
785 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \
786 KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \
787 MFSROOTFILE="${MFSROOTFLOPPYSET}.split ${MFSROOTFLOPPYSET}.boot"
788 .if defined(SMALLFLOPPYSIZE)
789 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \
790 KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \
791 MFSROOTFILE="${SMALLMFSROOTFLOPPYSET}.split ${SMALLMFSROOTFLOPPYSET}.boot" \
794 .else # !SPLIT_MFSROOT
795 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \
796 KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \
797 MFSROOTFILE=${RD}/mfsroot/mfsroot.gz
798 .if defined(SMALLFLOPPYSIZE)
799 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \
800 KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \
801 MFSROOTFILE=${RD}/mfsroot/mfsroot.gz \
804 .endif # SPLIT_MFSROOT
807 # Build fixit floppy.
809 @echo "Making fixit floppy."
810 @rm -rf ${RD}/fixitfd
812 @cd ${RD}/fixitfd && \
813 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
815 @cp ${RD}/trees/base/etc/spwd.db ${RD}/trees/base/etc/group \
817 @sed -e 's/#.*//' ${RD}/trees/base/etc/protocols \
818 > ${RD}/fixitfd/etc/protocols
819 @sed -e 's/#.*//' ${RD}/trees/base/usr/share/misc/scsi_modes \
820 > ${RD}/fixitfd/usr/share/misc/scsi_modes
821 @cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
822 @cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
823 @cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar
824 @chmod 555 ${RD}/fixitfd/stand/tar
825 .if defined(SMALLFLOPPYSIZE)
826 @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit-small \
827 DIR=${RD}/fixitfd/stand ZIP=false
828 @sh -e ${DOFS_SH} ${RD}/floppies/fixit-small.flp ${RD} ${MNT} \
829 ${SMALLFLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${SMALLFLOPPYLABEL}
830 @rm -rf ${RD}/fixitfd/stand
831 @mkdir ${RD}/fixitfd/stand
833 @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit \
834 DIR=${RD}/fixitfd/stand ZIP=false
835 @sh -e ${DOFS_SH} ${RD}/floppies/fixit.flp ${RD} ${MNT} \
836 ${FLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${FLOPPYLABEL}
839 # Do our last minute floppies directory setup
842 @cp ${RND}/${RELNOTES_LANG}/installation/${TARGET}/article.txt \
843 ${RD}/floppies/README.TXT
844 @(cd ${RD}/floppies; md5 README.TXT *.flp > CHECKSUM.MD5)
846 @(cd ${RD}/floppies; md5 *.flp > CHECKSUM.MD5)
851 # --==## Setup a suitable ftp-area ##==--
854 @echo "Setting up FTP distribution area"
856 -@ln -s . ${FD}/${BUILDNAME}
857 .if defined(MAKE_FLOPPIES)
858 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
860 @cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
862 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
863 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
864 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
865 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
866 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
868 @for i in ${DIST_DOCS_ARCH_DEP}; do \
869 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
870 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
871 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
872 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
874 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${FD}
875 @mv ${FD}/INSTALLATION.TXT ${FD}/INSTALL.TXT
876 @mv ${FD}/INSTALLATION.HTM ${FD}/INSTALL.HTM
878 @echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
881 # Build a live filesystem cdrom image
883 @echo "Building CDROM live filesystem image"
884 @mkdir -p ${CD_LIVEFS}
885 @for i in ${DISTRIBUTIONS} ; \
887 if [ -d ${RD}/trees/$${i} ] ; then \
888 chflags -R noschg ${RD}/trees/$${i} || true ; \
889 ( cd ${RD}/trees/$${i} && \
890 find . -depth -print | cpio -dumpl ${CD_LIVEFS} ) ; \
893 @rm -f ${CD_LIVEFS}/.profile
894 @cp ${.CURDIR}/fixit.profile ${CD_LIVEFS}/.profile
895 @ln -sf /rescue ${CD_LIVEFS}/stand
896 .if ${TARGET} != "pc98"
897 @echo "Setting up CDROM boot area"
898 @rm -f ${CD_LIVEFS}/boot/loader.conf
899 @cp ${RD}/mfsroot/mfsroot.gz ${CD_LIVEFS}/boot/mfsroot.gz
900 @echo 'mfsroot_load="YES"' > ${CD_LIVEFS}/boot/loader.conf
901 @echo 'mfsroot_type="mfs_root"' >> ${CD_LIVEFS}/boot/loader.conf
902 @echo 'mfsroot_name="/boot/mfsroot"' >> ${CD_LIVEFS}/boot/loader.conf
903 .if exists(${RD}/trees/base/boot/device.hints)
904 # Break the link to device.hints so we can modify it
905 @rm -f ${CD_LIVEFS}/boot/device.hints
906 @cp ${RD}/trees/base/boot/device.hints ${CD_LIVEFS}/boot/device.hints
907 .if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64"
908 @echo 'hint.atkbd.0.flags="0x1"' >> ${CD_LIVEFS}/boot/device.hints
912 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_LIVEFS}/cdrom.inf
915 # Build disc1 and disc2 cdrom images
917 @echo "Building CDROM disc1 filesystem image"
918 @mkdir -p ${CD_DISC1}/${BUILDNAME}
919 .if defined(MAKE_FLOPPIES)
920 @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
922 @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}/${BUILDNAME}
924 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
925 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
926 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
927 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
928 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
930 @for i in ${DIST_DOCS_ARCH_DEP}; do \
931 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
932 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
933 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
934 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
936 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DISC1}
937 @mv ${CD_DISC1}/INSTALLATION.TXT ${CD_DISC1}/INSTALL.TXT
938 @mv ${CD_DISC1}/INSTALLATION.HTM ${CD_DISC1}/INSTALL.HTM
940 @echo "CD_VOLUME = 1" >> ${CD_DISC1}/cdrom.inf
941 .if defined(SEPARATE_LIVEFS)
942 @cp -Rp ${CD_LIVEFS}/boot ${CD_DISC1}
943 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
945 @echo "Building CDROM disc2 filesystem image"
946 @mkdir -p ${CD_DISC2}
947 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
948 @echo "CD_VOLUME = 2" >> ${CD_DISC2}/cdrom.inf
950 @mkdir -p ${CD_DISC2}/usr/share/doc
951 @for i in `ls ${CD_LIVEFS}/usr/share/doc`; do \
952 if [ -L ${CD_LIVEFS}/usr/share/doc/$$i -o \
953 -d /usr/doc/$$i ]; then \
954 mv ${CD_LIVEFS}/usr/share/doc/$$i \
955 ${CD_DISC2}/usr/share/doc; \
962 # --==## Setup a suitable cdrom-area ##==--
966 @echo "Building bootonly CDROM filesystem image"
968 @cp -Rp ${CD_LIVEFS}/boot ${CD_BOOT}
969 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_BOOT}/cdrom.inf
970 .if defined(MINIROOT)
971 @echo "Building bootonly UFS filesystem image"
972 @mkdir -p ${FD}/miniroot
973 @sh -e ${DOFS_SH} ${FD}/miniroot/miniroot.ufs \
974 ${RD} ${MNT} 0 ${CD_BOOT} 8192 auto
975 @gzip -9v ${FD}/miniroot/miniroot.ufs
981 .if defined(CD_PACKAGE_TREE)
982 .if exists(${CD_PACKAGE_TREE}/disc1)
983 CD_DISC1_PKGS= ${CD_PACKAGE_TREE}/disc1
985 .if exists(${CD_PACKAGE_TREE}/disc2)
986 CD_DISC2_PKGS= ${CD_PACKAGE_TREE}/disc2
992 .if exists(${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh)
993 @echo "Creating ISO images..."
995 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
997 ${CD}/${BUILDNAME}-${TARGET}-bootonly.iso ${CD_BOOT}
999 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
1001 ${CD}/${BUILDNAME}-${TARGET}-disc1.iso ${CD_DISC1} \
1003 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \
1005 ${CD}/${BUILDNAME}-${TARGET}-disc2.iso ${CD_DISC2} \
1007 .if defined(SEPARATE_LIVEFS)
1008 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
1010 ${CD}/${BUILDNAME}-${TARGET}-livefs.iso ${CD_LIVEFS}
1012 @echo "Generating MD5 sums..."
1013 @(cd ${CD} && md5 *.iso > ${BUILDNAME}-${TARGET}-iso.CHECKSUM.MD5)
1016 @echo "Do not know how to create an ISO for ${TARGET_ARCH}."
1020 # --==## Documentation Project files such as the Handbook and FAQ ##==--
1023 @echo "Making docs..."
1024 @for i in ${DOCPORTS}; do \
1025 cd /usr/ports/$$i && \
1026 env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \
1027 make all install clean BATCH=yes WITHOUT_X11=yes JADETEX=no \
1028 WITHOUT_PYTHON=yes FORCE_PKG_REGISTER=yes; \
1030 @cd /usr/doc && make all install 'FORMATS=html html-split txt' \
1031 INSTALL_COMPRESSED='' DOCDIR=${RD}/trees/base/usr/share/doc \
1036 # --==## RELNOTESng: Next-generation replacements for *.TXT files ##==--
1039 @echo "Making release documentation..."
1040 @cd ${.CURDIR}/doc && make all install clean 'FORMATS=html txt' \
1041 INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${RND}
1044 # Various "subroutine" and other supporting targets.
1052 @echo "SD undefined in doTARBALL" && exit 1
1055 @echo "TD undefined in doTARBALL" && exit 1
1058 @echo "ARG undefined in doTARBALL" && exit 1
1060 @rm -rf ${RD}/dists/${TD}/${TN}*
1061 @mkdir -p ${RD}/dists/${TD}
1063 tn=`echo ${TN} | tr 'A-Z' 'a-z' | cut -c1-8` && \
1064 echo rolling ${TD}/$$tn tarball &&\
1065 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
1066 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
1067 sh ${.CURDIR}/scripts/info.sh ${RD}/dists/${TD}/$$tn \
1068 > ${RD}/dists/${TD}/$$tn.inf && \
1069 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
1070 cp -p ${.CURDIR}/scripts/$${TD}-install.sh \
1071 ${RD}/dists/${TD}/install.sh; \
1073 if [ "${SD}" != "/usr/src" ]; then \
1074 mtree -c -i -p ${SD}/${ARG} \
1075 -k gname,md5digest,mode,nlink,uname,size,link,type \
1076 > ${RD}/dists/${TD}/$$tn.mtree ; \
1080 ( cd ${RD}/dists/${TD}; \
1081 rm -f CHECKSUM.MD5; \
1082 md5 * > CHECKSUM.MD5 ) \
1085 doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 \
1086 release.5 release.6 release.7 release.8 ${EXTRAS}
1087 @echo "Release done"
1090 @rm -f release.4 release.8 floppies.[123]
1091 @cd ${.CURDIR} && ${MAKE} release.4 release.8 floppies.1 floppies.2 \
1093 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
1096 .if !defined(CRUNCH)
1097 @echo "CRUNCH undefined in installCRUNCH" && exit 1
1100 @echo "DIR undefined in installCRUNCH" && exit 1
1103 @echo "ZIP undefined in installCRUNCH" && exit 1
1106 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
1108 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
1110 @chmod 555 ${DIR}/${CRUNCH}_crunch
1111 @if [ -f ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf ] ; then \
1112 for i in `crunchgen -l ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf` ; do \
1113 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
1116 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
1117 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
1122 # --==## Build a floppy set for a splitfs file ##==--
1124 # FLOPPYBASE - basename of floppy image files
1125 # FLOPPYDESC - description of floppy set
1126 # SPLITFILE - filename of the file to split
1127 # FDSIZE - if specified and "small", small floppy is created
1129 .if make(makeFloppySet)
1130 SPLITDIR= ${RD}/floppyset/${FLOPPYBASE}
1131 .if defined(FDSIZE) && ${FDSIZE} == "SMALL"
1132 FLPSPLITSIZE= ${SMALLFLOPPYSPLITSIZE}
1133 FLPSIZE= ${SMALLFLOPPYSIZE}
1134 FLPLABEL= ${SMALLFLOPPYLABEL}
1136 FLPSPLITSIZE= ${FLOPPYSPLITSIZE}
1137 FLPSIZE= ${FLOPPYSIZE}
1138 FLPLABEL= ${FLOPPYLABEL}
1143 .if !defined(FLOPPYBASE)
1144 @echo "FLOPPYBASE undefined in ${.TARGET}" && exit 1
1146 .if !defined(FLOPPYDESC)
1147 @echo "FLOPPYDESC undefined in ${.TARGET}" && exit 1
1149 .if !defined(SPLITFILE)
1150 @echo "SPLITFILE undefined in ${.TARGET}" && exit 1
1152 sh ${.CURDIR}/scripts/split-file.sh ${SPLITFILE} \
1153 ${RD}/floppyset/${FLOPPYBASE} ${FLPSPLITSIZE} "${FLOPPYDESC}"
1154 ( splitfile=${SPLITDIR}/`basename ${SPLITFILE}`.split ; \
1155 lines=`cat $${splitfile} | wc -l`; \
1156 lines=$$(($$lines - 1)) ; \
1157 for line in `jot $$lines`; do \
1158 file=`head -n $$(($${line} + 1)) $${splitfile} | tail -1 | cut -f 1 -d ' '` ; \
1159 sh -e ${DOFS_SH} ${RD}/floppies/${FLOPPYBASE}$${line}.flp \
1160 ${RD} ${MNT} ${FLPSIZE} ${SPLITDIR}/$${file} \
1161 ${BOOTINODE} ${FLPLABEL}; \
1165 # --==## Build a boot floppy ##==--
1167 # FSIMAGE - base floppy image name
1168 # FDSIZE - if specified and "small", small floppy is created
1169 # KERNFILE - path to kernel split file
1170 # MFSROOTFILE - path to mfsroot split file
1172 .if make(buildBootFloppy)
1173 IMAGEDIR= ${RD}/image.${FSIMAGE}
1174 BOOTDIR= ${RD}/trees/base/boot
1175 HINTSFILE= ${BOOTDIR}/device.hints
1176 ACPI_KO= ${BOOTDIR}/kernel/acpi.ko
1177 IMAGEFILE= ${RD}/floppies/${FSIMAGE}.flp
1178 .if defined(FDSIZE) && ${FDSIZE} == "SMALL"
1179 FLPSIZE= ${SMALLFLOPPYSIZE}
1180 FLPLABEL= ${SMALLFLOPPYLABEL}
1182 FLPSIZE= ${FLOPPYSIZE}
1183 FLPLABEL= ${FLOPPYLABEL}
1188 .if !defined(FSIMAGE)
1189 @echo "FSIMAGE undefined in ${.TARGET}" && exit 1
1191 .if !defined(KERNFILE)
1192 @echo "KERNFILE undefined in ${.TARGET}" && exit 1
1194 .if !defined(MFSROOTFILE)
1195 @echo "MFSROOTFILE undefined in ${.TARGET}" && exit 1
1197 @echo "Running ${.TARGET} for ${FSIMAGE}"
1200 @echo "Setting up /boot directory for ${FSIMAGE} floppy"
1201 @mkdir -p ${IMAGEDIR}/boot
1202 .if ${TARGET} == "i386"
1203 @${WMAKEENV} kgzip -v -l ${RD}/trees/base/usr/lib/kgzldr.o -o \
1204 ${IMAGEDIR}/boot/loader ${BOOTDIR}/loader
1206 @cp ${BOOTDIR}/loader ${IMAGEDIR}/boot
1208 @cp -Rp ${BOOTDIR}/*.4th ${BOOTDIR}/defaults ${BOOTDIR}/loader.help \
1209 ${BOOTDIR}/loader.rc ${IMAGEDIR}/boot
1210 .if exists(${HINTSFILE})
1211 @cp ${HINTSFILE} ${IMAGEDIR}/boot/device.hints
1212 .if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64"
1213 @echo 'hint.atkbd.0.flags="0x1"' >> ${IMAGEDIR}/boot/device.hints
1215 @gzip -9n ${IMAGEDIR}/boot/device.hints
1217 @gzip -9n ${IMAGEDIR}/boot/*.4th ${IMAGEDIR}/boot/loader.help \
1218 ${IMAGEDIR}/boot/defaults/loader.conf
1219 @echo 'bootfile="/kernel"' > ${IMAGEDIR}/boot/loader.conf
1220 .if exists(${ACPI_KO})
1221 @gzip -9nc ${ACPI_KO} > ${IMAGEDIR}/acpi.ko.gz
1222 @echo 'acpi_load="YES"' >> ${IMAGEDIR}/boot/loader.conf
1223 @echo 'acpi_name="/acpi.ko"' >> ${IMAGEDIR}/boot/loader.conf
1224 @echo 'acpi_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
1226 @echo 'mfsroot_load="YES"' >> ${IMAGEDIR}/boot/loader.conf
1227 @echo 'mfsroot_type="mfs_root"' >> ${IMAGEDIR}/boot/loader.conf
1228 @echo 'mfsroot_name="/mfsroot"' >> ${IMAGEDIR}/boot/loader.conf
1229 .if !exists(${ACPI_KO})
1230 @echo 'mfsroot_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
1232 .if ${TARGET_ARCH} == "i386" && ${AUTO_KEYBOARD_DETECT}
1233 @echo "-P" >> ${IMAGEDIR}/boot.config
1236 @cp ${KERNFILE} ${MFSROOTFILE} ${IMAGEDIR}
1237 sh -e ${DOFS_SH} ${IMAGEFILE} ${RD} ${MNT} ${FLPSIZE} ${IMAGEDIR} \
1238 ${BOOTINODE} ${FLPLABEL}
1239 @echo "Created ${RD}/floppies/${FSIMAGE}.flp"
1241 .if make(package-split)
1242 # Targets related to making a package split
1244 # PKG_COPY instructs the script to copy the actual package files rather than
1246 # PKG_TREE is the path to the package tree to be split
1247 # PKG_DEST is the path to the destination tree to create the split in
1248 # PKG_VERBOSE asks for verbose output of the layout process
1249 # PKG_INDEX is the path to the INDEX file. By default ${PKG_TREE}/INDEX.
1251 .if defined(PKG_COPY)
1256 PKG_WRKIDX= ${PKG_DEST}/INDEX.master
1258 .if defined(TARGET_ARCH)
1259 PKG_ENV+= PKG_ARCH=${TARGET_ARCH}
1261 .if defined(PKG_VERBOSE)
1262 PKG_ENV+= PKG_VERBOSE=1
1264 PKG_INDEX?= ${PKG_TREE}/INDEX
1267 .if !defined(PKG_TREE)
1268 @echo "PKG_TREE must be defined" && exit 1
1270 .if !defined(PKG_DEST)
1271 @echo "PKG_DEST must be defined" && exit 1
1273 @env ${PKG_ENV} python ${.CURDIR}/scripts/package-split.py \
1274 ${PKG_INDEX} ${PKG_WRKIDX}
1275 @env ${PKG_ENV} sh ${.CURDIR}/scripts/package-trees.sh ${PKG_DO_COPY} \
1276 ${PKG_WRKIDX} ${PKG_TREE} ${PKG_DEST}
1279 .include <bsd.obj.mk>