1 # $Id: Makefile,v 1.331 1997/10/05 22:31:40 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 # Leave this on for now until we figure out how to build proper
29 # docs in the chrootdir.
32 # Things which without too much trouble can be considered variables
33 # BIN_DISTS are special in that they get full /etc installation sets.
35 COMPAT_DISTS?= compat1x compat20 compat21
36 OTHER_DISTS?= manpages catpages games proflibs dict info doc
37 CRYPTO_DISTS?= krb des
39 DISTRIBUTIONS?= ${BIN_DISTS} ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS}
42 # Extra source tarballs; each argument is a pair of source dir and
43 # distribution name. The dist name should not exceed 7 characters
44 # (another "s" for "source" will be prepended).
45 EXTRA_SRC+= usr.sbin/sendmail/cf smailcf
47 BOOT1= etc/protocols etc/rc.conf
49 # mountpoint for filesystems.
52 # other floppy parameters.
56 ZIPNSPLIT= gzip --no-name -9 -c | split -b 240640 -
58 # Upper size for the mfs in the boot.flp kernel.
59 # These are adjusted down to the minimum needed by doFS.sh.
65 # Things which may get you into trouble if you change them
66 MTREEFILES= ${.CURDIR}/../etc/mtree
73 # ${BOOTSTRAPDIR} is for those utilities that refer to the hosting
74 # environment, rather than the target environment. This is specifically
75 # intended for kernel-dependent utilities that are used during the build.
77 # ${BOOTSTRAPDIR} is actually being used by prepending it to the normal
78 # ${PATH}. Thus, it's also available to outside utilities like doFS.sh.
79 BOOTSTRAPDIR= /bootstrap
81 # The mount subsystem has been changed between 2.2 and 3.0 by the
83 BOOTSTRAPUTILS= /sbin/mount /sbin/umount
85 # 3.0 cpio tries to reference lchown(2) which is not available in 2.2
86 BOOTSTRAPUTILS+= /usr/bin/cpio
88 .if !defined(CRUNCH_TARGETS)
89 CRUNCH_TARGETS= boot fixit
99 REDOSED= sed -e 's/dirs/release.1/' -e 's/trees/release.2/' \
100 -e 's/kerns/release.3/' -e 's/sysinstall/release.4/' \
101 -e 's/fixup/release.5/' -e 's/tarbin/release.6/' \
102 -e 's/tarsrc/release.7/' -e 's/boot\.flp/release.8/' \
103 -e 's/fixit\.flp/release.9/' -e 's/ftp/ftp.1/' \
104 -e 's/cdrom/cdrom.1/'
106 REDOREDO!= echo ${REDO} | ${REDOSED}
109 .if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT)
110 @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false
113 .if exists(${CHROOTDIR})
114 chflags -R noschg ${CHROOTDIR}/.
117 -mkdir -p ${CHROOTDIR}
118 cd ${.CURDIR}/../etc && ${MAKE} distrib-dirs DESTDIR=${CHROOTDIR}
119 cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR}
120 cd ${.CURDIR}/.. && ${MAKE} install DESTDIR=${CHROOTDIR} NOMAN=1
121 mkdir ${CHROOTDIR}/${BOOTSTRAPDIR}
122 for i in ${BOOTSTRAPUTILS} ; do \
123 cp -p ${CHROOTDIR}$$i ${CHROOTDIR}/${BOOTSTRAPDIR} ; \
125 .if !defined(RELEASETAG)
126 cd ${CHROOTDIR}/usr && rm -rf src && \
127 cvs -d ${CVSROOT} co -P src
128 .if defined(INTCVSROOT)
129 cd ${CHROOTDIR}/usr && \
130 cvs -d ${INTCVSROOT} co -P src/secure src/crypto
133 cd ${CHROOTDIR}/usr && rm -rf src && \
134 cvs -d ${CVSROOT} co -P -r ${RELEASETAG} src
135 .if defined(INTCVSROOT)
136 cd ${CHROOTDIR}/usr && \
137 cvs -d ${INTCVSROOT} co -P -r ${RELEASETAG} src/secure src/crypto
140 .if defined(LOCAL_PATCHES) && exists(${LOCAL_PATCHES})
141 cd ${CHROOTDIR}/usr/src && patch --silent < ${LOCAL_PATCHES}
143 .if !defined(NOPORTS)
144 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -d ${CVSROOT} co -P ports && cd ports && make readmes
147 cd ${CHROOTDIR}/usr && rm -rf doc && cvs -d ${CVSROOT} co -P doc
151 .if !defined(RELEASENOUPDATE)
152 .if !defined(RELEASETAG)
153 cd ${CHROOTDIR}/usr/src && cvs -q update -P -d
155 cd ${CHROOTDIR}/usr/src && cvs -q update -P -d -r ${RELEASETAG}
157 .if !defined(NOPORTS)
158 cd ${CHROOTDIR}/usr/ports && cvs -q update -P -d
161 cd ${CHROOTDIR}/usr/doc && cvs -q update -P -d
165 # Add version information to those things that need it.
166 ( cd ${CHROOTDIR}/usr/src/sys/conf && \
167 mv newvers.sh foo && \
168 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh&& rm foo )
169 ( cd ${CHROOTDIR}/usr/src/release/sysinstall && \
170 sed "s/__RELEASE/${BUILDNAME}/" version.h > version.h.new && \
171 mv version.h.new version.h && \
173 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
174 echo "#!/bin/sh" > ${CHROOTDIR}/mk
175 echo "set -ex" >> ${CHROOTDIR}/mk
176 echo "export CFLAGS='-O2 -pipe'" >> ${CHROOTDIR}/mk
177 echo "export DISTRIBUTIONS=\"${DISTRIBUTIONS}\"" >> ${CHROOTDIR}/mk
178 echo "export BUILDNAME=${BUILDNAME}" >> ${CHROOTDIR}/mk
179 .if defined(RELEASETAG)
180 echo "export RELEASETAG=${RELEASETAG}" >> ${CHROOTDIR}/mk
183 echo "export NOPORTS=${NOPORTS}" >> ${CHROOTDIR}/mk
186 echo "export NODOC=${NODOC}" >> ${CHROOTDIR}/mk
189 echo "export NOSRC=${NOSRC}" >> ${CHROOTDIR}/mk
191 .if defined(NOSHARED)
192 echo "export NOSHARED=${NOSHARED}" >> ${CHROOTDIR}/mk
194 .if defined(BOOT_CONFIG)
195 echo "export BOOT_CONFIG=\"${BOOT_CONFIG}\"">> ${CHROOTDIR}/mk
197 # Don't remove this, or the build will fall over!
198 echo "export RELEASEDIR=/R" >> ${CHROOTDIR}/mk
199 echo "export PATH=${BOOTSTRAPDIR}:$${PATH}" >> ${CHROOTDIR}/mk
200 echo "cd /usr/src" >> ${CHROOTDIR}/mk
202 # This eases bootstrapping from a more recent hosting environment:
203 echo "mkdir -p /usr/lib/compat" >> ${CHROOTDIR}/mk
204 echo "chflags noschg /usr/lib/lib*.so.*" >> ${CHROOTDIR}/mk
205 echo "mv /usr/lib/lib*.so.* /usr/lib/compat" >> ${CHROOTDIR}/mk
206 echo "ldconfig /usr/lib /usr/lib/compat" >> ${CHROOTDIR}/mk
207 echo "(cd include; make all install)" >> ${CHROOTDIR}/mk
208 echo "(cd etc; make distrib-dirs distribution)" >> ${CHROOTDIR}/mk
209 echo "make world" >> ${CHROOTDIR}/mk
210 echo "(cd etc; make distribution)" >> ${CHROOTDIR}/mk
211 # Now we've got our own shared libs, remove the bootstrapping
213 echo "rm -f /usr/lib/compat/*" >> ${CHROOTDIR}/mk
214 echo "ldconfig /usr/lib" >> ${CHROOTDIR}/mk
217 echo "make all install" >> ${CHROOTDIR}/mk
219 echo "cd /usr/src/release/sysinstall" >> ${CHROOTDIR}/mk
220 echo "make obj" >> ${CHROOTDIR}/mk
221 echo "cd /usr/src/release" >> ${CHROOTDIR}/mk
222 echo "make objlink" >> ${CHROOTDIR}/mk
223 echo "(cd obj; rm -f ${REDOREDO})" >> ${CHROOTDIR}/mk
224 echo "make doRELEASE" >> ${CHROOTDIR}/mk
225 echo "echo make ${.TARGET} Finished" >> ${CHROOTDIR}/mk
226 chmod 755 ${CHROOTDIR}/mk
227 chroot ${CHROOTDIR} /mk
230 rm -rf boot_crunch release.[0-9]
232 # Clean out /R and make the directory structure.
235 chflags -R noschg /R/.
242 for i in ${DISTRIBUTIONS} ; do \
243 mkdir ${RD}/trees/$$i && \
244 mkdir ${RD}/dists/$$i && \
245 mtree -deU -f ${MTREEFILES}/BSD.root.dist \
246 -p ${RD}/trees/$$i > /dev/null && \
247 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
248 -p ${RD}/trees/$$i/usr > /dev/null && \
249 mtree -deU -f ${MTREEFILES}/BSD.include.dist \
250 -p ${RD}/trees/$$i/usr/include > /dev/null && \
251 mtree -deU -f ${MTREEFILES}/BSD.var.dist \
252 -p ${RD}/trees/$$i/var > /dev/null ; \
256 # Install the system into the various distributions.
258 cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/bin
259 cd ${.CURDIR}/.. && make distribute DISTDIR=${RD}/trees
260 .if exists(${.CURDIR}/../kerberosIV) && !defined(NOKERBEROS)
261 cd ${.CURDIR}/../kerberosIV && ( \
263 make obj all help-distribute DISTDIR=${RD}/trees &&\
267 chflags -R noschg ${RD}/trees
270 # Make and install the generic kernel(s).
272 .for kernel in ${KERNELS}
273 rm -f ${RD}/kernels/${kernel}
274 rm -rf ${.CURDIR}/../sys/compile/${kernel}
275 cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=${kernel}
276 rm -rf ${.CURDIR}/../sys/compile/${kernel}
277 ln -f ${RD}/kernels/${kernel} ${RD}/trees/bin/kernel.${kernel}
281 # Make and install the three crunched binaries which live on the floppies.
282 # You are not supposed to like this :-)
284 # NB: the "RELEASE_BUILD_FIXIT" magic prevents vi from including the
285 # Tcl and Perl APIs. See also /usr/src/usr.bin/vi/Makefile.
288 cd ${.CURDIR}/sysinstall && make obj depend all install
290 mkdir -p ${RD}/crunch
291 export RELEASE_BUILD_FIXIT=noway ; \
292 for j in ${CRUNCH_TARGETS} ; do \
293 rm -rf $${j}_crunch && \
294 mkdir $${j}_crunch && \
295 ( cd $${j}_crunch && \
296 crunchgen ${.CURDIR}/$${j}_crunch.conf && \
297 ${MAKE} -f $${j}_crunch.mk all NOCRYPT=yes \
298 "CFLAGS=${CFLAGS} -DCRUNCHED_BINARY") && \
299 mv $${j}_crunch/$${j}_crunch ${RD}/crunch/$${j} && \
300 true || { rm -rf $${j}_crunch ; false ; } ; \
305 # --==## Fix up the distributions. ##==--
308 # Handle some grief caused by the munition braindeadness.
309 for i in sbin/init bin/ed ; do \
310 ( cd ${.CURDIR}/../$$i; \
311 make -DNOCRYPT clean all distribute DISTDIR=${RD}/trees ) ; \
314 # Create any "synthetic dists" now.
315 @for i in ${DISTRIBUTIONS}; do \
316 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
317 echo -n "Running $$i dist creation script... "; \
318 env RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
323 # Create symlinks for the MD5-based crypt lib, too. The
324 # automatically created links still point to the DES stuff,
325 # which went into its own distribution.
326 for i in ${RD}/trees/bin/usr/lib/libscrypt* ; do \
327 c=`echo $$i | sed -e 's/libscrypt/libcrypt/'` ; \
329 ln -s `basename $$i` $$c ; \
332 # Remove all the directories we don't need.
334 find ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} -depth -type d -print | xargs rmdir
338 # --==## Package up the tarballs from assembled trees ##==--
343 @for i in ${DISTRIBUTIONS} ; \
345 if [ -d ${RD}/trees/$${i} ] ; then \
346 cd ${.CURDIR} && $(MAKE) doTARBALL \
347 SD=${RD}/trees/$${i} \
348 TN=$$i TD=$$i ARG="." && \
349 echo "$${i} distribution is finished."; \
352 # More munition braindeadness.
353 ( cd ${RD}/dists && \
354 if [ -f krb/krb.aa ] ; then mv krb/* des && rmdir krb ; fi )
359 # --==## Make source dists ##==--
363 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \
364 TD=src TN=sbase ARG="[A-Z]*"
365 @for i in `cd /usr/src && echo [a-z]*` ; do \
366 if [ -d /usr/src/$$i ] ; then \
367 cd ${.CURDIR} && $(MAKE) doTARBALL \
368 TN=`echo s$$i | tr -d '.' | sed 's/usr/u/'` \
369 SD=/usr/src TD=src ARG="$$i" ; \
372 .if defined(EXTRA_SRC)
373 @set ${EXTRA_SRC} && \
374 while [ $$# -ge 2 ] ; do \
375 if [ -d /usr/src/$$1 ] ; then \
376 cd ${.CURDIR} && $(MAKE) doTARBALL \
377 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
378 fi && shift && shift ; \
381 ( cd ${RD}/dists/src && \
382 if [ -f ssecure.aa ] ; then mv ssecure.* ../des ; fi && \
383 if [ -f scrypto.aa ] ; then mv scrypto.* ../des ; fi && \
384 if [ -f skerbero.aa ] ; then mv skerbero.* ../des ; fi ; )
385 @echo "src distribution is finished."
389 # Complete the bootfd
391 # Now, just to get this picture down once and for all:
393 # +------------------------------------------------------------------------+
395 # +-----+-----+------------------------------------------------------------+
396 # |boot1|boot2|floppy filesystem "bootfd" |
397 # +-----+-----+-+--------------------------------------------------------+-+
399 # +------------+-----------------------------------------+-+
400 # |mfs filesystem "mfsfd" |
401 # +-----------------------------------------+
404 release.8: write_mfs_in_kernel dumpnlist
408 mkdir -p etc dev mnt stand/help
409 @cp ${.CURDIR}/../sys/i386/boot/biosboot/boot.help ${RD}/mfsfd/stand
410 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
411 DIR=${RD}/mfsfd/stand ZIP=false
412 ( cd ${RD}/trees/bin/dev && \
413 ls console tty ttyv0 ttyv1 ttyv2 ttyv3 null zero \
414 *[swo]d* cuaa[01] cuaa[23] fd[01] rfd[01] \
415 cd0a mcd0a scd0a matcd0a wcd0c rst0 rft0 rwt0 | \
416 cpio -dump ${RD}/mfsfd/dev )
417 ( cd ${RD}/mfsfd/dev && rm -f *[swo]d*[bdefgh] )
418 cd ${RD}/trees/bin && ls ${BOOT1} | cpio -dump ${RD}/mfsfd/stand
419 echo "nameserver 42/tcp name" > ${RD}/mfsfd/stand/etc/services
420 echo "ftp 21/tcp" >> ${RD}/mfsfd/stand/etc/services
421 echo "domain 53/tcp nameserver" >> ${RD}/mfsfd/stand/etc/services
422 echo "domain 53/udp nameserver" >> ${RD}/mfsfd/stand/etc/services
423 echo "cmd 514/tcp shell" >> ${RD}/mfsfd/stand/etc/services
424 gzip -c ${.CURDIR}/../COPYRIGHT > ${RD}/mfsfd/stand/help/COPYRIGHT.hlp.gz
425 -test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
426 @echo "Making the regular boot floppy."
427 tar --exclude CVS -cf - -C ${.CURDIR}/sysinstall help | \
428 tar xvf - -C ${RD}/mfsfd/stand
429 @echo "Compressing doc files..."
430 @gzip -9 ${RD}/mfsfd/stand/help/*.hlp
431 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${BOOTMFSSIZE} ${RD}/mfsfd \
433 mv fs-image fs-image.std
434 mv fs-image.size fs-image.std.size
435 cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=std
436 mv ${RD}/floppies/bootstd.flp ${RD}/floppies/boot.flp
437 @echo "Regular boot floppy made."
441 # --==## Create a fixit floppy ##==--
446 cd ${RD}/fixitfd && \
447 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
448 usr/share/misc usr/mdec
449 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=fixit \
450 DIR=${RD}/fixitfd/stand ZIP=false
451 ( cd ${RD}/fixitfd/dev && \
452 sed -e '/^PATH/s/^/#/' ${RD}/trees/bin/dev/MAKEDEV > MAKEDEV && \
453 chmod 755 MAKEDEV && \
455 cp ${RD}/trees/bin/etc/spwd.db ${RD}/trees/bin/etc/group \
456 ${RD}/trees/bin/etc/protocols ${RD}/fixitfd/etc
457 cp ${RD}/trees/bin/usr/share/misc/scsi_modes \
458 ${RD}/fixitfd/usr/share/misc
459 cp ${RD}/trees/bin/usr/mdec/boot[12] ${RD}/fixitfd/usr/mdec
460 for type in fd od sd wd ; do \
461 ( cd ${RD}/fixitfd/usr/mdec && ln -s boot1 $${type}boot && \
462 ln -s boot2 boot$${type} ) ; \
464 cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
465 cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
466 cp ${.CURDIR}/tar.sh ${RD}/fixitfd/stand/tar
467 chmod 555 ${RD}/fixitfd/stand/tar
468 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${FDSIZE} ${RD}/fixitfd \
469 ${FIXITINODE} ${FDLABEL}
470 mv fs-image ${RD}/floppies/fixit.flp
471 # Do our last minute floppies directory setup in a convenient place.
472 cp ${.CURDIR}/README.TXT ${RD}/floppies/README.TXT
473 @(cd ${RD}/floppies; md5 * > CHECKSUM.MD5)
477 # --==## Setup a suitable ftp-area ##==--
481 cd ${RD} && find floppies -print | cpio -dumpl ${FD}
482 cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
483 cp ${.CURDIR}/ABOUT.TXT ${FD}/ABOUT.TXT
484 cp ${.CURDIR}/sysinstall/help/readme.hlp ${FD}/README.TXT
485 cp ${.CURDIR}/sysinstall/help/hardware.hlp ${FD}/HARDWARE.TXT
486 cp ${.CURDIR}/sysinstall/help/install.hlp ${FD}/INSTALL.TXT
487 cp ${.CURDIR}/sysinstall/help/relnotes.hlp ${FD}/RELNOTES.TXT
488 echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
489 .if !defined(NOPORTS)
490 tar -cBf - -C ${CD_DISC1} ports | tar -xBf - -C ${FD}
494 # --==## Setup a suitable cdrom-area ##==--
497 mkdir -p ${CD_DISC1} ${CD_DISC2}
498 cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
499 cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}
500 ln -f ${RD}/kernels/MFSKERNEL.std ${CD_DISC1}/kernel
501 ln -f ${RD}/trees/bin/usr/mdec/fbsdboot.exe ${CD_DISC1}
502 for i in ${DISTRIBUTIONS} ; \
504 if [ -d ${RD}/trees/$${i} ] ; then \
505 chflags -R noschg ${RD}/trees/$${i} ; \
506 ( cd ${RD}/trees/$${i} && \
507 find . -depth -print | cpio -dumpl ${CD_DISC2} ) ; \
510 rm -f ${CD_DISC2}/.profile
511 cp ${.CURDIR}/fixit.profile ${CD_DISC2}/.profile
512 echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
513 echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
514 cp ${.CURDIR}/ABOUT.TXT ${CD_DISC1}/ABOUT.TXT
515 cp ${.CURDIR}/sysinstall/help/readme.hlp ${CD_DISC1}/README.TXT
516 cp ${.CURDIR}/sysinstall/help/hardware.hlp ${CD_DISC1}/HARDWARE.TXT
517 cp ${.CURDIR}/sysinstall/help/install.hlp ${CD_DISC1}/INSTALL.TXT
518 cp ${.CURDIR}/sysinstall/help/relnotes.hlp ${CD_DISC1}/RELNOTES.TXT
519 .if !defined(NOPORTS)
520 tar -cBf - -C /usr ports | tar xBpf - -C ${CD_DISC2} && \
521 mkdir -p ${CD_DISC1}/ports && \
522 tar -czf ${CD_DISC1}/ports/ports.tgz -C /usr ports && \
523 cp ${.CURDIR}/scripts/ports-install.sh ${CD_DISC1}/ports/install.sh && \
524 (cd ${CD_DISC1}/ports; md5 * > CHECKSUM.MD5)
525 ln -s ../ports ${CD_DISC2}/usr/ports
529 cd /usr/doc && make all distribute DISTDIR=${RD}/trees
531 # Various "subroutine" and other supporting targets.
535 @echo "SD undefined in doTARBALL" && exit 1
538 @echo "TB undefined in doTARBALL" && exit 1
541 @echo "ARG undefined in doTARBALL" && exit 1
543 rm -rf ${RD}/dists/${TD}/${TN}*
544 mkdir -p ${RD}/dists/${TD}
546 tn=`echo ${TN} | tr '[A-Z]' '[a-z]' | cut -c1-8` && \
547 echo rolling ${TD}/$$tn tarball &&\
548 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
549 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
550 sh ${.CURDIR}/info.sh ${RD}/dists/${TD}/$$tn > \
551 ${RD}/dists/${TD}/$$tn.inf && \
552 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
553 cp -p ${.CURDIR}/scripts/$${TD}-install.sh ${RD}/dists/${TD}/install.sh; \
555 if [ "${SD}" != "/usr/src" ]; then \
556 mtree -c -i -p ${SD}/${ARG} \
557 -k gname,md5digest,mode,nlink,uname,size,link,type \
558 > ${RD}/dists/${TD}/$$tn.mtree ; \
562 (cd ${RD}/dists/${TD}; \
563 rm -f CHECKSUM.MD5; \
564 md5 * > CHECKSUM.MD5) \
567 doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 release.5 \
568 release.6 release.7 release.8 release.9
569 cd ${.CURDIR} && ${MAKE} ${EXTRAS}
573 cd ${.CURDIR} && ${MAKE} boot.flp
574 cd ${.CURDIR} && ${MAKE} fixit.flp
575 cd ${RD} && find floppies -print | cpio -dumpl ${FD}
578 rm -f release.4 release.8
579 cd ${.CURDIR} && ${MAKE} release.4 release.8 CRUNCH_TARGETS=boot
582 rm -f release.4 release.9
583 cd ${.CURDIR} && ${MAKE} release.4 release.9 CRUNCH_TARGETS=fixit
585 write_mfs_in_kernel: ${.CURDIR}/write_mfs_in_kernel.c
586 ${CC} ${CFLAGS} -o write_mfs_in_kernel ${.CURDIR}/write_mfs_in_kernel.c
588 dumpnlist: ${.CURDIR}/dumpnlist.c
589 ${CC} ${CFLAGS} -o dumpnlist ${.CURDIR}/dumpnlist.c
593 @echo "CRUNCH undefined in installCRUNCH" && exit 1
596 @echo "DIR undefined in installCRUNCH" && exit 1
599 @echo "ZIP undefined in installCRUNCH" && exit 1
602 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
604 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
606 chmod 555 ${DIR}/${CRUNCH}_crunch
607 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
608 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
612 # --==## Compile a kernel by name ${KERNEL} ##==--
614 # We don't erase the sys/compile/${KERNEL} directory, since somebody
615 # may want to reuse it (release.8 presently)
618 rm -f ${RD}/kernels/${KERNEL}
619 cd ${.CURDIR}/../sys/i386/conf && config -n ${KERNEL}
620 cd ${.CURDIR}/../sys/compile/${KERNEL} && \
623 cp kernel ${RD}/kernels/${KERNEL}
626 # --==## Put a filesystem into a BOOTMFS kernel ##==--
629 @rm -f ${RD}/kernels/BOOTMFS.${FSIMAGE}
630 @rm -f /sys/compile/BOOTMFS/mfs_vfsops.o
631 @cd ${.CURDIR}/../sys/i386/conf && \
636 -e 's/GENERIC/BOOTMFS/g' \
637 -e '/maxusers/s/10/4/' < GENERIC > BOOTMFS && \
638 echo "options MFS" >> BOOTMFS && \
639 echo "options NFS_NOSERVER" >> BOOTMFS && \
640 echo 'options "MAXCONS=4"' >> BOOTMFS && \
641 echo "options USERCONFIG_BOOT" >> BOOTMFS
642 @echo "options \"MFS_ROOT=`cat fs-image.${FSIMAGE}.size`\"" >> \
643 ${.CURDIR}/../sys/i386/conf/BOOTMFS
644 cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=BOOTMFS
645 @rm -rf ${RD}/boot.${FSIMAGE}
646 @mkdir ${RD}/boot.${FSIMAGE}
647 @mv ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE}
648 @cp ${RD}/kernels/BOOTMFS.${FSIMAGE} ${RD}/boot.${FSIMAGE}/kernel
649 .if defined(BOOT_CONFIG)
650 @echo "${BOOT_CONFIG}" >${RD}/boot.${FSIMAGE}/boot.config
652 @vnconfig /dev/vn0 fs-image.${FSIMAGE}
653 @mkdir -p /tmp/mnt_xx
654 @mount /dev/vn0 /tmp/mnt_xx
655 ./dumpnlist ${RD}/boot.${FSIMAGE}/kernel > /tmp/mnt_xx/stand/symbols
657 @vnconfig -u /dev/vn0
659 ./write_mfs_in_kernel ${RD}/boot.${FSIMAGE}/kernel \
661 kzip -v ${RD}/boot.${FSIMAGE}/kernel
662 @mv ${RD}/boot.${FSIMAGE}/kernel ${RD}/kernels/MFSKERNEL.${FSIMAGE}
663 @mv ${RD}/boot.${FSIMAGE}/kernel.kz ${RD}/boot.${FSIMAGE}/kernel
664 @cp ${.CURDIR}/../sys/i386/boot/biosboot/boot.help ${RD}/boot.${FSIMAGE}
665 @touch ${RD}/boot.${FSIMAGE}/boot.config
666 @touch ${RD}/boot.${FSIMAGE}/kernel.config
667 @rm -f ${RD}/floppies/boot${FSIMAGE}.flp
668 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${FDSIZE} ${RD}/boot.${FSIMAGE} \
669 ${BOOTINODE} ${FDLABEL}
670 mv fs-image ${RD}/floppies/boot${FSIMAGE}.flp
672 .include <bsd.prog.mk>