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 ${PCCARD} == "YES"
31 CARDDEV=card0 card1 card2 card3
39 # If you are using a local CVS repository with components stored in
40 # non-standard modules, override these on the make commandline or
42 RELEASESRCMODULE?= src
43 RELEASEDOCMODULE?= doc
44 RELEASEPORTSMODULE?= ports
46 # Unless set elsewhere, indicate the object format we'll be using.
49 # Uncomment this to disable the doc.1 target. It is also an ERROR
50 # to set NOPORTS and not set NODOC since docs depend on ports.
53 # Comment the following if you want the release documentation to be
56 DOCPORTS= textproc/docproj
57 # Set this to wherever the distfiles required by ${DOCPORTS} live.
58 DISTFILES?= ${.CURDIR}/../../ports/distfiles
60 DIST_DOCS= ABOUT.TXT ERRATA.TXT LAYOUT.TXT README.TXT HARDWARE.TXT \
61 RELNOTES.TXT TROUBLE.TXT UPGRADE.TXT INSTALL.TXT
63 # Things which without too much trouble can be considered variables
64 # BIN_DISTS are special in that they get full /etc installation sets.
66 COMPAT_DISTS?= compat1x compat20 compat21 compat22 compat3x
67 OTHER_DISTS?= manpages catpages games proflibs dict info doc
68 CRYPTO_DISTS?= des krb4
70 DISTRIBUTIONS?= ${BIN_DISTS} ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS}
73 # Extra source tarballs; each argument is a pair of source dir and
74 # distribution name. The dist name should not exceed 7 characters
75 # (another "s" for "source" will be prepended).
76 EXTRA_SRC+= usr.sbin/sendmail/cf smailcf
78 BOOT1= etc/protocols etc/defaults/rc.conf
80 # mountpoint for filesystems.
83 # Various floppy image parameters.
94 BIGBOOTLABEL= minimum2
98 .if ${MACHINE_ARCH} == "alpha"
103 ZIPNSPLIT= gzip --no-name -9 -c | split -b 240640 -
108 # Things which may get you into trouble if you change them
109 MTREEFILES= ${.CURDIR}/../etc/mtree
114 CD_DISC1= ${CD}/disc1
115 CD_DISC2= ${CD}/disc2
117 # Where the bootstrap ports (see DOCPORTS) get installed.
118 LOCALDIR= /usr/local/bin
120 # ${BOOTSTRAPDIR} is for those utilities that refer to the hosting
121 # environment, rather than the target environment. This is specifically
122 # intended for kernel-dependent utilities that are used during the build.
124 # ${BOOTSTRAPDIR} is actually being used by prepending it to the normal
125 # ${PATH}. Thus, it's also available to outside utilities like doFS.sh.
126 BOOTSTRAPDIR= /bootstrap
128 # The mount subsystem has been changed between 2.2 and 3.0 by the
130 BOOTSTRAPUTILS= /sbin/mount /sbin/umount
132 # 3.0 cpio tries to reference lchown(2) which is not available in 2.2
133 BOOTSTRAPUTILS+= /usr/bin/cpio
135 .if !defined(CRUNCH_TARGETS)
136 CRUNCH_TARGETS= boot fixit
139 .if ${MACHINE_ARCH} == "i386"
140 # Make both PC-card boot.flp and plain boot.flp
141 EXTRAS= floppies cdrom.1 ftp.1
143 EXTRAS= cdrom.1 ftp.1
151 .if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT)
152 @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false
155 .if exists(${CHROOTDIR})
156 # The first command will fail on a handful of files that have their schg
157 # flags set. But it greatly speeds up the next two commands.
158 -rm -rf ${CHROOTDIR} 2>/dev/null
159 -chflags -R noschg ${CHROOTDIR}/.
162 mkdir -p ${CHROOTDIR}
163 cd ${.CURDIR}/../etc && ${MAKE} distrib-dirs DESTDIR=${CHROOTDIR}
164 cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR}
165 if [ -f /etc/resolv.conf ]; then \
166 cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \
168 cd ${.CURDIR}/.. && ${MAKE} installworld DESTDIR=${CHROOTDIR} NOMAN=1
169 mkdir ${CHROOTDIR}/${BOOTSTRAPDIR}
170 for i in ${BOOTSTRAPUTILS} ; do \
171 cp -p ${CHROOTDIR}$$i ${CHROOTDIR}/${BOOTSTRAPDIR} ; \
173 .if !defined(RELEASETAG)
174 cd ${CHROOTDIR}/usr && rm -rf src && \
175 cvs -R -d ${CVSROOT} co -P ${RELEASESRCMODULE}
177 cd ${CHROOTDIR}/usr && rm -rf src && \
178 cvs -R -d ${CVSROOT} co -P -r ${RELEASETAG} ${RELEASESRCMODULE}
180 .if defined(LOCAL_PATCHES) && exists(${LOCAL_PATCHES})
181 cd ${CHROOTDIR}/usr/src && patch ${PATCH_FLAGS} < ${LOCAL_PATCHES}
183 .if defined(LOCAL_SCRIPT) && exists(${LOCAL_SCRIPT})
184 cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT}
186 .if !defined(NOPORTS)
187 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P ${RELEASEPORTSMODULE} && cd ports && make readmes PORTSDIR=${CHROOTDIR}/usr/ports
190 cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co -P ${RELEASEDOCMODULE}
191 if [ -d ${DISTFILES}/ ]; then \
192 cp -rp ${DISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \
197 .if !defined(RELEASENOUPDATE)
198 .if !defined(RELEASETAG)
199 cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d
201 cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d -r ${RELEASETAG}
203 .if !defined(NOPORTS)
204 cd ${CHROOTDIR}/usr/ports && cvs -R -q update -P -d
207 cd ${CHROOTDIR}/usr/doc && cvs -R -q update -P -d
211 # Add version information to those things that need it.
212 ( cd ${CHROOTDIR}/usr/src/sys/conf && \
213 mv newvers.sh foo && \
214 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && rm foo )
215 echo OBJFORMAT=${OBJFORMAT} > ${CHROOTDIR}/etc/objformat
216 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
217 echo "#!/bin/sh" > ${CHROOTDIR}/mk
218 echo "set -ex" >> ${CHROOTDIR}/mk
219 echo "_RELTARGET=\$${1:-doRELEASE}" >> ${CHROOTDIR}/mk
220 echo "export CFLAGS='-O -pipe'" >> ${CHROOTDIR}/mk
221 echo "export DISTRIBUTIONS=\"${DISTRIBUTIONS}\"" >> ${CHROOTDIR}/mk
222 echo "export BUILDNAME=${BUILDNAME}" >> ${CHROOTDIR}/mk
223 echo "export VNDEVICE=${VNDEVICE}" >> ${CHROOTDIR}/mk
224 echo "export OBJFORMAT=${OBJFORMAT}" >> ${CHROOTDIR}/mk
225 .if defined(RELEASETAG)
226 echo "export RELEASETAG=${RELEASETAG}" >> ${CHROOTDIR}/mk
229 echo "export NOPORTS=${NOPORTS}" >> ${CHROOTDIR}/mk
232 echo "export NODOC=${NODOC}" >> ${CHROOTDIR}/mk
235 echo "export ALLLANG=${ALLLANG}" >> ${CHROOTDIR}/mk
237 echo "export DOC_LANG=en_US.ISO_8859-1" >> ${CHROOTDIR}/mk
240 echo "export NOSRC=${NOSRC}" >> ${CHROOTDIR}/mk
242 .if defined(NOSHARED)
243 echo "export NOSHARED=${NOSHARED}" >> ${CHROOTDIR}/mk
245 .if defined(BOOT_CONFIG)
246 echo "export BOOT_CONFIG=\"${BOOT_CONFIG}\"">> ${CHROOTDIR}/mk
248 # Don't remove this, or the build will fall over!
249 echo "export RELEASEDIR=${_R}" >> ${CHROOTDIR}/mk
250 echo "export PATH=${BOOTSTRAPDIR}:$${PATH}:${LOCALDIR}" >> ${CHROOTDIR}/mk
251 echo "if [ ! -f /tmp/.world_done ]; then" >> ${CHROOTDIR}/mk
252 echo " cd /usr/src" >> ${CHROOTDIR}/mk
254 echo " (cd etc; make distrib-dirs distribution)" >> ${CHROOTDIR}/mk
255 echo " make world" >> ${CHROOTDIR}/mk
258 echo " make all install" >> ${CHROOTDIR}/mk
260 echo " touch /tmp/.world_done" >> ${CHROOTDIR}/mk
261 echo "fi" >> ${CHROOTDIR}/mk
262 echo "cd /usr/src/release/sysinstall" >> ${CHROOTDIR}/mk
263 echo "make obj" >> ${CHROOTDIR}/mk
264 echo "cd /usr/src/release" >> ${CHROOTDIR}/mk
265 echo "make \$${_RELTARGET}" >> ${CHROOTDIR}/mk
266 echo "echo make ${.TARGET} Finished" >> ${CHROOTDIR}/mk
267 chmod 755 ${CHROOTDIR}/mk
268 chroot ${CHROOTDIR} /mk
271 rm -rf boot_crunch ${.OBJDIR}/boot_crunch.conf release.[0-9]
273 # Clean out ${_R} and make the directory structure.
276 -rm -rf ${_R}/* 2> /dev/null
277 -chflags -R noschg ${_R}/.
281 .if ${MACHINE_ARCH} == "i386"
282 mkdir ${RD}/floppies/pccard
287 for i in ${DISTRIBUTIONS} ; do \
288 mkdir ${RD}/trees/$$i && \
289 mkdir ${RD}/dists/$$i && \
290 mtree -deU -f ${MTREEFILES}/BSD.root.dist \
291 -p ${RD}/trees/$$i > /dev/null && \
292 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
293 -p ${RD}/trees/$$i/usr > /dev/null && \
294 mtree -deU -f ${MTREEFILES}/BSD.include.dist \
295 -p ${RD}/trees/$$i/usr/include > /dev/null && \
296 mtree -deU -f ${MTREEFILES}/BSD.var.dist \
297 -p ${RD}/trees/$$i/var > /dev/null ; \
301 # Install the system into the various distributions.
303 cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/bin
304 cd ${.CURDIR}/.. && make distribute DISTDIR=${RD}/trees
305 .if exists(${.CURDIR}/../kerberosIV) && exists(${.CURDIR}/../crypto) && !defined(NOKERBEROS)
306 cd ${.CURDIR}/../kerberosIV && ( \
308 make obj all help-distribute DISTDIR=${RD}/trees &&\
312 -chflags -R noschg ${RD}/trees
315 # Make and install the generic kernel(s).
317 .for kernel in ${KERNELS}
318 rm -f ${RD}/kernels/${kernel}
319 rm -rf ${.CURDIR}/../sys/compile/${kernel}
320 cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=${kernel}
321 rm -rf ${.CURDIR}/../sys/compile/${kernel}
322 ln -f ${RD}/kernels/${kernel} ${RD}/trees/bin/kernel.${kernel}
326 # Make and install the three crunched binaries which live on the floppies.
327 # You are not supposed to like this :-)
329 # NB: the "RELEASE_BUILD_FIXIT" magic prevents vi from including the
330 # Tcl and Perl APIs. See also /usr/src/usr.bin/vi/Makefile.
333 .if ${PCCARD} == "YES"
334 cp ${.CURDIR}/boot_crunch.conf.pccard ${.OBJDIR}/boot_crunch.conf
336 cp ${.CURDIR}/boot_crunch.conf.generic ${.OBJDIR}/boot_crunch.conf
338 cd ${.CURDIR}/sysinstall && make obj depend all install
340 mkdir -p ${RD}/crunch
341 export RELEASE_BUILD_FIXIT=noway ; \
342 for j in ${CRUNCH_TARGETS} ; do \
343 rm -rf $${j}_crunch && \
344 mkdir $${j}_crunch && \
345 ( cd $${j}_crunch && \
346 ( ( [ -f ${.CURDIR}/$${j}_crunch.conf ] && \
347 crunchgen ${.CURDIR}/$${j}_crunch.conf ) || \
348 ( [ -f ${.OBJDIR}/$${j}_crunch.conf ] && \
349 crunchgen ${.OBJDIR}/$${j}_crunch.conf ) ) && \
350 ${MAKE} -DRELEASE_CRUNCH -f $${j}_crunch.mk subclean all \
351 NOCRYPT=yes "CFLAGS=${CFLAGS} -DCRUNCHED_BINARY") && \
352 mv $${j}_crunch/$${j}_crunch ${RD}/crunch/$${j} && \
353 true || { rm -rf $${j}_crunch ; false ; } ; \
358 # --==## Fix up the distributions. ##==--
361 # Handle some grief caused by the munition braindeadness.
362 for i in sbin/init bin/ed usr.sbin/ppp usr.sbin/pppd ; do \
363 ( cd ${.CURDIR}/../$$i; \
364 make -DNOCRYPT clean all distribute DISTDIR=${RD}/trees ) ; \
367 # Create any "synthetic dists" now.
368 @for i in ${DISTRIBUTIONS}; do \
369 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
370 echo -n "Running $$i dist creation script... "; \
371 env OBJFORMAT=${OBJFORMAT} RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
376 # Create symlinks for the MD5-based crypt lib, too. The
377 # automatically created links still point to the DES stuff,
378 # which went into its own distribution.
379 for i in ${RD}/trees/bin/usr/lib/libscrypt* ; do \
380 c=`echo $$i | sed -e 's/libscrypt/libcrypt/'` ; \
382 ln -s `basename $$i` $$c ; \
385 # Remove all the directories we don't need.
387 find ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} -depth -type d -print | xargs rmdir
391 # --==## Package up the tarballs from assembled trees ##==--
396 @for i in ${DISTRIBUTIONS} ; \
398 if [ -d ${RD}/trees/$${i} ] ; then \
399 cd ${.CURDIR} && $(MAKE) doTARBALL \
400 SD=${RD}/trees/$${i} \
401 TN=$$i TD=$$i ARG="." && \
402 echo "$${i} distribution is finished."; \
405 # More munition braindeadness.
406 ( cd ${RD}/dists && \
407 if [ -f krb4/krb4.aa ] ; then mv krb4/* des && rmdir krb4 ; fi )
412 # --==## Make source dists ##==--
416 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \
417 TD=src TN=sbase ARG="[A-Z]*"
418 @for i in `cd /usr/src && echo [a-z]*` ; do \
419 if [ -d /usr/src/$$i ] ; then \
420 cd ${.CURDIR} && $(MAKE) doTARBALL \
421 TN=`echo s$$i | tr -d '.' | sed 's/usr/u/'` \
422 SD=/usr/src TD=src ARG="$$i" ; \
425 .if defined(EXTRA_SRC)
426 @set ${EXTRA_SRC} && \
427 while [ $$# -ge 2 ] ; do \
428 if [ -d /usr/src/$$1 ] ; then \
429 cd ${.CURDIR} && $(MAKE) doTARBALL \
430 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
431 fi && shift && shift ; \
434 .if exists(${RD}/dists/des)
435 ( cd ${RD}/dists/src && \
436 if [ -f ssecure.aa ] ; then mv ssecure.* ../des ; fi && \
437 if [ -f scrypto.aa ] ; then mv scrypto.* ../des ; fi && \
438 if [ -f skerbero.aa ] ; then mv skerbero.* ../des ; fi ; )
440 @echo "src distribution is finished."
444 # Complete the bootfd
446 # Now, just to get this picture down once and for all:
448 # +------------------------------------------------------------------------+
450 # +-----+-----+------------------------------------------------------------+
451 # |boot1|boot2|floppy filesystem "bootfd" |
452 # +-----+-----+-+--------------------------------------------------------+-+
454 # +------------+-----------------------------------------+-+
455 # |mfs filesystem "mfsfd" |
456 # +-----------------------------------------+
459 release.8: write_mfs_in_kernel
463 mkdir -p etc dev mnt stand/help
464 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
465 DIR=${RD}/mfsfd/stand ZIP=false
466 ( cd ${RD}/trees/bin/dev && \
467 ls console tty bpf0 ttyv0 ttyv1 ttyv2 ttyv3 null zero ${CARDDEV} | \
468 cpio -dump ${RD}/mfsfd/dev )
469 ( cd ${RD}/mfsfd/dev && rm -f *[swo]d*[bdefgh] )
470 ( cd ${RD}/mfsfd && mkdir -p bin sbin && ln -s /stand/sh bin/sh )
471 cp /sbin/dhclient-script ${RD}/mfsfd/sbin
472 .if ${PCCARD} == "YES"
473 cp ${.CURDIR}/../etc/pccard.conf.sample ${RD}/mfsfd/etc/pccard.conf
475 cd ${RD}/trees/bin && ls ${BOOT1} | cpio -dump ${RD}/mfsfd/stand
476 echo "nameserver 42/tcp name" > ${RD}/mfsfd/stand/etc/services
477 echo "ftp 21/tcp" >> ${RD}/mfsfd/stand/etc/services
478 echo "domain 53/tcp nameserver" >> ${RD}/mfsfd/stand/etc/services
479 echo "domain 53/udp nameserver" >> ${RD}/mfsfd/stand/etc/services
480 echo "cmd 514/tcp shell" >> ${RD}/mfsfd/stand/etc/services
481 gzip -9c ${.CURDIR}/../COPYRIGHT > ${RD}/mfsfd/stand/help/COPYRIGHT.hlp.gz
482 @for i in README.TXT RELNOTES.TXT INSTALL.TXT UPGRADE.TXT HARDWARE.TXT; do \
483 if [ -f ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} ]; then \
484 gzip -9c ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} > ${RD}/mfsfd/stand/help/$${i}.gz; \
486 gzip -9c ${.CURDIR}/texts/$${i} > ${RD}/mfsfd/stand/help/$${i}.gz; \
489 -test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
490 @mkdir -p ${RD}/mfsfd/boot
491 @cp /boot/boot* ${RD}/mfsfd/boot
492 @cp /boot/loader.help ${RD}/mfsfd/boot
493 @echo "Making the regular boot floppy."
494 @tar --exclude CVS -cf - -C ${.CURDIR}/sysinstall help | \
495 tar xf - -C ${RD}/mfsfd/stand
496 @echo "Compressing doc files..."
497 @gzip -9 ${RD}/mfsfd/stand/help/*.hlp
498 sh -e ${.CURDIR}/scripts/doFS.sh -s mfsroot ${RD} ${MNT} \
499 ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL}
500 @gzip -9vc mfsroot > mfsroot.gz
501 @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/mfsroot.flp \
502 ${RD} ${MNT} ${BOOTSIZE} mfsroot.gz ${BOOTINODE} ${BOOTLABEL}
503 @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=kern
504 @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=boot BIGBOOT=YES
505 @rm mfsroot mfsroot.gz mfsroot.size
506 @echo "Regular and MFS boot floppies made."
510 # --==## Create a fixit floppy ##==--
513 @echo "Making fixit floppy."
514 @rm -rf ${RD}/fixitfd
516 @cd ${RD}/fixitfd && \
517 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
519 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=fixit \
520 DIR=${RD}/fixitfd/stand ZIP=false
521 @( cd ${RD}/fixitfd/dev && \
522 sed -e '/^PATH/s/^/#/' ${RD}/trees/bin/dev/MAKEDEV > MAKEDEV && \
523 chmod 755 MAKEDEV && \
525 @cp ${RD}/trees/bin/etc/spwd.db ${RD}/trees/bin/etc/group \
526 ${RD}/trees/bin/etc/protocols ${RD}/fixitfd/etc
527 @cp ${RD}/trees/bin/usr/share/misc/scsi_modes \
528 ${RD}/fixitfd/usr/share/misc
529 @cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
530 @cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
531 @cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar
532 @chmod 555 ${RD}/fixitfd/stand/tar
533 @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/fixit.flp ${RD} \
534 ${MNT} ${FIXITSIZE} ${RD}/fixitfd ${FIXITINODE} ${FIXITLABEL}
535 # Do our last minute floppies directory setup in a convenient place.
536 @cp ${.CURDIR}/texts/FLOPPIES.TXT ${RD}/floppies/README.TXT
537 @(cd ${RD}/floppies; md5 README.TXT *.flp > CHECKSUM.MD5)
538 .if ${MACHINE_ARCH} == "i386"
539 @cp ${.CURDIR}/texts/PCCARD.TXT ${RD}/floppies/pccard/README.TXT
540 @(cd ${RD}/floppies/pccard; md5 *.flp > CHECKSUM.MD5)
545 # --==## Setup a suitable ftp-area ##==--
548 @echo "Setting up FTP distribution area"
550 -@ln -s . ${FD}/${BUILDNAME}
551 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
552 @cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
553 @for i in ${DIST_DOCS}; do \
554 if [ -f ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} ]; then \
555 cp ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} ${FD}; \
557 cp ${.CURDIR}/texts/$${i} ${FD}; \
560 @echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
561 .if !defined(NOPORTS)
562 @tar --exclude CVS -cBf - -C ${CD_DISC1} ports | tar -xBf - -C ${FD}
566 # --==## Setup a suitable cdrom-area ##==--
569 @echo "Setting up CDROM distribution area"
570 @mkdir -p ${CD_DISC1} ${CD_DISC2}
571 @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
572 @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}
573 @ln -f ${RD}/kernels/MFSKERNEL.boot ${CD_DISC1}/kernel
574 @for i in ${DISTRIBUTIONS} ; \
576 if [ -d ${RD}/trees/$${i} ] ; then \
577 chflags -R noschg ${RD}/trees/$${i} || true ; \
578 ( cd ${RD}/trees/$${i} && \
579 find . -depth -print | cpio -dumpl ${CD_DISC2} ) ; \
582 @rm -f ${CD_DISC2}/.profile
583 @cp ${.CURDIR}/fixit.profile ${CD_DISC2}/.profile
584 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
585 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
586 @for i in ${DIST_DOCS}; do \
587 if [ -f ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} ]; then \
588 cp ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} ${CD_DISC1}; \
590 cp ${.CURDIR}/texts/$${i} ${CD_DISC1}; \
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.
613 @echo "SD undefined in doTARBALL" && exit 1
616 @echo "TB undefined in doTARBALL" && exit 1
619 @echo "ARG undefined in doTARBALL" && exit 1
621 @rm -rf ${RD}/dists/${TD}/${TN}*
622 @mkdir -p ${RD}/dists/${TD}
624 tn=`echo ${TN} | tr '[A-Z]' '[a-z]' | cut -c1-8` && \
625 echo rolling ${TD}/$$tn tarball &&\
626 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
627 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
628 sh ${.CURDIR}/scripts/info.sh ${RD}/dists/${TD}/$$tn > \
629 ${RD}/dists/${TD}/$$tn.inf && \
630 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
631 cp -p ${.CURDIR}/scripts/$${TD}-install.sh ${RD}/dists/${TD}/install.sh; \
633 if [ "${SD}" != "/usr/src" ]; then \
634 mtree -c -i -p ${SD}/${ARG} \
635 -k gname,md5digest,mode,nlink,uname,size,link,type \
636 > ${RD}/dists/${TD}/$$tn.mtree ; \
640 (cd ${RD}/dists/${TD}; \
641 rm -f CHECKSUM.MD5; \
642 md5 * > CHECKSUM.MD5) \
645 doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 release.5 \
646 release.6 release.7 release.8 release.9
647 @cd ${.CURDIR} && ${MAKE} ${EXTRAS}
651 .if ${MACHINE_ARCH} == "i386"
652 @cd ${.CURDIR} && ${MAKE} PCCARD=YES boot.flp
653 mv ${RD}/floppies/boot.flp ${RD}/floppies/kern.flp \
654 ${RD}/floppies/mfsroot.flp ${RD}/floppies/pccard
656 @cd ${.CURDIR} && ${MAKE} boot.flp
657 @cd ${.CURDIR} && ${MAKE} fixit.flp
658 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
661 @rm -f release.4 release.8
662 @cd ${.CURDIR} && ${MAKE} release.4 release.8 CRUNCH_TARGETS=boot
665 @rm -f release.4 release.9
666 @cd ${.CURDIR} && ${MAKE} release.4 release.9 CRUNCH_TARGETS=fixit
668 write_mfs_in_kernel: ${.CURDIR}/write_mfs_in_kernel.c
669 ${CC} ${CFLAGS} -o write_mfs_in_kernel ${.CURDIR}/write_mfs_in_kernel.c
673 @echo "CRUNCH undefined in installCRUNCH" && exit 1
676 @echo "DIR undefined in installCRUNCH" && exit 1
679 @echo "ZIP undefined in installCRUNCH" && exit 1
682 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
684 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
686 @chmod 555 ${DIR}/${CRUNCH}_crunch
687 @if [ -f ${.OBJDIR}/${CRUNCH}_crunch.conf ] ; then \
688 for i in `crunchgen -l ${.OBJDIR}/${CRUNCH}_crunch.conf` ; do \
689 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
692 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
693 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
698 # --==## Compile a kernel by name ${KERNEL} ##==--
700 # We don't erase the sys/compile/${KERNEL} directory, since somebody
701 # may want to reuse it (release.8 presently)
704 @rm -f ${RD}/kernels/${KERNEL}
705 @cd ${.CURDIR}/../sys/${MACHINE_ARCH}/conf && config ${KERNEL}
706 @cd ${.CURDIR}/../sys/compile/${KERNEL} && \
709 strip --strip-debug ${KERNEL} && \
710 cp ${KERNEL} ${RD}/kernels/${KERNEL}
713 # --==## Put a filesystem into a BOOTMFS kernel ##==--
716 @echo "Running doMFSKERN for ${FSIMAGE}"
717 @rm -f ${RD}/kernels/BOOTMFS.${FSIMAGE}
718 @cd ${.CURDIR}/../sys/${MACHINE_ARCH}/conf && \
719 sh ${.CURDIR}/scripts/dokern.sh ${BIGBOOT} < ${KERNCONF} > BOOTMFS
720 .if ${MACHINE_ARCH} == "i386"
721 @echo "options INTRO_USERCONFIG" >> ${.CURDIR}/../sys/i386/conf/BOOTMFS
724 @echo "options \"MD_ROOT_SIZE=`cat mfsroot.size`\"" >> \
725 ${.CURDIR}/../sys/${MACHINE_ARCH}/conf/BOOTMFS
727 @cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=BOOTMFS
728 @rm -rf ${RD}/image.${FSIMAGE}
729 @mkdir ${RD}/image.${FSIMAGE}
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) || ${MACHINE_ARCH} == "alpha"
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>