1 # $Id: Makefile,v 1.382 1998/09/13 17:20:57 phk 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 600MB 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 # other floppy parameters.
72 ZIPNSPLIT= gzip --no-name -9 -c | split -b 240640 -
74 # Upper size for the mfs in the boot.flp kernel.
75 # These are adjusted down to the minimum needed by doFS.sh.
83 # Things which may get you into trouble if you change them
84 MTREEFILES= ${.CURDIR}/../etc/mtree
91 # Where the bootstrap ports (see DOCPORTS) get installed.
92 LOCALDIR= /usr/local/bin
94 # ${BOOTSTRAPDIR} is for those utilities that refer to the hosting
95 # environment, rather than the target environment. This is specifically
96 # intended for kernel-dependent utilities that are used during the build.
98 # ${BOOTSTRAPDIR} is actually being used by prepending it to the normal
99 # ${PATH}. Thus, it's also available to outside utilities like doFS.sh.
100 BOOTSTRAPDIR= /bootstrap
102 # The mount subsystem has been changed between 2.2 and 3.0 by the
104 BOOTSTRAPUTILS= /sbin/mount /sbin/umount
106 # 3.0 cpio tries to reference lchown(2) which is not available in 2.2
107 BOOTSTRAPUTILS+= /usr/bin/cpio
109 .if !defined(CRUNCH_TARGETS)
110 CRUNCH_TARGETS= boot fixit
113 EXTRAS= cdrom.1 ftp.1
120 REDOSED= sed -e 's/dirs/release.1/' -e 's/trees/release.2/' \
121 -e 's/kerns/release.3/' -e 's/sysinstall/release.4/' \
122 -e 's/fixup/release.5/' -e 's/tarbin/release.6/' \
123 -e 's/tarsrc/release.7/' -e 's/boot\.flp/release.8/' \
124 -e 's/fixit\.flp/release.9/' -e 's/ftp/ftp.1/' \
125 -e 's/cdrom/cdrom.1/'
127 REDOREDO!= echo ${REDO} | ${REDOSED}
130 .if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT)
131 @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false
134 .if exists(${CHROOTDIR})
135 # The first command will fail on a handful of files that have their schg
136 # flags set. But it greatly speeds up the next two commands.
138 -chflags -R noschg ${CHROOTDIR}/.
141 -mkdir -p ${CHROOTDIR}
142 cd ${.CURDIR}/../etc && ${MAKE} distrib-dirs DESTDIR=${CHROOTDIR}
143 cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR}
144 cd ${.CURDIR}/.. && ${MAKE} installworld DESTDIR=${CHROOTDIR} NOMAN=1
145 mkdir ${CHROOTDIR}/${BOOTSTRAPDIR}
146 for i in ${BOOTSTRAPUTILS} ; do \
147 cp -p ${CHROOTDIR}$$i ${CHROOTDIR}/${BOOTSTRAPDIR} ; \
149 .if !defined(RELEASETAG)
150 cd ${CHROOTDIR}/usr && rm -rf src && \
151 cvs -R -d ${CVSROOT} co -P ${RELEASESRCMODULE}
153 cd ${CHROOTDIR}/usr && rm -rf src && \
154 cvs -R -d ${CVSROOT} co -P -r ${RELEASETAG} ${RELEASESRCMODULE}
156 .if defined(LOCAL_PATCHES) && exists(${LOCAL_PATCHES})
157 cd ${CHROOTDIR}/usr/src && patch --silent < ${LOCAL_PATCHES}
159 .if defined(LOCAL_SCRIPT) && exists(${LOCAL_SCRIPT})
160 cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT}
162 .if !defined(NOPORTS)
163 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P ${RELEASEPORTSMODULE} && cd ports && make readmes PORTSDIR=${CHROOTDIR}/usr/ports
166 cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co -P ${RELEASEDOCMODULE}
167 cd ${CHROOTDIR}/usr/ports && for i in ${DOCPORTS}; do \
168 (cd $$i; make fetch MASTER_SITE_OVERRIDE=file:/usr/ports/distfiles/ \
169 DISTDIR=${CHROOTDIR}/usr/ports/distfiles ); \
174 .if !defined(RELEASENOUPDATE)
175 .if !defined(RELEASETAG)
176 cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d
178 cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d -r ${RELEASETAG}
180 .if !defined(NOPORTS)
181 cd ${CHROOTDIR}/usr/ports && cvs -R -q update -P -d
184 cd ${CHROOTDIR}/usr/doc && cvs -R -q update -P -d
188 # Add version information to those things that need it.
189 ( cd ${CHROOTDIR}/usr/src/sys/conf && \
190 mv newvers.sh foo && \
191 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh&& rm foo )
192 ( cd ${CHROOTDIR}/usr/src/release/sysinstall && \
193 sed "s/__RELEASE/${BUILDNAME}/" version.h > version.h.new && \
194 mv version.h.new version.h && \
196 echo OBJFORMAT=${OBJFORMAT} > ${CHROOTDIR}/etc/objformat
197 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
198 echo "#!/bin/sh" > ${CHROOTDIR}/mk
199 echo "set -ex" >> ${CHROOTDIR}/mk
200 echo "export CFLAGS='-O2 -pipe'" >> ${CHROOTDIR}/mk
201 echo "export DISTRIBUTIONS=\"${DISTRIBUTIONS}\"" >> ${CHROOTDIR}/mk
202 echo "export BUILDNAME=${BUILDNAME}" >> ${CHROOTDIR}/mk
203 echo "export VNDEVICE=${VNDEVICE}" >> ${CHROOTDIR}/mk
204 echo "export OBJFORMAT=${OBJFORMAT}" >> ${CHROOTDIR}/mk
205 .if defined(RELEASETAG)
206 echo "export RELEASETAG=${RELEASETAG}" >> ${CHROOTDIR}/mk
209 echo "export NOPORTS=${NOPORTS}" >> ${CHROOTDIR}/mk
212 echo "export NODOC=${NODOC}" >> ${CHROOTDIR}/mk
215 echo "export ALLLANG=${ALLLANG}" >> ${CHROOTDIR}/mk
218 echo "export NOSRC=${NOSRC}" >> ${CHROOTDIR}/mk
220 .if defined(NOSHARED)
221 echo "export NOSHARED=${NOSHARED}" >> ${CHROOTDIR}/mk
223 .if defined(BOOT_CONFIG)
224 echo "export BOOT_CONFIG=\"${BOOT_CONFIG}\"">> ${CHROOTDIR}/mk
226 # Don't remove this, or the build will fall over!
227 echo "export RELEASEDIR=/R" >> ${CHROOTDIR}/mk
228 echo "export PATH=${BOOTSTRAPDIR}:$${PATH}:${LOCALDIR}" >> ${CHROOTDIR}/mk
229 echo "cd /usr/src" >> ${CHROOTDIR}/mk
231 echo "(cd etc; make distrib-dirs distribution)" >> ${CHROOTDIR}/mk
232 echo "make world" >> ${CHROOTDIR}/mk
235 echo "make all install" >> ${CHROOTDIR}/mk
237 echo "cd /usr/src/release/sysinstall" >> ${CHROOTDIR}/mk
238 echo "make obj" >> ${CHROOTDIR}/mk
239 echo "cd /usr/src/release" >> ${CHROOTDIR}/mk
240 echo "make objlink" >> ${CHROOTDIR}/mk
241 echo "(cd obj; rm -f ${REDOREDO})" >> ${CHROOTDIR}/mk
242 echo "make doRELEASE" >> ${CHROOTDIR}/mk
243 echo "echo make ${.TARGET} Finished" >> ${CHROOTDIR}/mk
244 chmod 755 ${CHROOTDIR}/mk
245 chroot ${CHROOTDIR} /mk
248 rm -rf boot_crunch release.[0-9]
250 # Clean out /R and make the directory structure.
253 chflags -R noschg /R/.
260 for i in ${DISTRIBUTIONS} ; do \
261 mkdir ${RD}/trees/$$i && \
262 mkdir ${RD}/dists/$$i && \
263 mtree -deU -f ${MTREEFILES}/BSD.root.dist \
264 -p ${RD}/trees/$$i > /dev/null && \
265 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
266 -p ${RD}/trees/$$i/usr > /dev/null && \
267 mtree -deU -f ${MTREEFILES}/BSD.include.dist \
268 -p ${RD}/trees/$$i/usr/include > /dev/null && \
269 mtree -deU -f ${MTREEFILES}/BSD.var.dist \
270 -p ${RD}/trees/$$i/var > /dev/null ; \
274 # Install the system into the various distributions.
276 cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/bin
277 cd ${.CURDIR}/.. && make distribute DISTDIR=${RD}/trees
278 .if exists(${.CURDIR}/../kerberosIV) && !defined(NOKERBEROS)
279 cd ${.CURDIR}/../kerberosIV && ( \
281 make obj all help-distribute DISTDIR=${RD}/trees &&\
285 chflags -R noschg ${RD}/trees
288 # Make and install the generic kernel(s).
290 .for kernel in ${KERNELS}
291 rm -f ${RD}/kernels/${kernel}
292 rm -rf ${.CURDIR}/../sys/compile/${kernel}
293 cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=${kernel}
294 rm -rf ${.CURDIR}/../sys/compile/${kernel}
295 ln -f ${RD}/kernels/${kernel} ${RD}/trees/bin/kernel.${kernel}
299 # Make and install the three crunched binaries which live on the floppies.
300 # You are not supposed to like this :-)
302 # NB: the "RELEASE_BUILD_FIXIT" magic prevents vi from including the
303 # Tcl and Perl APIs. See also /usr/src/usr.bin/vi/Makefile.
306 cd ${.CURDIR}/sysinstall && make obj depend all install
308 mkdir -p ${RD}/crunch
309 export RELEASE_BUILD_FIXIT=noway ; \
310 for j in ${CRUNCH_TARGETS} ; do \
311 rm -rf $${j}_crunch && \
312 mkdir $${j}_crunch && \
313 ( cd $${j}_crunch && \
314 crunchgen ${.CURDIR}/$${j}_crunch.conf && \
315 ${MAKE} -DRELEASE_CRUNCH -f $${j}_crunch.mk subclean all \
316 NOCRYPT=yes "CFLAGS=${CFLAGS} -DCRUNCHED_BINARY") && \
317 mv $${j}_crunch/$${j}_crunch ${RD}/crunch/$${j} && \
318 true || { rm -rf $${j}_crunch ; false ; } ; \
323 # --==## Fix up the distributions. ##==--
326 # Handle some grief caused by the munition braindeadness.
327 for i in sbin/init bin/ed usr.sbin/ppp ; do \
328 ( cd ${.CURDIR}/../$$i; \
329 make -DNOCRYPT clean all distribute DISTDIR=${RD}/trees ) ; \
332 # Create any "synthetic dists" now.
333 @for i in ${DISTRIBUTIONS}; do \
334 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
335 echo -n "Running $$i dist creation script... "; \
336 env OBJFORMAT=${OBJFORMAT} RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
341 # Create symlinks for the MD5-based crypt lib, too. The
342 # automatically created links still point to the DES stuff,
343 # which went into its own distribution.
344 for i in ${RD}/trees/bin/usr/lib/libscrypt* ; do \
345 c=`echo $$i | sed -e 's/libscrypt/libcrypt/'` ; \
347 ln -s `basename $$i` $$c ; \
350 # Remove all the directories we don't need.
352 find ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} -depth -type d -print | xargs rmdir
356 # --==## Package up the tarballs from assembled trees ##==--
361 @for i in ${DISTRIBUTIONS} ; \
363 if [ -d ${RD}/trees/$${i} ] ; then \
364 cd ${.CURDIR} && $(MAKE) doTARBALL \
365 SD=${RD}/trees/$${i} \
366 TN=$$i TD=$$i ARG="." && \
367 echo "$${i} distribution is finished."; \
370 # More munition braindeadness.
371 ( cd ${RD}/dists && \
372 if [ -f krb/krb.aa ] ; then mv krb/* des && rmdir krb ; fi )
377 # --==## Make source dists ##==--
381 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \
382 TD=src TN=sbase ARG="[A-Z]*"
383 @for i in `cd /usr/src && echo [a-z]*` ; do \
384 if [ -d /usr/src/$$i ] ; then \
385 cd ${.CURDIR} && $(MAKE) doTARBALL \
386 TN=`echo s$$i | tr -d '.' | sed 's/usr/u/'` \
387 SD=/usr/src TD=src ARG="$$i" ; \
390 .if defined(EXTRA_SRC)
391 @set ${EXTRA_SRC} && \
392 while [ $$# -ge 2 ] ; do \
393 if [ -d /usr/src/$$1 ] ; then \
394 cd ${.CURDIR} && $(MAKE) doTARBALL \
395 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
396 fi && shift && shift ; \
399 ( cd ${RD}/dists/src && \
400 if [ -f ssecure.aa ] ; then mv ssecure.* ../des ; fi && \
401 if [ -f scrypto.aa ] ; then mv scrypto.* ../des ; fi && \
402 if [ -f skerbero.aa ] ; then mv skerbero.* ../des ; fi ; )
403 @echo "src distribution is finished."
407 # Complete the bootfd
409 # Now, just to get this picture down once and for all:
411 # +------------------------------------------------------------------------+
413 # +-----+-----+------------------------------------------------------------+
414 # |boot1|boot2|floppy filesystem "bootfd" |
415 # +-----+-----+-+--------------------------------------------------------+-+
417 # +------------+-----------------------------------------+-+
418 # |mfs filesystem "mfsfd" |
419 # +-----------------------------------------+
422 release.8: write_mfs_in_kernel dumpnlist
426 mkdir -p etc dev mnt stand/help
427 @cp ${.CURDIR}/../sys/i386/boot/biosboot/boot.help ${RD}/mfsfd/stand
428 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
429 DIR=${RD}/mfsfd/stand ZIP=false
430 ( cd ${RD}/trees/bin/dev && \
431 ls console tty ttyv0 ttyv1 ttyv2 ttyv3 null zero | \
432 cpio -dump ${RD}/mfsfd/dev )
433 ( cd ${RD}/mfsfd/dev && rm -f *[swo]d*[bdefgh] )
434 cd ${RD}/trees/bin && ls ${BOOT1} | cpio -dump ${RD}/mfsfd/stand
435 echo "nameserver 42/tcp name" > ${RD}/mfsfd/stand/etc/services
436 echo "ftp 21/tcp" >> ${RD}/mfsfd/stand/etc/services
437 echo "domain 53/tcp nameserver" >> ${RD}/mfsfd/stand/etc/services
438 echo "domain 53/udp nameserver" >> ${RD}/mfsfd/stand/etc/services
439 echo "cmd 514/tcp shell" >> ${RD}/mfsfd/stand/etc/services
440 gzip -c ${.CURDIR}/../COPYRIGHT > ${RD}/mfsfd/stand/help/COPYRIGHT.hlp.gz
441 -test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
442 @echo "Making the regular boot floppy."
443 tar --exclude CVS -cf - -C ${.CURDIR}/sysinstall help | \
444 tar xvf - -C ${RD}/mfsfd/stand
445 @echo "Compressing doc files..."
446 @gzip -9 ${RD}/mfsfd/stand/help/*.hlp
447 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${BOOTMFSSIZE} ${RD}/mfsfd \
449 mv fs-image fs-image.std
450 mv fs-image.size fs-image.std.size
451 cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=std
452 mv ${RD}/floppies/bootstd.flp ${RD}/floppies/boot.flp
453 @echo "Regular boot floppy made."
457 # --==## Create a fixit floppy ##==--
462 cd ${RD}/fixitfd && \
463 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
464 usr/share/misc usr/mdec
465 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=fixit \
466 DIR=${RD}/fixitfd/stand ZIP=false
467 ( cd ${RD}/fixitfd/dev && \
468 sed -e '/^PATH/s/^/#/' ${RD}/trees/bin/dev/MAKEDEV > MAKEDEV && \
469 chmod 755 MAKEDEV && \
471 cp ${RD}/trees/bin/etc/spwd.db ${RD}/trees/bin/etc/group \
472 ${RD}/trees/bin/etc/protocols ${RD}/fixitfd/etc
473 cp ${RD}/trees/bin/usr/share/misc/scsi_modes \
474 ${RD}/fixitfd/usr/share/misc
475 cp ${RD}/trees/bin/usr/mdec/boot[12] ${RD}/fixitfd/usr/mdec
476 for type in fd od sd wd ; do \
477 ( cd ${RD}/fixitfd/usr/mdec && ln -s boot1 $${type}boot && \
478 ln -s boot2 boot$${type} ) ; \
480 cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
481 cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
482 cp ${.CURDIR}/tar.sh ${RD}/fixitfd/stand/tar
483 chmod 555 ${RD}/fixitfd/stand/tar
484 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${FDSIZE} ${RD}/fixitfd \
485 ${FIXITINODE} ${FDLABEL}
486 mv fs-image ${RD}/floppies/fixit.flp
487 # Do our last minute floppies directory setup in a convenient place.
488 cp ${.CURDIR}/README.TXT ${RD}/floppies/README.TXT
489 @(cd ${RD}/floppies; md5 * > CHECKSUM.MD5)
493 # --==## Setup a suitable ftp-area ##==--
497 cd ${RD} && find floppies -print | cpio -dumpl ${FD}
498 cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
499 cp ${.CURDIR}/ABOUT.TXT ${FD}/ABOUT.TXT
500 cp ${.CURDIR}/ERRATA.TXT ${FD}/ERRATA.TXT
501 cp ${.CURDIR}/LAYOUT.TXT ${FD}/LAYOUT.TXT
502 cp ${.CURDIR}/sysinstall/help/readme.hlp ${FD}/README.TXT
503 cp ${.CURDIR}/sysinstall/help/hardware.hlp ${FD}/HARDWARE.TXT
504 cp ${.CURDIR}/sysinstall/help/install.hlp ${FD}/INSTALL.TXT
505 cp ${.CURDIR}/sysinstall/help/relnotes.hlp ${FD}/RELNOTES.TXT
506 cp ${.CURDIR}/sysinstall/help/trouble.hlp ${FD}/TROUBLE.TXT
507 cp ${.CURDIR}/sysinstall/help/upgrade.hlp ${FD}/UPGRADE.TXT
509 echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
510 .if !defined(NOPORTS)
511 tar -cBf - -C ${CD_DISC1} ports | tar -xBf - -C ${FD}
515 # --==## Setup a suitable cdrom-area ##==--
518 mkdir -p ${CD_DISC1} ${CD_DISC2}
519 cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
520 cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}
521 ln -f ${RD}/kernels/MFSKERNEL.std ${CD_DISC1}/kernel
522 ln -f ${RD}/trees/bin/usr/mdec/fbsdboot.exe ${CD_DISC1}
523 for i in ${DISTRIBUTIONS} ; \
525 if [ -d ${RD}/trees/$${i} ] ; then \
526 chflags -R noschg ${RD}/trees/$${i} ; \
527 ( cd ${RD}/trees/$${i} && \
528 find . -depth -print | cpio -dumpl ${CD_DISC2} ) ; \
531 rm -f ${CD_DISC2}/.profile
532 cp ${.CURDIR}/fixit.profile ${CD_DISC2}/.profile
533 echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
534 echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
535 cp ${.CURDIR}/ABOUT.TXT ${CD_DISC1}/ABOUT.TXT
536 cp ${.CURDIR}/ERRATA.TXT ${CD_DISC1}/ERRATA.TXT
537 cp ${.CURDIR}/LAYOUT.TXT ${CD_DISC1}/LAYOUT.TXT
538 cp ${.CURDIR}/sysinstall/help/readme.hlp ${CD_DISC1}/README.TXT
539 cp ${.CURDIR}/sysinstall/help/hardware.hlp ${CD_DISC1}/HARDWARE.TXT
540 cp ${.CURDIR}/sysinstall/help/install.hlp ${CD_DISC1}/INSTALL.TXT
541 cp ${.CURDIR}/sysinstall/help/relnotes.hlp ${CD_DISC1}/RELNOTES.TXT
542 cp ${.CURDIR}/sysinstall/help/trouble.hlp ${CD_DISC1}/TROUBLE.TXT
543 cp ${.CURDIR}/sysinstall/help/upgrade.hlp ${CD_DISC1}/UPGRADE.TXT
545 .if !defined(NOPORTS)
546 -rm -rf /usr/ports/distfiles/*
547 tar -cBf - -C /usr ports | tar xBpf - -C ${CD_DISC2} && \
548 mkdir -p ${CD_DISC1}/ports && \
549 tar -czf ${CD_DISC1}/ports/ports.tgz -C /usr ports && \
550 cp ${.CURDIR}/scripts/ports-install.sh ${CD_DISC1}/ports/install.sh && \
551 (cd ${CD_DISC1}/ports; md5 * > CHECKSUM.MD5)
552 ln -s ../ports ${CD_DISC2}/usr/ports
556 for i in ${DOCPORTS}; do \
557 cd /usr/ports/$$i && make all install clean FORCE_PKG_REGISTER=yes; \
559 cd /usr/doc && make all distribute DISTDIR=${RD}/trees
561 # Various "subroutine" and other supporting targets.
565 @echo "SD undefined in doTARBALL" && exit 1
568 @echo "TB undefined in doTARBALL" && exit 1
571 @echo "ARG undefined in doTARBALL" && exit 1
573 rm -rf ${RD}/dists/${TD}/${TN}*
574 mkdir -p ${RD}/dists/${TD}
576 tn=`echo ${TN} | tr '[A-Z]' '[a-z]' | cut -c1-8` && \
577 echo rolling ${TD}/$$tn tarball &&\
578 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
579 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
580 sh ${.CURDIR}/info.sh ${RD}/dists/${TD}/$$tn > \
581 ${RD}/dists/${TD}/$$tn.inf && \
582 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
583 cp -p ${.CURDIR}/scripts/$${TD}-install.sh ${RD}/dists/${TD}/install.sh; \
585 if [ "${SD}" != "/usr/src" ]; then \
586 mtree -c -i -p ${SD}/${ARG} \
587 -k gname,md5digest,mode,nlink,uname,size,link,type \
588 > ${RD}/dists/${TD}/$$tn.mtree ; \
592 (cd ${RD}/dists/${TD}; \
593 rm -f CHECKSUM.MD5; \
594 md5 * > CHECKSUM.MD5) \
597 .if ${MACHINE_ARCH} == "i386"
598 doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 release.5 \
599 release.6 release.7 release.8 release.9
600 cd ${.CURDIR} && ${MAKE} ${EXTRAS}
604 .if ${MACHINE_ARCH} == "alpha"
605 doRELEASE: release.1 release.2 ${DOCREL} release.5 release.6 release.7
606 cd ${.CURDIR} && ${MAKE} ${EXTRAS}
611 cd ${.CURDIR} && ${MAKE} boot.flp
612 cd ${.CURDIR} && ${MAKE} fixit.flp
613 cd ${RD} && find floppies -print | cpio -dumpl ${FD}
616 rm -f release.4 release.8
617 cd ${.CURDIR} && ${MAKE} release.4 release.8 CRUNCH_TARGETS=boot
620 rm -f release.4 release.9
621 cd ${.CURDIR} && ${MAKE} release.4 release.9 CRUNCH_TARGETS=fixit
623 write_mfs_in_kernel: ${.CURDIR}/write_mfs_in_kernel.c
624 ${CC} ${CFLAGS} -o write_mfs_in_kernel ${.CURDIR}/write_mfs_in_kernel.c
626 dumpnlist: ${.CURDIR}/dumpnlist.c
627 ${CC} ${CFLAGS} -o dumpnlist ${.CURDIR}/dumpnlist.c
631 @echo "CRUNCH undefined in installCRUNCH" && exit 1
634 @echo "DIR undefined in installCRUNCH" && exit 1
637 @echo "ZIP undefined in installCRUNCH" && exit 1
640 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
642 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
644 chmod 555 ${DIR}/${CRUNCH}_crunch
645 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
646 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
650 # --==## Compile a kernel by name ${KERNEL} ##==--
652 # We don't erase the sys/compile/${KERNEL} directory, since somebody
653 # may want to reuse it (release.8 presently)
656 rm -f ${RD}/kernels/${KERNEL}
657 cd ${.CURDIR}/../sys/i386/conf && config ${KERNEL}
658 cd ${.CURDIR}/../sys/compile/${KERNEL} && \
661 cp kernel ${RD}/kernels/${KERNEL}
664 # --==## Put a filesystem into a BOOTMFS kernel ##==--
667 @rm -f ${RD}/kernels/BOOTMFS.${FSIMAGE}
668 @rm -f /sys/compile/BOOTMFS/mfs_vfsops.o
669 @cd ${.CURDIR}/../sys/i386/conf && \
674 -e '/MATH_EMULATE/d' \
675 -e 's/GENERIC/BOOTMFS/g' \
676 -e '/maxusers/s/10/4/' < GENERIC > BOOTMFS && \
677 echo "options MFS" >> BOOTMFS && \
678 echo "options NFS_NOSERVER" >> BOOTMFS && \
679 echo 'options "MAXCONS=4"' >> BOOTMFS && \
680 echo "options USERCONFIG_BOOT" >> BOOTMFS
681 @echo "options \"MFS_ROOT=`cat fs-image.${FSIMAGE}.size`\"" >> \
682 ${.CURDIR}/../sys/i386/conf/BOOTMFS
683 cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=BOOTMFS
684 @rm -rf ${RD}/boot.${FSIMAGE}
685 @mkdir ${RD}/boot.${FSIMAGE}
686 @mv ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE}
687 @cp ${RD}/kernels/BOOTMFS.${FSIMAGE} ${RD}/boot.${FSIMAGE}/kernel
688 .if defined(BOOT_CONFIG)
689 @echo "${BOOT_CONFIG}" >${RD}/boot.${FSIMAGE}/boot.config
691 @vnconfig /dev/${VNDEVICE} fs-image.${FSIMAGE}
692 @mkdir -p /tmp/mnt_xx
693 @mount /dev/${VNDEVICE} /tmp/mnt_xx
694 ./dumpnlist ${RD}/boot.${FSIMAGE}/kernel > /tmp/mnt_xx/stand/symbols
696 @vnconfig -u /dev/${VNDEVICE}
698 ./write_mfs_in_kernel ${RD}/boot.${FSIMAGE}/kernel \
700 kzip -v ${RD}/boot.${FSIMAGE}/kernel
701 @mv ${RD}/boot.${FSIMAGE}/kernel ${RD}/kernels/MFSKERNEL.${FSIMAGE}
702 @mv ${RD}/boot.${FSIMAGE}/kernel.kz ${RD}/boot.${FSIMAGE}/kernel
703 @cp ${.CURDIR}/../sys/i386/boot/biosboot/boot.help ${RD}/boot.${FSIMAGE}
704 @printf \\a\\a\\a >> ${RD}/boot.${FSIMAGE}/boot.help
705 @touch ${RD}/boot.${FSIMAGE}/boot.config
706 @touch ${RD}/boot.${FSIMAGE}/kernel.config
707 @rm -f ${RD}/floppies/boot${FSIMAGE}.flp
708 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${FDSIZE} ${RD}/boot.${FSIMAGE} \
709 ${BOOTINODE} ${FDLABEL}
710 mv fs-image ${RD}/floppies/boot${FSIMAGE}.flp
712 .include <bsd.prog.mk>