1 # $Id: Makefile,v 1.378 1998/09/05 07:43:13 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 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.
41 # Comment the following if you want the release documentation to be
44 DOCPORTS= archivers/unzip lang/perl5 textproc/jade textproc/iso8879 \
45 textproc/linuxdoc textproc/docbook textproc/sgmlformat
47 # Things which without too much trouble can be considered variables
48 # BIN_DISTS are special in that they get full /etc installation sets.
50 COMPAT_DISTS?= compat1x compat20 compat21
51 OTHER_DISTS?= manpages catpages games proflibs dict info doc
52 CRYPTO_DISTS?= krb des
54 DISTRIBUTIONS?= ${BIN_DISTS} ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS}
57 # Extra source tarballs; each argument is a pair of source dir and
58 # distribution name. The dist name should not exceed 7 characters
59 # (another "s" for "source" will be prepended).
60 EXTRA_SRC+= usr.sbin/sendmail/cf smailcf
62 BOOT1= etc/protocols etc/rc.conf
64 # mountpoint for filesystems.
67 # other floppy parameters.
71 ZIPNSPLIT= gzip --no-name -9 -c | split -b 240640 -
73 # Upper size for the mfs in the boot.flp kernel.
74 # These are adjusted down to the minimum needed by doFS.sh.
82 # Things which may get you into trouble if you change them
83 MTREEFILES= ${.CURDIR}/../etc/mtree
90 # Where the bootstrap ports (see DOCPORTS) get installed.
91 LOCALDIR= /usr/local/bin
93 # ${BOOTSTRAPDIR} is for those utilities that refer to the hosting
94 # environment, rather than the target environment. This is specifically
95 # intended for kernel-dependent utilities that are used during the build.
97 # ${BOOTSTRAPDIR} is actually being used by prepending it to the normal
98 # ${PATH}. Thus, it's also available to outside utilities like doFS.sh.
99 BOOTSTRAPDIR= /bootstrap
101 # The mount subsystem has been changed between 2.2 and 3.0 by the
103 BOOTSTRAPUTILS= /sbin/mount /sbin/umount
105 # 3.0 cpio tries to reference lchown(2) which is not available in 2.2
106 BOOTSTRAPUTILS+= /usr/bin/cpio
108 .if !defined(CRUNCH_TARGETS)
109 CRUNCH_TARGETS= boot fixit
112 EXTRAS= cdrom.1 ftp.1
119 REDOSED= sed -e 's/dirs/release.1/' -e 's/trees/release.2/' \
120 -e 's/kerns/release.3/' -e 's/sysinstall/release.4/' \
121 -e 's/fixup/release.5/' -e 's/tarbin/release.6/' \
122 -e 's/tarsrc/release.7/' -e 's/boot\.flp/release.8/' \
123 -e 's/fixit\.flp/release.9/' -e 's/ftp/ftp.1/' \
124 -e 's/cdrom/cdrom.1/'
126 REDOREDO!= echo ${REDO} | ${REDOSED}
129 .if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT)
130 @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false
133 .if exists(${CHROOTDIR})
134 # The first command will fail on a handful of files that have their schg
135 # flags set. But it greatly speeds up the next two commands.
137 -chflags -R noschg ${CHROOTDIR}/.
140 -mkdir -p ${CHROOTDIR}
141 cd ${.CURDIR}/../etc && ${MAKE} distrib-dirs DESTDIR=${CHROOTDIR}
142 cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR}
143 cd ${.CURDIR}/.. && ${MAKE} installworld DESTDIR=${CHROOTDIR} NOMAN=1
144 mkdir ${CHROOTDIR}/${BOOTSTRAPDIR}
145 for i in ${BOOTSTRAPUTILS} ; do \
146 cp -p ${CHROOTDIR}$$i ${CHROOTDIR}/${BOOTSTRAPDIR} ; \
148 .if !defined(RELEASETAG)
149 cd ${CHROOTDIR}/usr && rm -rf src && \
150 cvs -d ${CVSROOT} co -P ${RELEASESRCMODULE}
152 cd ${CHROOTDIR}/usr && rm -rf src && \
153 cvs -d ${CVSROOT} co -P -r ${RELEASETAG} ${RELEASESRCMODULE}
155 .if defined(LOCAL_PATCHES) && exists(${LOCAL_PATCHES})
156 cd ${CHROOTDIR}/usr/src && patch --silent < ${LOCAL_PATCHES}
158 .if defined(LOCAL_SCRIPT) && exists(${LOCAL_SCRIPT})
159 cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT}
161 .if !defined(NOPORTS)
162 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -d ${CVSROOT} co -P ${RELEASEPORTSMODULE} && cd ports && make readmes PORTSDIR=${CHROOTDIR}/usr/ports
165 cd ${CHROOTDIR}/usr && rm -rf doc && cvs -d ${CVSROOT} co -P ${RELEASEDOCMODULE}
166 cd ${CHROOTDIR}/usr/ports && for i in ${DOCPORTS}; do \
167 (cd $$i; make fetch MASTER_SITE_OVERRIDE=file:/usr/ports/distfiles/ \
168 DISTDIR=${CHROOTDIR}/usr/ports/distfiles ); \
173 .if !defined(RELEASENOUPDATE)
174 .if !defined(RELEASETAG)
175 cd ${CHROOTDIR}/usr/src && cvs -q update -P -d
177 cd ${CHROOTDIR}/usr/src && cvs -q update -P -d -r ${RELEASETAG}
179 .if !defined(NOPORTS)
180 cd ${CHROOTDIR}/usr/ports && cvs -q update -P -d
183 cd ${CHROOTDIR}/usr/doc && cvs -q update -P -d
187 # Add version information to those things that need it.
188 ( cd ${CHROOTDIR}/usr/src/sys/conf && \
189 mv newvers.sh foo && \
190 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh&& rm foo )
191 ( cd ${CHROOTDIR}/usr/src/release/sysinstall && \
192 sed "s/__RELEASE/${BUILDNAME}/" version.h > version.h.new && \
193 mv version.h.new version.h && \
195 echo OBJFORMAT=${OBJFORMAT} > ${CHROOTDIR}/etc/objformat
196 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
197 echo "#!/bin/sh" > ${CHROOTDIR}/mk
198 echo "set -ex" >> ${CHROOTDIR}/mk
199 echo "export CFLAGS='-O2 -pipe'" >> ${CHROOTDIR}/mk
200 echo "export DISTRIBUTIONS=\"${DISTRIBUTIONS}\"" >> ${CHROOTDIR}/mk
201 echo "export BUILDNAME=${BUILDNAME}" >> ${CHROOTDIR}/mk
202 echo "export VNDEVICE=${VNDEVICE}" >> ${CHROOTDIR}/mk
203 echo "export OBJFORMAT=${OBJFORMAT}" >> ${CHROOTDIR}/mk
204 .if defined(RELEASETAG)
205 echo "export RELEASETAG=${RELEASETAG}" >> ${CHROOTDIR}/mk
208 echo "export NOPORTS=${NOPORTS}" >> ${CHROOTDIR}/mk
211 echo "export NODOC=${NODOC}" >> ${CHROOTDIR}/mk
214 echo "export ALLLANG=${ALLLANG}" >> ${CHROOTDIR}/mk
217 echo "export NOSRC=${NOSRC}" >> ${CHROOTDIR}/mk
219 .if defined(NOSHARED)
220 echo "export NOSHARED=${NOSHARED}" >> ${CHROOTDIR}/mk
222 .if defined(BOOT_CONFIG)
223 echo "export BOOT_CONFIG=\"${BOOT_CONFIG}\"">> ${CHROOTDIR}/mk
225 # Don't remove this, or the build will fall over!
226 echo "export RELEASEDIR=/R" >> ${CHROOTDIR}/mk
227 echo "export PATH=${BOOTSTRAPDIR}:$${PATH}:${LOCALDIR}" >> ${CHROOTDIR}/mk
228 echo "cd /usr/src" >> ${CHROOTDIR}/mk
230 echo "(cd etc; make distrib-dirs distribution)" >> ${CHROOTDIR}/mk
231 echo "make world" >> ${CHROOTDIR}/mk
234 echo "make all install" >> ${CHROOTDIR}/mk
236 echo "cd /usr/src/release/sysinstall" >> ${CHROOTDIR}/mk
237 echo "make obj" >> ${CHROOTDIR}/mk
238 echo "cd /usr/src/release" >> ${CHROOTDIR}/mk
239 echo "make objlink" >> ${CHROOTDIR}/mk
240 echo "(cd obj; rm -f ${REDOREDO})" >> ${CHROOTDIR}/mk
241 echo "make doRELEASE" >> ${CHROOTDIR}/mk
242 echo "echo make ${.TARGET} Finished" >> ${CHROOTDIR}/mk
243 chmod 755 ${CHROOTDIR}/mk
244 chroot ${CHROOTDIR} /mk
247 rm -rf boot_crunch release.[0-9]
249 # Clean out /R and make the directory structure.
252 chflags -R noschg /R/.
259 for i in ${DISTRIBUTIONS} ; do \
260 mkdir ${RD}/trees/$$i && \
261 mkdir ${RD}/dists/$$i && \
262 mtree -deU -f ${MTREEFILES}/BSD.root.dist \
263 -p ${RD}/trees/$$i > /dev/null && \
264 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
265 -p ${RD}/trees/$$i/usr > /dev/null && \
266 mtree -deU -f ${MTREEFILES}/BSD.include.dist \
267 -p ${RD}/trees/$$i/usr/include > /dev/null && \
268 mtree -deU -f ${MTREEFILES}/BSD.var.dist \
269 -p ${RD}/trees/$$i/var > /dev/null ; \
273 # Install the system into the various distributions.
275 cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/bin
276 cd ${.CURDIR}/.. && make distribute DISTDIR=${RD}/trees
277 .if exists(${.CURDIR}/../kerberosIV) && !defined(NOKERBEROS)
278 cd ${.CURDIR}/../kerberosIV && ( \
280 make obj all help-distribute DISTDIR=${RD}/trees &&\
284 chflags -R noschg ${RD}/trees
287 # Make and install the generic kernel(s).
289 .for kernel in ${KERNELS}
290 rm -f ${RD}/kernels/${kernel}
291 rm -rf ${.CURDIR}/../sys/compile/${kernel}
292 cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=${kernel}
293 rm -rf ${.CURDIR}/../sys/compile/${kernel}
294 ln -f ${RD}/kernels/${kernel} ${RD}/trees/bin/kernel.${kernel}
298 # Make and install the three crunched binaries which live on the floppies.
299 # You are not supposed to like this :-)
301 # NB: the "RELEASE_BUILD_FIXIT" magic prevents vi from including the
302 # Tcl and Perl APIs. See also /usr/src/usr.bin/vi/Makefile.
305 cd ${.CURDIR}/sysinstall && make obj depend all install
307 mkdir -p ${RD}/crunch
308 export RELEASE_BUILD_FIXIT=noway ; \
309 for j in ${CRUNCH_TARGETS} ; do \
310 rm -rf $${j}_crunch && \
311 mkdir $${j}_crunch && \
312 ( cd $${j}_crunch && \
313 crunchgen ${.CURDIR}/$${j}_crunch.conf && \
314 ${MAKE} -DRELEASE_CRUNCH -f $${j}_crunch.mk subclean all \
315 NOCRYPT=yes "CFLAGS=${CFLAGS} -DCRUNCHED_BINARY") && \
316 mv $${j}_crunch/$${j}_crunch ${RD}/crunch/$${j} && \
317 true || { rm -rf $${j}_crunch ; false ; } ; \
322 # --==## Fix up the distributions. ##==--
325 # Handle some grief caused by the munition braindeadness.
326 for i in sbin/init bin/ed usr.sbin/ppp ; do \
327 ( cd ${.CURDIR}/../$$i; \
328 make -DNOCRYPT clean all distribute DISTDIR=${RD}/trees ) ; \
331 # Create any "synthetic dists" now.
332 @for i in ${DISTRIBUTIONS}; do \
333 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
334 echo -n "Running $$i dist creation script... "; \
335 env OBJFORMAT=${OBJFORMAT} RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
340 # Create symlinks for the MD5-based crypt lib, too. The
341 # automatically created links still point to the DES stuff,
342 # which went into its own distribution.
343 for i in ${RD}/trees/bin/usr/lib/${OBJFORMAT}/libscrypt* ; do \
344 c=`echo $$i | sed -e 's/libscrypt/libcrypt/'` ; \
346 ln -s `basename $$i` $$c ; \
349 # Remove all the directories we don't need.
351 find ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} -depth -type d -print | xargs rmdir
355 # --==## Package up the tarballs from assembled trees ##==--
360 @for i in ${DISTRIBUTIONS} ; \
362 if [ -d ${RD}/trees/$${i} ] ; then \
363 cd ${.CURDIR} && $(MAKE) doTARBALL \
364 SD=${RD}/trees/$${i} \
365 TN=$$i TD=$$i ARG="." && \
366 echo "$${i} distribution is finished."; \
369 # More munition braindeadness.
370 ( cd ${RD}/dists && \
371 if [ -f krb/krb.aa ] ; then mv krb/* des && rmdir krb ; fi )
376 # --==## Make source dists ##==--
380 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \
381 TD=src TN=sbase ARG="[A-Z]*"
382 @for i in `cd /usr/src && echo [a-z]*` ; do \
383 if [ -d /usr/src/$$i ] ; then \
384 cd ${.CURDIR} && $(MAKE) doTARBALL \
385 TN=`echo s$$i | tr -d '.' | sed 's/usr/u/'` \
386 SD=/usr/src TD=src ARG="$$i" ; \
389 .if defined(EXTRA_SRC)
390 @set ${EXTRA_SRC} && \
391 while [ $$# -ge 2 ] ; do \
392 if [ -d /usr/src/$$1 ] ; then \
393 cd ${.CURDIR} && $(MAKE) doTARBALL \
394 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
395 fi && shift && shift ; \
398 ( cd ${RD}/dists/src && \
399 if [ -f ssecure.aa ] ; then mv ssecure.* ../des ; fi && \
400 if [ -f scrypto.aa ] ; then mv scrypto.* ../des ; fi && \
401 if [ -f skerbero.aa ] ; then mv skerbero.* ../des ; fi ; )
402 @echo "src distribution is finished."
406 # Complete the bootfd
408 # Now, just to get this picture down once and for all:
410 # +------------------------------------------------------------------------+
412 # +-----+-----+------------------------------------------------------------+
413 # |boot1|boot2|floppy filesystem "bootfd" |
414 # +-----+-----+-+--------------------------------------------------------+-+
416 # +------------+-----------------------------------------+-+
417 # |mfs filesystem "mfsfd" |
418 # +-----------------------------------------+
421 release.8: write_mfs_in_kernel dumpnlist
425 mkdir -p etc dev mnt stand/help
426 @cp ${.CURDIR}/../sys/i386/boot/biosboot/boot.help ${RD}/mfsfd/stand
427 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
428 DIR=${RD}/mfsfd/stand ZIP=false
429 ( cd ${RD}/trees/bin/dev && \
430 ls console tty ttyv0 ttyv1 ttyv2 ttyv3 null zero | \
431 cpio -dump ${RD}/mfsfd/dev )
432 ( cd ${RD}/mfsfd/dev && rm -f *[swo]d*[bdefgh] )
433 cd ${RD}/trees/bin && ls ${BOOT1} | cpio -dump ${RD}/mfsfd/stand
434 echo "nameserver 42/tcp name" > ${RD}/mfsfd/stand/etc/services
435 echo "ftp 21/tcp" >> ${RD}/mfsfd/stand/etc/services
436 echo "domain 53/tcp nameserver" >> ${RD}/mfsfd/stand/etc/services
437 echo "domain 53/udp nameserver" >> ${RD}/mfsfd/stand/etc/services
438 echo "cmd 514/tcp shell" >> ${RD}/mfsfd/stand/etc/services
439 gzip -c ${.CURDIR}/../COPYRIGHT > ${RD}/mfsfd/stand/help/COPYRIGHT.hlp.gz
440 -test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
441 @echo "Making the regular boot floppy."
442 tar --exclude CVS -cf - -C ${.CURDIR}/sysinstall help | \
443 tar xvf - -C ${RD}/mfsfd/stand
444 @echo "Compressing doc files..."
445 @gzip -9 ${RD}/mfsfd/stand/help/*.hlp
446 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${BOOTMFSSIZE} ${RD}/mfsfd \
448 mv fs-image fs-image.std
449 mv fs-image.size fs-image.std.size
450 cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=std
451 mv ${RD}/floppies/bootstd.flp ${RD}/floppies/boot.flp
452 @echo "Regular boot floppy made."
456 # --==## Create a fixit floppy ##==--
461 cd ${RD}/fixitfd && \
462 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
463 usr/share/misc usr/mdec
464 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=fixit \
465 DIR=${RD}/fixitfd/stand ZIP=false
466 ( cd ${RD}/fixitfd/dev && \
467 sed -e '/^PATH/s/^/#/' ${RD}/trees/bin/dev/MAKEDEV > MAKEDEV && \
468 chmod 755 MAKEDEV && \
470 cp ${RD}/trees/bin/etc/spwd.db ${RD}/trees/bin/etc/group \
471 ${RD}/trees/bin/etc/protocols ${RD}/fixitfd/etc
472 cp ${RD}/trees/bin/usr/share/misc/scsi_modes \
473 ${RD}/fixitfd/usr/share/misc
474 cp ${RD}/trees/bin/usr/mdec/boot[12] ${RD}/fixitfd/usr/mdec
475 for type in fd od sd wd ; do \
476 ( cd ${RD}/fixitfd/usr/mdec && ln -s boot1 $${type}boot && \
477 ln -s boot2 boot$${type} ) ; \
479 cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
480 cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
481 cp ${.CURDIR}/tar.sh ${RD}/fixitfd/stand/tar
482 chmod 555 ${RD}/fixitfd/stand/tar
483 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${FDSIZE} ${RD}/fixitfd \
484 ${FIXITINODE} ${FDLABEL}
485 mv fs-image ${RD}/floppies/fixit.flp
486 # Do our last minute floppies directory setup in a convenient place.
487 cp ${.CURDIR}/README.TXT ${RD}/floppies/README.TXT
488 @(cd ${RD}/floppies; md5 * > CHECKSUM.MD5)
492 # --==## Setup a suitable ftp-area ##==--
496 cd ${RD} && find floppies -print | cpio -dumpl ${FD}
497 cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
498 cp ${.CURDIR}/ABOUT.TXT ${FD}/ABOUT.TXT
499 cp ${.CURDIR}/ERRATA.TXT ${FD}/ERRATA.TXT
500 cp ${.CURDIR}/LAYOUT.TXT ${FD}/LAYOUT.TXT
501 cp ${.CURDIR}/sysinstall/help/readme.hlp ${FD}/README.TXT
502 cp ${.CURDIR}/sysinstall/help/hardware.hlp ${FD}/HARDWARE.TXT
503 cp ${.CURDIR}/sysinstall/help/install.hlp ${FD}/INSTALL.TXT
504 cp ${.CURDIR}/sysinstall/help/relnotes.hlp ${FD}/RELNOTES.TXT
505 cp ${.CURDIR}/sysinstall/help/trouble.hlp ${FD}/TROUBLE.TXT
506 cp ${.CURDIR}/sysinstall/help/upgrade.hlp ${FD}/UPGRADE.TXT
508 echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
509 .if !defined(NOPORTS)
510 tar -cBf - -C ${CD_DISC1} ports | tar -xBf - -C ${FD}
514 # --==## Setup a suitable cdrom-area ##==--
517 mkdir -p ${CD_DISC1} ${CD_DISC2}
518 cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
519 cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}
520 ln -f ${RD}/kernels/MFSKERNEL.std ${CD_DISC1}/kernel
521 ln -f ${RD}/trees/bin/usr/mdec/fbsdboot.exe ${CD_DISC1}
522 for i in ${DISTRIBUTIONS} ; \
524 if [ -d ${RD}/trees/$${i} ] ; then \
525 chflags -R noschg ${RD}/trees/$${i} ; \
526 ( cd ${RD}/trees/$${i} && \
527 find . -depth -print | cpio -dumpl ${CD_DISC2} ) ; \
530 rm -f ${CD_DISC2}/.profile
531 cp ${.CURDIR}/fixit.profile ${CD_DISC2}/.profile
532 echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
533 echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
534 cp ${.CURDIR}/ABOUT.TXT ${CD_DISC1}/ABOUT.TXT
535 cp ${.CURDIR}/ERRATA.TXT ${CD_DISC1}/ERRATA.TXT
536 cp ${.CURDIR}/LAYOUT.TXT ${CD_DISC1}/LAYOUT.TXT
537 cp ${.CURDIR}/sysinstall/help/readme.hlp ${CD_DISC1}/README.TXT
538 cp ${.CURDIR}/sysinstall/help/hardware.hlp ${CD_DISC1}/HARDWARE.TXT
539 cp ${.CURDIR}/sysinstall/help/install.hlp ${CD_DISC1}/INSTALL.TXT
540 cp ${.CURDIR}/sysinstall/help/relnotes.hlp ${CD_DISC1}/RELNOTES.TXT
541 cp ${.CURDIR}/sysinstall/help/trouble.hlp ${CD_DISC1}/TROUBLE.TXT
542 cp ${.CURDIR}/sysinstall/help/upgrade.hlp ${CD_DISC1}/UPGRADE.TXT
544 .if !defined(NOPORTS)
545 -rm -rf /usr/ports/distfiles/*
546 tar -cBf - -C /usr ports | tar xBpf - -C ${CD_DISC2} && \
547 mkdir -p ${CD_DISC1}/ports && \
548 tar -czf ${CD_DISC1}/ports/ports.tgz -C /usr ports && \
549 cp ${.CURDIR}/scripts/ports-install.sh ${CD_DISC1}/ports/install.sh && \
550 (cd ${CD_DISC1}/ports; md5 * > CHECKSUM.MD5)
551 ln -s ../ports ${CD_DISC2}/usr/ports
555 for i in ${DOCPORTS}; do \
556 cd /usr/ports/$$i && make all install clean FORCE_PKG_REGISTER=yes; \
558 cd /usr/doc && make all distribute DISTDIR=${RD}/trees
560 # Various "subroutine" and other supporting targets.
564 @echo "SD undefined in doTARBALL" && exit 1
567 @echo "TB undefined in doTARBALL" && exit 1
570 @echo "ARG undefined in doTARBALL" && exit 1
572 rm -rf ${RD}/dists/${TD}/${TN}*
573 mkdir -p ${RD}/dists/${TD}
575 tn=`echo ${TN} | tr '[A-Z]' '[a-z]' | cut -c1-8` && \
576 echo rolling ${TD}/$$tn tarball &&\
577 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
578 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
579 sh ${.CURDIR}/info.sh ${RD}/dists/${TD}/$$tn > \
580 ${RD}/dists/${TD}/$$tn.inf && \
581 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
582 cp -p ${.CURDIR}/scripts/$${TD}-install.sh ${RD}/dists/${TD}/install.sh; \
584 if [ "${SD}" != "/usr/src" ]; then \
585 mtree -c -i -p ${SD}/${ARG} \
586 -k gname,md5digest,mode,nlink,uname,size,link,type \
587 > ${RD}/dists/${TD}/$$tn.mtree ; \
591 (cd ${RD}/dists/${TD}; \
592 rm -f CHECKSUM.MD5; \
593 md5 * > CHECKSUM.MD5) \
596 .if ${MACHINE_ARCH} == "i386"
597 doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 release.5 \
598 release.6 release.7 release.8 release.9
599 cd ${.CURDIR} && ${MAKE} ${EXTRAS}
603 .if ${MACHINE_ARCH} == "alpha"
604 doRELEASE: release.1 release.2 ${DOCREL} release.5 release.6 release.7
605 cd ${.CURDIR} && ${MAKE} ${EXTRAS}
610 cd ${.CURDIR} && ${MAKE} boot.flp
611 cd ${.CURDIR} && ${MAKE} fixit.flp
612 cd ${RD} && find floppies -print | cpio -dumpl ${FD}
615 rm -f release.4 release.8
616 cd ${.CURDIR} && ${MAKE} release.4 release.8 CRUNCH_TARGETS=boot
619 rm -f release.4 release.9
620 cd ${.CURDIR} && ${MAKE} release.4 release.9 CRUNCH_TARGETS=fixit
622 write_mfs_in_kernel: ${.CURDIR}/write_mfs_in_kernel.c
623 ${CC} ${CFLAGS} -o write_mfs_in_kernel ${.CURDIR}/write_mfs_in_kernel.c
625 dumpnlist: ${.CURDIR}/dumpnlist.c
626 ${CC} ${CFLAGS} -o dumpnlist ${.CURDIR}/dumpnlist.c
630 @echo "CRUNCH undefined in installCRUNCH" && exit 1
633 @echo "DIR undefined in installCRUNCH" && exit 1
636 @echo "ZIP undefined in installCRUNCH" && exit 1
639 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
641 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
643 chmod 555 ${DIR}/${CRUNCH}_crunch
644 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
645 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
649 # --==## Compile a kernel by name ${KERNEL} ##==--
651 # We don't erase the sys/compile/${KERNEL} directory, since somebody
652 # may want to reuse it (release.8 presently)
655 rm -f ${RD}/kernels/${KERNEL}
656 cd ${.CURDIR}/../sys/i386/conf && config ${KERNEL}
657 cd ${.CURDIR}/../sys/compile/${KERNEL} && \
660 cp kernel ${RD}/kernels/${KERNEL}
663 # --==## Put a filesystem into a BOOTMFS kernel ##==--
666 @rm -f ${RD}/kernels/BOOTMFS.${FSIMAGE}
667 @rm -f /sys/compile/BOOTMFS/mfs_vfsops.o
668 @cd ${.CURDIR}/../sys/i386/conf && \
673 -e '/MATH_EMULATE/d' \
674 -e 's/GENERIC/BOOTMFS/g' \
675 -e '/maxusers/s/10/4/' < GENERIC > BOOTMFS && \
676 echo "options MFS" >> BOOTMFS && \
677 echo "options NFS_NOSERVER" >> BOOTMFS && \
678 echo 'options "MAXCONS=4"' >> BOOTMFS && \
679 echo "options USERCONFIG_BOOT" >> BOOTMFS
680 @echo "options \"MFS_ROOT=`cat fs-image.${FSIMAGE}.size`\"" >> \
681 ${.CURDIR}/../sys/i386/conf/BOOTMFS
682 cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=BOOTMFS
683 @rm -rf ${RD}/boot.${FSIMAGE}
684 @mkdir ${RD}/boot.${FSIMAGE}
685 @mv ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE}
686 @cp ${RD}/kernels/BOOTMFS.${FSIMAGE} ${RD}/boot.${FSIMAGE}/kernel
687 .if defined(BOOT_CONFIG)
688 @echo "${BOOT_CONFIG}" >${RD}/boot.${FSIMAGE}/boot.config
690 @vnconfig /dev/${VNDEVICE} fs-image.${FSIMAGE}
691 @mkdir -p /tmp/mnt_xx
692 @mount /dev/${VNDEVICE} /tmp/mnt_xx
693 ./dumpnlist ${RD}/boot.${FSIMAGE}/kernel > /tmp/mnt_xx/stand/symbols
695 @vnconfig -u /dev/${VNDEVICE}
697 ./write_mfs_in_kernel ${RD}/boot.${FSIMAGE}/kernel \
699 kzip -v ${RD}/boot.${FSIMAGE}/kernel
700 @mv ${RD}/boot.${FSIMAGE}/kernel ${RD}/kernels/MFSKERNEL.${FSIMAGE}
701 @mv ${RD}/boot.${FSIMAGE}/kernel.kz ${RD}/boot.${FSIMAGE}/kernel
702 @cp ${.CURDIR}/../sys/i386/boot/biosboot/boot.help ${RD}/boot.${FSIMAGE}
703 @printf \\a\\a\\a >> ${RD}/boot.${FSIMAGE}
704 @touch ${RD}/boot.${FSIMAGE}/boot.config
705 @touch ${RD}/boot.${FSIMAGE}/kernel.config
706 @rm -f ${RD}/floppies/boot${FSIMAGE}.flp
707 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${FDSIZE} ${RD}/boot.${FSIMAGE} \
708 ${BOOTINODE} ${FDLABEL}
709 mv fs-image ${RD}/floppies/boot${FSIMAGE}.flp
711 .include <bsd.prog.mk>