1 # $FreeBSD: src/release/Makefile,v 1.536.2.110 2003/05/10 23:01:29 murray Exp $
3 # make release CHROOTDIR=/some/dir BUILDNAME=somename 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 vn driver must also be compiled into your kernel,
13 # otherwise the target 'release.8' and possibly others will fail.
15 # Note: "/some/dir" cannot reside on a filesystem mounted with
16 # the "nodev" option, otherwise the chrooted "buildworld" will likely
19 # Note: If you add options to this file, please keep release(7) updated!
21 # Set these, release builder!
24 #BUILDNAME=4.0-RELEASE
26 # Automatic SNAP versioning:
29 BUILDNAME?=${BASE}-${DATE}-STABLE
31 #CHROOTDIR=/junk/release
32 # If this is a -stable snapshot, then set
34 # If you want to add other options to CVS commands, then set
35 #CVSCMDARGS="-D '01/01/2002 00:00:00 UTC'"
37 # Non-zero if ${RELEASETAG} is in the form "RELENG_ver_RELEASE"; we
38 # are building an official release. Otherwise, we are building for
40 .if defined(RELEASETAG)
41 ISRELEASE!= expr "${RELEASETAG}" : '^RELENG_.*_RELEASE$$' || true
43 # Convert "RELENG_ver_RELEASE" to "RELEASE_ver" for ports and doc trees.
44 AUXRELEASETAG!= echo ${RELEASETAG} | sed -e 's/^RELENG_/RELEASE_/' -e 's/_RELEASE$$//'
45 DOCRELEASETAG?= ${AUXRELEASETAG}
46 PORTSRELEASETAG?= ${AUXRELEASETAG}
50 # If you want to pass flags to the world build such as -j X, use
51 # WORLD_FLAGS. Similarly, you can specify make flags for kernel
52 # builds via KERNEL_FLAGS.
53 # Similarly, you can specify make flags for make readmes via PORTREADMES_FLAGS.
56 #PORTREADMES_FLAGS=-j4
58 TARGET_ARCH?= ${MACHINE_ARCH}
59 .if ${TARGET_ARCH} == ${MACHINE_ARCH}
62 TARGET?= ${TARGET_ARCH}
64 CROSSMAKE= ${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}
65 NATIVEMAKE= ${MAKE} TARGET_ARCH=${MACHINE_ARCH} TARGET=${MACHINE}
67 # If you are using a local CVS repository with components stored in
68 # non-standard modules, override these on the make commandline or
70 RELEASESRCMODULE?= src
71 RELEASEDOCMODULE?= doc
72 RELEASEPORTSMODULE?= ports
74 # Unless set elsewhere, indicate the object format we'll be using.
77 # Comment this out to enable port readmes to be built.
80 # Uncomment this to disable the doc.1 target. Docs normally require
81 # the ports tree, so NOPORTS can be set together with NODOC in order
82 # to have neither ports or docs. If only NOPORTS is set to YES, but
83 # docs are still desired, the DOMINIMALDOCPORTS logic below will only
84 # install the ports that are minimally required for the docs. This is
85 # intended as a compromise, less disk space is required than for using
86 # the entire ports collection (and much less time due to the huge number
87 # of directories it would create), but still quite a bit as well as some
88 # CPU cycles (some of the programs are C++, and things like ghostscript
89 # belong to the required ports nevertheless).
91 # Setting this also disables building of release note documentation
96 # Modify this definition if you want the release notes
97 # and other release documentation in a language other than English.
98 RELNOTES_LANG?= en_US.ISO8859-1
100 # As an alternative to installing the entire ports collection (which
101 # can take a huge amount of time, in particular on slower disks),
102 # setting ${MINIMALDOCPORTS} allows to install and build just those
103 # ports that are really required for getting the docs up & running.
104 .if defined(NOPORTS) && !defined(NODOC)
105 DOMINIMALDOCPORTS= YES
106 .include "Makefile.inc.docports"
111 .if !defined(DOMINIMALDOCPORTS) || ${DOMINIMALDOCPORTS} != "YES"
116 # By default, documentation (Handbook, FAQ, etc.) is built for all
117 # the languages. To speed up building, set the DOC_LANG to just
118 # the languages you need. (The language for the release notes is
119 # controlled by the RELNOTES_LANG variable above.)
120 #DOC_LANG= en_US.ISO8859-1
121 DOCPORTS= textproc/docproj
122 # Set this to wherever the distfiles required by release procedures.
123 .if defined(DOCDISTFILES)
124 # Respect DOCDISTFILES which is used before.
125 RELEASEDISTFILES?= ${DOCDISTFILES}
127 RELEASEDISTFILES?= ${.CURDIR}/../../ports/distfiles
129 # Set this to 1 if you want -P to be used for automatic keyboard detection
130 # on the boot floppy. WARNING: Breaks on some Athlon (K7) motherboards.
131 AUTO_KEYBOARD_DETECT?= 0
134 DIST_DOCS_ARCH_INDEP= readme errata
135 DIST_DOCS_ARCH_DEP= installation relnotes hardware
138 # Things which without too much trouble can be considered variables
139 # BIN_DISTS are special in that they get full /etc installation sets.
141 .if ${TARGET_ARCH} == "i386"
142 COMPAT_DISTS?= compat1x compat20 compat21 compat22 compat3x compat4x
144 COMPAT_DISTS?= compat4x
146 OTHER_DISTS?= catpages manpages games proflibs dict info doc
147 CRYPTO_DISTS?= crypto krb4 krb5
149 DISTRIBUTIONS?= ${BIN_DISTS} ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS}
151 BOOT1= etc/protocols etc/defaults/rc.conf
153 # mountpoint for filesystems.
156 # Various floppy image parameters.
159 .if ${TARGET_ARCH} == "i386"
160 .if ${TARGET} == "pc98"
168 SMALLBOOTLABEL= fd1200
183 BIGBOOTLABEL= minimum2
185 .elif ${TARGET_ARCH} == "alpha"
196 BIGBOOTLABEL= minimum2
199 ZIPNSPLIT= gzip --no-name -9 -c | split -b 240640 -
201 # Things that need to be recompiled with Kerberos support.
202 .if exists(${.CURDIR}/../kerberosIV) && exists(${.CURDIR}/../crypto) && !defined(NOKERBEROS)
203 K4PROGS!= cd ${.CURDIR}/../kerberosIV; ${MAKE} -V KPROGS
205 .if exists(${.CURDIR}/../kerberos5) && exists(${.CURDIR}/../crypto) && !defined(NOKERBEROS)
206 K5PROGS!= cd ${.CURDIR}/../kerberos5; ${MAKE} -V KPROGS
209 # Things that need to be compiled without crypto support in releases
210 .if !defined(FIXCRYPTO)
211 FIXCRYPTO= bin/ed usr.sbin/ppp usr.sbin/pppd usr.sbin/tcpdump/tcpdump \
212 lib/libfetch usr.bin/fetch
213 .if !defined(NO_SENDMAIL)
214 FIXCRYPTO+= usr.sbin/sendmail
221 # Things which may get you into trouble if you change them
222 MTREEFILES= ${.CURDIR}/../etc/mtree
225 RND= ${RD}/release.doc
228 CD_DISC1= ${CD}/disc1
229 CD_DISC2= ${CD}/disc2
231 # Where the bootstrap ports (see DOCPORTS) get installed.
232 LOCALDIR= /usr/local/bin
234 .if !defined(CRUNCH_TARGETS)
235 CRUNCH_TARGETS= boot fixit
239 .if !defined(NOCDROM)
241 .if defined(MAKE_ISOS)
244 .if ${TARGET} != "pc98"
253 TMAKE!= echo MAKEFLAGS=\"-m ${.CURDIR}/../share/mk\"; \
254 cd ${.CURDIR}/..; ${MAKE} -f Makefile.inc1 -V TMAKE
255 WMAKEENV!= echo MAKEFLAGS=\"-m ${.CURDIR}/../share/mk\"; \
256 cd ${.CURDIR}/..; ${CROSSMAKE} -f Makefile.inc1 -V WMAKEENV
257 WMAKE= ${WMAKEENV} ${MAKE}
260 .if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT)
261 @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false
263 .if defined(NOPORTSATALL) && !defined(NODOC)
264 @echo "Ports are required for building the docs. Either set NODOC or"
265 @echo "unset NOPORTS, or set at least DOMINIMALDOCPORTS to YES!"
269 .if exists(${CHROOTDIR})
270 # The first command will fail on a handful of files that have their schg
271 # flags set. But it greatly speeds up the next two commands.
272 -rm -rf ${CHROOTDIR} 2>/dev/null
273 -chflags -R noschg ${CHROOTDIR}/.
276 mkdir -p ${CHROOTDIR}
277 @echo ">>> make release for ${TARGET} started on `LC_ALL=C TZ=GMT date`"
278 cd ${.CURDIR}/.. && ${NATIVEMAKE} -DNOGAMES -DNOHTML -DNOINFO -DNOMAN \
279 -DNOPROFILE installworld DESTDIR=${CHROOTDIR}
280 cd ${.CURDIR}/../etc && ${NATIVEMAKE} distribution DESTDIR=${CHROOTDIR}
281 if [ -f /etc/resolv.conf ]; then \
282 cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \
284 .if !defined(RELEASETAG)
285 cd ${CHROOTDIR}/usr && rm -rf src && \
286 cvs -R -d ${CVSROOT} co ${CVSCMDARGS} -P ${RELEASESRCMODULE}
288 cd ${CHROOTDIR}/usr && rm -rf src && \
289 cvs -R -d ${CVSROOT} co ${CVSCMDARGS} -P -r ${RELEASETAG} ${RELEASESRCMODULE}
291 .if defined(LOCAL_PATCHES) && exists(${LOCAL_PATCHES})
292 cd ${CHROOTDIR}/usr/src && patch ${PATCH_FLAGS} < ${LOCAL_PATCHES}
294 .if defined(LOCAL_SCRIPT) && exists(${LOCAL_SCRIPT})
295 cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT}
297 .if !defined(NOPORTS)
298 .if defined(PORTSRELEASETAG)
299 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co ${CVSCMDARGS} -P -r ${PORTSRELEASETAG} ${RELEASEPORTSMODULE}
301 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co ${CVSCMDARGS} -P ${RELEASEPORTSMODULE}
303 .elif defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES"
304 .if defined(PORTSRELEASETAG)
305 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co ${CVSCMDARGS} -P -r ${PORTSRELEASETAG} ${MINIMALDOCPORTS}
307 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co ${CVSCMDARGS} -P ${MINIMALDOCPORTS}
311 .if defined(DOCRELEASETAG)
312 cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co ${CVSCMDARGS} -P -r ${DOCRELEASETAG} ${RELEASEDOCMODULE}
314 cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co ${CVSCMDARGS} -P ${RELEASEDOCMODULE}
316 if [ -d ${RELEASEDISTFILES}/ ]; then \
317 cp -rp ${RELEASEDISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \
319 mkdir -p ${CHROOTDIR}/usr/ports/distfiles; \
321 .if defined(PREFETCHDISTFILES)
322 @for i in ${DOCPORTS}; do \
323 cd ${CHROOTDIR}/usr/ports/$$i && \
324 make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \
325 WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes \
332 .if !defined(RELEASENOUPDATE)
333 .if !defined(RELEASETAG)
334 cd ${CHROOTDIR}/usr/src && cvs -R -q update ${CVSCMDARGS} -P -d -A
336 cd ${CHROOTDIR}/usr/src && cvs -R -q update ${CVSCMDARGS} -P -d -r ${RELEASETAG}
338 .if !defined(NOPORTS)
339 cd ${CHROOTDIR}/usr/ports && cvs -R -q update ${CVSCMDARGS} -P -d
341 .if defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES"
342 for i in ${MINIMALDOCPORTS}; do \
343 ( cd ${CHROOTDIR}/usr/$$i && cvs -R -q update ${CVSCMDARGS} -P -d ) ; \
347 cd ${CHROOTDIR}/usr/doc && cvs -R -q update ${CVSCMDARGS} -P -d
351 # Add version information to those things that need it.
352 ( cd ${CHROOTDIR}/usr/src/sys/conf && \
353 mv newvers.sh foo && \
354 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && rm foo )
355 echo OBJFORMAT=${OBJFORMAT} > ${CHROOTDIR}/etc/objformat
356 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
357 echo "#!/bin/sh" > ${CHROOTDIR}/mk
358 echo "set -ex" >> ${CHROOTDIR}/mk
359 echo "_RELTARGET=\$${1:-doRELEASE}" >> ${CHROOTDIR}/mk
360 echo "export MODULES_WITH_WORLD=YES" >> ${CHROOTDIR}/mk
362 AUTO_KEYBOARD_DETECT \
392 echo "export ${var}=\"${${var}}\"" >> ${CHROOTDIR}/mk
395 # Don't remove this, or the build will fall over!
396 echo "export RELEASEDIR=${_R}" >> ${CHROOTDIR}/mk
397 echo "export PATH=/bin:/usr/bin:/sbin:/usr/sbin:${LOCALDIR}" >> ${CHROOTDIR}/mk
398 echo "export MANBUILDCAT=YES" >> ${CHROOTDIR}/mk
399 echo "if [ ! -f /tmp/.world_done ]; then" >> ${CHROOTDIR}/mk
400 echo " cd /usr/src" >> ${CHROOTDIR}/mk
401 echo " ${CROSSMAKE} ${WORLD_FLAGS} -DNOCLEAN buildworld && \\" >> ${CHROOTDIR}/mk
402 echo " touch /tmp/.world_done" >> ${CHROOTDIR}/mk
403 echo "fi" >> ${CHROOTDIR}/mk
404 .if defined(NOPORTS) || defined(NOPORTREADMES)
405 echo "if false; then" >> ${CHROOTDIR}/mk
407 echo "if true; then" >> ${CHROOTDIR}/mk
409 echo " echo \">>> make readmes started on \`LC_ALL=C TZ=GMT date\`\"" >> ${CHROOTDIR}/mk
410 echo " cd /usr/ports" >> ${CHROOTDIR}/mk
411 echo " make ${PORTREADMES_FLAGS} readmes" >> ${CHROOTDIR}/mk
412 echo " echo \">>> make readmes finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${CHROOTDIR}/mk
413 echo "fi" >> ${CHROOTDIR}/mk
414 echo "cd /usr/src/release" >> ${CHROOTDIR}/mk
415 echo "make obj" >> ${CHROOTDIR}/mk
416 echo "make \$${_RELTARGET}" >> ${CHROOTDIR}/mk
417 echo "echo \">>> make ${.TARGET} for ${TARGET} finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${CHROOTDIR}/mk
418 chmod 755 ${CHROOTDIR}/mk
419 env -i /usr/sbin/chroot ${CHROOTDIR} /mk
422 rm -rf boot_crunch release.[0-9]
424 # Clean out ${_R} and make the directory structure.
427 -rm -rf ${_R}/* 2> /dev/null
428 -chflags -R noschg ${_R}/.
434 for i in ${DISTRIBUTIONS} ; do \
435 mkdir ${RD}/trees/$$i && \
436 mtree -deU -f ${MTREEFILES}/BSD.root.dist \
437 -p ${RD}/trees/$$i > /dev/null && \
438 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
439 -p ${RD}/trees/$$i/usr > /dev/null && \
440 mtree -deU -f ${MTREEFILES}/BSD.include.dist \
441 -p ${RD}/trees/$$i/usr/include > /dev/null && \
442 mtree -deU -f ${MTREEFILES}/BSD.var.dist \
443 -p ${RD}/trees/$$i/var > /dev/null ; \
447 # Install the system into the various distributions.
449 cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/bin
450 cd ${.CURDIR}/.. && ${CROSSMAKE} distributeworld DISTDIR=${RD}/trees
453 # Build and install crypto, krb4 and krb5 distributions.
455 # Handle some grief caused by the munition braindeadness.
457 ${CROSSMAKE} ${WORLD_FLAGS} -DNO_MAKEDB_RUN -DNOCRYPT \
458 SUBDIR_OVERRIDE="${FIXCRYPTO}" \
459 buildworld distributeworld DISTDIR=${RD}/trees
460 .if exists(${.CURDIR}/../kerberosIV) && exists(${.CURDIR}/../crypto) && !defined(NOKERBEROS)
462 ${CROSSMAKE} ${WORLD_FLAGS} -DNO_MAKEDB_RUN -DMAKE_KERBEROS4 \
463 SUBDIR_OVERRIDE="kerberosIV ${K4PROGS}" \
464 buildworld distributeworld DISTDIR=${RD}/trees
466 .if exists(${.CURDIR}/../kerberos5) && exists(${.CURDIR}/../crypto) && !defined(NOKERBEROS)
468 ${CROSSMAKE} ${WORLD_FLAGS} -DNO_MAKEDB_RUN -DMAKE_KERBEROS5 \
469 SUBDIR_OVERRIDE="kerberos5 ${K5PROGS}" \
470 buildworld distributeworld DISTDIR=${RD}/trees
472 -chflags -R noschg ${RD}/trees
475 # Make and install the generic kernel(s).
477 .for kernel in ${KERNELS}
479 ${CROSSMAKE} ${KERNEL_FLAGS} -DNO_MODULES \
480 KERNCONF=${kernel} INSTKERNNAME=kernel.${kernel} kernel \
481 DESTDIR=${RD}/trees/bin
483 # Install a standard boot kernel.
485 ${CROSSMAKE} ${KERNEL_FLAGS} \
486 INSTKERNNAME=kernel.GENERIC kernel \
487 DESTDIR=${RD}/trees/bin
490 # Make and install the three crunched binaries which live on the floppies.
491 # You are not supposed to like this :-)
494 mkdir -p ${RD}/crunch
495 .for j in ${CRUNCH_TARGETS}
498 .if exists(${.CURDIR}/${TARGET}/${j}_crunch.conf)
499 cd ${j}_crunch; ${WMAKEENV} crunchgen -o ${.CURDIR}/${TARGET}/${j}_crunch.conf
501 cd ${j}_crunch; ${WMAKEENV} crunchgen -o ${.CURDIR}/${j}_crunch.conf
503 cd ${j}_crunch; ${WMAKE} -f ${j}_crunch.mk subclean
504 cd ${.CURDIR}/..; ${TMAKE} build-tools
505 cd ${j}_crunch; ${WMAKE} -f ${j}_crunch.mk all
506 ${WMAKEENV} strip -R .comment ${j}_crunch/${j}_crunch
507 mv ${j}_crunch/${j}_crunch ${RD}/crunch/${j}
512 # --==## Fix up the distributions. ##==--
515 # Create any "synthetic dists" now.
516 @for i in ${DISTRIBUTIONS}; do \
517 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
518 echo -n "Running $$i dist creation script... "; \
519 env OBJFORMAT=${OBJFORMAT} RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
524 # Remove all the directories we don't need.
526 find ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} -depth -type d -print | xargs rmdir
530 # --==## Package up the tarballs from assembled trees ##==--
535 @for i in ${DISTRIBUTIONS} ; \
537 if [ -d ${RD}/trees/$${i} ] ; then \
538 cd ${.CURDIR} && $(MAKE) doTARBALL \
539 SD=${RD}/trees/$${i} \
540 TN=$$i TD=$$i ARG="." && \
541 echo "$${i} distribution is finished."; \
544 # More munition braindeadness.
545 ( cd ${RD}/dists && \
546 if [ -f krb4/krb4.aa ] ; then \
547 mv krb4/krb4.* crypto && \
548 cat krb4/CHECKSUM.MD5 >> crypto/CHECKSUM.MD5 && \
551 ( cd ${RD}/dists && \
552 if [ -f krb5/krb5.aa ] ; then \
553 mv krb5/krb5.* crypto && \
554 cat krb5/CHECKSUM.MD5 >> crypto/CHECKSUM.MD5 && \
561 # --==## Make source dists ##==--
565 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \
566 TD=src TN=sbase ARG="[A-Z]*"
567 @for i in `cd /usr/src && echo [a-z]*` ; do \
568 if [ -d /usr/src/$$i ] ; then \
569 cd ${.CURDIR} && $(MAKE) doTARBALL \
570 TN=`echo s$$i | tr -d '.' | \
572 -e 's/kerberosIV/krb4/' \
573 -e 's/kerberos5/krb5/'` \
574 SD=/usr/src TD=src ARG="$$i" ; \
577 .if defined(EXTRA_SRC)
578 @set ${EXTRA_SRC} && \
579 while [ $$# -ge 2 ] ; do \
580 if [ -d /usr/src/$$1 ] ; then \
581 cd ${.CURDIR} && $(MAKE) doTARBALL \
582 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
583 fi && shift && shift ; \
586 if [ -d ${RD}/dists/crypto ] ; then ( cd ${RD}/dists/src && \
587 if [ -f ssecure.aa ] ; then mv ssecure.* ../crypto ; fi && \
588 if [ -f scrypto.aa ] ; then mv scrypto.* ../crypto ; fi && \
589 if [ -f skrb4.aa ] ; then mv skrb4.* ../crypto ; fi && \
590 if [ -f skrb5.aa ] ; then mv skrb5.* ../crypto ; fi ; \
591 cd ${RD}/dists/crypto; rm -f CHECKSUM.MD5; \
592 md5 * > CHECKSUM.MD5 ) ; fi
593 (cd ${RD}/dists/src; rm -f CHECKSUM.MD5; md5 * > CHECKSUM.MD5)
594 @echo "src distribution is finished."
598 # Complete the bootfd
600 # Now, just to get this picture down once and for all:
602 # +------------------------------------------------------------------------+
604 # +-----+-----+------------------------------------------------------------+
605 # |boot1|boot2|floppy filesystem "bootfd" |
606 # +-----+-----+-+----------------------+---------------------------------+-+
607 # |kernel.gz |mfsroot.gz |
608 # +----------------------+---------------------------------+
612 -vnconfig 2>/dev/null
616 mkdir -p etc/defaults dev mnt stand/help
617 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
618 DIR=${RD}/mfsfd/stand ZIP=false
619 ( cd ${RD}/trees/bin/dev && \
620 ls console tty bpf0 ttyd0 ttyv0 ttyv1 ttyv2 ttyv3 null zero card0 card1 card2 card3 usb usb0 uhid0 ums0 ulpt0 ugen0 kbd0 kmem mem xpt0 | \
621 cpio -dump ${RD}/mfsfd/dev )
622 ( cd ${RD}/mfsfd/dev && rm -f *[swo]d*[bdefgh] )
623 ( cd ${RD}/mfsfd && \
624 for dir in bin sbin ; do \
625 ln -sf /stand $$dir; \
627 cp ${RD}/trees/bin/sbin/dhclient-script ${RD}/mfsfd/stand
628 .if ${TARGET_ARCH} == "i386"
629 cp ${.CURDIR}/../etc/defaults/pccard.conf ${RD}/mfsfd/etc/defaults/pccard.conf
631 cp ${.CURDIR}/../etc/usbd.conf ${RD}/mfsfd/etc/usbd.conf
632 cd ${RD}/trees/bin && ls ${BOOT1} | cpio -dump ${RD}/mfsfd/stand
633 echo "nameserver 42/tcp name" > ${RD}/mfsfd/stand/etc/services
634 echo "ftp 21/tcp" >> ${RD}/mfsfd/stand/etc/services
635 echo "domain 53/tcp nameserver" >> ${RD}/mfsfd/stand/etc/services
636 echo "domain 53/udp nameserver" >> ${RD}/mfsfd/stand/etc/services
637 echo "cmd 514/tcp shell" >> ${RD}/mfsfd/stand/etc/services
638 gzip -9c ${RD}/trees/bin/COPYRIGHT > ${RD}/mfsfd/stand/help/COPYRIGHT.hlp.gz
640 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
641 gzip -9c ${RND}/${RELNOTES_LANG}/$$i/article.txt > ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT.gz; \
643 @for i in ${DIST_DOCS_ARCH_DEP}; do \
644 gzip -9c ${RND}/${RELNOTES_LANG}/$$i/${TARGET_ARCH}/article.txt > ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT.gz; \
646 @mv ${RD}/mfsfd/stand/help/INSTALLATION.TXT.gz ${RD}/mfsfd/stand/help/INSTALL.TXT.gz
648 -test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
649 @mkdir -p ${RD}/mfsfd/boot
650 @cp ${RD}/trees/bin/boot/boot* ${RD}/mfsfd/boot
651 .if ${TARGET} == "i386"
652 @cp ${RD}/trees/bin/boot/mbr ${RD}/mfsfd/boot
654 @cp ${RD}/trees/bin/boot/loader.help ${RD}/mfsfd/boot
655 @echo "Making the regular boot floppy."
656 @tar --exclude CVS -cf - -C ${.CURDIR}/sysinstall help | \
657 tar xf - -C ${RD}/mfsfd/stand
658 @echo "Compressing doc files..."
659 @gzip -9 ${RD}/mfsfd/stand/help/*.hlp
660 .if exists(${.CURDIR}/${TARGET}/drivers.conf)
661 @mkdir -p ${RD}/mfsfd/stand/modules
662 @awk -f ${.CURDIR}/scripts/driver-copy2.awk \
663 ${.CURDIR}/${TARGET}/drivers.conf \
664 ${RD}/trees/bin/modules ${RD}/mfsfd/stand/modules
666 sh -e ${.CURDIR}/scripts/doFS.sh -s mfsroot ${RD} ${MNT} \
667 ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL}
668 @gzip -9vc mfsroot > mfsroot.gz
669 .if ${TARGET} == "pc98"
670 @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/mfsroot.flp \
671 ${RD} ${MNT} ${SMALLBOOTSIZE} mfsroot.gz \
672 ${BOOTINODE} ${SMALLBOOTLABEL}
673 @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=kern-small FDSIZE=SMALL
674 @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=kern
676 @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/mfsroot.flp \
677 ${RD} ${MNT} ${BOOTSIZE} mfsroot.gz ${BOOTINODE} ${BOOTLABEL}
678 @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=kern
679 @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=boot FDSIZE=BIG
681 @rm mfsroot mfsroot.gz
682 @echo "Regular and MFS boot floppies made."
686 # --==## Create a fixit floppy ##==--
689 @echo "Making fixit floppy."
690 @rm -rf ${RD}/fixitfd
692 @cd ${RD}/fixitfd && \
693 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
695 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=fixit \
696 DIR=${RD}/fixitfd/stand ZIP=false
697 @( cd ${RD}/fixitfd/dev && \
698 sed -e '/^PATH/s/^/#/' ${RD}/trees/bin/dev/MAKEDEV > MAKEDEV && \
699 chmod 755 MAKEDEV && \
701 @cp ${RD}/trees/bin/etc/spwd.db ${RD}/trees/bin/etc/group \
702 ${RD}/trees/bin/etc/protocols ${RD}/fixitfd/etc
703 @cp ${RD}/trees/bin/usr/share/misc/scsi_modes \
704 ${RD}/fixitfd/usr/share/misc
705 @cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
706 @cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
707 @cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar
708 @chmod 555 ${RD}/fixitfd/stand/tar
709 @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/fixit.flp ${RD} \
710 ${MNT} ${FIXITSIZE} ${RD}/fixitfd ${FIXITINODE} ${FIXITLABEL}
711 # Do our last minute floppies directory setup in a convenient place.
713 @cp ${RND}/${RELNOTES_LANG}/installation/${TARGET_ARCH}/article.txt \
714 ${RD}/floppies/README.TXT
715 @(cd ${RD}/floppies; md5 README.TXT *.flp > CHECKSUM.MD5)
717 @(cd ${RD}/floppies; md5 *.flp > CHECKSUM.MD5)
722 # --==## Setup a suitable ftp-area ##==--
725 @echo "Setting up FTP distribution area"
727 -@ln -s . ${FD}/${BUILDNAME}
728 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
729 @cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
731 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
732 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
733 cp ${RND}/${RELNOTES_LANG}/$$i/article.html ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
735 @for i in ${DIST_DOCS_ARCH_DEP}; do \
736 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET_ARCH}/article.txt ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
737 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET_ARCH}/article.html ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
739 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${FD}
740 @mv ${FD}/INSTALLATION.TXT ${FD}/INSTALL.TXT
741 @mv ${FD}/INSTALLATION.HTM ${FD}/INSTALL.HTM
743 @echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
744 .if !defined(NOPORTS)
745 @tar --exclude CVS -cBf - -C ${CD_DISC1} ports | tar -xBf - -C ${FD}
750 # --==## Setup a suitable cdrom-area ##==--
753 @echo "Setting up CDROM distribution area"
754 @mkdir -p ${CD_DISC1} ${CD_DISC2}
755 @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
756 @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}
757 @for i in ${DISTRIBUTIONS} ; \
759 if [ -d ${RD}/trees/$${i} ] ; then \
760 chflags -R noschg ${RD}/trees/$${i} || true ; \
761 ( cd ${RD}/trees/$${i} && \
762 find . -depth -print | cpio -dumpl ${CD_DISC2} ) ; \
765 @rm -f ${CD_DISC2}/.profile
766 @cp ${.CURDIR}/fixit.profile ${CD_DISC2}/.profile
767 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
768 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
770 @for i in ${DIST_DOCS_ARCH_INDEP}; do \
771 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
772 cp ${RND}/${RELNOTES_LANG}/$$i/article.html ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
774 @for i in ${DIST_DOCS_ARCH_DEP}; do \
775 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET_ARCH}/article.txt ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
776 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET_ARCH}/article.html ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
778 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DISC1}
779 @mv ${CD_DISC1}/INSTALLATION.TXT ${CD_DISC1}/INSTALL.TXT
780 @mv ${CD_DISC1}/INSTALLATION.HTM ${CD_DISC1}/INSTALL.HTM
782 .if ${TARGET} != "pc98"
783 @echo "Setting up /boot"
784 @cp -Rp ${CD_DISC2}/boot ${CD_DISC1}
785 @ln -f ${RD}/image.boot/mfsroot.gz ${CD_DISC1}/boot/mfsroot.gz
786 @ln -f ${CD_DISC1}/boot/mfsroot.gz ${CD_DISC2}/boot/mfsroot.gz
787 @echo 'mfsroot_load="YES"' > ${CD_DISC1}/boot/loader.conf
788 @echo 'mfsroot_type="mfs_root"' >> ${CD_DISC1}/boot/loader.conf
789 @echo 'mfsroot_name="/boot/mfsroot"' >> ${CD_DISC1}/boot/loader.conf
790 .if ${TARGET} == "i386"
791 @echo 'userconfig_script_load="YES"' >> ${CD_DISC1}/boot/loader.conf
792 @echo 'intro' > ${CD_DISC1}/boot/kernel.conf
794 @ln -f ${CD_DISC1}/boot/loader.conf ${CD_DISC2}/boot/loader.conf
795 @ln -f ${CD_DISC2}/kernel.GENERIC ${CD_DISC1}/kernel
797 .if ${TARGET} == "i386"
798 @mkdir -p ${CD_DISC2}/floppies
799 @cp ${CD_DISC1}/floppies/boot.flp ${CD_DISC2}/floppies
801 .if !defined(NOPORTS)
802 @mkdir -p ${CD_DISC1}/ports && \
803 tar --exclude CVS --exclude 'ports/distfiles/*' -czf \
804 ${CD_DISC1}/ports/ports.tgz -C /usr ports && \
805 cp ${.CURDIR}/scripts/ports-install.sh ${CD_DISC1}/ports/install.sh \
806 && (cd ${CD_DISC1}/ports; md5 * > CHECKSUM.MD5)
811 @if [ -r ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ]; then \
812 echo "Creating ISO images..."; \
813 sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
814 fbsd_miniinst ${CD}/${BUILDNAME}-${TARGET}-miniinst.iso ${CD_DISC1}; \
815 sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
816 fbsd_livefs ${CD}/${BUILDNAME}-${TARGET}-disc2.iso ${CD_DISC2}; \
817 if [ "x${CD_EXTRA_BITS}" != "x" ]; then \
818 sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
819 fbsd_boot ${CD}/${BUILDNAME}-${TARGET}-disc1.iso ${CD_DISC1} ${CD_EXTRA_BITS}; \
822 echo "Do not know how to create an ISO for ${TARGET_ARCH}."; \
827 # --==## Documentation Project files such as the Handbook and FAQ ##==--
830 @echo "Making docs..."
831 @for i in ${DOCPORTS}; do \
832 cd /usr/ports/$$i && \
833 env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \
834 make all install clean BATCH=yes WITHOUT_X11=yes JADETEX=no \
835 WITHOUT_PYTHON=yes FORCE_PKG_REGISTER=yes; \
837 @cd /usr/doc && make all install 'FORMATS=html html-split txt' INSTALL_COMPRESSED='' DOCDIR=${RD}/trees/bin/usr/share/doc
841 # --==## RELNOTESng: Next-generation replacements for *.TXT files ##==--
844 @echo "Making release documentation..."
845 @cd ${.CURDIR}/doc && make all install clean 'FORMATS=html txt' INSTALL_COMPRESSED='' DOCDIR=${RND}
848 # Various "subroutine" and other supporting targets.
856 @echo "SD undefined in doTARBALL" && exit 1
859 @echo "TD undefined in doTARBALL" && exit 1
862 @echo "ARG undefined in doTARBALL" && exit 1
864 @rm -rf ${RD}/dists/${TD}/${TN}*
865 @mkdir -p ${RD}/dists/${TD}
867 tn=`echo ${TN} | tr '[A-Z]' '[a-z]' | cut -c1-8` && \
868 echo rolling ${TD}/$$tn tarball &&\
869 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
870 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
871 sh ${.CURDIR}/scripts/info.sh ${RD}/dists/${TD}/$$tn > \
872 ${RD}/dists/${TD}/$$tn.inf && \
873 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
874 cp -p ${.CURDIR}/scripts/$${TD}-install.sh ${RD}/dists/${TD}/install.sh; \
876 if [ "${SD}" != "/usr/src" ]; then \
877 mtree -c -i -p ${SD}/${ARG} \
878 -k gname,md5digest,mode,nlink,uname,size,link,type \
879 > ${RD}/dists/${TD}/$$tn.mtree ; \
883 (cd ${RD}/dists/${TD}; \
884 rm -f CHECKSUM.MD5; \
885 md5 * > CHECKSUM.MD5) \
888 doRELEASE: release.1 release.2 release.3 ${DOCREL} release.4 release.5 \
889 release.6 release.7 release.8 release.9 release.10
890 @cd ${.CURDIR} && ${MAKE} ${EXTRAS}
894 @cd ${.CURDIR} && ${MAKE} boot.flp
895 @cd ${.CURDIR} && ${MAKE} fixit.flp
896 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
899 @rm -f release.5 release.9
900 @cd ${.CURDIR} && ${MAKE} release.5 release.9 CRUNCH_TARGETS=boot
903 @rm -f release.5 release.10
904 @cd ${.CURDIR} && ${MAKE} release.5 release.10 CRUNCH_TARGETS=fixit
906 write_mfs_in_kernel: ${.CURDIR}/write_mfs_in_kernel.c
907 ${CC} ${CFLAGS} -o write_mfs_in_kernel ${.CURDIR}/write_mfs_in_kernel.c
911 @echo "CRUNCH undefined in installCRUNCH" && exit 1
914 @echo "DIR undefined in installCRUNCH" && exit 1
917 @echo "ZIP undefined in installCRUNCH" && exit 1
920 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
922 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
924 @chmod 555 ${DIR}/${CRUNCH}_crunch
925 @if [ -f ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf ] ; then \
926 for i in `crunchgen -l ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf` ; do \
927 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
930 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
931 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
936 # --==## Put a filesystem into a BOOTMFS kernel ##==--
939 @echo "Running ${.TARGET} for ${FSIMAGE}"
940 @rm -f ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE}
941 @cd ${.CURDIR}/../sys/${TARGET}/conf && \
942 sh ${.CURDIR}/${TARGET}/dokern.sh ${FDSIZE} < GENERIC > BOOTMFS
943 .if ${TARGET_ARCH} == "i386"
944 @echo "options INTRO_USERCONFIG" >> \
945 ${.CURDIR}/../sys/${TARGET}/conf/BOOTMFS
947 .if exists(${.CURDIR}/${TARGET}/drivers.conf)
948 @awk -f ${.CURDIR}/scripts/driver-remove.awk \
949 ${.CURDIR}/${TARGET}/drivers.conf \
950 ${.CURDIR}/../sys/${TARGET}/conf/BOOTMFS
953 INSTKERNNAME=BOOTMFS \
954 ${CROSSMAKE} ${KERNEL_FLAGS} -DNO_MODULES -DNO_KERNELCLEAN \
955 KERNCONF=BOOTMFS buildkernel reinstallkernel \
956 DESTDIR=${RD}/kernels
957 @rm -rf ${RD}/image.${FSIMAGE}
958 @mkdir ${RD}/image.${FSIMAGE}
959 @cd ${RD}/kernels && \
960 (chflags noschg BOOTMFS || true) && \
961 ${WMAKEENV} strip -R .comment BOOTMFS && \
962 cp BOOTMFS BOOTMFS.${FSIMAGE}
963 mv ${RD}/kernels/BOOTMFS ${RD}/image.${FSIMAGE}/kernel
964 @echo "Setting up /boot directory for ${FSIMAGE} floppy"
965 @mkdir -p ${RD}/image.${FSIMAGE}/boot
966 .if ${TARGET} == "i386"
967 @kgzip -vo ${RD}/image.${FSIMAGE}/boot/loader ${RD}/trees/bin/boot/loader
969 @cp ${RD}/trees/bin/boot/loader ${RD}/image.${FSIMAGE}/boot
971 @echo "load /kernel" > ${RD}/image.${FSIMAGE}/boot/loader.rc
972 .if !defined(FDSIZE) || ${FDSIZE} != "BIG"
973 @echo "echo \\007\\007" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
974 @echo "echo Please insert MFS root floppy and press enter:" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
975 @echo "read" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
977 @echo "load -t mfs_root /mfsroot" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
978 @echo "echo \\007\\007" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
979 @echo "autoboot 10" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
980 .if ${TARGET_ARCH} == "i386" && ${AUTO_KEYBOARD_DETECT}
981 @echo "-P" >> ${RD}/image.${FSIMAGE}/boot.config
983 @gzip -9v ${RD}/image.${FSIMAGE}/kernel
984 @rm -f ${RD}/floppies/${FSIMAGE}.flp
985 .if defined(FDSIZE) && ${FDSIZE} == "BIG"
986 @cp mfsroot.gz ${RD}/image.${FSIMAGE}
987 sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/${FSIMAGE}.flp \
988 ${RD} ${MNT} ${BIGBOOTSIZE} ${RD}/image.${FSIMAGE} \
989 ${BOOTINODE} ${BIGBOOTLABEL}
990 .elif defined(FDSIZE) && ${FDSIZE} == "SMALL"
991 sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/${FSIMAGE}.flp \
992 ${RD} ${MNT} ${SMALLBOOTSIZE} ${RD}/image.${FSIMAGE} \
993 ${BOOTINODE} ${SMALLBOOTLABEL}
995 sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/${FSIMAGE}.flp \
996 ${RD} ${MNT} ${BOOTSIZE} ${RD}/image.${FSIMAGE} \
997 ${BOOTINODE} ${BOOTLABEL}
999 @echo "Created ${RD}/floppies/${FSIMAGE}.flp"
1001 .include <bsd.prog.mk>