1 # $Id: Makefile,v 1.418 1998/10/14 02:13:45 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 # Things which without too much trouble can be considered variables
49 # BIN_DISTS are special in that they get full /etc installation sets.
51 COMPAT_DISTS?= compat1x compat20 compat21
52 OTHER_DISTS?= manpages catpages games proflibs dict info doc
53 CRYPTO_DISTS?= krb des
55 DISTRIBUTIONS?= ${BIN_DISTS} ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS}
58 # Extra source tarballs; each argument is a pair of source dir and
59 # distribution name. The dist name should not exceed 7 characters
60 # (another "s" for "source" will be prepended).
61 EXTRA_SRC+= usr.sbin/sendmail/cf smailcf
63 BOOT1= etc/protocols etc/rc.conf
65 # mountpoint for filesystems.
68 # Various floppy image parameters.
70 # These are adjusted down to the minimum needed by doFS.sh.
71 .if ${MACHINE_ARCH} == "i386"
89 BOOTMFSLABEL= minimum2
93 ZIPNSPLIT= gzip --no-name -9 -c | split -b 240640 -
98 # Things which may get you into trouble if you change them
99 MTREEFILES= ${.CURDIR}/../etc/mtree
103 CD_DISC1= ${CD}/disc1
104 CD_DISC2= ${CD}/disc2
106 # Where the bootstrap ports (see DOCPORTS) get installed.
107 LOCALDIR= /usr/local/bin
109 # ${BOOTSTRAPDIR} is for those utilities that refer to the hosting
110 # environment, rather than the target environment. This is specifically
111 # intended for kernel-dependent utilities that are used during the build.
113 # ${BOOTSTRAPDIR} is actually being used by prepending it to the normal
114 # ${PATH}. Thus, it's also available to outside utilities like doFS.sh.
115 BOOTSTRAPDIR= /bootstrap
117 # The mount subsystem has been changed between 2.2 and 3.0 by the
119 BOOTSTRAPUTILS= /sbin/mount /sbin/umount
121 # 3.0 cpio tries to reference lchown(2) which is not available in 2.2
122 BOOTSTRAPUTILS+= /usr/bin/cpio
124 .if !defined(CRUNCH_TARGETS)
125 CRUNCH_TARGETS= boot fixit
128 EXTRAS= cdrom.1 ftp.1
135 REDOSED= sed -e 's/dirs/release.1/' -e 's/trees/release.2/' \
136 -e 's/kerns/release.3/' -e 's/sysinstall/release.4/' \
137 -e 's/fixup/release.5/' -e 's/tarbin/release.6/' \
138 -e 's/tarsrc/release.7/' -e 's/boot\.flp/release.8/' \
139 -e 's/fixit\.flp/release.9/' -e 's/ftp/ftp.1/' \
140 -e 's/cdrom/cdrom.1/' -e 's/doc/doc.1/'
142 REDOREDO!= echo ${REDO} | ${REDOSED}
145 .if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT)
146 @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false
149 .if exists(${CHROOTDIR})
150 # The first command will fail on a handful of files that have their schg
151 # flags set. But it greatly speeds up the next two commands.
153 -chflags -R noschg ${CHROOTDIR}/.
156 -mkdir -p ${CHROOTDIR}
157 cd ${.CURDIR}/../etc && ${MAKE} distrib-dirs DESTDIR=${CHROOTDIR}
158 cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR}
159 cd ${.CURDIR}/.. && ${MAKE} installworld DESTDIR=${CHROOTDIR} NOMAN=1
160 mkdir ${CHROOTDIR}/${BOOTSTRAPDIR}
161 for i in ${BOOTSTRAPUTILS} ; do \
162 cp -p ${CHROOTDIR}$$i ${CHROOTDIR}/${BOOTSTRAPDIR} ; \
164 .if !defined(RELEASETAG)
165 cd ${CHROOTDIR}/usr && rm -rf src && \
166 cvs -R -d ${CVSROOT} co -P ${RELEASESRCMODULE}
168 cd ${CHROOTDIR}/usr && rm -rf src && \
169 cvs -R -d ${CVSROOT} co -P -r ${RELEASETAG} ${RELEASESRCMODULE}
171 .if defined(LOCAL_PATCHES) && exists(${LOCAL_PATCHES})
172 cd ${CHROOTDIR}/usr/src && patch --silent < ${LOCAL_PATCHES}
174 .if defined(LOCAL_SCRIPT) && exists(${LOCAL_SCRIPT})
175 cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT}
177 .if !defined(NOPORTS)
178 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P ${RELEASEPORTSMODULE} && cd ports && make readmes PORTSDIR=${CHROOTDIR}/usr/ports
181 cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co -P ${RELEASEDOCMODULE}
182 cd ${CHROOTDIR}/usr/ports && for i in ${DOCPORTS}; do \
183 (cd $$i; make fetch MASTER_SITE_OVERRIDE=file:/usr/ports/distfiles/ \
184 DISTDIR=${CHROOTDIR}/usr/ports/distfiles ); \
189 .if !defined(RELEASENOUPDATE)
190 .if !defined(RELEASETAG)
191 cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d
193 cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d -r ${RELEASETAG}
195 .if !defined(NOPORTS)
196 cd ${CHROOTDIR}/usr/ports && cvs -R -q update -P -d
199 cd ${CHROOTDIR}/usr/doc && cvs -R -q update -P -d
203 # Add version information to those things that need it.
204 ( cd ${CHROOTDIR}/usr/src/sys/conf && \
205 mv newvers.sh foo && \
206 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh&& rm foo )
207 ( cd ${CHROOTDIR}/usr/src/release/sysinstall && \
208 sed "s/__RELEASE/${BUILDNAME}/" version.h > version.h.new && \
209 mv version.h.new version.h && \
211 echo OBJFORMAT=${OBJFORMAT} > ${CHROOTDIR}/etc/objformat
212 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
213 echo "#!/bin/sh" > ${CHROOTDIR}/mk
214 echo "set -ex" >> ${CHROOTDIR}/mk
215 echo "_RELTARGET=\$${1:-doRELEASE}" >> ${CHROOTDIR}/mk
216 echo "export CFLAGS='-O -pipe'" >> ${CHROOTDIR}/mk
217 echo "export DISTRIBUTIONS=\"${DISTRIBUTIONS}\"" >> ${CHROOTDIR}/mk
218 echo "export BUILDNAME=${BUILDNAME}" >> ${CHROOTDIR}/mk
219 echo "export VNDEVICE=${VNDEVICE}" >> ${CHROOTDIR}/mk
220 echo "export OBJFORMAT=${OBJFORMAT}" >> ${CHROOTDIR}/mk
221 .if defined(RELEASETAG)
222 echo "export RELEASETAG=${RELEASETAG}" >> ${CHROOTDIR}/mk
225 echo "export NOPORTS=${NOPORTS}" >> ${CHROOTDIR}/mk
228 echo "export NODOC=${NODOC}" >> ${CHROOTDIR}/mk
231 echo "export ALLLANG=${ALLLANG}" >> ${CHROOTDIR}/mk
234 echo "export NOSRC=${NOSRC}" >> ${CHROOTDIR}/mk
236 .if defined(NOSHARED)
237 echo "export NOSHARED=${NOSHARED}" >> ${CHROOTDIR}/mk
239 .if defined(BOOT_CONFIG)
240 echo "export BOOT_CONFIG=\"${BOOT_CONFIG}\"">> ${CHROOTDIR}/mk
242 # Don't remove this, or the build will fall over!
243 echo "export RELEASEDIR=/R" >> ${CHROOTDIR}/mk
244 echo "export PATH=${BOOTSTRAPDIR}:$${PATH}:${LOCALDIR}" >> ${CHROOTDIR}/mk
245 echo "cd /usr/src" >> ${CHROOTDIR}/mk
247 echo "(cd etc; make distrib-dirs distribution)" >> ${CHROOTDIR}/mk
248 echo "make world" >> ${CHROOTDIR}/mk
251 echo "make all install" >> ${CHROOTDIR}/mk
253 echo "cd /usr/src/release/sysinstall" >> ${CHROOTDIR}/mk
254 echo "make obj" >> ${CHROOTDIR}/mk
255 echo "cd /usr/src/release" >> ${CHROOTDIR}/mk
256 echo "make objlink" >> ${CHROOTDIR}/mk
257 echo "(cd obj; rm -f ${REDOREDO})" >> ${CHROOTDIR}/mk
258 echo "make \$${_RELTARGET}" >> ${CHROOTDIR}/mk
259 echo "echo make ${.TARGET} Finished" >> ${CHROOTDIR}/mk
260 chmod 755 ${CHROOTDIR}/mk
261 chroot ${CHROOTDIR} /mk
264 rm -rf boot_crunch release.[0-9]
266 # Clean out /R and make the directory structure.
269 chflags -R noschg /R/.
276 for i in ${DISTRIBUTIONS} ; do \
277 mkdir ${RD}/trees/$$i && \
278 mkdir ${RD}/dists/$$i && \
279 mtree -deU -f ${MTREEFILES}/BSD.root.dist \
280 -p ${RD}/trees/$$i > /dev/null && \
281 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
282 -p ${RD}/trees/$$i/usr > /dev/null && \
283 mtree -deU -f ${MTREEFILES}/BSD.include.dist \
284 -p ${RD}/trees/$$i/usr/include > /dev/null && \
285 mtree -deU -f ${MTREEFILES}/BSD.var.dist \
286 -p ${RD}/trees/$$i/var > /dev/null ; \
290 # Install the system into the various distributions.
292 cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/bin
293 cd ${.CURDIR}/.. && make distribute DISTDIR=${RD}/trees
294 .if exists(${.CURDIR}/../kerberosIV) && !defined(NOKERBEROS)
295 cd ${.CURDIR}/../kerberosIV && ( \
297 make obj all help-distribute DISTDIR=${RD}/trees &&\
301 # XXX until lkm and mdec gets populated again by some other means
302 .if ${MACHINE_ARCH} == "i386"
303 cd ${.CURDIR}/.. && OBJFORMAT=aout MAKEOBJDIRPREFIX=/usr/obj/aout \
304 NOTOOLS=1 NOSECURE=1 NOCRYPT=1 \
305 make -f Makefile.inc1 legacy-install DESTDIR=${RD}/trees/bin
307 chflags -R noschg ${RD}/trees
310 # Make and install the generic kernel(s).
312 .for kernel in ${KERNELS}
313 rm -f ${RD}/kernels/${kernel}
314 rm -rf ${.CURDIR}/../sys/compile/${kernel}
315 cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=${kernel}
316 rm -rf ${.CURDIR}/../sys/compile/${kernel}
317 ln -f ${RD}/kernels/${kernel} ${RD}/trees/bin/kernel.${kernel}
321 # Make and install the three crunched binaries which live on the floppies.
322 # You are not supposed to like this :-)
324 # NB: the "RELEASE_BUILD_FIXIT" magic prevents vi from including the
325 # Tcl and Perl APIs. See also /usr/src/usr.bin/vi/Makefile.
328 cd ${.CURDIR}/sysinstall && make obj depend all install
330 mkdir -p ${RD}/crunch
331 export RELEASE_BUILD_FIXIT=noway ; \
332 for j in ${CRUNCH_TARGETS} ; do \
333 rm -rf $${j}_crunch && \
334 mkdir $${j}_crunch && \
335 ( cd $${j}_crunch && \
336 crunchgen ${.CURDIR}/$${j}_crunch.conf && \
337 ${MAKE} -DRELEASE_CRUNCH -f $${j}_crunch.mk subclean all \
338 NOCRYPT=yes "CFLAGS=${CFLAGS} -DCRUNCHED_BINARY") && \
339 mv $${j}_crunch/$${j}_crunch ${RD}/crunch/$${j} && \
340 true || { rm -rf $${j}_crunch ; false ; } ; \
345 # --==## Fix up the distributions. ##==--
348 # Handle some grief caused by the munition braindeadness.
349 for i in sbin/init bin/ed usr.sbin/ppp ; do \
350 ( cd ${.CURDIR}/../$$i; \
351 make -DNOCRYPT clean all distribute DISTDIR=${RD}/trees ) ; \
354 # Create any "synthetic dists" now.
355 @for i in ${DISTRIBUTIONS}; do \
356 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
357 echo -n "Running $$i dist creation script... "; \
358 env OBJFORMAT=${OBJFORMAT} RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
363 # Create symlinks for the MD5-based crypt lib, too. The
364 # automatically created links still point to the DES stuff,
365 # which went into its own distribution.
366 for i in ${RD}/trees/bin/usr/lib/libscrypt* ; do \
367 c=`echo $$i | sed -e 's/libscrypt/libcrypt/'` ; \
369 ln -s `basename $$i` $$c ; \
372 # Remove all the directories we don't need.
374 find ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} -depth -type d -print | xargs rmdir
378 # --==## Package up the tarballs from assembled trees ##==--
383 @for i in ${DISTRIBUTIONS} ; \
385 if [ -d ${RD}/trees/$${i} ] ; then \
386 cd ${.CURDIR} && $(MAKE) doTARBALL \
387 SD=${RD}/trees/$${i} \
388 TN=$$i TD=$$i ARG="." && \
389 echo "$${i} distribution is finished."; \
392 # More munition braindeadness.
393 ( cd ${RD}/dists && \
394 if [ -f krb/krb.aa ] ; then mv krb/* des && rmdir krb ; fi )
399 # --==## Make source dists ##==--
403 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \
404 TD=src TN=sbase ARG="[A-Z]*"
405 @for i in `cd /usr/src && echo [a-z]*` ; do \
406 if [ -d /usr/src/$$i ] ; then \
407 cd ${.CURDIR} && $(MAKE) doTARBALL \
408 TN=`echo s$$i | tr -d '.' | sed 's/usr/u/'` \
409 SD=/usr/src TD=src ARG="$$i" ; \
412 .if defined(EXTRA_SRC)
413 @set ${EXTRA_SRC} && \
414 while [ $$# -ge 2 ] ; do \
415 if [ -d /usr/src/$$1 ] ; then \
416 cd ${.CURDIR} && $(MAKE) doTARBALL \
417 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
418 fi && shift && shift ; \
421 ( cd ${RD}/dists/src && \
422 if [ -f ssecure.aa ] ; then mv ssecure.* ../des ; fi && \
423 if [ -f scrypto.aa ] ; then mv scrypto.* ../des ; fi && \
424 if [ -f skerbero.aa ] ; then mv skerbero.* ../des ; fi ; )
425 @echo "src distribution is finished."
429 # Complete the bootfd
431 # Now, just to get this picture down once and for all:
433 # +------------------------------------------------------------------------+
435 # +-----+-----+------------------------------------------------------------+
436 # |boot1|boot2|floppy filesystem "bootfd" |
437 # +-----+-----+-+--------------------------------------------------------+-+
439 # +------------+-----------------------------------------+-+
440 # |mfs filesystem "mfsfd" |
441 # +-----------------------------------------+
444 release.8: write_mfs_in_kernel dumpnlist
448 mkdir -p etc dev mnt stand/help
449 .if ${MACHINE_ARCH} == "i386"
450 @cp ${.CURDIR}/../sys/i386/boot/biosboot/boot.help ${RD}/mfsfd/stand
452 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
453 DIR=${RD}/mfsfd/stand ZIP=false
454 ( cd ${RD}/trees/bin/dev && \
455 ls console tty ttyv0 ttyv1 ttyv2 ttyv3 null zero | \
456 cpio -dump ${RD}/mfsfd/dev )
457 ( cd ${RD}/mfsfd/dev && rm -f *[swo]d*[bdefgh] )
458 cd ${RD}/trees/bin && ls ${BOOT1} | cpio -dump ${RD}/mfsfd/stand
459 echo "nameserver 42/tcp name" > ${RD}/mfsfd/stand/etc/services
460 echo "ftp 21/tcp" >> ${RD}/mfsfd/stand/etc/services
461 echo "domain 53/tcp nameserver" >> ${RD}/mfsfd/stand/etc/services
462 echo "domain 53/udp nameserver" >> ${RD}/mfsfd/stand/etc/services
463 echo "cmd 514/tcp shell" >> ${RD}/mfsfd/stand/etc/services
464 gzip -c ${.CURDIR}/../COPYRIGHT > ${RD}/mfsfd/stand/help/COPYRIGHT.hlp.gz
465 -test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
466 @echo "Making the regular boot floppy."
467 tar --exclude CVS -cf - -C ${.CURDIR}/sysinstall help | \
468 tar xvf - -C ${RD}/mfsfd/stand
469 @echo "Compressing doc files..."
470 @gzip -9 ${RD}/mfsfd/stand/help/*.hlp
471 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${BOOTMFSSIZE} \
472 ${RD}/mfsfd ${MFSINODE} ${BOOTMFSLABEL}
473 mv fs-image fs-image.std
474 mv fs-image.size fs-image.std.size
475 gzip -c fs-image.std > ${RD}/floppies/mfsroot.gz
476 cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=std
477 mv ${RD}/floppies/bootstd.flp ${RD}/floppies/kern.flp
478 cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=std _MFSKERN=YES
479 mv ${RD}/floppies/bootstd.flp ${RD}/floppies/boot.flp
480 @echo "Regular and MFS boot floppies made."
484 # --==## Create a fixit floppy ##==--
489 cd ${RD}/fixitfd && \
490 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
491 usr/share/misc usr/mdec
492 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=fixit \
493 DIR=${RD}/fixitfd/stand ZIP=false
494 ( cd ${RD}/fixitfd/dev && \
495 sed -e '/^PATH/s/^/#/' ${RD}/trees/bin/dev/MAKEDEV > MAKEDEV && \
496 chmod 755 MAKEDEV && \
498 cp ${RD}/trees/bin/etc/spwd.db ${RD}/trees/bin/etc/group \
499 ${RD}/trees/bin/etc/protocols ${RD}/fixitfd/etc
500 cp ${RD}/trees/bin/usr/share/misc/scsi_modes \
501 ${RD}/fixitfd/usr/share/misc
502 cp ${RD}/trees/bin/usr/mdec/boot[12] ${RD}/fixitfd/usr/mdec
503 for type in fd od sd wd ; do \
504 ( cd ${RD}/fixitfd/usr/mdec && ln -s boot1 $${type}boot && \
505 ln -s boot2 boot$${type} ) ; \
507 cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
508 cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
509 cp ${.CURDIR}/tar.sh ${RD}/fixitfd/stand/tar
510 chmod 555 ${RD}/fixitfd/stand/tar
511 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${FIXITSIZE} \
512 ${RD}/fixitfd ${FIXITINODE} ${FIXITLABEL}
513 mv fs-image ${RD}/floppies/fixit.flp
514 # Do our last minute floppies directory setup in a convenient place.
515 cp ${.CURDIR}/README.TXT ${RD}/floppies/README.TXT
516 @(cd ${RD}/floppies; md5 * > CHECKSUM.MD5)
520 # --==## Setup a suitable ftp-area ##==--
524 cd ${RD} && find floppies -print | cpio -dumpl ${FD}
525 cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
526 cp ${.CURDIR}/ABOUT.TXT ${FD}/ABOUT.TXT
527 cp ${.CURDIR}/ERRATA.TXT ${FD}/ERRATA.TXT
528 cp ${.CURDIR}/LAYOUT.TXT ${FD}/LAYOUT.TXT
529 cp ${.CURDIR}/sysinstall/help/readme.hlp ${FD}/README.TXT
530 cp ${.CURDIR}/sysinstall/help/hardware.hlp ${FD}/HARDWARE.TXT
531 cp ${.CURDIR}/sysinstall/help/install.hlp ${FD}/INSTALL.TXT
532 cp ${.CURDIR}/sysinstall/help/relnotes.hlp ${FD}/RELNOTES.TXT
533 cp ${.CURDIR}/sysinstall/help/trouble.hlp ${FD}/TROUBLE.TXT
534 cp ${.CURDIR}/sysinstall/help/upgrade.hlp ${FD}/UPGRADE.TXT
536 echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
537 .if !defined(NOPORTS)
538 tar -cBf - -C ${CD_DISC1} ports | tar -xBf - -C ${FD}
542 # --==## Setup a suitable cdrom-area ##==--
545 mkdir -p ${CD_DISC1} ${CD_DISC2}
546 cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
547 cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}
548 ln -f ${RD}/kernels/MFSKERNEL.std ${CD_DISC1}/kernel
549 .if ${MACHINE_ARCH} != "alpha"
550 ln -f ${RD}/trees/bin/usr/mdec/fbsdboot.exe ${CD_DISC1}
552 for i in ${DISTRIBUTIONS} ; \
554 if [ -d ${RD}/trees/$${i} ] ; then \
555 chflags -R noschg ${RD}/trees/$${i} ; \
556 ( cd ${RD}/trees/$${i} && \
557 find . -depth -print | cpio -dumpl ${CD_DISC2} ) ; \
560 rm -f ${CD_DISC2}/.profile
561 cp ${.CURDIR}/fixit.profile ${CD_DISC2}/.profile
562 echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
563 echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
564 cp ${.CURDIR}/ABOUT.TXT ${CD_DISC1}/ABOUT.TXT
565 cp ${.CURDIR}/ERRATA.TXT ${CD_DISC1}/ERRATA.TXT
566 cp ${.CURDIR}/LAYOUT.TXT ${CD_DISC1}/LAYOUT.TXT
567 cp ${.CURDIR}/sysinstall/help/readme.hlp ${CD_DISC1}/README.TXT
568 cp ${.CURDIR}/sysinstall/help/hardware.hlp ${CD_DISC1}/HARDWARE.TXT
569 cp ${.CURDIR}/sysinstall/help/install.hlp ${CD_DISC1}/INSTALL.TXT
570 cp ${.CURDIR}/sysinstall/help/relnotes.hlp ${CD_DISC1}/RELNOTES.TXT
571 cp ${.CURDIR}/sysinstall/help/trouble.hlp ${CD_DISC1}/TROUBLE.TXT
572 cp ${.CURDIR}/sysinstall/help/upgrade.hlp ${CD_DISC1}/UPGRADE.TXT
574 .if !defined(NOPORTS)
575 -rm -rf /usr/ports/distfiles/*
576 tar -cBf - -C /usr ports | tar xBpf - -C ${CD_DISC2} && \
577 mkdir -p ${CD_DISC1}/ports && \
578 tar -czf ${CD_DISC1}/ports/ports.tgz -C /usr ports && \
579 cp ${.CURDIR}/scripts/ports-install.sh ${CD_DISC1}/ports/install.sh && \
580 (cd ${CD_DISC1}/ports; md5 * > CHECKSUM.MD5)
581 ln -s ../ports ${CD_DISC2}/usr/ports
585 for i in ${DOCPORTS}; do \
586 cd /usr/ports/$$i && make all install clean FORCE_PKG_REGISTER=yes; \
588 cd /usr/doc && make all distribute DISTDIR=${RD}/trees
591 # Various "subroutine" and other supporting targets.
595 @echo "SD undefined in doTARBALL" && exit 1
598 @echo "TB undefined in doTARBALL" && exit 1
601 @echo "ARG undefined in doTARBALL" && exit 1
603 rm -rf ${RD}/dists/${TD}/${TN}*
604 mkdir -p ${RD}/dists/${TD}
606 tn=`echo ${TN} | tr '[A-Z]' '[a-z]' | cut -c1-8` && \
607 echo rolling ${TD}/$$tn tarball &&\
608 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
609 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
610 sh ${.CURDIR}/info.sh ${RD}/dists/${TD}/$$tn > \
611 ${RD}/dists/${TD}/$$tn.inf && \
612 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
613 cp -p ${.CURDIR}/scripts/$${TD}-install.sh ${RD}/dists/${TD}/install.sh; \
615 if [ "${SD}" != "/usr/src" ]; then \
616 mtree -c -i -p ${SD}/${ARG} \
617 -k gname,md5digest,mode,nlink,uname,size,link,type \
618 > ${RD}/dists/${TD}/$$tn.mtree ; \
622 (cd ${RD}/dists/${TD}; \
623 rm -f CHECKSUM.MD5; \
624 md5 * > CHECKSUM.MD5) \
627 doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 release.5 \
628 release.6 release.7 release.8 release.9
629 cd ${.CURDIR} && ${MAKE} ${EXTRAS}
633 cd ${.CURDIR} && ${MAKE} boot.flp
634 cd ${.CURDIR} && ${MAKE} fixit.flp
635 cd ${RD} && find floppies -print | cpio -dumpl ${FD}
638 rm -f release.4 release.8
639 cd ${.CURDIR} && ${MAKE} release.4 release.8 CRUNCH_TARGETS=boot
642 rm -f release.4 release.9
643 cd ${.CURDIR} && ${MAKE} release.4 release.9 CRUNCH_TARGETS=fixit
645 write_mfs_in_kernel: ${.CURDIR}/write_mfs_in_kernel.c
646 ${CC} ${CFLAGS} -o write_mfs_in_kernel ${.CURDIR}/write_mfs_in_kernel.c
648 # Add -DDO_SCSI to CFLAGS to enable scsi frobbing support.
649 dumpnlist: ${.CURDIR}/dumpnlist.c
650 ${CC} ${CFLAGS} -o dumpnlist ${.CURDIR}/dumpnlist.c
654 @echo "CRUNCH undefined in installCRUNCH" && exit 1
657 @echo "DIR undefined in installCRUNCH" && exit 1
660 @echo "ZIP undefined in installCRUNCH" && exit 1
663 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
665 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
667 chmod 555 ${DIR}/${CRUNCH}_crunch
668 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
669 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
673 # --==## Compile a kernel by name ${KERNEL} ##==--
675 # We don't erase the sys/compile/${KERNEL} directory, since somebody
676 # may want to reuse it (release.8 presently)
679 rm -f ${RD}/kernels/${KERNEL}
680 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/conf && config ${KERNEL}
681 cd ${.CURDIR}/../sys/compile/${KERNEL} && \
684 cp kernel ${RD}/kernels/${KERNEL}
687 # --==## Put a filesystem into a BOOTMFS kernel ##==--
690 @rm -f ${RD}/kernels/BOOTMFS.${FSIMAGE}
691 @rm -f /sys/compile/BOOTMFS/mfs_vfsops.o
692 @cd ${.CURDIR}/../sys/${MACHINE_ARCH}/conf && \
702 -e '/MATH_EMULATE/d' \
703 -e 's/GENERIC/BOOTMFS/g' \
704 -e '/maxusers/s/32/4/' < GENERIC > BOOTMFS && \
705 echo "options NFS_NOSERVER" >> BOOTMFS && \
706 echo 'options "MAXCONS=4"' >> BOOTMFS && \
707 echo "options SCSI_NO_OP_STRINGS" >> BOOTMFS && \
708 echo "options SCSI_NO_SENSE_STRINGS" >> BOOTMFS
709 .if ${MACHINE_ARCH} == "i386"
710 @echo "options USERCONFIG_BOOT" >> ${.CURDIR}/../sys/i386/conf/BOOTMFS
712 .if defined(_MFSKERN)
713 @echo "options \"MFS_ROOT_SIZE=`cat fs-image.${FSIMAGE}.size`\"" >> \
714 ${.CURDIR}/../sys/${MACHINE_ARCH}/conf/BOOTMFS
716 cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=BOOTMFS
717 @rm -rf ${RD}/boot.${FSIMAGE}
718 @mkdir ${RD}/boot.${FSIMAGE}
719 @mv ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE}
720 @cp ${RD}/kernels/BOOTMFS.${FSIMAGE} ${RD}/boot.${FSIMAGE}/kernel
721 .if exists(/boot/loader) && !defined(_MFSKERN)
722 @mkdir -p ${RD}/boot.${FSIMAGE}/boot
723 @cp /boot/* ${RD}/boot.${FSIMAGE}/boot
724 @echo "@load /kernel" > ${RD}/boot.${FSIMAGE}/boot/boot.conf
725 @echo "@echo Please insert MFS root floppy and press enter:" >> ${RD}/boot.${FSIMAGE}/boot/boot.conf
726 @echo "@read" >> ${RD}/boot.${FSIMAGE}/boot/boot.conf
727 @echo "@load -t mfs_root /mfsroot" >> ${RD}/boot.${FSIMAGE}/boot/boot.conf
728 @echo "@boot" >> ${RD}/boot.${FSIMAGE}/boot/boot.conf
729 .if ${MACHINE_ARCH} != "alpha"
730 @echo "/boot/loader" >${RD}/boot.${FSIMAGE}/boot.config
731 @touch ${RD}/boot.${FSIMAGE}/boot/loader.config
733 .elif defined(BOOT_CONFIG)
734 @echo "${BOOT_CONFIG}" >${RD}/boot.${FSIMAGE}/boot.config
736 @vnconfig /dev/${VNDEVICE} fs-image.${FSIMAGE}
737 @mkdir -p /tmp/mnt_xx
738 @mount /dev/${VNDEVICE} /tmp/mnt_xx
739 ./dumpnlist ${RD}/boot.${FSIMAGE}/kernel > /tmp/mnt_xx/stand/symbols
741 @vnconfig -u /dev/${VNDEVICE}
743 .if defined(_MFSKERN)
744 ./write_mfs_in_kernel ${RD}/boot.${FSIMAGE}/kernel \
747 .if ${MACHINE_ARCH} == "i386"
748 kzip -v ${RD}/boot.${FSIMAGE}/kernel
749 @mv ${RD}/boot.${FSIMAGE}/kernel ${RD}/kernels/MFSKERNEL.${FSIMAGE}
750 @mv ${RD}/boot.${FSIMAGE}/kernel.kz ${RD}/boot.${FSIMAGE}/kernel
751 @cp ${.CURDIR}/../sys/i386/boot/biosboot/boot.help ${RD}/boot.${FSIMAGE}
753 @cp ${RD}/boot.${FSIMAGE}/kernel ${RD}/kernels/MFSKERNEL.${FSIMAGE}
754 gzip -v ${RD}/boot.${FSIMAGE}/kernel
755 @mv ${RD}/boot.${FSIMAGE}/kernel.gz ${RD}/boot.${FSIMAGE}/kernel.gz
757 @printf \\a\\a\\a >> ${RD}/boot.${FSIMAGE}/boot.help
758 @touch ${RD}/boot.${FSIMAGE}/boot.config
759 @touch ${RD}/boot.${FSIMAGE}/kernel.config
760 @rm -f ${RD}/floppies/boot${FSIMAGE}.flp
761 .if defined(_MFSKERN)
762 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${BOOTMFSSIZE} \
763 ${RD}/boot.${FSIMAGE} ${BOOTINODE} ${BOOTMFSLABEL}
765 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${BOOTSIZE} \
766 ${RD}/boot.${FSIMAGE} ${BOOTINODE} ${BOOTLABEL}
768 mv fs-image ${RD}/floppies/boot${FSIMAGE}.flp
770 .include <bsd.prog.mk>