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?= des krb4
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 -chflags -R noschg ${RD}/trees
303 # Make and install the generic kernel(s).
305 .for kernel in ${KERNELS}
306 rm -f ${RD}/kernels/${kernel}
307 rm -rf ${.CURDIR}/../sys/compile/${kernel}
308 cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=${kernel}
309 rm -rf ${.CURDIR}/../sys/compile/${kernel}
310 ln -f ${RD}/kernels/${kernel} ${RD}/trees/bin/kernel.${kernel}
314 # Make and install the three crunched binaries which live on the floppies.
315 # You are not supposed to like this :-)
317 # NB: the "RELEASE_BUILD_FIXIT" magic prevents vi from including the
318 # Tcl and Perl APIs. See also /usr/src/usr.bin/vi/Makefile.
321 cp ${.CURDIR}/boot_crunch.conf.generic ${.OBJDIR}/boot_crunch.conf
322 cd ${.CURDIR}/sysinstall && make obj depend all install
324 mkdir -p ${RD}/crunch
325 export RELEASE_BUILD_FIXIT=noway ; \
326 for j in ${CRUNCH_TARGETS} ; do \
327 rm -rf $${j}_crunch && \
328 mkdir $${j}_crunch && \
329 ( cd $${j}_crunch && \
330 ( ( [ -f ${.CURDIR}/$${j}_crunch.conf ] && \
331 crunchgen ${.CURDIR}/$${j}_crunch.conf ) || \
332 ( [ -f ${.OBJDIR}/$${j}_crunch.conf ] && \
333 crunchgen ${.OBJDIR}/$${j}_crunch.conf ) ) && \
334 ${MAKE} -DRELEASE_CRUNCH -f $${j}_crunch.mk subclean all \
335 NOCRYPT=yes "CFLAGS=${CFLAGS} -DCRUNCHED_BINARY") && \
336 mv $${j}_crunch/$${j}_crunch ${RD}/crunch/$${j} && \
337 true || { rm -rf $${j}_crunch ; false ; } ; \
342 # --==## Fix up the distributions. ##==--
345 # Handle some grief caused by the munition braindeadness.
346 for i in sbin/init bin/ed usr.sbin/ppp usr.sbin/pppd ; do \
347 ( cd ${.CURDIR}/../$$i; \
348 make -DNOCRYPT clean all distribute DISTDIR=${RD}/trees ) ; \
351 # Create any "synthetic dists" now.
352 @for i in ${DISTRIBUTIONS}; do \
353 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
354 echo -n "Running $$i dist creation script... "; \
355 env OBJFORMAT=${OBJFORMAT} RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
360 # Create symlinks for the MD5-based crypt lib, too. The
361 # automatically created links still point to the DES stuff,
362 # which went into its own distribution.
363 for i in ${RD}/trees/bin/usr/lib/libscrypt* ; do \
364 c=`echo $$i | sed -e 's/libscrypt/libcrypt/'` ; \
366 ln -s `basename $$i` $$c ; \
369 # Remove all the directories we don't need.
371 find ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} -depth -type d -print | xargs rmdir
375 # --==## Package up the tarballs from assembled trees ##==--
380 @for i in ${DISTRIBUTIONS} ; \
382 if [ -d ${RD}/trees/$${i} ] ; then \
383 cd ${.CURDIR} && $(MAKE) doTARBALL \
384 SD=${RD}/trees/$${i} \
385 TN=$$i TD=$$i ARG="." && \
386 echo "$${i} distribution is finished."; \
389 # More munition braindeadness.
390 ( cd ${RD}/dists && \
391 if [ -f krb4/krb4.aa ] ; then mv krb4/* des && rmdir krb4 ; fi )
396 # --==## Make source dists ##==--
400 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \
401 TD=src TN=sbase ARG="[A-Z]*"
402 @for i in `cd /usr/src && echo [a-z]*` ; do \
403 if [ -d /usr/src/$$i ] ; then \
404 cd ${.CURDIR} && $(MAKE) doTARBALL \
405 TN=`echo s$$i | tr -d '.' | sed 's/usr/u/'` \
406 SD=/usr/src TD=src ARG="$$i" ; \
409 .if defined(EXTRA_SRC)
410 @set ${EXTRA_SRC} && \
411 while [ $$# -ge 2 ] ; do \
412 if [ -d /usr/src/$$1 ] ; then \
413 cd ${.CURDIR} && $(MAKE) doTARBALL \
414 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
415 fi && shift && shift ; \
418 if [ -d ${RD}/dists/des ] ; then ( cd ${RD}/dists/src && \
419 if [ -f ssecure.aa ] ; then mv ssecure.* ../des ; fi && \
420 if [ -f scrypto.aa ] ; then mv scrypto.* ../des ; fi && \
421 if [ -f skerbero.aa ] ; then mv skerbero.* ../des ; fi ; ) ; fi
422 @echo "src distribution is finished."
426 # Complete the bootfd
428 # Now, just to get this picture down once and for all:
430 # +------------------------------------------------------------------------+
432 # +-----+-----+------------------------------------------------------------+
433 # |boot1|boot2|floppy filesystem "bootfd" |
434 # +-----+-----+-+--------------------------------------------------------+-+
436 # +------------+-----------------------------------------+-+
437 # |mfs filesystem "mfsfd" |
438 # +-----------------------------------------+
441 release.8: write_mfs_in_kernel
445 mkdir -p etc dev mnt stand/help
446 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
447 DIR=${RD}/mfsfd/stand ZIP=false
448 ( cd ${RD}/trees/bin/dev && \
449 ls console tty bpf0 ttyv0 ttyv1 ttyv2 ttyv3 null zero card0 card1 card2 card3 | \
450 cpio -dump ${RD}/mfsfd/dev )
451 ( cd ${RD}/mfsfd/dev && rm -f *[swo]d*[bdefgh] )
452 ( cd ${RD}/mfsfd && mkdir -p bin sbin && ln -s /stand/sh bin/sh )
453 cp /sbin/dhclient-script ${RD}/mfsfd/sbin
454 cp ${.CURDIR}/../etc/pccard.conf.sample ${RD}/mfsfd/etc/pccard.conf
455 cd ${RD}/trees/bin && ls ${BOOT1} | cpio -dump ${RD}/mfsfd/stand
456 echo "nameserver 42/tcp name" > ${RD}/mfsfd/stand/etc/services
457 echo "ftp 21/tcp" >> ${RD}/mfsfd/stand/etc/services
458 echo "domain 53/tcp nameserver" >> ${RD}/mfsfd/stand/etc/services
459 echo "domain 53/udp nameserver" >> ${RD}/mfsfd/stand/etc/services
460 echo "cmd 514/tcp shell" >> ${RD}/mfsfd/stand/etc/services
461 gzip -9c ${.CURDIR}/../COPYRIGHT > ${RD}/mfsfd/stand/help/COPYRIGHT.hlp.gz
462 @for i in README.TXT RELNOTES.TXT INSTALL.TXT UPGRADE.TXT HARDWARE.TXT; do \
463 if [ -f ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} ]; then \
464 gzip -9c ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} > ${RD}/mfsfd/stand/help/$${i}.gz; \
466 gzip -9c ${.CURDIR}/texts/$${i} > ${RD}/mfsfd/stand/help/$${i}.gz; \
469 -test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
470 @mkdir -p ${RD}/mfsfd/boot
471 @cp /boot/boot* ${RD}/mfsfd/boot
472 @cp /boot/loader.help ${RD}/mfsfd/boot
473 @echo "Making the regular boot floppy."
474 @tar --exclude CVS -cf - -C ${.CURDIR}/sysinstall help | \
475 tar xf - -C ${RD}/mfsfd/stand
476 @echo "Compressing doc files..."
477 @gzip -9 ${RD}/mfsfd/stand/help/*.hlp
478 sh -e ${.CURDIR}/scripts/doFS.sh -s mfsroot ${RD} ${MNT} \
479 ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL}
480 @gzip -9vc mfsroot > mfsroot.gz
481 @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/mfsroot.flp \
482 ${RD} ${MNT} ${BOOTSIZE} mfsroot.gz ${BOOTINODE} ${BOOTLABEL}
483 @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=kern
484 @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=boot BIGBOOT=YES
485 @rm mfsroot mfsroot.gz mfsroot.size
486 @echo "Regular and MFS boot floppies made."
490 # --==## Create a fixit floppy ##==--
493 @echo "Making fixit floppy."
494 @rm -rf ${RD}/fixitfd
496 @cd ${RD}/fixitfd && \
497 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
499 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=fixit \
500 DIR=${RD}/fixitfd/stand ZIP=false
501 @( cd ${RD}/fixitfd/dev && \
502 sed -e '/^PATH/s/^/#/' ${RD}/trees/bin/dev/MAKEDEV > MAKEDEV && \
503 chmod 755 MAKEDEV && \
505 @cp ${RD}/trees/bin/etc/spwd.db ${RD}/trees/bin/etc/group \
506 ${RD}/trees/bin/etc/protocols ${RD}/fixitfd/etc
507 @cp ${RD}/trees/bin/usr/share/misc/scsi_modes \
508 ${RD}/fixitfd/usr/share/misc
509 @cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
510 @cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
511 @cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar
512 @chmod 555 ${RD}/fixitfd/stand/tar
513 @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/fixit.flp ${RD} \
514 ${MNT} ${FIXITSIZE} ${RD}/fixitfd ${FIXITINODE} ${FIXITLABEL}
515 # Do our last minute floppies directory setup in a convenient place.
516 @cp ${.CURDIR}/texts/FLOPPIES.TXT ${RD}/floppies/README.TXT
517 @(cd ${RD}/floppies; md5 README.TXT *.flp > CHECKSUM.MD5)
521 # --==## Setup a suitable ftp-area ##==--
524 @echo "Setting up FTP distribution area"
526 -@ln -s . ${FD}/${BUILDNAME}
527 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
528 @cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
529 @for i in ${DIST_DOCS}; do \
530 cp ${.CURDIR}/texts/$${i} ${FD}; \
531 if [ -f ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} ]; then \
532 echo "=== Platform specifics for ${MACHINE_ARCH}" >> ${FD}/$${i}; \
533 cat ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} >> ${FD}/$${i}; \
536 @echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
537 .if !defined(NOPORTS)
538 @tar --exclude CVS -cBf - -C ${CD_DISC1} ports | tar -xBf - -C ${FD}
542 # --==## Setup a suitable cdrom-area ##==--
545 @echo "Setting up CDROM distribution area"
546 @mkdir -p ${CD_DISC1} ${CD_DISC2}
547 @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
548 @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}
549 @ln -f ${RD}/kernels/MFSKERNEL.boot ${CD_DISC1}/kernel
550 @for i in ${DISTRIBUTIONS} ; \
552 if [ -d ${RD}/trees/$${i} ] ; then \
553 chflags -R noschg ${RD}/trees/$${i} || true ; \
554 ( cd ${RD}/trees/$${i} && \
555 find . -depth -print | cpio -dumpl ${CD_DISC2} ) ; \
558 @rm -f ${CD_DISC2}/.profile
559 @cp ${.CURDIR}/fixit.profile ${CD_DISC2}/.profile
560 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
561 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
562 @for i in ${DIST_DOCS}; do \
563 cp ${.CURDIR}/texts/$${i} ${CD_DISC1}; \
564 if [ -f ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} ]; then \
565 echo "=== Platform specifics for ${MACHINE_ARCH}" >> ${FD}/$${i}; \
566 cat ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} >> ${CD_DISC1}/$${i}; \
569 .if !defined(NOPORTS)
570 @-rm -rf /usr/ports/distfiles/*
571 @mkdir -p ${CD_DISC1}/ports && \
572 tar --exclude CVS -czf ${CD_DISC1}/ports/ports.tgz -C /usr ports && \
573 cp ${.CURDIR}/scripts/ports-install.sh ${CD_DISC1}/ports/install.sh \
574 && (cd ${CD_DISC1}/ports; md5 * > CHECKSUM.MD5)
578 @echo "Making docs..."
579 @for i in ${DOCPORTS}; do \
580 cd /usr/ports/$$i && make all install clean JADETEX=no FORCE_PKG_REGISTER=yes; \
582 @cd /usr/doc && make all install 'FORMATS=html html-split txt' INSTALL_COMPRESSED='' DOCDIR=${RD}/trees/bin/usr/share/doc
585 # Various "subroutine" and other supporting targets.
589 @echo "SD undefined in doTARBALL" && exit 1
592 @echo "TB undefined in doTARBALL" && exit 1
595 @echo "ARG undefined in doTARBALL" && exit 1
597 @rm -rf ${RD}/dists/${TD}/${TN}*
598 @mkdir -p ${RD}/dists/${TD}
600 tn=`echo ${TN} | tr '[A-Z]' '[a-z]' | cut -c1-8` && \
601 echo rolling ${TD}/$$tn tarball &&\
602 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
603 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
604 sh ${.CURDIR}/scripts/info.sh ${RD}/dists/${TD}/$$tn > \
605 ${RD}/dists/${TD}/$$tn.inf && \
606 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
607 cp -p ${.CURDIR}/scripts/$${TD}-install.sh ${RD}/dists/${TD}/install.sh; \
609 if [ "${SD}" != "/usr/src" ]; then \
610 mtree -c -i -p ${SD}/${ARG} \
611 -k gname,md5digest,mode,nlink,uname,size,link,type \
612 > ${RD}/dists/${TD}/$$tn.mtree ; \
616 (cd ${RD}/dists/${TD}; \
617 rm -f CHECKSUM.MD5; \
618 md5 * > CHECKSUM.MD5) \
621 doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 release.5 \
622 release.6 release.7 release.8 release.9
623 @cd ${.CURDIR} && ${MAKE} ${EXTRAS}
627 @cd ${.CURDIR} && ${MAKE} boot.flp
628 @cd ${.CURDIR} && ${MAKE} fixit.flp
629 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
632 @rm -f release.4 release.8
633 @cd ${.CURDIR} && ${MAKE} release.4 release.8 CRUNCH_TARGETS=boot
636 @rm -f release.4 release.9
637 @cd ${.CURDIR} && ${MAKE} release.4 release.9 CRUNCH_TARGETS=fixit
639 write_mfs_in_kernel: ${.CURDIR}/write_mfs_in_kernel.c
640 ${CC} ${CFLAGS} -o write_mfs_in_kernel ${.CURDIR}/write_mfs_in_kernel.c
644 @echo "CRUNCH undefined in installCRUNCH" && exit 1
647 @echo "DIR undefined in installCRUNCH" && exit 1
650 @echo "ZIP undefined in installCRUNCH" && exit 1
653 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
655 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
657 @chmod 555 ${DIR}/${CRUNCH}_crunch
658 @if [ -f ${.OBJDIR}/${CRUNCH}_crunch.conf ] ; then \
659 for i in `crunchgen -l ${.OBJDIR}/${CRUNCH}_crunch.conf` ; do \
660 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
663 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
664 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
669 # --==## Compile a kernel by name ${KERNEL} ##==--
671 # We don't erase the sys/compile/${KERNEL} directory, since somebody
672 # may want to reuse it (release.8 presently)
675 @rm -f ${RD}/kernels/${KERNEL}
676 @cd ${.CURDIR}/../sys/${MACHINE_ARCH}/conf && config ${KERNEL}
677 @cd ${.CURDIR}/../sys/compile/${KERNEL} && \
680 strip --strip-debug ${KERNEL} && \
681 cp ${KERNEL} ${RD}/kernels/${KERNEL}
684 # --==## Put a filesystem into a BOOTMFS kernel ##==--
687 @echo "Running doMFSKERN for ${FSIMAGE}"
688 @rm -f ${RD}/kernels/BOOTMFS.${FSIMAGE}
689 @cd ${.CURDIR}/../sys/${MACHINE_ARCH}/conf && \
690 sh ${.CURDIR}/scripts/dokern.sh ${BIGBOOT} < ${KERNCONF} > BOOTMFS
691 .if ${MACHINE_ARCH} == "i386"
692 @echo "options INTRO_USERCONFIG" >> ${.CURDIR}/../sys/i386/conf/BOOTMFS
695 @echo "options \"MD_ROOT_SIZE=`cat mfsroot.size`\"" >> \
696 ${.CURDIR}/../sys/${MACHINE_ARCH}/conf/BOOTMFS
698 @cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=BOOTMFS
699 @rm -rf ${RD}/image.${FSIMAGE}
700 @mkdir ${RD}/image.${FSIMAGE}
701 @strip ${RD}/kernels/BOOTMFS
702 @cp ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE}
703 mv ${RD}/kernels/BOOTMFS ${RD}/image.${FSIMAGE}/kernel
704 @echo "Setting up /boot directory for ${FSIMAGE} floppy"
705 @mkdir -p ${RD}/image.${FSIMAGE}/boot
706 @cp /boot/boot[12] /boot/loader ${RD}/image.${FSIMAGE}/boot
707 .if !defined(BIGBOOT) || ${MACHINE_ARCH} == "alpha"
708 @echo "load /kernel" > ${RD}/image.${FSIMAGE}/boot/loader.rc
709 @echo "echo \\007\\007" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
710 @echo "echo Please insert MFS root floppy and press enter:" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
711 @echo "read" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
712 @echo "load -t mfs_root /mfsroot" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
714 @echo "echo \\007\\007" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
715 @echo "autoboot 10" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
716 @touch ${RD}/image.${FSIMAGE}/boot/loader.config
717 .if ${MACHINE_ARCH} == "i386"
718 @echo "-P" >> ${RD}/image.${FSIMAGE}/boot.config
721 @echo "Writing MFS image into kernel for ${FSIMAGE} floppy"
722 @./write_mfs_in_kernel ${RD}/image.${FSIMAGE}/kernel mfsroot
723 @cp ${RD}/image.${FSIMAGE}/kernel ${RD}/kernels/MFSKERNEL.${FSIMAGE}
725 @gzip -9v ${RD}/image.${FSIMAGE}/kernel
726 @touch ${RD}/image.${FSIMAGE}/kernel.config
727 @rm -f ${RD}/floppies/${FSIMAGE}.flp
729 sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/${FSIMAGE}.flp \
730 ${RD} ${MNT} ${BIGBOOTSIZE} ${RD}/image.${FSIMAGE} \
731 ${BOOTINODE} ${BIGBOOTLABEL}
733 sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/${FSIMAGE}.flp \
734 ${RD} ${MNT} ${BOOTSIZE} ${RD}/image.${FSIMAGE} \
735 ${BOOTINODE} ${BOOTLABEL}
737 @echo "Created ${RD}/floppies/${FSIMAGE}.flp"
739 .include <bsd.prog.mk>