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=4.0-RELEASE
19 # Automatic SNAP versioning:
22 BUILDNAME?=${BASE}-${DATE}-SNAP
24 #CHROOTDIR=/junk/release
25 # If this is a -stable snapshot, then set
30 # If you are using a local CVS repository with components stored in
31 # non-standard modules, override these on the make commandline or
33 RELEASESRCMODULE?= src
34 RELEASEDOCMODULE?= doc
35 RELEASEPORTSMODULE?= ports
37 # Unless set elsewhere, indicate the object format we'll be using.
40 # Uncomment this to disable the doc.1 target. It is also an ERROR
41 # to set NOPORTS and not set NODOC since docs depend on ports.
44 # Comment the following if you want the release documentation to be
47 DOCPORTS= textproc/docproj
48 # Set this to wherever the distfiles required by ${DOCPORTS} live.
49 DISTFILES?= ${.CURDIR}/../../ports/distfiles
51 DIST_DOCS= ABOUT.TXT ERRATA.TXT LAYOUT.TXT README.TXT HARDWARE.TXT \
52 RELNOTES.TXT TROUBLE.TXT UPGRADE.TXT INSTALL.TXT
54 # Things which without too much trouble can be considered variables
55 # BIN_DISTS are special in that they get full /etc installation sets.
57 COMPAT_DISTS?= compat1x compat20 compat21 compat22 compat3x
58 OTHER_DISTS?= manpages catpages games proflibs dict info doc
59 CRYPTO_DISTS?= crypto krb4 krb5
61 DISTRIBUTIONS?= ${BIN_DISTS} ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS}
64 # Extra source tarballs; each argument is a pair of source dir and
65 # distribution name. The dist name should not exceed 7 characters
66 # (another "s" for "source" will be prepended).
67 EXTRA_SRC+= usr.sbin/sendmail/cf smailcf
69 BOOT1= etc/protocols etc/defaults/rc.conf
71 # mountpoint for filesystems.
74 # Various floppy image parameters.
85 BIGBOOTLABEL= minimum2
89 .if ${MACHINE_ARCH} == "alpha"
94 ZIPNSPLIT= gzip --no-name -9 -c | split -b 240640 -
99 # Things which may get you into trouble if you change them
100 MTREEFILES= ${.CURDIR}/../etc/mtree
105 CD_DISC1= ${CD}/disc1
106 CD_DISC2= ${CD}/disc2
108 # Where the bootstrap ports (see DOCPORTS) get installed.
109 LOCALDIR= /usr/local/bin
111 # ${BOOTSTRAPDIR} is for those utilities that refer to the hosting
112 # environment, rather than the target environment. This is specifically
113 # intended for kernel-dependent utilities that are used during the build.
115 # ${BOOTSTRAPDIR} is actually being used by prepending it to the normal
116 # ${PATH}. Thus, it's also available to outside utilities like doFS.sh.
117 BOOTSTRAPDIR= /bootstrap
119 # The mount subsystem has been changed between 2.2 and 3.0 by the
121 BOOTSTRAPUTILS= /sbin/mount /sbin/umount
123 # 3.0 cpio tries to reference lchown(2) which is not available in 2.2
124 BOOTSTRAPUTILS+= /usr/bin/cpio
126 .if !defined(CRUNCH_TARGETS)
127 CRUNCH_TARGETS= boot fixit
130 .if ${MACHINE_ARCH} == "i386"
131 # Make both PC-card boot.flp and plain boot.flp
132 EXTRAS= floppies cdrom.1 ftp.1
134 EXTRAS= cdrom.1 ftp.1
142 .if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT)
143 @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false
146 .if exists(${CHROOTDIR})
147 # The first command will fail on a handful of files that have their schg
148 # flags set. But it greatly speeds up the next two commands.
149 -rm -rf ${CHROOTDIR} 2>/dev/null
150 -chflags -R noschg ${CHROOTDIR}/.
153 mkdir -p ${CHROOTDIR}
154 cd ${.CURDIR}/../etc && ${MAKE} distrib-dirs DESTDIR=${CHROOTDIR}
155 cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR}
156 if [ -f /etc/resolv.conf ]; then \
157 cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \
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 ${PATCH_FLAGS} < ${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 if [ -d ${DISTFILES}/ ]; then \
183 cp -rp ${DISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \
188 .if !defined(RELEASENOUPDATE)
189 .if !defined(RELEASETAG)
190 cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d
192 cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d -r ${RELEASETAG}
194 .if !defined(NOPORTS)
195 cd ${CHROOTDIR}/usr/ports && cvs -R -q update -P -d
198 cd ${CHROOTDIR}/usr/doc && cvs -R -q update -P -d
202 # Add version information to those things that need it.
203 ( cd ${CHROOTDIR}/usr/src/sys/conf && \
204 mv newvers.sh foo && \
205 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && rm foo )
206 echo OBJFORMAT=${OBJFORMAT} > ${CHROOTDIR}/etc/objformat
207 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
208 echo "#!/bin/sh" > ${CHROOTDIR}/mk
209 echo "set -ex" >> ${CHROOTDIR}/mk
210 echo "_RELTARGET=\$${1:-doRELEASE}" >> ${CHROOTDIR}/mk
211 echo "export CFLAGS='-O -pipe'" >> ${CHROOTDIR}/mk
212 echo "export DISTRIBUTIONS=\"${DISTRIBUTIONS}\"" >> ${CHROOTDIR}/mk
213 echo "export BUILDNAME=${BUILDNAME}" >> ${CHROOTDIR}/mk
214 echo "export VNDEVICE=${VNDEVICE}" >> ${CHROOTDIR}/mk
215 echo "export OBJFORMAT=${OBJFORMAT}" >> ${CHROOTDIR}/mk
216 .if defined(RELEASETAG)
217 echo "export RELEASETAG=${RELEASETAG}" >> ${CHROOTDIR}/mk
220 echo "export NOPORTS=${NOPORTS}" >> ${CHROOTDIR}/mk
223 echo "export NODOC=${NODOC}" >> ${CHROOTDIR}/mk
226 echo "export ALLLANG=${ALLLANG}" >> ${CHROOTDIR}/mk
228 echo "export DOC_LANG=en_US.ISO_8859-1" >> ${CHROOTDIR}/mk
231 echo "export NOSRC=${NOSRC}" >> ${CHROOTDIR}/mk
233 .if defined(NOSHARED)
234 echo "export NOSHARED=${NOSHARED}" >> ${CHROOTDIR}/mk
236 .if defined(BOOT_CONFIG)
237 echo "export BOOT_CONFIG=\"${BOOT_CONFIG}\"">> ${CHROOTDIR}/mk
239 # Don't remove this, or the build will fall over!
240 echo "export RELEASEDIR=${_R}" >> ${CHROOTDIR}/mk
241 echo "export PATH=${BOOTSTRAPDIR}:$${PATH}:${LOCALDIR}" >> ${CHROOTDIR}/mk
242 echo "if [ ! -f /tmp/.world_done ]; then" >> ${CHROOTDIR}/mk
243 echo " cd /usr/src" >> ${CHROOTDIR}/mk
245 echo " (cd etc; make distrib-dirs distribution)" >> ${CHROOTDIR}/mk
246 echo " make world" >> ${CHROOTDIR}/mk
249 echo " make all install" >> ${CHROOTDIR}/mk
251 echo " touch /tmp/.world_done" >> ${CHROOTDIR}/mk
252 echo "fi" >> ${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 \$${_RELTARGET}" >> ${CHROOTDIR}/mk
257 echo "echo make ${.TARGET} Finished" >> ${CHROOTDIR}/mk
258 chmod 755 ${CHROOTDIR}/mk
259 chroot ${CHROOTDIR} /mk
262 rm -rf boot_crunch ${.OBJDIR}/boot_crunch.conf release.[0-9]
264 # Clean out ${_R} and make the directory structure.
267 -rm -rf ${_R}/* 2> /dev/null
268 -chflags -R noschg ${_R}/.
275 for i in ${DISTRIBUTIONS} ; do \
276 mkdir ${RD}/trees/$$i && \
277 mkdir ${RD}/dists/$$i && \
278 mtree -deU -f ${MTREEFILES}/BSD.root.dist \
279 -p ${RD}/trees/$$i > /dev/null && \
280 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
281 -p ${RD}/trees/$$i/usr > /dev/null && \
282 mtree -deU -f ${MTREEFILES}/BSD.include.dist \
283 -p ${RD}/trees/$$i/usr/include > /dev/null && \
284 mtree -deU -f ${MTREEFILES}/BSD.var.dist \
285 -p ${RD}/trees/$$i/var > /dev/null ; \
289 # Install the system into the various distributions.
291 cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/bin
292 cd ${.CURDIR}/.. && make distribute DISTDIR=${RD}/trees
293 .if exists(${.CURDIR}/../kerberosIV) && exists(${.CURDIR}/../crypto) && !defined(NOKERBEROS)
294 cd ${.CURDIR}/../kerberosIV && ( \
296 make obj all help-distribute DISTDIR=${RD}/trees &&\
300 .if exists(${.CURDIR}/../kerberos5) && exists(${.CURDIR}/../crypto) && !defined(NOKERBEROS)
301 cd ${.CURDIR}/../kerberos5 && ( \
303 make obj all help-distribute DISTDIR=${RD}/trees &&\
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 cp ${.CURDIR}/boot_crunch.conf.generic ${.OBJDIR}/boot_crunch.conf
329 cd ${.CURDIR}/sysinstall && make obj depend all install
331 mkdir -p ${RD}/crunch
332 export RELEASE_BUILD_FIXIT=noway ; \
333 for j in ${CRUNCH_TARGETS} ; do \
334 rm -rf $${j}_crunch && \
335 mkdir $${j}_crunch && \
336 ( cd $${j}_crunch && \
337 ( ( [ -f ${.CURDIR}/$${j}_crunch.conf ] && \
338 crunchgen ${.CURDIR}/$${j}_crunch.conf ) || \
339 ( [ -f ${.OBJDIR}/$${j}_crunch.conf ] && \
340 crunchgen ${.OBJDIR}/$${j}_crunch.conf ) ) && \
341 ${MAKE} -DRELEASE_CRUNCH -f $${j}_crunch.mk subclean all \
342 NOCRYPT=yes "CFLAGS=${CFLAGS} -DCRUNCHED_BINARY") && \
343 mv $${j}_crunch/$${j}_crunch ${RD}/crunch/$${j} && \
344 true || { rm -rf $${j}_crunch ; false ; } ; \
349 # --==## Fix up the distributions. ##==--
352 # Handle some grief caused by the munition braindeadness.
353 for i in sbin/init bin/ed usr.sbin/ppp usr.sbin/pppd ; do \
354 ( cd ${.CURDIR}/../$$i; \
355 make -DNOCRYPT clean all distribute DISTDIR=${RD}/trees ) ; \
358 # Create any "synthetic dists" now.
359 @for i in ${DISTRIBUTIONS}; do \
360 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
361 echo -n "Running $$i dist creation script... "; \
362 env OBJFORMAT=${OBJFORMAT} RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
367 # Create symlinks for the MD5-based crypt lib, too. The
368 # automatically created links still point to the DES stuff,
369 # which went into its own distribution.
370 for i in ${RD}/trees/bin/usr/lib/libscrypt* ; do \
371 c=`echo $$i | sed -e 's/libscrypt/libcrypt/'` ; \
373 ln -s `basename $$i` $$c ; \
376 # Remove all the directories we don't need.
378 find ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} -depth -type d -print | xargs rmdir
382 # --==## Package up the tarballs from assembled trees ##==--
387 @for i in ${DISTRIBUTIONS} ; \
389 if [ -d ${RD}/trees/$${i} ] ; then \
390 cd ${.CURDIR} && $(MAKE) doTARBALL \
391 SD=${RD}/trees/$${i} \
392 TN=$$i TD=$$i ARG="." && \
393 echo "$${i} distribution is finished."; \
396 # More munition braindeadness.
397 ( cd ${RD}/dists && \
398 if [ -f krb4/krb4.aa ] ; then mv krb4/* crypto && rmdir krb4 ; fi )
399 ( cd ${RD}/dists && \
400 if [ -f krb5/krb5.aa ] ; then mv krb5/* crypto && rmdir krb5 ; fi )
405 # --==## Make source dists ##==--
409 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \
410 TD=src TN=sbase ARG="[A-Z]*"
411 @for i in `cd /usr/src && echo [a-z]*` ; do \
412 if [ -d /usr/src/$$i ] ; then \
413 cd ${.CURDIR} && $(MAKE) doTARBALL \
414 TN=`echo s$$i | tr -d '.' | \
416 -e 's/kerberosIV/krb4/' \
417 -e 's/kerberos5/krb5/'` \
418 SD=/usr/src TD=src ARG="$$i" ; \
421 .if defined(EXTRA_SRC)
422 @set ${EXTRA_SRC} && \
423 while [ $$# -ge 2 ] ; do \
424 if [ -d /usr/src/$$1 ] ; then \
425 cd ${.CURDIR} && $(MAKE) doTARBALL \
426 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
427 fi && shift && shift ; \
430 if [ -d ${RD}/dists/crypto ] ; then ( cd ${RD}/dists/src && \
431 if [ -f ssecure.aa ] ; then mv ssecure.* ../crypto ; fi && \
432 if [ -f scrypto.aa ] ; then mv scrypto.* ../crypto ; fi && \
433 if [ -f skrb4.aa ] ; then mv skrb4.* ../crypto ; fi && \
434 if [ -f skrb5.aa ] ; then mv skrb5.* ../crypto ; fi ; ) ; fi
435 @echo "src distribution is finished."
439 # Complete the bootfd
441 # Now, just to get this picture down once and for all:
443 # +------------------------------------------------------------------------+
445 # +-----+-----+------------------------------------------------------------+
446 # |boot1|boot2|floppy filesystem "bootfd" |
447 # +-----+-----+-+--------------------------------------------------------+-+
449 # +------------+-----------------------------------------+-+
450 # |mfs filesystem "mfsfd" |
451 # +-----------------------------------------+
454 release.8: write_mfs_in_kernel
458 mkdir -p etc dev mnt stand/help
459 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
460 DIR=${RD}/mfsfd/stand ZIP=false
461 ( cd ${RD}/trees/bin/dev && \
462 ls console tty bpf0 ttyv0 ttyv1 ttyv2 ttyv3 null zero card0 card1 card2 card3 | \
463 cpio -dump ${RD}/mfsfd/dev )
464 ( cd ${RD}/mfsfd/dev && rm -f *[swo]d*[bdefgh] )
465 ( cd ${RD}/mfsfd && mkdir -p bin sbin && ln -s /stand/sh bin/sh )
466 cp /sbin/dhclient-script ${RD}/mfsfd/sbin
467 cp ${.CURDIR}/../etc/pccard.conf.sample ${RD}/mfsfd/etc/pccard.conf
468 cd ${RD}/trees/bin && ls ${BOOT1} | cpio -dump ${RD}/mfsfd/stand
469 echo "nameserver 42/tcp name" > ${RD}/mfsfd/stand/etc/services
470 echo "ftp 21/tcp" >> ${RD}/mfsfd/stand/etc/services
471 echo "domain 53/tcp nameserver" >> ${RD}/mfsfd/stand/etc/services
472 echo "domain 53/udp nameserver" >> ${RD}/mfsfd/stand/etc/services
473 echo "cmd 514/tcp shell" >> ${RD}/mfsfd/stand/etc/services
474 gzip -9c ${.CURDIR}/../COPYRIGHT > ${RD}/mfsfd/stand/help/COPYRIGHT.hlp.gz
475 @for i in README.TXT RELNOTES.TXT INSTALL.TXT UPGRADE.TXT HARDWARE.TXT; do \
476 if [ -f ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} ]; then \
477 gzip -9c ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} > ${RD}/mfsfd/stand/help/$${i}.gz; \
479 gzip -9c ${.CURDIR}/texts/$${i} > ${RD}/mfsfd/stand/help/$${i}.gz; \
482 -test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
483 @mkdir -p ${RD}/mfsfd/boot
484 @cp /boot/boot* ${RD}/mfsfd/boot
485 @cp /boot/loader.help ${RD}/mfsfd/boot
486 @echo "Making the regular boot floppy."
487 @tar --exclude CVS -cf - -C ${.CURDIR}/sysinstall help | \
488 tar xf - -C ${RD}/mfsfd/stand
489 @echo "Compressing doc files..."
490 @gzip -9 ${RD}/mfsfd/stand/help/*.hlp
491 sh -e ${.CURDIR}/scripts/doFS.sh -s mfsroot ${RD} ${MNT} \
492 ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL}
493 @gzip -9vc mfsroot > mfsroot.gz
494 @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/mfsroot.flp \
495 ${RD} ${MNT} ${BOOTSIZE} mfsroot.gz ${BOOTINODE} ${BOOTLABEL}
496 @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=kern
497 @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=boot BIGBOOT=YES
498 @rm mfsroot mfsroot.gz mfsroot.size
499 @echo "Regular and MFS boot floppies made."
503 # --==## Create a fixit floppy ##==--
506 @echo "Making fixit floppy."
507 @rm -rf ${RD}/fixitfd
509 @cd ${RD}/fixitfd && \
510 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
512 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=fixit \
513 DIR=${RD}/fixitfd/stand ZIP=false
514 @( cd ${RD}/fixitfd/dev && \
515 sed -e '/^PATH/s/^/#/' ${RD}/trees/bin/dev/MAKEDEV > MAKEDEV && \
516 chmod 755 MAKEDEV && \
518 @cp ${RD}/trees/bin/etc/spwd.db ${RD}/trees/bin/etc/group \
519 ${RD}/trees/bin/etc/protocols ${RD}/fixitfd/etc
520 @cp ${RD}/trees/bin/usr/share/misc/scsi_modes \
521 ${RD}/fixitfd/usr/share/misc
522 @cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
523 @cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
524 @cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar
525 @chmod 555 ${RD}/fixitfd/stand/tar
526 @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/fixit.flp ${RD} \
527 ${MNT} ${FIXITSIZE} ${RD}/fixitfd ${FIXITINODE} ${FIXITLABEL}
528 # Do our last minute floppies directory setup in a convenient place.
529 @cp ${.CURDIR}/texts/FLOPPIES.TXT ${RD}/floppies/README.TXT
530 @(cd ${RD}/floppies; md5 README.TXT *.flp > CHECKSUM.MD5)
534 # --==## Setup a suitable ftp-area ##==--
537 @echo "Setting up FTP distribution area"
539 -@ln -s . ${FD}/${BUILDNAME}
540 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
541 @cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
542 @for i in ${DIST_DOCS}; do \
543 if [ -f ${.CURDIR}/texts/$${i} ]; then \
544 cp ${.CURDIR}/texts/$${i} ${FD}; \
546 if [ -f ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} ]; then \
547 echo "=== Platform specifics for ${MACHINE_ARCH}" >> ${FD}/$${i}; \
548 cat ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} >> ${FD}/$${i}; \
551 @echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
552 .if !defined(NOPORTS)
553 @tar --exclude CVS -cBf - -C ${CD_DISC1} ports | tar -xBf - -C ${FD}
557 # --==## Setup a suitable cdrom-area ##==--
560 @echo "Setting up CDROM distribution area"
561 @mkdir -p ${CD_DISC1} ${CD_DISC2}
562 @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
563 @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}
564 @ln -f ${RD}/kernels/MFSKERNEL.boot ${CD_DISC1}/kernel
565 @for i in ${DISTRIBUTIONS} ; \
567 if [ -d ${RD}/trees/$${i} ] ; then \
568 chflags -R noschg ${RD}/trees/$${i} || true ; \
569 ( cd ${RD}/trees/$${i} && \
570 find . -depth -print | cpio -dumpl ${CD_DISC2} ) ; \
573 @rm -f ${CD_DISC2}/.profile
574 @cp ${.CURDIR}/fixit.profile ${CD_DISC2}/.profile
575 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
576 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
577 @for i in ${DIST_DOCS}; do \
578 if [ -f ${.CURDIR}/texts/$${i} ]; then \
579 cp ${.CURDIR}/texts/$${i} ${CD_DISC1}; \
581 if [ -f ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} ]; then \
582 echo "=== Platform specifics for ${MACHINE_ARCH}" >> ${CD_DISC1}/$${i}; \
583 cat ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} >> ${CD_DISC1}/$${i}; \
586 .if ${MACHINE_ARCH} == "alpha"
587 @echo "Setting up Alpha CD disc1 for booting"
588 @cp -Rp ${RD}/image.boot/boot ${CD_DISC1}
589 @ln -f ${CD_DISC2}/boot/cdboot ${CD_DISC1}/boot
590 @ln -f ${CD_DISC1}/boot/loader.rc ${CD_DISC2}/boot
591 @ln -f ${CD_DISC1}/kernel ${CD_DISC2}/kernel
593 .if !defined(NOPORTS)
594 @-rm -rf /usr/ports/distfiles/*
595 @mkdir -p ${CD_DISC1}/ports && \
596 tar --exclude CVS -czf ${CD_DISC1}/ports/ports.tgz -C /usr ports && \
597 cp ${.CURDIR}/scripts/ports-install.sh ${CD_DISC1}/ports/install.sh \
598 && (cd ${CD_DISC1}/ports; md5 * > CHECKSUM.MD5)
602 @echo "Making docs..."
603 @for i in ${DOCPORTS}; do \
604 cd /usr/ports/$$i && make all install clean JADETEX=no FORCE_PKG_REGISTER=yes; \
606 @cd /usr/doc && make all install 'FORMATS=html html-split txt' INSTALL_COMPRESSED='' DOCDIR=${RD}/trees/bin/usr/share/doc
609 # Various "subroutine" and other supporting targets.
617 @echo "SD undefined in doTARBALL" && exit 1
620 @echo "TB undefined in doTARBALL" && exit 1
623 @echo "ARG undefined in doTARBALL" && exit 1
625 @rm -rf ${RD}/dists/${TD}/${TN}*
626 @mkdir -p ${RD}/dists/${TD}
628 tn=`echo ${TN} | tr '[A-Z]' '[a-z]' | cut -c1-8` && \
629 echo rolling ${TD}/$$tn tarball &&\
630 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
631 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
632 sh ${.CURDIR}/scripts/info.sh ${RD}/dists/${TD}/$$tn > \
633 ${RD}/dists/${TD}/$$tn.inf && \
634 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
635 cp -p ${.CURDIR}/scripts/$${TD}-install.sh ${RD}/dists/${TD}/install.sh; \
637 if [ "${SD}" != "/usr/src" ]; then \
638 mtree -c -i -p ${SD}/${ARG} \
639 -k gname,md5digest,mode,nlink,uname,size,link,type \
640 > ${RD}/dists/${TD}/$$tn.mtree ; \
644 (cd ${RD}/dists/${TD}; \
645 rm -f CHECKSUM.MD5; \
646 md5 * > CHECKSUM.MD5) \
649 doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 release.5 \
650 release.6 release.7 release.8 release.9
651 @cd ${.CURDIR} && ${MAKE} ${EXTRAS}
655 @cd ${.CURDIR} && ${MAKE} boot.flp
656 @cd ${.CURDIR} && ${MAKE} fixit.flp
657 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
660 @rm -f release.4 release.8
661 @cd ${.CURDIR} && ${MAKE} release.4 release.8 CRUNCH_TARGETS=boot
664 @rm -f release.4 release.9
665 @cd ${.CURDIR} && ${MAKE} release.4 release.9 CRUNCH_TARGETS=fixit
667 write_mfs_in_kernel: ${.CURDIR}/write_mfs_in_kernel.c
668 ${CC} ${CFLAGS} -o write_mfs_in_kernel ${.CURDIR}/write_mfs_in_kernel.c
672 @echo "CRUNCH undefined in installCRUNCH" && exit 1
675 @echo "DIR undefined in installCRUNCH" && exit 1
678 @echo "ZIP undefined in installCRUNCH" && exit 1
681 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
683 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
685 @chmod 555 ${DIR}/${CRUNCH}_crunch
686 @if [ -f ${.OBJDIR}/${CRUNCH}_crunch.conf ] ; then \
687 for i in `crunchgen -l ${.OBJDIR}/${CRUNCH}_crunch.conf` ; do \
688 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
691 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
692 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
697 # --==## Compile a kernel by name ${KERNEL} ##==--
699 # We don't erase the sys/compile/${KERNEL} directory, since somebody
700 # may want to reuse it (release.8 presently)
703 @rm -f ${RD}/kernels/${KERNEL}
704 @cd ${.CURDIR}/../sys/${MACHINE_ARCH}/conf && config ${KERNEL}
705 @cd ${.CURDIR}/../sys/compile/${KERNEL} && \
708 strip --strip-debug ${KERNEL} && \
709 cp ${KERNEL} ${RD}/kernels/${KERNEL}
712 # --==## Put a filesystem into a BOOTMFS kernel ##==--
715 @echo "Running doMFSKERN for ${FSIMAGE}"
716 @rm -f ${RD}/kernels/BOOTMFS.${FSIMAGE}
717 @cd ${.CURDIR}/../sys/${MACHINE_ARCH}/conf && \
718 sh ${.CURDIR}/scripts/dokern.sh ${BIGBOOT} < ${KERNCONF} > BOOTMFS
719 .if ${MACHINE_ARCH} == "i386"
720 @echo "options INTRO_USERCONFIG" >> ${.CURDIR}/../sys/i386/conf/BOOTMFS
723 @echo "options \"MD_ROOT_SIZE=`cat mfsroot.size`\"" >> \
724 ${.CURDIR}/../sys/${MACHINE_ARCH}/conf/BOOTMFS
726 @cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=BOOTMFS
727 @rm -rf ${RD}/image.${FSIMAGE}
728 @mkdir ${RD}/image.${FSIMAGE}
729 @strip ${RD}/kernels/BOOTMFS
730 @cp ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE}
731 mv ${RD}/kernels/BOOTMFS ${RD}/image.${FSIMAGE}/kernel
732 @echo "Setting up /boot directory for ${FSIMAGE} floppy"
733 @mkdir -p ${RD}/image.${FSIMAGE}/boot
734 @cp /boot/boot[12] /boot/loader ${RD}/image.${FSIMAGE}/boot
735 .if !defined(BIGBOOT)
736 @echo "load /kernel" > ${RD}/image.${FSIMAGE}/boot/loader.rc
737 @echo "echo \\007\\007" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
738 @echo "echo Please insert MFS root floppy and press enter:" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
739 @echo "read" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
740 @echo "load -t mfs_root /mfsroot" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
742 @echo "echo \\007\\007" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
743 @echo "autoboot 10" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
744 @touch ${RD}/image.${FSIMAGE}/boot/loader.config
745 .if ${MACHINE_ARCH} == "i386"
746 @echo "-P" >> ${RD}/image.${FSIMAGE}/boot.config
749 @echo "Writing MFS image into kernel for ${FSIMAGE} floppy"
750 @./write_mfs_in_kernel ${RD}/image.${FSIMAGE}/kernel mfsroot
751 @cp ${RD}/image.${FSIMAGE}/kernel ${RD}/kernels/MFSKERNEL.${FSIMAGE}
753 @gzip -9v ${RD}/image.${FSIMAGE}/kernel
754 @touch ${RD}/image.${FSIMAGE}/kernel.config
755 @rm -f ${RD}/floppies/${FSIMAGE}.flp
757 sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/${FSIMAGE}.flp \
758 ${RD} ${MNT} ${BIGBOOTSIZE} ${RD}/image.${FSIMAGE} \
759 ${BOOTINODE} ${BIGBOOTLABEL}
761 sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/${FSIMAGE}.flp \
762 ${RD} ${MNT} ${BOOTSIZE} ${RD}/image.${FSIMAGE} \
763 ${BOOTINODE} ${BOOTLABEL}
765 @echo "Created ${RD}/floppies/${FSIMAGE}.flp"
767 .include <bsd.prog.mk>