1 # $Id: Makefile,v 1.429 1998/11/11 08:46:52 jkh Exp $
3 # make release CHROOTDIR=/some/dir BUILDNAME=somename [ RELEASETAG=tag ]
5 # Where "/some/dir" is the pathname of a directory on a some
6 # filesystem with at least 1000MB of free space, "somename" is what
7 # you want the release to call itself and, optionally, which CVS "tag"
8 # name should be used when checking out the sources to build the release
11 # Please note: the vn driver must also be compiled into your kernel,
12 # otherwise the target 'release.8' and possibly others will fail.
14 # Set these, release builder!
17 #BUILDNAME=2.2-RELEASE
19 # Automatic SNAP versioning:
22 BUILDNAME?=${BASE}-${DATE}-SNAP
24 #CHROOTDIR=/junk/release
25 # If this is a RELEASE, then set
26 #RELEASETAG=RELENG_2_2
28 # If you are using a local CVS repository with components stored in
29 # non-standard modules, override these on the make commandline or
31 RELEASESRCMODULE?= src
32 RELEASEDOCMODULE?= doc
33 RELEASEPORTSMODULE?= ports
35 # Unless set elsewhere, indicate the object format we'll be using.
38 # Uncomment this to disable the doc.1 target. It is also an ERROR
39 # to set NOPORTS and not set NODOC since docs depend on ports.
42 # Comment the following if you want the release documentation to be
45 DOCPORTS= archivers/unzip textproc/jade textproc/iso8879 \
46 textproc/linuxdoc textproc/docbook textproc/sgmlformat
48 DIST_DOCS= ABOUT.TXT ERRATA.TXT LAYOUT.TXT README.TXT HARDWARE.TXT \
49 INSTALL.TXT RELNOTES.TXT TROUBLE.TXT UPGRADE.TXT
51 # Things which without too much trouble can be considered variables
52 # BIN_DISTS are special in that they get full /etc installation sets.
54 COMPAT_DISTS?= compat1x compat20 compat21
55 OTHER_DISTS?= manpages catpages games proflibs dict info doc
56 CRYPTO_DISTS?= krb des
58 DISTRIBUTIONS?= ${BIN_DISTS} ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS}
61 # Extra source tarballs; each argument is a pair of source dir and
62 # distribution name. The dist name should not exceed 7 characters
63 # (another "s" for "source" will be prepended).
64 EXTRA_SRC+= usr.sbin/sendmail/cf smailcf
66 BOOT1= etc/protocols etc/rc.conf
68 # mountpoint for filesystems.
71 # Various floppy image parameters.
73 # These are adjusted down to the minimum needed by doFS.sh.
74 .if ${MACHINE_ARCH} == "i386"
92 BOOTMFSLABEL= minimum2
96 ZIPNSPLIT= gzip --no-name -9 -c | split -b 240640 -
101 # Things which may get you into trouble if you change them
102 MTREEFILES= ${.CURDIR}/../etc/mtree
106 CD_DISC1= ${CD}/disc1
107 CD_DISC2= ${CD}/disc2
109 # Where the bootstrap ports (see DOCPORTS) get installed.
110 LOCALDIR= /usr/local/bin
112 # ${BOOTSTRAPDIR} is for those utilities that refer to the hosting
113 # environment, rather than the target environment. This is specifically
114 # intended for kernel-dependent utilities that are used during the build.
116 # ${BOOTSTRAPDIR} is actually being used by prepending it to the normal
117 # ${PATH}. Thus, it's also available to outside utilities like doFS.sh.
118 BOOTSTRAPDIR= /bootstrap
120 # The mount subsystem has been changed between 2.2 and 3.0 by the
122 BOOTSTRAPUTILS= /sbin/mount /sbin/umount
124 # 3.0 cpio tries to reference lchown(2) which is not available in 2.2
125 BOOTSTRAPUTILS+= /usr/bin/cpio
127 .if !defined(CRUNCH_TARGETS)
128 CRUNCH_TARGETS= boot fixit
131 EXTRAS= cdrom.1 ftp.1
138 REDOSED= sed -e 's/dirs/release.1/' -e 's/trees/release.2/' \
139 -e 's/kerns/release.3/' -e 's/sysinstall/release.4/' \
140 -e 's/fixup/release.5/' -e 's/tarbin/release.6/' \
141 -e 's/tarsrc/release.7/' -e 's/boot\.flp/release.8/' \
142 -e 's/fixit\.flp/release.9/' -e 's/ftp/ftp.1/' \
143 -e 's/cdrom/cdrom.1/' -e 's/doc/doc.1/'
145 REDOREDO!= echo ${REDO} | ${REDOSED}
148 .if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT)
149 @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false
152 .if exists(${CHROOTDIR})
153 # The first command will fail on a handful of files that have their schg
154 # flags set. But it greatly speeds up the next two commands.
156 -chflags -R noschg ${CHROOTDIR}/.
159 -mkdir -p ${CHROOTDIR}
160 cd ${.CURDIR}/../etc && ${MAKE} distrib-dirs DESTDIR=${CHROOTDIR}
161 cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR}
162 cd ${.CURDIR}/.. && ${MAKE} installworld DESTDIR=${CHROOTDIR} NOMAN=1
163 mkdir ${CHROOTDIR}/${BOOTSTRAPDIR}
164 for i in ${BOOTSTRAPUTILS} ; do \
165 cp -p ${CHROOTDIR}$$i ${CHROOTDIR}/${BOOTSTRAPDIR} ; \
167 .if !defined(RELEASETAG)
168 cd ${CHROOTDIR}/usr && rm -rf src && \
169 cvs -R -d ${CVSROOT} co -P ${RELEASESRCMODULE}
171 cd ${CHROOTDIR}/usr && rm -rf src && \
172 cvs -R -d ${CVSROOT} co -P -r ${RELEASETAG} ${RELEASESRCMODULE}
174 .if defined(LOCAL_PATCHES) && exists(${LOCAL_PATCHES})
175 cd ${CHROOTDIR}/usr/src && patch --silent < ${LOCAL_PATCHES}
177 .if defined(LOCAL_SCRIPT) && exists(${LOCAL_SCRIPT})
178 cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT}
180 .if !defined(NOPORTS)
181 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P ${RELEASEPORTSMODULE} && cd ports && make readmes PORTSDIR=${CHROOTDIR}/usr/ports
184 cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co -P ${RELEASEDOCMODULE}
185 cd ${CHROOTDIR}/usr/ports && for i in ${DOCPORTS}; do \
186 (cd $$i; make fetch MASTER_SITE_OVERRIDE=file:/usr/ports/distfiles/ \
187 DISTDIR=${CHROOTDIR}/usr/ports/distfiles ); \
192 .if !defined(RELEASENOUPDATE)
193 .if !defined(RELEASETAG)
194 cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d
196 cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d -r ${RELEASETAG}
198 .if !defined(NOPORTS)
199 cd ${CHROOTDIR}/usr/ports && cvs -R -q update -P -d
202 cd ${CHROOTDIR}/usr/doc && cvs -R -q update -P -d
206 # Add version information to those things that need it.
207 ( cd ${CHROOTDIR}/usr/src/sys/conf && \
208 mv newvers.sh foo && \
209 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh&& rm foo )
210 ( cd ${CHROOTDIR}/usr/src/release/sysinstall && \
211 sed "s/__RELEASE/${BUILDNAME}/" version.h > version.h.new && \
212 mv version.h.new version.h && \
214 echo OBJFORMAT=${OBJFORMAT} > ${CHROOTDIR}/etc/objformat
215 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
216 echo "#!/bin/sh" > ${CHROOTDIR}/mk
217 echo "set -ex" >> ${CHROOTDIR}/mk
218 echo "_RELTARGET=\$${1:-doRELEASE}" >> ${CHROOTDIR}/mk
219 echo "export CFLAGS='-O -pipe'" >> ${CHROOTDIR}/mk
220 echo "export DISTRIBUTIONS=\"${DISTRIBUTIONS}\"" >> ${CHROOTDIR}/mk
221 echo "export BUILDNAME=${BUILDNAME}" >> ${CHROOTDIR}/mk
222 echo "export VNDEVICE=${VNDEVICE}" >> ${CHROOTDIR}/mk
223 echo "export OBJFORMAT=${OBJFORMAT}" >> ${CHROOTDIR}/mk
224 .if defined(RELEASETAG)
225 echo "export RELEASETAG=${RELEASETAG}" >> ${CHROOTDIR}/mk
228 echo "export NOPORTS=${NOPORTS}" >> ${CHROOTDIR}/mk
231 echo "export NODOC=${NODOC}" >> ${CHROOTDIR}/mk
234 echo "export ALLLANG=${ALLLANG}" >> ${CHROOTDIR}/mk
237 echo "export NOSRC=${NOSRC}" >> ${CHROOTDIR}/mk
239 .if defined(NOSHARED)
240 echo "export NOSHARED=${NOSHARED}" >> ${CHROOTDIR}/mk
242 .if defined(BOOT_CONFIG)
243 echo "export BOOT_CONFIG=\"${BOOT_CONFIG}\"">> ${CHROOTDIR}/mk
245 # Don't remove this, or the build will fall over!
246 echo "export RELEASEDIR=/R" >> ${CHROOTDIR}/mk
247 echo "export PATH=${BOOTSTRAPDIR}:$${PATH}:${LOCALDIR}" >> ${CHROOTDIR}/mk
248 echo "cd /usr/src" >> ${CHROOTDIR}/mk
250 echo "(cd etc; make distrib-dirs distribution)" >> ${CHROOTDIR}/mk
251 echo "make world" >> ${CHROOTDIR}/mk
254 echo "make all install" >> ${CHROOTDIR}/mk
256 echo "cd /usr/src/release/sysinstall" >> ${CHROOTDIR}/mk
257 echo "make obj" >> ${CHROOTDIR}/mk
258 echo "cd /usr/src/release" >> ${CHROOTDIR}/mk
259 echo "make objlink" >> ${CHROOTDIR}/mk
260 echo "(cd obj; rm -f ${REDOREDO})" >> ${CHROOTDIR}/mk
261 echo "make \$${_RELTARGET}" >> ${CHROOTDIR}/mk
262 echo "echo make ${.TARGET} Finished" >> ${CHROOTDIR}/mk
263 chmod 755 ${CHROOTDIR}/mk
264 chroot ${CHROOTDIR} /mk
267 rm -rf boot_crunch release.[0-9]
269 # Clean out /R and make the directory structure.
272 chflags -R noschg /R/.
279 for i in ${DISTRIBUTIONS} ; do \
280 mkdir ${RD}/trees/$$i && \
281 mkdir ${RD}/dists/$$i && \
282 mtree -deU -f ${MTREEFILES}/BSD.root.dist \
283 -p ${RD}/trees/$$i > /dev/null && \
284 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
285 -p ${RD}/trees/$$i/usr > /dev/null && \
286 mtree -deU -f ${MTREEFILES}/BSD.include.dist \
287 -p ${RD}/trees/$$i/usr/include > /dev/null && \
288 mtree -deU -f ${MTREEFILES}/BSD.var.dist \
289 -p ${RD}/trees/$$i/var > /dev/null ; \
293 # Install the system into the various distributions.
295 cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/bin
296 cd ${.CURDIR}/.. && make distribute DISTDIR=${RD}/trees
297 .if exists(${.CURDIR}/../kerberosIV) && !defined(NOKERBEROS)
298 cd ${.CURDIR}/../kerberosIV && ( \
300 make obj all help-distribute DISTDIR=${RD}/trees &&\
304 # XXX until lkm and mdec gets populated again by some other means
305 .if ${MACHINE_ARCH} == "i386"
306 cd ${.CURDIR}/.. && OBJFORMAT=aout MAKEOBJDIRPREFIX=/usr/obj/aout \
307 NOTOOLS=1 NOSECURE=1 NOCRYPT=1 \
308 make -f Makefile.inc1 legacy-install DESTDIR=${RD}/trees/bin
310 chflags -R noschg ${RD}/trees
313 # Make and install the generic kernel(s).
315 .for kernel in ${KERNELS}
316 rm -f ${RD}/kernels/${kernel}
317 rm -rf ${.CURDIR}/../sys/compile/${kernel}
318 cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=${kernel}
319 rm -rf ${.CURDIR}/../sys/compile/${kernel}
320 ln -f ${RD}/kernels/${kernel} ${RD}/trees/bin/kernel.${kernel}
324 # Make and install the three crunched binaries which live on the floppies.
325 # You are not supposed to like this :-)
327 # NB: the "RELEASE_BUILD_FIXIT" magic prevents vi from including the
328 # Tcl and Perl APIs. See also /usr/src/usr.bin/vi/Makefile.
331 cd ${.CURDIR}/sysinstall && make obj depend all install
333 mkdir -p ${RD}/crunch
334 export RELEASE_BUILD_FIXIT=noway ; \
335 for j in ${CRUNCH_TARGETS} ; do \
336 rm -rf $${j}_crunch && \
337 mkdir $${j}_crunch && \
338 ( cd $${j}_crunch && \
339 crunchgen ${.CURDIR}/$${j}_crunch.conf && \
340 ${MAKE} -DRELEASE_CRUNCH -f $${j}_crunch.mk subclean all \
341 NOCRYPT=yes "CFLAGS=${CFLAGS} -DCRUNCHED_BINARY") && \
342 mv $${j}_crunch/$${j}_crunch ${RD}/crunch/$${j} && \
343 true || { rm -rf $${j}_crunch ; false ; } ; \
348 # --==## Fix up the distributions. ##==--
351 # Handle some grief caused by the munition braindeadness.
352 for i in sbin/init bin/ed usr.sbin/ppp ; do \
353 ( cd ${.CURDIR}/../$$i; \
354 make -DNOCRYPT clean all distribute DISTDIR=${RD}/trees ) ; \
357 # Create any "synthetic dists" now.
358 @for i in ${DISTRIBUTIONS}; do \
359 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
360 echo -n "Running $$i dist creation script... "; \
361 env OBJFORMAT=${OBJFORMAT} RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
366 # Create symlinks for the MD5-based crypt lib, too. The
367 # automatically created links still point to the DES stuff,
368 # which went into its own distribution.
369 for i in ${RD}/trees/bin/usr/lib/libscrypt* ; do \
370 c=`echo $$i | sed -e 's/libscrypt/libcrypt/'` ; \
372 ln -s `basename $$i` $$c ; \
375 # Remove all the directories we don't need.
377 find ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} -depth -type d -print | xargs rmdir
381 # --==## Package up the tarballs from assembled trees ##==--
386 @for i in ${DISTRIBUTIONS} ; \
388 if [ -d ${RD}/trees/$${i} ] ; then \
389 cd ${.CURDIR} && $(MAKE) doTARBALL \
390 SD=${RD}/trees/$${i} \
391 TN=$$i TD=$$i ARG="." && \
392 echo "$${i} distribution is finished."; \
395 # More munition braindeadness.
396 ( cd ${RD}/dists && \
397 if [ -f krb/krb.aa ] ; then mv krb/* des && rmdir krb ; fi )
402 # --==## Make source dists ##==--
406 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \
407 TD=src TN=sbase ARG="[A-Z]*"
408 @for i in `cd /usr/src && echo [a-z]*` ; do \
409 if [ -d /usr/src/$$i ] ; then \
410 cd ${.CURDIR} && $(MAKE) doTARBALL \
411 TN=`echo s$$i | tr -d '.' | sed 's/usr/u/'` \
412 SD=/usr/src TD=src ARG="$$i" ; \
415 .if defined(EXTRA_SRC)
416 @set ${EXTRA_SRC} && \
417 while [ $$# -ge 2 ] ; do \
418 if [ -d /usr/src/$$1 ] ; then \
419 cd ${.CURDIR} && $(MAKE) doTARBALL \
420 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
421 fi && shift && shift ; \
424 ( cd ${RD}/dists/src && \
425 if [ -f ssecure.aa ] ; then mv ssecure.* ../des ; fi && \
426 if [ -f scrypto.aa ] ; then mv scrypto.* ../des ; fi && \
427 if [ -f skerbero.aa ] ; then mv skerbero.* ../des ; fi ; )
428 @echo "src distribution is finished."
432 # Complete the bootfd
434 # Now, just to get this picture down once and for all:
436 # +------------------------------------------------------------------------+
438 # +-----+-----+------------------------------------------------------------+
439 # |boot1|boot2|floppy filesystem "bootfd" |
440 # +-----+-----+-+--------------------------------------------------------+-+
442 # +------------+-----------------------------------------+-+
443 # |mfs filesystem "mfsfd" |
444 # +-----------------------------------------+
447 release.8: write_mfs_in_kernel dumpnlist
451 mkdir -p etc dev mnt stand/help
452 .if ${MACHINE_ARCH} == "i386"
453 @cp ${.CURDIR}/../sys/i386/boot/biosboot/boot.help ${RD}/mfsfd/stand
455 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
456 DIR=${RD}/mfsfd/stand ZIP=false
457 ( cd ${RD}/trees/bin/dev && \
458 ls console tty ttyv0 ttyv1 ttyv2 ttyv3 null zero | \
459 cpio -dump ${RD}/mfsfd/dev )
460 ( cd ${RD}/mfsfd/dev && rm -f *[swo]d*[bdefgh] )
461 cd ${RD}/trees/bin && ls ${BOOT1} | cpio -dump ${RD}/mfsfd/stand
462 echo "nameserver 42/tcp name" > ${RD}/mfsfd/stand/etc/services
463 echo "ftp 21/tcp" >> ${RD}/mfsfd/stand/etc/services
464 echo "domain 53/tcp nameserver" >> ${RD}/mfsfd/stand/etc/services
465 echo "domain 53/udp nameserver" >> ${RD}/mfsfd/stand/etc/services
466 echo "cmd 514/tcp shell" >> ${RD}/mfsfd/stand/etc/services
467 gzip -c ${.CURDIR}/../COPYRIGHT > ${RD}/mfsfd/stand/help/COPYRIGHT.hlp.gz
468 for i in README.TXT RELNOTES.TXT INSTALL.TXT UPGRADE.TXT HARDWARE.TXT; do \
469 gzip -9c ${.CURDIR}/texts/$${i} > ${RD}/mfsfd/stand/help/$${i}.gz; done
470 -test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
471 @echo "Making the regular boot floppy."
472 tar --exclude CVS -cf - -C ${.CURDIR}/sysinstall help | \
473 tar xvf - -C ${RD}/mfsfd/stand
474 @echo "Compressing doc files..."
475 @gzip -9 ${RD}/mfsfd/stand/help/*.hlp
476 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${BOOTMFSSIZE} \
477 ${RD}/mfsfd ${MFSINODE} ${BOOTMFSLABEL}
478 mv fs-image fs-image.std
479 mv fs-image.size fs-image.std.size
480 gzip -c fs-image.std > ${RD}/floppies/mfsroot.gz
481 cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=std
482 mv ${RD}/floppies/bootstd.flp ${RD}/floppies/kern.flp
483 cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=std _MFSKERN=YES
484 mv ${RD}/floppies/bootstd.flp ${RD}/floppies/boot.flp
485 @echo "Regular and MFS boot floppies made."
489 # --==## Create a fixit floppy ##==--
494 cd ${RD}/fixitfd && \
495 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
496 usr/share/misc usr/mdec
497 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=fixit \
498 DIR=${RD}/fixitfd/stand ZIP=false
499 ( cd ${RD}/fixitfd/dev && \
500 sed -e '/^PATH/s/^/#/' ${RD}/trees/bin/dev/MAKEDEV > MAKEDEV && \
501 chmod 755 MAKEDEV && \
503 cp ${RD}/trees/bin/etc/spwd.db ${RD}/trees/bin/etc/group \
504 ${RD}/trees/bin/etc/protocols ${RD}/fixitfd/etc
505 cp ${RD}/trees/bin/usr/share/misc/scsi_modes \
506 ${RD}/fixitfd/usr/share/misc
507 cp ${RD}/trees/bin/usr/mdec/boot[12] ${RD}/fixitfd/usr/mdec
508 for type in fd od sd wd ; do \
509 ( cd ${RD}/fixitfd/usr/mdec && ln -s boot1 $${type}boot && \
510 ln -s boot2 boot$${type} ) ; \
512 cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
513 cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
514 cp ${.CURDIR}/tar.sh ${RD}/fixitfd/stand/tar
515 chmod 555 ${RD}/fixitfd/stand/tar
516 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${FIXITSIZE} \
517 ${RD}/fixitfd ${FIXITINODE} ${FIXITLABEL}
518 mv fs-image ${RD}/floppies/fixit.flp
519 # Do our last minute floppies directory setup in a convenient place.
520 cp ${.CURDIR}/texts/FLOPPIES.TXT ${RD}/floppies/README.TXT
521 @(cd ${RD}/floppies; md5 * > CHECKSUM.MD5)
525 # --==## Setup a suitable ftp-area ##==--
529 cd ${RD} && find floppies -print | cpio -dumpl ${FD}
530 cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
531 for i in ${DIST_DOCS}; do cp ${.CURDIR}/texts/$${i} ${FD}; done
532 echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
533 .if !defined(NOPORTS)
534 tar -cBf - -C ${CD_DISC1} ports | tar -xBf - -C ${FD}
538 # --==## Setup a suitable cdrom-area ##==--
541 mkdir -p ${CD_DISC1} ${CD_DISC2}
542 cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
543 cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}
544 ln -f ${RD}/kernels/MFSKERNEL.std ${CD_DISC1}/kernel
545 .if ${MACHINE_ARCH} != "alpha"
546 ln -f ${RD}/trees/bin/usr/mdec/fbsdboot.exe ${CD_DISC1}
548 for i in ${DISTRIBUTIONS} ; \
550 if [ -d ${RD}/trees/$${i} ] ; then \
551 chflags -R noschg ${RD}/trees/$${i} ; \
552 ( cd ${RD}/trees/$${i} && \
553 find . -depth -print | cpio -dumpl ${CD_DISC2} ) ; \
556 rm -f ${CD_DISC2}/.profile
557 cp ${.CURDIR}/fixit.profile ${CD_DISC2}/.profile
558 echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
559 echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
560 for i in ${DIST_DOCS}; do cp ${.CURDIR}/texts/$${i} ${CD_DISC1}; done
561 .if !defined(NOPORTS)
562 -rm -rf /usr/ports/distfiles/*
563 tar -cBf - -C /usr ports | tar xBpf - -C ${CD_DISC2} && \
564 mkdir -p ${CD_DISC1}/ports && \
565 tar -czf ${CD_DISC1}/ports/ports.tgz -C /usr ports && \
566 cp ${.CURDIR}/scripts/ports-install.sh ${CD_DISC1}/ports/install.sh && \
567 (cd ${CD_DISC1}/ports; md5 * > CHECKSUM.MD5)
568 ln -s ../ports ${CD_DISC2}/usr/ports
572 for i in ${DOCPORTS}; do \
573 cd /usr/ports/$$i && make all install clean FORCE_PKG_REGISTER=yes; \
575 cd /usr/doc && make all distribute DISTDIR=${RD}/trees
578 # Various "subroutine" and other supporting targets.
582 @echo "SD undefined in doTARBALL" && exit 1
585 @echo "TB undefined in doTARBALL" && exit 1
588 @echo "ARG undefined in doTARBALL" && exit 1
590 rm -rf ${RD}/dists/${TD}/${TN}*
591 mkdir -p ${RD}/dists/${TD}
593 tn=`echo ${TN} | tr '[A-Z]' '[a-z]' | cut -c1-8` && \
594 echo rolling ${TD}/$$tn tarball &&\
595 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
596 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
597 sh ${.CURDIR}/info.sh ${RD}/dists/${TD}/$$tn > \
598 ${RD}/dists/${TD}/$$tn.inf && \
599 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
600 cp -p ${.CURDIR}/scripts/$${TD}-install.sh ${RD}/dists/${TD}/install.sh; \
602 if [ "${SD}" != "/usr/src" ]; then \
603 mtree -c -i -p ${SD}/${ARG} \
604 -k gname,md5digest,mode,nlink,uname,size,link,type \
605 > ${RD}/dists/${TD}/$$tn.mtree ; \
609 (cd ${RD}/dists/${TD}; \
610 rm -f CHECKSUM.MD5; \
611 md5 * > CHECKSUM.MD5) \
614 doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 release.5 \
615 release.6 release.7 release.8 release.9
616 cd ${.CURDIR} && ${MAKE} ${EXTRAS}
620 cd ${.CURDIR} && ${MAKE} boot.flp
621 cd ${.CURDIR} && ${MAKE} fixit.flp
622 cd ${RD} && find floppies -print | cpio -dumpl ${FD}
625 rm -f release.4 release.8
626 cd ${.CURDIR} && ${MAKE} release.4 release.8 CRUNCH_TARGETS=boot
629 rm -f release.4 release.9
630 cd ${.CURDIR} && ${MAKE} release.4 release.9 CRUNCH_TARGETS=fixit
632 write_mfs_in_kernel: ${.CURDIR}/write_mfs_in_kernel.c
633 ${CC} ${CFLAGS} -o write_mfs_in_kernel ${.CURDIR}/write_mfs_in_kernel.c
635 # Add -DDO_SCSI to CFLAGS to enable scsi frobbing support.
636 dumpnlist: ${.CURDIR}/dumpnlist.c
637 ${CC} ${CFLAGS} -o dumpnlist ${.CURDIR}/dumpnlist.c
641 @echo "CRUNCH undefined in installCRUNCH" && exit 1
644 @echo "DIR undefined in installCRUNCH" && exit 1
647 @echo "ZIP undefined in installCRUNCH" && exit 1
650 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
652 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
654 chmod 555 ${DIR}/${CRUNCH}_crunch
655 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
656 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
660 # --==## Compile a kernel by name ${KERNEL} ##==--
662 # We don't erase the sys/compile/${KERNEL} directory, since somebody
663 # may want to reuse it (release.8 presently)
666 rm -f ${RD}/kernels/${KERNEL}
667 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/conf && config ${KERNEL}
668 cd ${.CURDIR}/../sys/compile/${KERNEL} && \
671 cp kernel ${RD}/kernels/${KERNEL}
674 # --==## Put a filesystem into a BOOTMFS kernel ##==--
677 @rm -f ${RD}/kernels/BOOTMFS.${FSIMAGE}
678 @cd ${.CURDIR}/../sys/${MACHINE_ARCH}/conf && \
679 sh ${.CURDIR}/scripts/dokern.sh ${_MFSKERN} < GENERIC > BOOTMFS
680 .if ${MACHINE_ARCH} == "i386"
681 @echo "options INTRO_USERCONFIG" >> ${.CURDIR}/../sys/i386/conf/BOOTMFS
683 .if defined(_MFSKERN)
684 @echo "options \"MFS_ROOT_SIZE=`cat fs-image.${FSIMAGE}.size`\"" >> \
685 ${.CURDIR}/../sys/${MACHINE_ARCH}/conf/BOOTMFS
687 cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=BOOTMFS
688 @rm -rf ${RD}/boot.${FSIMAGE}
689 @mkdir ${RD}/boot.${FSIMAGE}
690 @mv ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE}
691 @cp ${RD}/kernels/BOOTMFS.${FSIMAGE} ${RD}/boot.${FSIMAGE}/kernel
692 .if !defined(_MFSKERN) || ${MACHINE_ARCH} == "alpha"
693 @mkdir -p ${RD}/boot.${FSIMAGE}/boot
694 @cp /boot/* ${RD}/boot.${FSIMAGE}/boot
695 @echo "@load /kernel" > ${RD}/boot.${FSIMAGE}/boot/boot.conf
696 @echo "@echo Please insert MFS root floppy and press enter:" >> ${RD}/boot.${FSIMAGE}/boot/boot.conf
697 @echo "@read" >> ${RD}/boot.${FSIMAGE}/boot/boot.conf
698 @echo "@load -t mfs_root /mfsroot" >> ${RD}/boot.${FSIMAGE}/boot/boot.conf
699 @echo "@boot" >> ${RD}/boot.${FSIMAGE}/boot/boot.conf
700 @echo "/boot/loader" >${RD}/boot.${FSIMAGE}/boot.config
701 @touch ${RD}/boot.${FSIMAGE}/boot/loader.config
703 @vnconfig /dev/${VNDEVICE} fs-image.${FSIMAGE}
704 @mkdir -p /tmp/mnt_xx
705 @mount /dev/${VNDEVICE} /tmp/mnt_xx
706 ./dumpnlist ${RD}/boot.${FSIMAGE}/kernel > /tmp/mnt_xx/stand/symbols
708 @vnconfig -u /dev/${VNDEVICE}
710 .if defined(_MFSKERN)
711 ./write_mfs_in_kernel ${RD}/boot.${FSIMAGE}/kernel \
714 .if ${MACHINE_ARCH} == "i386"
715 kzip -v ${RD}/boot.${FSIMAGE}/kernel
716 @mv ${RD}/boot.${FSIMAGE}/kernel ${RD}/kernels/MFSKERNEL.${FSIMAGE}
717 @mv ${RD}/boot.${FSIMAGE}/kernel.kz ${RD}/boot.${FSIMAGE}/kernel
718 @cp ${.CURDIR}/../sys/i386/boot/biosboot/boot.help ${RD}/boot.${FSIMAGE}
720 @cp ${RD}/boot.${FSIMAGE}/kernel ${RD}/kernels/MFSKERNEL.${FSIMAGE}
721 gzip -v ${RD}/boot.${FSIMAGE}/kernel
722 @mv ${RD}/boot.${FSIMAGE}/kernel.gz ${RD}/boot.${FSIMAGE}/kernel.gz
724 @printf \\a\\a\\a >> ${RD}/boot.${FSIMAGE}/boot.help
725 @touch ${RD}/boot.${FSIMAGE}/boot.config
726 @touch ${RD}/boot.${FSIMAGE}/kernel.config
727 @rm -f ${RD}/floppies/boot${FSIMAGE}.flp
728 .if defined(_MFSKERN)
729 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${BOOTMFSSIZE} \
730 ${RD}/boot.${FSIMAGE} ${BOOTINODE} ${BOOTMFSLABEL}
732 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${BOOTSIZE} \
733 ${RD}/boot.${FSIMAGE} ${BOOTINODE} ${BOOTLABEL}
735 mv fs-image ${RD}/floppies/boot${FSIMAGE}.flp
737 .include <bsd.prog.mk>