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.
66 # Similarly, you can specify make flags for make readmes via PORTREADMES_FLAGS.
69 #PORTREADMES_FLAGS=-j4
71 TARGET_ARCH?= ${MACHINE_ARCH}
72 .if ${TARGET_ARCH} == ${MACHINE_ARCH}
75 TARGET?= ${TARGET_ARCH}
77 CROSSENV= TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}
78 CROSSMAKE= ${MAKE} ${CROSSENV}
79 NATIVEMAKE= ${MAKE} TARGET_ARCH=${MACHINE_ARCH} TARGET=${MACHINE}
81 # If you are using a local CVS repository with components stored in
82 # non-standard modules, override these on the make commandline or
84 RELEASESRCMODULE?= src
85 RELEASEDOCMODULE?= doc
86 RELEASEPORTSMODULE?= ports
88 # Uncomment this to disable the doc.1 target. Docs normally require
89 # the ports tree, so NOPORTS can be set together with NODOC in order
90 # to have neither ports or docs. If only NOPORTS is set to YES, but
91 # docs are still desired, the DOMINIMALDOCPORTS logic below will only
92 # install the ports that are minimally required for the docs. This is
93 # intended as a compromise, less disk space is required than for using
94 # the entire ports collection (and much less time due to the huge number
95 # of directories it would create), but still quite a bit as well as some
96 # CPU cycles (some of the programs are C++, and things like ghostscript
97 # belong to the required ports nevertheless).
99 # Setting this also disables building of release note documentation
104 # When retrieving ports using the pkg_add -r method, set your proxies to these.
105 # src/release/${arch}/mkisoimages.sh can use these.
106 #HTTP_PROXY?= www.example.com
107 #FTP_PROXY?= ftp.example.com
109 # When creating ISO images, point ${CD_EXTRA_BITS} to a directory containing
110 # extra packages or other files. It will be appended to the disk 1 ISO.
111 #CD_EXTRA_BITS= /path/to/pkg
113 # Extra source tarballs; each argument is a pair of source dir and
114 # distribution name. The dist name should not exceed 7 characters
115 # (another "s" for "source" will be prepended).
116 #EXTRA_SRC= games/fortune fortune
118 # Modify this definition if you want the release notes
119 # and other release documentation in a language other than English.
120 RELNOTES_LANG?= en_US.ISO8859-1
122 # As an alternative to installing the entire ports collection (which
123 # can take a huge amount of time, in particular on slower disks),
124 # setting ${MINIMALDOCPORTS} allows to install and build just those
125 # ports that are really required for getting the docs up & running.
126 .if defined(NOPORTS) && !defined(NODOC)
127 DOMINIMALDOCPORTS= YES
128 .include "Makefile.inc.docports"
129 RELEASEPORTSMODULE= ${MINIMALDOCPORTS}
132 # Make changing names of disc1/disc2 CD's possible.
133 DISC1_LABEL?= fbsd_miniinst
134 DISC1_NAME?= miniinst
135 DISC2_LABEL?= fbsd_livefs
140 .if !defined(DOMINIMALDOCPORTS) || ${DOMINIMALDOCPORTS} != "YES"
146 # Doing 'make index' in /usr/ports requires Perl.
147 MAKEINDEXPORTS= lang/perl5.8
148 # By default, documentation (Handbook, FAQ, etc.) is built for all
149 # the languages. To speed up building, set the DOC_LANG to just
150 # the languages you need. (The language for the release notes is
151 # controlled by the RELNOTES_LANG variable above.)
152 #DOC_LANG= en_US.ISO8859-1
153 DOCPORTS= textproc/docproj
154 # Set this to wherever the distfiles required by release procedures.
155 .if defined(DOCDISTFILES)
156 # Respect DOCDISTFILES which is used before.
157 RELEASEDISTFILES?= ${DOCDISTFILES}
159 RELEASEDISTFILES?= ${.CURDIR}/../../ports/distfiles
161 # Set this to 1 if you want -P to be used for automatic keyboard detection
162 # on the boot floppy. WARNING: Breaks on some Athlon (K7) motherboards.
163 AUTO_KEYBOARD_DETECT?= 0
166 DIST_DOCS_ARCH_INDEP= readme errata
167 DIST_DOCS_ARCH_DEP= installation relnotes hardware
170 # Things which without too much trouble can be considered variables
171 # BASE_DISTS are special in that they get full /etc installation sets.
173 OTHER_DISTS?= catpages manpages games proflibs dict info doc
175 DISTRIBUTIONS?= ${BASE_DISTS} ${OTHER_DISTS}
177 # mountpoint for filesystems.
180 # Various floppy image parameters.
184 .if ${TARGET_ARCH} == "i386"
186 .if ${TARGET} == "pc98"
187 SMALLFLOPPYSIZE= 1200
188 SMALLFLOPPYSPLITSIZE= 1152
189 SMALLFLOPPYLABEL= fd1200
193 FLOPPYSPLITSIZE= 1392
200 .elif ${TARGET_ARCH} == "alpha"
203 FLOPPYSPLITSIZE= 1392
211 .elif ${TARGET_ARCH} == "sparc64"
217 .elif ${TARGET_ARCH} == "ia64"
221 .elif ${TARGET_ARCH} == "amd64"
225 .elif ${TARGET_ARCH} == "powerpc"
231 .if defined(NO_FLOPPIES)
235 .if exists(/sbin/bsdlabel)
238 DISKLABEL?= disklabel
241 ZIPNSPLIT= gzip --no-name -9 -c | split -b 1392k -
243 # Things which may get you into trouble if you change them
244 MTREEFILES= ${.CURDIR}/../etc/mtree
247 RND= ${RD}/release.doc
250 .if ${TARGET} != "pc98"
251 CD_BOOT= ${CD}/bootonly
253 CD_DISC1= ${CD}/disc1
254 CD_DISC2= ${CD}/disc2
255 _MK?= ${CHROOTDIR}/mk
257 # Some architectures may not have space for the ports tree on disc2.
258 # For these architectures there is no sense building the README.html
259 # files no matter what.
260 .if ${TARGET_ARCH} == "ia64"
264 # Where the bootstrap ports (see DOCPORTS) get installed.
265 LOCALDIR= /usr/local/bin
267 .if ${TARGET} != ${MACHINE} && ${DISKLABEL} == "bsdlabel"
268 DOFS_SH= ${.CURDIR}/scripts/doFS.sh ${DISKLABEL} ${TARGET}
270 DOFS_SH= ${.CURDIR}/scripts/doFS.sh ${DISKLABEL} ""
274 .if ${TARGET_ARCH} == "i386"
275 CRUNCH_TARGETS+=fixit
276 .if ${TARGET} == "pc98"
277 CRUNCH_TARGETS+=fixit-small
281 .if defined(MAKE_FLOPPIES)
283 .if ${TARGET_ARCH} == "i386"
289 .if !defined(NOCDROM)
291 .if defined(MAKE_ISOS)
294 .if ${TARGET} == "pc98"
305 .if !make(release) && !make(rerelease)
306 BINMAKE!= cd ${.CURDIR}/..; ${MAKE} -V BINMAKE
307 WMAKEENV!= cd ${.CURDIR}/..; \
308 ${BINMAKE} ${CROSSENV} -f Makefile.inc1 -V WMAKEENV
309 WMAKE= ${WMAKEENV} ${BINMAKE}
313 .if defined(RELEASETAG)
314 CVS_SRCARGS+= -r ${RELEASETAG}
318 .if defined(DOCRELEASETAG)
319 CVS_DOCARGS+= -r ${DOCRELEASETAG}
323 .if defined(PORTSRELEASETAG)
324 CVS_PORTSARGS+= -r ${PORTSRELEASETAG}
327 WORLDDIR?= ${.CURDIR}/..
330 .if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT)
331 @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false
333 .if defined(NOPORTSATALL) && !defined(NODOC)
334 @echo "Ports are required for building the docs. Either set NODOC or"
335 @echo "unset NOPORTS, or set at least DOMINIMALDOCPORTS to YES!"
338 .if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES)
339 .for p in ${LOCAL_PATCHES}
341 @echo "The patch file ${p} does not exist!"
346 .if defined(LOCAL_SCRIPT) && !exists(${LOCAL_SCRIPT})
347 @echo "The local script ${LOCAL_SCRIPT} does not exist!"
351 .if exists(${CHROOTDIR})
352 # The first command will fail on a handful of files that have their schg
353 # flags set. But it greatly speeds up the next two commands.
354 # NB: clear any vestigial devfs mount, just in case
355 -umount ${CHROOTDIR}/dev > /dev/null 2>&1
356 -rm -rf ${CHROOTDIR} 2>/dev/null
357 -chflags -R noschg ${CHROOTDIR}/.
360 mkdir -p ${CHROOTDIR}
361 @echo ">>> make release for ${TARGET} started on `LC_ALL=C TZ=GMT date`"
362 cd ${WORLDDIR} && ${NATIVEMAKE} -DNO_GAMES -DNO_HTML -DNO_INFO -DNO_MAN \
363 -DNO_PROFILE installworld DESTDIR=${CHROOTDIR}
364 cd ${WORLDDIR}/etc && ${NATIVEMAKE} distribution DESTDIR=${CHROOTDIR}
365 if [ -f /etc/resolv.conf ]; then \
366 cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \
368 .if defined(EXTLOCALDIR)
369 rm -rf ${CHROOTDIR}/usr/local
370 cd ${CHROOTDIR}/usr && cp -R -H ${EXTLOCALDIR} local
372 rm -rf ${CHROOTDIR}/usr/src
373 .if defined(EXTSRCDIR)
374 cd ${CHROOTDIR}/usr && \
375 cp -R -H ${EXTSRCDIR} src
377 cd ${CHROOTDIR}/usr && \
378 ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
379 co ${CVSCMDARGS} ${CVS_SRCARGS} ${RELEASESRCMODULE}
381 .if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES)
382 .for p in ${LOCAL_PATCHES}
383 patch -d ${CHROOTDIR}/usr/${RELEASESRCMODULE} ${PATCH_FLAGS} < ${p}
386 .if defined(LOCAL_SCRIPT)
387 cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} \
388 RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT}
390 rm -rf ${CHROOTDIR}/usr/ports
391 .if !defined(NOPORTSATALL)
392 cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
393 co ${CVSCMDARGS} ${CVS_PORTSARGS} ${RELEASEPORTSMODULE}
396 rm -rf ${CHROOTDIR}/usr/doc
397 .if defined(EXTDOCDIR)
398 cd ${CHROOTDIR}/usr && cp -R -H ${EXTDOCDIR} doc
400 cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
401 co ${CVSCMDARGS} ${CVS_DOCARGS} ${RELEASEDOCMODULE}
403 if [ -d ${RELEASEDISTFILES}/ ]; then \
404 cp -rp ${RELEASEDISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \
406 mkdir -p ${CHROOTDIR}/usr/ports/distfiles; \
408 .if !defined(NO_PREFETCHDISTFILES)
409 @cd ${.CURDIR} && ${MAKE} fetch-distfiles
414 .if !defined(RELEASENOUPDATE)
415 .if !defined(RELEASETAG)
416 cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
417 update ${CVSCMDARGS} -P -d -A
419 cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
420 update ${CVSCMDARGS} -P -d -r ${RELEASETAG}
422 rm -f ${CHROOTDIR}/tmp/.world_done
423 .if !defined(NOPORTS)
424 cd ${CHROOTDIR}/usr/ports && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
425 update ${CVSCMDARGS} -P -d
426 rm -f ${CHROOTDIR}/tmp/.skip_ports_index \
427 ${CHROOTDIR}/tmp/.skip_ports_readmes
429 .if defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES"
430 for i in ${MINIMALDOCPORTS}; do \
431 ( cd ${CHROOTDIR}/usr/$$i && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
432 update ${CVSCMDARGS} -P -d ) ; \
436 cd ${CHROOTDIR}/usr/doc && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
437 update ${CVSCMDARGS} -P -d
441 # Add version information to those things that need it.
442 if [ ! -f ${CHROOTDIR}/tmp/.world_done ]; then \
443 cd ${CHROOTDIR}/usr/src/sys/conf && \
444 mv newvers.sh foo && \
445 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && \
448 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
449 echo "#!/bin/sh" > ${_MK}
450 echo "set -ex" >> ${_MK}
451 echo "trap 'umount /dev || true' 0" >> ${_MK}
452 echo "_RELTARGET=\$${1:-doRELEASE}" >> ${_MK}
454 AUTO_KEYBOARD_DETECT \
487 echo "export ${var}=\"${${var}}\"" >> ${_MK}
490 # Don't remove this, or the build will fall over!
491 echo "export RELEASEDIR=${_R}" >> ${_MK}
492 echo "export PATH=/bin:/usr/bin:/sbin:/usr/sbin:${LOCALDIR}" >> ${_MK}
493 echo "export MANBUILDCAT=YES" >> ${_MK}
494 # NB: these may fail if the host is running w/o devfs
495 echo "umount /dev >/dev/null 2>&1 || true" >> ${_MK}
496 echo "mount -t devfs devfs /dev >/dev/null 2>&1 || true" >> ${_MK}
497 echo "if [ -x /etc/rc.d/ldconfig ]; then" >> ${_MK}
498 echo " /etc/rc.d/ldconfig start" >> ${_MK}
499 echo "else" >> ${_MK}
500 echo " ldconfig /lib /usr/lib /usr/local/lib || true" >> ${_MK}
502 echo "if [ ! -f /tmp/.world_done ]; then" >> ${_MK}
503 echo " cd /usr/src" >> ${_MK}
504 echo " ${CROSSMAKE} ${WORLD_FLAGS} -DNO_CLEAN buildworld && \\" >> ${_MK}
505 echo " touch /tmp/.world_done || exit 1" >> ${_MK}
507 echo "if [ ! -f /tmp/.skip_ports_index ]; then" >> ${_MK}
508 echo " echo \">>> make index started on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
509 echo " for i in ${MAKEINDEXPORTS}" >> ${_MK}
511 echo " cd /usr/ports/\$${i}" >> ${_MK}
512 echo " env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \\" >> ${_MK}
513 echo " make all install clean BATCH=yes FORCE_PKG_REGISTER=yes" >> ${_MK}
514 echo " done" >> ${_MK}
515 echo " cd /usr/ports" >> ${_MK}
516 echo " rm -f INDEX*" >> ${_MK}
517 echo " make index -DINDEX_PRISTINE" >> ${_MK}
518 echo " rm -f INDEX*.tmp" >> ${_MK}
519 echo " touch /tmp/.skip_ports_index" >> ${_MK}
520 echo " echo \">>> make index finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
522 echo "if [ ! -f /tmp/.skip_ports_readmes ]; then" >> ${_MK}
523 echo " echo \">>> make readmes started on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
524 echo " cd /usr/ports" >> ${_MK}
525 echo " make ${PORTREADMES_FLAGS} readmes" >> ${_MK}
526 echo " touch /tmp/.skip_ports_readmes" >> ${_MK}
527 echo " echo \">>> make readmes finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
529 echo "cd /usr/src/release" >> ${_MK}
530 echo "make obj" >> ${_MK}
531 echo "make \$${_RELTARGET}" >> ${_MK}
532 echo "echo \">>> make ${.TARGET} for ${TARGET} finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
535 touch ${CHROOTDIR}/tmp/.skip_ports_index
537 .if defined(NOPORTS) || defined(NOPORTREADMES)
538 touch ${CHROOTDIR}/tmp/.skip_ports_readmes
540 # Ensure md.ko is loaded if md(4) is not statically compiled into
542 -mdconfig 2>/dev/null
543 env -i /usr/sbin/chroot `dirname ${_MK}` /`basename ${_MK}`
546 rm -rf ${CRUNCH_TARGETS:S/$/_crunch/} release.[0-8] ${EXTRAS}
549 @for i in ${MAKEINDEXPORTS}; do \
550 cd ${CHROOTDIR}/usr/ports/$$i && \
551 make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \
552 checksum-recursive ; \
554 @for i in ${DOCPORTS}; do \
555 cd ${CHROOTDIR}/usr/ports/$$i && \
556 make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \
557 WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes \
558 checksum-recursive ; \
561 # Clean out ${_R} and make the directory structure.
564 -rm -rf ${_R}/* 2> /dev/null
565 -chflags -R noschg ${_R}/.
568 .if defined(MAKE_FLOPPIES)
573 for i in ${DISTRIBUTIONS}; do \
574 mkdir ${RD}/trees/$$i && \
575 mtree -deU -f ${MTREEFILES}/BSD.root.dist \
576 -p ${RD}/trees/$$i > /dev/null && \
577 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
578 -p ${RD}/trees/$$i/usr > /dev/null && \
579 mtree -deU -f ${MTREEFILES}/BSD.include.dist \
580 -p ${RD}/trees/$$i/usr/include > /dev/null && \
581 mtree -deU -f ${MTREEFILES}/BSD.var.dist \
582 -p ${RD}/trees/$$i/var > /dev/null ; \
586 # Install the system into the various distributions.
588 cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/base
589 cd ${.CURDIR}/.. && ${CROSSMAKE} ${WORLD_FLAGS} distributeworld \
593 # Make and install the generic kernel(s).
595 .for kernel in ${KERNELS}
597 ${CROSSMAKE} ${KERNEL_FLAGS} -DNO_MODULES \
598 KERNCONF=${kernel} INSTKERNNAME=${kernel} kernel \
599 DESTDIR=${RD}/trees/base
601 # Install a standard boot kernel+modules.
603 ${CROSSMAKE} ${KERNEL_FLAGS} \
605 DESTDIR=${RD}/trees/base; \
607 ${CROSSMAKE} ${KERNEL_FLAGS} -DNO_MODULES \
608 reinstallkernel -DINSTALL_DEBUG \
609 DESTDIR=${RD}/trees/base
612 # Make and install the three crunched binaries which live on the floppies.
613 # You are not supposed to like this :-)
616 mkdir -p ${RD}/crunch
617 .for j in ${CRUNCH_TARGETS}
618 .if exists(${.CURDIR}/${TARGET}/${j}_crunch.conf)
621 cd ${j}_crunch; ${WMAKEENV} crunchgen -o \
622 ${.CURDIR}/${TARGET}/${j}_crunch.conf
623 cd ${j}_crunch; ${WMAKE} -f ${j}_crunch.mk subclean
624 cd ${.CURDIR}/..; ${BINMAKE} -f Makefile.inc1 _build-tools
625 cd ${j}_crunch; CFLAGS="-Os -pipe" ${WMAKE} -f ${j}_crunch.mk \
627 ${WMAKEENV} strip -R .comment ${j}_crunch/${j}_crunch
628 mv ${j}_crunch/${j}_crunch ${RD}/crunch/${j}
634 # --==## Fix up the distributions. ##==--
637 # Create any "synthetic dists" now.
638 @for i in ${DISTRIBUTIONS}; do \
639 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
640 echo -n "Running $$i dist creation script... "; \
641 env RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
646 # Remove all the directories we don't need.
648 find ${OTHER_DISTS} -depth -type d -print | xargs rmdir
652 # --==## Package up the tarballs from assembled trees ##==--
657 @for i in ${DISTRIBUTIONS} ; \
659 if [ -d ${RD}/trees/$${i} ] ; then \
660 cd ${.CURDIR} && $(MAKE) doTARBALL \
661 SD=${RD}/trees/$${i} \
662 TN=$$i TD=$$i ARG="." && \
663 echo "$${i} distribution is finished."; \
666 .if !defined(NOPORTS)
667 # XXX: Inline stripped version of doTARBALL
668 @rm -rf ${RD}/dists/ports/ports*
669 @mkdir -p ${RD}/dists/ports
670 @echo rolling ports/ports tarball
671 @tar --exclude CVS --exclude 'ports/distfiles/*' \
672 --exclude README.html -czf ${RD}/dists/ports/ports.tgz -C /usr ports
673 @cp ${.CURDIR}/scripts/ports-install.sh ${RD}/dists/ports/install.sh
674 @(cd ${RD}/dists/ports; \
675 rm -f CHECKSUM.MD5; \
676 md5 * > CHECKSUM.MD5)
677 @echo "ports distribution is finished."
683 # --==## Make source dists ##==--
687 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \
688 TD=src TN=sbase ARG="[A-Z]*"
689 @for i in `cd /usr/src && echo [a-z]*` ; do \
690 if [ -d /usr/src/$$i ] ; then \
691 cd ${.CURDIR} && $(MAKE) doTARBALL \
692 TN=`echo s$$i | tr -d '.' | \
694 -e 's/kerberos5/krb5/'` \
695 SD=/usr/src TD=src ARG="$$i" ; \
698 .if defined(EXTRA_SRC)
699 @set ${EXTRA_SRC} && \
700 while [ $$# -ge 2 ] ; do \
701 if [ -d /usr/src/$$1 ] ; then \
702 cd ${.CURDIR} && $(MAKE) doTARBALL \
703 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
704 fi && shift && shift ; \
707 (cd ${RD}/dists/src; rm -f CHECKSUM.MD5; md5 * > CHECKSUM.MD5)
708 @echo "src distribution is finished."
712 # Build the memory root filesystem.
714 cp ${RD}/trees/base/etc/disktab /etc
718 mkdir -p etc/defaults dev mnt stand/etc/defaults stand/help
719 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
720 DIR=${RD}/mfsfd/stand ZIP=false
721 ( cd ${RD}/mfsfd && \
722 for dir in bin sbin ; do \
723 ln -sf /stand $$dir; \
725 cp ${RD}/trees/base/sbin/dhclient-script ${RD}/mfsfd/stand
726 .if ${TARGET} == "pc98"
727 cp ${.CURDIR}/../etc/defaults/pccard.conf \
728 ${RD}/mfsfd/etc/defaults/pccard.conf
730 cp ${.CURDIR}/../etc/usbd.conf ${RD}/mfsfd/etc/usbd.conf
731 ( for F in defaults/rc.conf netconfig protocols ; do \
732 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \
733 ${RD}/trees/base/etc/$$F > ${RD}/mfsfd/stand/etc/$$F ; \
735 grep -E '^(ftp|nameserver|domain|sunrpc|cmd|nfsd)[^-\w]' \
736 ${RD}/trees/base/etc/services | \
737 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \
738 > ${RD}/mfsfd/stand/etc/services
739 grep 'operator' ${RD}/trees/base/etc/group \
740 > ${RD}/mfsfd/stand/etc/group
741 ln ${RD}/mfsfd/stand/etc/services ${RD}/mfsfd/etc/services
742 ln ${RD}/mfsfd/stand/etc/group ${RD}/mfsfd/etc/group
743 ln ${RD}/mfsfd/stand/etc/netconfig ${RD}/mfsfd/etc/netconfig
744 cp ${RD}/trees/base/COPYRIGHT ${RD}/mfsfd/stand/help/COPYRIGHT.hlp
746 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
747 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
748 ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
750 @for i in ${DIST_DOCS_ARCH_DEP}; do \
751 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
752 ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
754 @mv ${RD}/mfsfd/stand/help/INSTALLATION.TXT \
755 ${RD}/mfsfd/stand/help/INSTALL.TXT
757 -test -f ${.CURDIR}/install.cfg \
758 && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
759 @mkdir -p ${RD}/mfsfd/boot
760 .if ${TARGET_ARCH} != "ia64" && ${TARGET_ARCH} != "powerpc"
761 @cp ${RD}/trees/base/boot/boot* ${RD}/mfsfd/boot
763 .if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64"
764 @cp ${RD}/trees/base/boot/mbr ${RD}/mfsfd/boot
766 @tar --exclude CVS -cf - -C ${.CURDIR}/../usr.sbin/sysinstall help | \
767 tar xf - -C ${RD}/mfsfd/stand
768 @mkdir -p ${RD}/mfsroot
769 sh -e ${DOFS_SH} ${RD}/mfsroot/mfsroot ${RD} ${MNT} \
770 ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL}
771 @gzip -9fnv ${RD}/mfsroot/mfsroot
774 KERNFLOPPYSET= ${RD}/floppyset/kern/kernel.gz
775 .if defined(SMALLFLOPPYSIZE)
776 SMALLKERNFLOPPYSET= ${RD}/floppyset/kern-small/kernel.gz
778 .if defined(SPLIT_MFSROOT)
779 MFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot/mfsroot.gz
780 .if defined(SMALLFLOPPYSIZE)
781 SMALLMFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot-small/mfsroot.gz
785 # Build boot and install floppies.
787 @gzip -9nc ${RD}/trees/base/boot/kernel/kernel > ${RD}/kernels/kernel.gz
788 @echo "Making the kernel boot floppies..."
789 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern \
790 FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz
791 .if defined(SMALLFLOPPYSIZE)
792 @echo "Making the small kernel boot floppies..."
793 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern-small \
794 FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz \
797 .if defined(SPLIT_MFSROOT)
798 @echo "Making the mfsroot boot floppies..."
799 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot \
800 FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz
801 .if defined(SMALLFLOPPYSIZE)
802 @echo "Making the small mfsroot boot floppies..."
803 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot-small \
804 FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz \
807 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \
808 KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \
809 MFSROOTFILE="${MFSROOTFLOPPYSET}.split ${MFSROOTFLOPPYSET}.boot"
810 .if defined(SMALLFLOPPYSIZE)
811 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \
812 KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \
813 MFSROOTFILE="${SMALLMFSROOTFLOPPYSET}.split ${SMALLMFSROOTFLOPPYSET}.boot" \
816 .else # !SPLIT_MFSROOT
817 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \
818 KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \
819 MFSROOTFILE=${RD}/mfsroot/mfsroot.gz
820 .if defined(SMALLFLOPPYSIZE)
821 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \
822 KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \
823 MFSROOTFILE=${RD}/mfsroot/mfsroot.gz \
826 .endif # SPLIT_MFSROOT
829 # Build fixit floppy.
831 @echo "Making fixit floppy."
832 @rm -rf ${RD}/fixitfd
834 @cd ${RD}/fixitfd && \
835 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
837 @cp ${RD}/trees/base/etc/spwd.db ${RD}/trees/base/etc/group \
839 @sed -e 's/#.*//' ${RD}/trees/base/etc/protocols \
840 > ${RD}/fixitfd/etc/protocols
841 @sed -e 's/#.*//' ${RD}/trees/base/usr/share/misc/scsi_modes \
842 > ${RD}/fixitfd/usr/share/misc/scsi_modes
843 @cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
844 @cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
845 @cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar
846 @chmod 555 ${RD}/fixitfd/stand/tar
847 .if defined(SMALLFLOPPYSIZE)
848 @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit-small \
849 DIR=${RD}/fixitfd/stand ZIP=false
850 @sh -e ${DOFS_SH} ${RD}/floppies/fixit-small.flp ${RD} ${MNT} \
851 ${SMALLFLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${SMALLFLOPPYLABEL}
852 @rm -rf ${RD}/fixitfd/stand
853 @mkdir ${RD}/fixitfd/stand
855 @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit \
856 DIR=${RD}/fixitfd/stand ZIP=false
857 @sh -e ${DOFS_SH} ${RD}/floppies/fixit.flp ${RD} ${MNT} \
858 ${FLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${FLOPPYLABEL}
861 # Do our last minute floppies directory setup
864 @cp ${RND}/${RELNOTES_LANG}/installation/${TARGET}/article.txt \
865 ${RD}/floppies/README.TXT
866 @(cd ${RD}/floppies; md5 README.TXT *.flp > CHECKSUM.MD5)
868 @(cd ${RD}/floppies; md5 *.flp > CHECKSUM.MD5)
873 # --==## Setup a suitable ftp-area ##==--
876 @echo "Setting up FTP distribution area"
878 -@ln -s . ${FD}/${BUILDNAME}
879 .if defined(MAKE_FLOPPIES)
880 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
882 @cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
884 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
885 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
886 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
887 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
888 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
890 @for i in ${DIST_DOCS_ARCH_DEP}; do \
891 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
892 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
893 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
894 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
896 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${FD}
897 @mv ${FD}/INSTALLATION.TXT ${FD}/INSTALL.TXT
898 @mv ${FD}/INSTALLATION.HTM ${FD}/INSTALL.HTM
900 @echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
904 # --==## Setup a suitable cdrom-area ##==--
907 @echo "Setting up CDROM distribution area"
908 @mkdir -p ${CD_BOOT} ${CD_DISC1} ${CD_DISC2}
909 -@ln -s . ${CD_DISC1}/${BUILDNAME}
910 .if defined(MAKE_FLOPPIES)
911 @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
913 @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}
914 @for i in ${DISTRIBUTIONS} ; \
916 if [ -d ${RD}/trees/$${i} ] ; then \
917 chflags -R noschg ${RD}/trees/$${i} || true ; \
918 ( cd ${RD}/trees/$${i} && \
919 find . -depth -print | cpio -dumpl ${CD_DISC2} ) ; \
922 @rm -f ${CD_DISC2}/.profile
923 @cp ${.CURDIR}/fixit.profile ${CD_DISC2}/.profile
924 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
925 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
926 .if !defined(NOPORTS) && !defined(NOPORTREADMES)
927 @tar --exclude CVS --exclude 'ports/distfiles/*' -czf - \
928 -C /usr ports | (cd ${CD_DISC2}/usr; tar -xpBf -)
931 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
932 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
933 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
934 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
935 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
937 @for i in ${DIST_DOCS_ARCH_DEP}; do \
938 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
939 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
940 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
941 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
943 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DISC1}
944 @mv ${CD_DISC1}/INSTALLATION.TXT ${CD_DISC1}/INSTALL.TXT
945 @mv ${CD_DISC1}/INSTALLATION.HTM ${CD_DISC1}/INSTALL.HTM
947 .if ${TARGET} != "pc98"
948 @echo "Setting up boot area"
949 @rm -f ${CD_DISC2}/boot/loader.conf
950 @cp ${RD}/mfsroot/mfsroot.gz ${CD_DISC2}/boot/mfsroot.gz
951 @echo 'mfsroot_load="YES"' > ${CD_DISC2}/boot/loader.conf
952 @echo 'mfsroot_type="mfs_root"' >> ${CD_DISC2}/boot/loader.conf
953 @echo 'mfsroot_name="/boot/mfsroot"' >> ${CD_DISC2}/boot/loader.conf
954 .if exists(${RD}/trees/base/boot/device.hints)
955 # Break the link to device.hints so we can modify it
956 @rm -f ${CD_DISC2}/boot/device.hints
957 @cp ${RD}/trees/base/boot/device.hints ${CD_DISC2}/boot/device.hints
958 .if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64"
959 @echo 'hint.atkbd.0.flags="0x1"' >> ${CD_DISC2}/boot/device.hints
963 @cp -Rp ${CD_DISC2}/boot ${CD_BOOT}
964 .if defined(MINIROOT)
965 @mkdir -p ${FD}/miniroot
966 @sh -e ${DOFS_SH} ${FD}/miniroot/miniroot.ufs \
967 ${RD} ${MNT} 0 ${CD_BOOT} 8192 auto
968 @gzip -9v ${FD}/miniroot/miniroot.ufs
971 @cp -Rp ${CD_DISC2}/boot ${CD_DISC1}
976 .if exists(${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh)
977 @echo "Creating ISO images..."
979 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
981 ${CD}/${BUILDNAME}-${TARGET}-bootonly.iso ${CD_BOOT}
983 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
985 ${CD}/${BUILDNAME}-${TARGET}-${DISC1_NAME}.iso ${CD_DISC1}
986 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
988 ${CD}/${BUILDNAME}-${TARGET}-${DISC2_NAME}.iso ${CD_DISC2}
989 .if defined(CD_EXTRA_BITS)
990 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
992 ${CD}/${BUILDNAME}-${TARGET}-disc1.iso ${CD_DISC1} \
996 @(cd ${CD} && md5 *.iso > ${BUILDNAME}-${TARGET}-iso.CHECKSUM.MD5)
999 @echo "Do not know how to create an ISO for ${TARGET_ARCH}."
1003 # --==## Documentation Project files such as the Handbook and FAQ ##==--
1006 @echo "Making docs..."
1007 @for i in ${DOCPORTS}; do \
1008 cd /usr/ports/$$i && \
1009 env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \
1010 make all install clean BATCH=yes WITHOUT_X11=yes JADETEX=no \
1011 WITHOUT_PYTHON=yes FORCE_PKG_REGISTER=yes; \
1013 @cd /usr/doc && make all install 'FORMATS=html html-split txt' \
1014 INSTALL_COMPRESSED='' DOCDIR=${RD}/trees/base/usr/share/doc \
1019 # --==## RELNOTESng: Next-generation replacements for *.TXT files ##==--
1022 @echo "Making release documentation..."
1023 @cd ${.CURDIR}/doc && make all install clean 'FORMATS=html txt' \
1024 INSTALL_COMPRESSED='' DOCDIR=${RND}
1027 # Various "subroutine" and other supporting targets.
1035 @echo "SD undefined in doTARBALL" && exit 1
1038 @echo "TD undefined in doTARBALL" && exit 1
1041 @echo "ARG undefined in doTARBALL" && exit 1
1043 @rm -rf ${RD}/dists/${TD}/${TN}*
1044 @mkdir -p ${RD}/dists/${TD}
1046 tn=`echo ${TN} | tr 'A-Z' 'a-z' | cut -c1-8` && \
1047 echo rolling ${TD}/$$tn tarball &&\
1048 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
1049 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
1050 sh ${.CURDIR}/scripts/info.sh ${RD}/dists/${TD}/$$tn \
1051 > ${RD}/dists/${TD}/$$tn.inf && \
1052 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
1053 cp -p ${.CURDIR}/scripts/$${TD}-install.sh \
1054 ${RD}/dists/${TD}/install.sh; \
1056 if [ "${SD}" != "/usr/src" ]; then \
1057 mtree -c -i -p ${SD}/${ARG} \
1058 -k gname,md5digest,mode,nlink,uname,size,link,type \
1059 > ${RD}/dists/${TD}/$$tn.mtree ; \
1063 ( cd ${RD}/dists/${TD}; \
1064 rm -f CHECKSUM.MD5; \
1065 md5 * > CHECKSUM.MD5 ) \
1068 doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 \
1069 release.5 release.6 release.7 release.8 ${EXTRAS}
1070 @echo "Release done"
1073 @rm -f release.4 release.8 floppies.[123]
1074 @cd ${.CURDIR} && ${MAKE} release.4 release.8 floppies.1 floppies.2 \
1076 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
1079 .if !defined(CRUNCH)
1080 @echo "CRUNCH undefined in installCRUNCH" && exit 1
1083 @echo "DIR undefined in installCRUNCH" && exit 1
1086 @echo "ZIP undefined in installCRUNCH" && exit 1
1089 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
1091 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
1093 @chmod 555 ${DIR}/${CRUNCH}_crunch
1094 @if [ -f ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf ] ; then \
1095 for i in `crunchgen -l ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf` ; do \
1096 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
1099 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
1100 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
1105 # --==## Build a floppy set for a splitfs file ##==--
1107 # FLOPPYBASE - basename of floppy image files
1108 # FLOPPYDESC - description of floppy set
1109 # SPLITFILE - filename of the file to split
1110 # FDSIZE - if specified and "small", small floppy is created
1112 .if make(makeFloppySet)
1113 SPLITDIR= ${RD}/floppyset/${FLOPPYBASE}
1114 .if defined(FDSIZE) && ${FDSIZE} == "SMALL"
1115 FLPSPLITSIZE= ${SMALLFLOPPYSPLITSIZE}
1116 FLPSIZE= ${SMALLFLOPPYSIZE}
1117 FLPLABEL= ${SMALLFLOPPYLABEL}
1119 FLPSPLITSIZE= ${FLOPPYSPLITSIZE}
1120 FLPSIZE= ${FLOPPYSIZE}
1121 FLPLABEL= ${FLOPPYLABEL}
1126 .if !defined(FLOPPYBASE)
1127 @echo "FLOPPYBASE undefined in ${.TARGET}" && exit 1
1129 .if !defined(FLOPPYDESC)
1130 @echo "FLOPPYDESC undefined in ${.TARGET}" && exit 1
1132 .if !defined(SPLITFILE)
1133 @echo "SPLITFILE undefined in ${.TARGET}" && exit 1
1135 sh ${.CURDIR}/scripts/split-file.sh ${SPLITFILE} \
1136 ${RD}/floppyset/${FLOPPYBASE} ${FLPSPLITSIZE} "${FLOPPYDESC}"
1137 ( splitfile=${SPLITDIR}/`basename ${SPLITFILE}`.split ; \
1138 lines=`cat $${splitfile} | wc -l`; \
1139 lines=$$(($$lines - 1)) ; \
1140 for line in `jot $$lines`; do \
1141 file=`head -n $$(($${line} + 1)) $${splitfile} | tail -1 | cut -f 1 -d ' '` ; \
1142 sh -e ${DOFS_SH} ${RD}/floppies/${FLOPPYBASE}$${line}.flp \
1143 ${RD} ${MNT} ${FLPSIZE} ${SPLITDIR}/$${file} \
1144 ${BOOTINODE} ${FLPLABEL}; \
1148 # --==## Build a boot floppy ##==--
1150 # FSIMAGE - base floppy image name
1151 # FDSIZE - if specified and "small", small floppy is created
1152 # KERNFILE - path to kernel split file
1153 # MFSROOTFILE - path to mfsroot split file
1155 .if make(buildBootFloppy)
1156 IMAGEDIR= ${RD}/image.${FSIMAGE}
1157 BOOTDIR= ${RD}/trees/base/boot
1158 HINTSFILE= ${BOOTDIR}/device.hints
1159 ACPI_KO= ${BOOTDIR}/kernel/acpi.ko
1160 IMAGEFILE= ${RD}/floppies/${FSIMAGE}.flp
1161 .if defined(FDSIZE) && ${FDSIZE} == "SMALL"
1162 FLPSIZE= ${SMALLFLOPPYSIZE}
1163 FLPLABEL= ${SMALLFLOPPYLABEL}
1165 FLPSIZE= ${FLOPPYSIZE}
1166 FLPLABEL= ${FLOPPYLABEL}
1171 .if !defined(FSIMAGE)
1172 @echo "FSIMAGE undefined in ${.TARGET}" && exit 1
1174 .if !defined(KERNFILE)
1175 @echo "KERNFILE undefined in ${.TARGET}" && exit 1
1177 .if !defined(MFSROOTFILE)
1178 @echo "MFSROOTFILE undefined in ${.TARGET}" && exit 1
1180 @echo "Running ${.TARGET} for ${FSIMAGE}"
1183 @echo "Setting up /boot directory for ${FSIMAGE} floppy"
1184 @mkdir -p ${IMAGEDIR}/boot
1185 .if ${TARGET} == "i386"
1186 @${WMAKEENV} kgzip -v -l ${RD}/trees/base/usr/lib/kgzldr.o -o \
1187 ${IMAGEDIR}/boot/loader ${BOOTDIR}/loader
1189 @cp ${BOOTDIR}/loader ${IMAGEDIR}/boot
1191 @cp -Rp ${BOOTDIR}/*.4th ${BOOTDIR}/defaults ${BOOTDIR}/loader.help \
1192 ${BOOTDIR}/loader.rc ${IMAGEDIR}/boot
1193 .if exists(${HINTSFILE})
1194 @cp ${HINTSFILE} ${IMAGEDIR}/boot/device.hints
1195 .if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64"
1196 @echo 'hint.atkbd.0.flags="0x1"' >> ${IMAGEDIR}/boot/device.hints
1198 @gzip -9n ${IMAGEDIR}/boot/device.hints
1200 @gzip -9n ${IMAGEDIR}/boot/*.4th ${IMAGEDIR}/boot/loader.help \
1201 ${IMAGEDIR}/boot/defaults/loader.conf
1202 @echo 'bootfile="/kernel"' > ${IMAGEDIR}/boot/loader.conf
1203 .if exists(${ACPI_KO})
1204 @gzip -9nc ${ACPI_KO} > ${IMAGEDIR}/acpi.ko.gz
1205 @echo 'acpi_load="YES"' >> ${IMAGEDIR}/boot/loader.conf
1206 @echo 'acpi_name="/acpi.ko"' >> ${IMAGEDIR}/boot/loader.conf
1207 @echo 'acpi_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
1209 @echo 'mfsroot_load="YES"' >> ${IMAGEDIR}/boot/loader.conf
1210 @echo 'mfsroot_type="mfs_root"' >> ${IMAGEDIR}/boot/loader.conf
1211 @echo 'mfsroot_name="/mfsroot"' >> ${IMAGEDIR}/boot/loader.conf
1212 .if !exists(${ACPI_KO})
1213 @echo 'mfsroot_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
1215 .if ${TARGET_ARCH} == "i386" && ${AUTO_KEYBOARD_DETECT}
1216 @echo "-P" >> ${IMAGEDIR}/boot.config
1219 @cp ${KERNFILE} ${MFSROOTFILE} ${IMAGEDIR}
1220 sh -e ${DOFS_SH} ${IMAGEFILE} ${RD} ${MNT} ${FLPSIZE} ${IMAGEDIR} \
1221 ${BOOTINODE} ${FLPLABEL}
1222 @echo "Created ${RD}/floppies/${FSIMAGE}.flp"
1224 .include <bsd.obj.mk>