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
28 # Non-zero if ${RELEASETAG} is in the form "RELENG_ver_RELEASE"; we
29 # are building an official release. Otherwise, we are building for
31 .if defined(RELEASETAG)
32 ISRELEASE!= expr ${RELEASETAG} : '^RELENG_.*_RELEASE$$' || true
34 # Convert "RELENG_ver_RELEASE" to "RELEASE_ver" for ports and doc trees.
35 AUXRELEASETAG!= echo ${RELEASETAG} | sed -e 's/^RELENG_/RELEASE_/' -e 's/_RELEASE$$//'
41 # If you are using a local CVS repository with components stored in
42 # non-standard modules, override these on the make commandline or
44 RELEASESRCMODULE?= src
45 RELEASEDOCMODULE?= doc
46 RELEASEPORTSMODULE?= ports
48 # Unless set elsewhere, indicate the object format we'll be using.
51 # Uncomment this to disable the doc.1 target. It is also an ERROR
52 # to set NOPORTS and not set NODOC since docs depend on ports.
55 # Set ALLLANG=no if you want the release documentation to be
58 DOCPORTS= textproc/docproj
59 # Set this to wherever the distfiles required by ${DOCPORTS} live.
60 DOCDISTFILES?= ${.CURDIR}/../../ports/distfiles
61 # Set this to 1 if you want -P to be used for automatic keyboard detection
62 # on the boot floppy. WARNING: Breaks on some Athlon (K7) motherboards.
63 AUTO_KEYBOARD_DETECT?= 0
66 DIST_DOCS= ABOUT.TXT ERRATA.TXT LAYOUT.TXT README.TXT HARDWARE.TXT \
67 RELNOTES.TXT TROUBLE.TXT UPGRADE.TXT INSTALL.TXT
69 # Things which without too much trouble can be considered variables
70 # BIN_DISTS are special in that they get full /etc installation sets.
72 COMPAT_DISTS?= compat1x compat20 compat21 compat22 compat3x
73 OTHER_DISTS?= manpages catpages games proflibs dict info doc
74 CRYPTO_DISTS?= crypto krb4 krb5
76 DISTRIBUTIONS?= ${BIN_DISTS} ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS}
79 # Extra source tarballs; each argument is a pair of source dir and
80 # distribution name. The dist name should not exceed 7 characters
81 # (another "s" for "source" will be prepended).
82 EXTRA_SRC+= usr.sbin/sendmail/cf smailcf
84 BOOT1= etc/protocols etc/defaults/rc.conf
86 # mountpoint for filesystems.
89 # Various floppy image parameters.
100 BIGBOOTLABEL= minimum2
104 .if ${MACHINE_ARCH} == "alpha"
109 ZIPNSPLIT= gzip --no-name -9 -c | split -b 240640 -
114 # Things which may get you into trouble if you change them
115 MTREEFILES= ${.CURDIR}/../etc/mtree
120 CD_DISC1= ${CD}/disc1
121 CD_DISC2= ${CD}/disc2
123 # Where the bootstrap ports (see DOCPORTS) get installed.
124 LOCALDIR= /usr/local/bin
126 # ${BOOTSTRAPDIR} is for those utilities that refer to the hosting
127 # environment, rather than the target environment. This is specifically
128 # intended for kernel-dependent utilities that are used during the build.
130 # ${BOOTSTRAPDIR} is actually being used by prepending it to the normal
131 # ${PATH}. Thus, it's also available to outside utilities like doFS.sh.
132 BOOTSTRAPDIR= /bootstrap
134 # The mount subsystem has been changed between 2.2 and 3.0 by the
136 BOOTSTRAPUTILS= /sbin/mount /sbin/umount
138 # 3.0 cpio tries to reference lchown(2) which is not available in 2.2
139 BOOTSTRAPUTILS+= /usr/bin/cpio
141 .if !defined(CRUNCH_TARGETS)
142 CRUNCH_TARGETS= boot fixit
145 .if ${MACHINE_ARCH} == "i386"
146 # Make both PC-card boot.flp and plain boot.flp
147 EXTRAS= floppies cdrom.1 ftp.1
149 EXTRAS= cdrom.1 ftp.1
156 .if !defined(NOPORTREADMES)
157 MAKEREADMES= make readmes PORTSDIR=${CHROOTDIR}/usr/ports
163 .if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT)
164 @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false
167 .if exists(${CHROOTDIR})
168 # The first command will fail on a handful of files that have their schg
169 # flags set. But it greatly speeds up the next two commands.
170 -rm -rf ${CHROOTDIR} 2>/dev/null
171 -chflags -R noschg ${CHROOTDIR}/.
174 mkdir -p ${CHROOTDIR}
175 cd ${.CURDIR}/../etc && ${MAKE} distrib-dirs DESTDIR=${CHROOTDIR}
176 cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR}
177 if [ -f /etc/resolv.conf ]; then \
178 cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \
180 cd ${.CURDIR}/.. && ${MAKE} installworld DESTDIR=${CHROOTDIR} NOMAN=1
181 mkdir ${CHROOTDIR}/${BOOTSTRAPDIR}
182 for i in ${BOOTSTRAPUTILS} ; do \
183 cp -p ${CHROOTDIR}$$i ${CHROOTDIR}/${BOOTSTRAPDIR} ; \
185 .if !defined(RELEASETAG)
186 cd ${CHROOTDIR}/usr && rm -rf src && \
187 cvs -R -d ${CVSROOT} co -P ${RELEASESRCMODULE}
189 cd ${CHROOTDIR}/usr && rm -rf src && \
190 cvs -R -d ${CVSROOT} co -P -r ${RELEASETAG} ${RELEASESRCMODULE}
192 .if defined(LOCAL_PATCHES) && exists(${LOCAL_PATCHES})
193 cd ${CHROOTDIR}/usr/src && patch ${PATCH_FLAGS} < ${LOCAL_PATCHES}
195 .if defined(LOCAL_SCRIPT) && exists(${LOCAL_SCRIPT})
196 cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT}
198 .if !defined(NOPORTS)
199 .if defined(AUXRELEASETAG)
200 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P -r ${AUXRELEASETAG} ${RELEASEPORTSMODULE} && cd ports && ${MAKEREADMES}
202 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P ${RELEASEPORTSMODULE} && cd ports && ${MAKEREADMES}
206 .if defined(AUXRELEASETAG)
207 cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co -P -r ${AUXRELEASETAG} ${RELEASEDOCMODULE}
209 cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co -P ${RELEASEDOCMODULE}
211 if [ -d ${DOCDISTFILES}/ ]; then \
212 cp -rp ${DOCDISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \
217 .if !defined(RELEASENOUPDATE)
218 .if !defined(RELEASETAG)
219 cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d
221 cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d -r ${RELEASETAG}
223 .if !defined(NOPORTS)
224 cd ${CHROOTDIR}/usr/ports && cvs -R -q update -P -d
227 cd ${CHROOTDIR}/usr/doc && cvs -R -q update -P -d
231 # Add version information to those things that need it.
232 ( cd ${CHROOTDIR}/usr/src/sys/conf && \
233 mv newvers.sh foo && \
234 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && rm foo )
235 echo OBJFORMAT=${OBJFORMAT} > ${CHROOTDIR}/etc/objformat
236 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
237 echo "#!/bin/sh" > ${CHROOTDIR}/mk
238 echo "set -ex" >> ${CHROOTDIR}/mk
239 echo "_RELTARGET=\$${1:-doRELEASE}" >> ${CHROOTDIR}/mk
240 echo "export CFLAGS='-O -pipe'" >> ${CHROOTDIR}/mk
241 echo "export DISTRIBUTIONS=\"${DISTRIBUTIONS}\"" >> ${CHROOTDIR}/mk
242 echo "export BUILDNAME=${BUILDNAME}" >> ${CHROOTDIR}/mk
243 echo "export VNDEVICE=${VNDEVICE}" >> ${CHROOTDIR}/mk
244 echo "export OBJFORMAT=${OBJFORMAT}" >> ${CHROOTDIR}/mk
245 .if defined(RELEASETAG)
246 echo "export RELEASETAG=${RELEASETAG}" >> ${CHROOTDIR}/mk
249 echo "export NOPORTS=${NOPORTS}" >> ${CHROOTDIR}/mk
252 echo "export NODOC=${NODOC}" >> ${CHROOTDIR}/mk
254 .if defined(ALLLANG) && ${ALLLANG} != "NO" && ${ALLLANG} != "no"
255 echo "export ALLLANG=${ALLLANG}" >> ${CHROOTDIR}/mk
257 echo "export DOC_LANG=en_US.ISO_8859-1" >> ${CHROOTDIR}/mk
260 echo "export NOSRC=${NOSRC}" >> ${CHROOTDIR}/mk
262 .if defined(NOSHARED)
263 echo "export NOSHARED=${NOSHARED}" >> ${CHROOTDIR}/mk
265 .if defined(USA_RESIDENT)
266 echo "export USA_RESIDENT=${USA_RESIDENT}" >> ${CHROOTDIR}/mk
268 .if defined(BOOT_CONFIG)
269 echo "export BOOT_CONFIG=\"${BOOT_CONFIG}\"">> ${CHROOTDIR}/mk
271 # Don't remove this, or the build will fall over!
272 echo "export RELEASEDIR=${_R}" >> ${CHROOTDIR}/mk
273 echo "export PATH=${BOOTSTRAPDIR}:$${PATH}:${LOCALDIR}" >> ${CHROOTDIR}/mk
274 echo "if [ ! -f /tmp/.world_done ]; then" >> ${CHROOTDIR}/mk
275 echo " cd /usr/src" >> ${CHROOTDIR}/mk
277 echo " (cd etc; make distrib-dirs distribution)" >> ${CHROOTDIR}/mk
278 echo " make world && \\" >> ${CHROOTDIR}/mk
281 echo " make all install && \\" >> ${CHROOTDIR}/mk
283 echo " touch /tmp/.world_done" >> ${CHROOTDIR}/mk
284 echo "fi" >> ${CHROOTDIR}/mk
285 echo "cd /usr/src/release/sysinstall" >> ${CHROOTDIR}/mk
286 echo "make obj" >> ${CHROOTDIR}/mk
287 echo "cd /usr/src/release" >> ${CHROOTDIR}/mk
288 echo "make \$${_RELTARGET}" >> ${CHROOTDIR}/mk
289 echo "echo make ${.TARGET} Finished" >> ${CHROOTDIR}/mk
290 chmod 755 ${CHROOTDIR}/mk
291 chroot ${CHROOTDIR} /mk
294 rm -rf boot_crunch ${.OBJDIR}/boot_crunch.conf release.[0-9]
296 # Clean out ${_R} and make the directory structure.
299 -rm -rf ${_R}/* 2> /dev/null
300 -chflags -R noschg ${_R}/.
307 for i in ${DISTRIBUTIONS} ; do \
308 mkdir ${RD}/trees/$$i && \
309 mkdir ${RD}/dists/$$i && \
310 mtree -deU -f ${MTREEFILES}/BSD.root.dist \
311 -p ${RD}/trees/$$i > /dev/null && \
312 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
313 -p ${RD}/trees/$$i/usr > /dev/null && \
314 mtree -deU -f ${MTREEFILES}/BSD.include.dist \
315 -p ${RD}/trees/$$i/usr/include > /dev/null && \
316 mtree -deU -f ${MTREEFILES}/BSD.var.dist \
317 -p ${RD}/trees/$$i/var > /dev/null ; \
321 # Install the system into the various distributions.
323 cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/bin
324 cd ${.CURDIR}/.. && make distribute DISTDIR=${RD}/trees
325 .if exists(${.CURDIR}/../kerberosIV) && exists(${.CURDIR}/../crypto) && !defined(NOKERBEROS)
326 cd ${.CURDIR}/../kerberosIV && ( \
328 make obj all help-distribute DISTDIR=${RD}/trees &&\
332 .if exists(${.CURDIR}/../kerberos5) && exists(${.CURDIR}/../crypto) && !defined(NOKERBEROS)
333 cd ${.CURDIR}/../kerberos5 && ( \
335 make obj all help-distribute DISTDIR=${RD}/trees &&\
339 -chflags -R noschg ${RD}/trees
342 # Make and install the generic kernel(s).
344 .for kernel in ${KERNELS}
345 rm -f ${RD}/kernels/${kernel}
346 rm -rf ${.CURDIR}/../sys/compile/${kernel}
347 cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=${kernel}
348 rm -rf ${.CURDIR}/../sys/compile/${kernel}
349 ln -f ${RD}/kernels/${kernel} ${RD}/trees/bin/kernel.${kernel}
353 # Make and install the three crunched binaries which live on the floppies.
354 # You are not supposed to like this :-)
356 # NB: the "RELEASE_BUILD_FIXIT" magic prevents vi from including the
357 # Tcl and Perl APIs. See also /usr/src/usr.bin/vi/Makefile.
358 # It also prevents ls linking against termcap by disabling color support.
359 # See /usr/src/bin/ls/Makefile.
362 cp ${.CURDIR}/boot_crunch.conf.generic ${.OBJDIR}/boot_crunch.conf
363 cd ${.CURDIR}/sysinstall && make obj depend all install
365 mkdir -p ${RD}/crunch
366 export RELEASE_BUILD_FIXIT=noway ; \
367 for j in ${CRUNCH_TARGETS} ; do \
368 rm -rf $${j}_crunch && \
369 mkdir $${j}_crunch && \
370 ( cd $${j}_crunch && \
371 ( ( [ -f ${.CURDIR}/$${j}_crunch.conf ] && \
372 crunchgen ${.CURDIR}/$${j}_crunch.conf ) || \
373 ( [ -f ${.OBJDIR}/$${j}_crunch.conf ] && \
374 crunchgen ${.OBJDIR}/$${j}_crunch.conf ) ) && \
375 ${MAKE} -DRELEASE_CRUNCH -f $${j}_crunch.mk subclean all \
376 NOCRYPT=yes "CFLAGS=${CFLAGS} -DCRUNCHED_BINARY") && \
377 mv $${j}_crunch/$${j}_crunch ${RD}/crunch/$${j} && \
378 true || { rm -rf $${j}_crunch ; false ; } ; \
383 # --==## Fix up the distributions. ##==--
386 # Handle some grief caused by the munition braindeadness.
387 for i in sbin/init bin/ed usr.sbin/ppp usr.sbin/pppd ; do \
388 ( cd ${.CURDIR}/../$$i; \
389 make -DNOCRYPT clean all distribute DISTDIR=${RD}/trees ) ; \
392 # Create any "synthetic dists" now.
393 @for i in ${DISTRIBUTIONS}; do \
394 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
395 echo -n "Running $$i dist creation script... "; \
396 env OBJFORMAT=${OBJFORMAT} RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
401 # Create symlinks for the MD5-based crypt lib, too. The
402 # automatically created links still point to the DES stuff,
403 # which went into its own distribution.
404 for i in ${RD}/trees/bin/usr/lib/libscrypt* ; do \
405 c=`echo $$i | sed -e 's/libscrypt/libcrypt/'` ; \
407 ln -s `basename $$i` $$c ; \
410 # Remove all the directories we don't need.
412 find ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} -depth -type d -print | xargs rmdir
416 # --==## Package up the tarballs from assembled trees ##==--
421 @for i in ${DISTRIBUTIONS} ; \
423 if [ -d ${RD}/trees/$${i} ] ; then \
424 cd ${.CURDIR} && $(MAKE) doTARBALL \
425 SD=${RD}/trees/$${i} \
426 TN=$$i TD=$$i ARG="." && \
427 echo "$${i} distribution is finished."; \
430 # More munition braindeadness.
431 ( cd ${RD}/dists && \
432 if [ -f krb4/krb4.aa ] ; then mv krb4/* crypto && rmdir krb4 ; fi )
433 ( cd ${RD}/dists && \
434 if [ -f krb5/krb5.aa ] ; then mv krb5/* crypto && rmdir krb5 ; fi )
439 # --==## Make source dists ##==--
443 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \
444 TD=src TN=sbase ARG="[A-Z]*"
445 @for i in `cd /usr/src && echo [a-z]*` ; do \
446 if [ -d /usr/src/$$i ] ; then \
447 cd ${.CURDIR} && $(MAKE) doTARBALL \
448 TN=`echo s$$i | tr -d '.' | \
450 -e 's/kerberosIV/krb4/' \
451 -e 's/kerberos5/krb5/'` \
452 SD=/usr/src TD=src ARG="$$i" ; \
455 .if defined(EXTRA_SRC)
456 @set ${EXTRA_SRC} && \
457 while [ $$# -ge 2 ] ; do \
458 if [ -d /usr/src/$$1 ] ; then \
459 cd ${.CURDIR} && $(MAKE) doTARBALL \
460 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
461 fi && shift && shift ; \
464 if [ -d ${RD}/dists/crypto ] ; then ( cd ${RD}/dists/src && \
465 if [ -f ssecure.aa ] ; then mv ssecure.* ../crypto ; fi && \
466 if [ -f scrypto.aa ] ; then mv scrypto.* ../crypto ; fi && \
467 if [ -f skrb4.aa ] ; then mv skrb4.* ../crypto ; fi && \
468 if [ -f skrb5.aa ] ; then mv skrb5.* ../crypto ; fi ; ) ; fi
469 @echo "src distribution is finished."
473 # Complete the bootfd
475 # Now, just to get this picture down once and for all:
477 # +------------------------------------------------------------------------+
479 # +-----+-----+------------------------------------------------------------+
480 # |boot1|boot2|floppy filesystem "bootfd" |
481 # +-----+-----+-+--------------------------------------------------------+-+
483 # +------------+-----------------------------------------+-+
484 # |mfs filesystem "mfsfd" |
485 # +-----------------------------------------+
488 release.8: write_mfs_in_kernel
492 mkdir -p etc/defaults dev mnt stand/help
493 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
494 DIR=${RD}/mfsfd/stand ZIP=false
495 ( cd ${RD}/trees/bin/dev && \
496 ls console tty bpf0 ttyv0 ttyv1 ttyv2 ttyv3 null zero card0 card1 card2 card3 usb usb0 uhid0 ums0 ulpt0 ugen0 kbd0 | \
497 cpio -dump ${RD}/mfsfd/dev )
498 ( cd ${RD}/mfsfd/dev && rm -f *[swo]d*[bdefgh] )
499 ( cd ${RD}/mfsfd && mkdir -p bin sbin && ln -s /stand/sh bin/sh )
500 cp /sbin/dhclient-script ${RD}/mfsfd/sbin
501 cp ${.CURDIR}/../etc/defaults/pccard.conf ${RD}/mfsfd/etc/defaults/pccard.conf
502 cp ${.CURDIR}/../etc/usbd.conf ${RD}/mfsfd/etc/usbd.conf
503 cd ${RD}/trees/bin && ls ${BOOT1} | cpio -dump ${RD}/mfsfd/stand
504 echo "nameserver 42/tcp name" > ${RD}/mfsfd/stand/etc/services
505 echo "ftp 21/tcp" >> ${RD}/mfsfd/stand/etc/services
506 echo "domain 53/tcp nameserver" >> ${RD}/mfsfd/stand/etc/services
507 echo "domain 53/udp nameserver" >> ${RD}/mfsfd/stand/etc/services
508 echo "cmd 514/tcp shell" >> ${RD}/mfsfd/stand/etc/services
509 gzip -9c ${.CURDIR}/../COPYRIGHT > ${RD}/mfsfd/stand/help/COPYRIGHT.hlp.gz
510 @for i in README.TXT RELNOTES.TXT INSTALL.TXT UPGRADE.TXT HARDWARE.TXT; do \
511 if [ -f ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} ]; then \
512 gzip -9c ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} > ${RD}/mfsfd/stand/help/$${i}.gz; \
514 gzip -9c ${.CURDIR}/texts/$${i} > ${RD}/mfsfd/stand/help/$${i}.gz; \
517 -test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
518 @mkdir -p ${RD}/mfsfd/boot
519 @cp /boot/boot* ${RD}/mfsfd/boot
520 @cp /boot/loader.help ${RD}/mfsfd/boot
521 @echo "Making the regular boot floppy."
522 @tar --exclude CVS -cf - -C ${.CURDIR}/sysinstall help | \
523 tar xf - -C ${RD}/mfsfd/stand
524 @echo "Compressing doc files..."
525 @gzip -9 ${RD}/mfsfd/stand/help/*.hlp
526 sh -e ${.CURDIR}/scripts/doFS.sh -s mfsroot ${RD} ${MNT} \
527 ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL}
528 @gzip -9vc mfsroot > mfsroot.gz
529 @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/mfsroot.flp \
530 ${RD} ${MNT} ${BOOTSIZE} mfsroot.gz ${BOOTINODE} ${BOOTLABEL}
531 @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=kern
532 @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=boot BIGBOOT=YES
533 @rm mfsroot mfsroot.gz mfsroot.size
534 @echo "Regular and MFS boot floppies made."
538 # --==## Create a fixit floppy ##==--
541 @echo "Making fixit floppy."
542 @rm -rf ${RD}/fixitfd
544 @cd ${RD}/fixitfd && \
545 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
547 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=fixit \
548 DIR=${RD}/fixitfd/stand ZIP=false
549 @( cd ${RD}/fixitfd/dev && \
550 sed -e '/^PATH/s/^/#/' ${RD}/trees/bin/dev/MAKEDEV > MAKEDEV && \
551 chmod 755 MAKEDEV && \
553 @cp ${RD}/trees/bin/etc/spwd.db ${RD}/trees/bin/etc/group \
554 ${RD}/trees/bin/etc/protocols ${RD}/fixitfd/etc
555 @cp ${RD}/trees/bin/usr/share/misc/scsi_modes \
556 ${RD}/fixitfd/usr/share/misc
557 @cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
558 @cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
559 @cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar
560 @chmod 555 ${RD}/fixitfd/stand/tar
561 @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/fixit.flp ${RD} \
562 ${MNT} ${FIXITSIZE} ${RD}/fixitfd ${FIXITINODE} ${FIXITLABEL}
563 # Do our last minute floppies directory setup in a convenient place.
564 @cp ${.CURDIR}/texts/FLOPPIES.TXT ${RD}/floppies/README.TXT
565 @(cd ${RD}/floppies; md5 README.TXT *.flp > CHECKSUM.MD5)
569 # --==## Setup a suitable ftp-area ##==--
572 @echo "Setting up FTP distribution area"
574 -@ln -s . ${FD}/${BUILDNAME}
575 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
576 @cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
577 @for i in ${DIST_DOCS}; do \
578 if [ -f ${.CURDIR}/texts/$${i} ]; then \
579 cp ${.CURDIR}/texts/$${i} ${FD}; \
581 if [ -f ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} ]; then \
582 echo "=== Platform specifics for ${MACHINE_ARCH}" >> ${FD}/$${i}; \
583 cat ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} >> ${FD}/$${i}; \
586 @echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
587 .if !defined(NOPORTS)
588 @tar --exclude CVS -cBf - -C ${CD_DISC1} ports | tar -xBf - -C ${FD}
592 # --==## Setup a suitable cdrom-area ##==--
595 @echo "Setting up CDROM distribution area"
596 @mkdir -p ${CD_DISC1} ${CD_DISC2}
597 @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
598 @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}
599 @ln -f ${RD}/kernels/MFSKERNEL.boot ${CD_DISC1}/kernel
600 @for i in ${DISTRIBUTIONS} ; \
602 if [ -d ${RD}/trees/$${i} ] ; then \
603 chflags -R noschg ${RD}/trees/$${i} || true ; \
604 ( cd ${RD}/trees/$${i} && \
605 find . -depth -print | cpio -dumpl ${CD_DISC2} ) ; \
608 @rm -f ${CD_DISC2}/.profile
609 @cp ${.CURDIR}/fixit.profile ${CD_DISC2}/.profile
610 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
611 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
612 @for i in ${DIST_DOCS}; do \
613 if [ -f ${.CURDIR}/texts/$${i} ]; then \
614 cp ${.CURDIR}/texts/$${i} ${CD_DISC1}; \
616 if [ -f ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} ]; then \
617 echo "=== Platform specifics for ${MACHINE_ARCH}" >> ${CD_DISC1}/$${i}; \
618 cat ${.CURDIR}/texts/${MACHINE_ARCH}/$${i} >> ${CD_DISC1}/$${i}; \
621 .if ${MACHINE_ARCH} == "alpha"
622 @echo "Setting up Alpha CD disc1 for booting"
623 @cp -Rp ${RD}/image.boot/boot ${CD_DISC1}
624 @ln -f ${CD_DISC2}/boot/cdboot ${CD_DISC1}/boot
625 @ln -f ${CD_DISC1}/boot/loader.rc ${CD_DISC2}/boot
626 @ln -f ${CD_DISC1}/kernel ${CD_DISC2}/kernel
628 .if !defined(NOPORTS)
629 @-rm -rf /usr/ports/distfiles/*
630 @mkdir -p ${CD_DISC1}/ports && \
631 tar --exclude CVS -czf ${CD_DISC1}/ports/ports.tgz -C /usr ports && \
632 cp ${.CURDIR}/scripts/ports-install.sh ${CD_DISC1}/ports/install.sh \
633 && (cd ${CD_DISC1}/ports; md5 * > CHECKSUM.MD5)
637 @echo "Making docs..."
638 @for i in ${DOCPORTS}; do \
639 cd /usr/ports/$$i && make all install clean JADETEX=no FORCE_PKG_REGISTER=yes; \
641 @cd /usr/doc && make all install 'FORMATS=html html-split txt' INSTALL_COMPRESSED='' DOCDIR=${RD}/trees/bin/usr/share/doc
644 # Various "subroutine" and other supporting targets.
652 @echo "SD undefined in doTARBALL" && exit 1
655 @echo "TB undefined in doTARBALL" && exit 1
658 @echo "ARG undefined in doTARBALL" && exit 1
660 @rm -rf ${RD}/dists/${TD}/${TN}*
661 @mkdir -p ${RD}/dists/${TD}
663 tn=`echo ${TN} | tr '[A-Z]' '[a-z]' | cut -c1-8` && \
664 echo rolling ${TD}/$$tn tarball &&\
665 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
666 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
667 sh ${.CURDIR}/scripts/info.sh ${RD}/dists/${TD}/$$tn > \
668 ${RD}/dists/${TD}/$$tn.inf && \
669 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
670 cp -p ${.CURDIR}/scripts/$${TD}-install.sh ${RD}/dists/${TD}/install.sh; \
672 if [ "${SD}" != "/usr/src" ]; then \
673 mtree -c -i -p ${SD}/${ARG} \
674 -k gname,md5digest,mode,nlink,uname,size,link,type \
675 > ${RD}/dists/${TD}/$$tn.mtree ; \
679 (cd ${RD}/dists/${TD}; \
680 rm -f CHECKSUM.MD5; \
681 md5 * > CHECKSUM.MD5) \
684 doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 release.5 \
685 release.6 release.7 release.8 release.9
686 @cd ${.CURDIR} && ${MAKE} ${EXTRAS}
690 @cd ${.CURDIR} && ${MAKE} boot.flp
691 @cd ${.CURDIR} && ${MAKE} fixit.flp
692 @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
695 @rm -f release.4 release.8
696 @cd ${.CURDIR} && ${MAKE} release.4 release.8 CRUNCH_TARGETS=boot
699 @rm -f release.4 release.9
700 @cd ${.CURDIR} && ${MAKE} release.4 release.9 CRUNCH_TARGETS=fixit
702 write_mfs_in_kernel: ${.CURDIR}/write_mfs_in_kernel.c
703 ${CC} ${CFLAGS} -o write_mfs_in_kernel ${.CURDIR}/write_mfs_in_kernel.c
707 @echo "CRUNCH undefined in installCRUNCH" && exit 1
710 @echo "DIR undefined in installCRUNCH" && exit 1
713 @echo "ZIP undefined in installCRUNCH" && exit 1
716 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
718 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
720 @chmod 555 ${DIR}/${CRUNCH}_crunch
721 @if [ -f ${.OBJDIR}/${CRUNCH}_crunch.conf ] ; then \
722 for i in `crunchgen -l ${.OBJDIR}/${CRUNCH}_crunch.conf` ; do \
723 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
726 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
727 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
732 # --==## Compile a kernel by name ${KERNEL} ##==--
734 # We don't erase the sys/compile/${KERNEL} directory, since somebody
735 # may want to reuse it (release.8 presently)
738 @rm -f ${RD}/kernels/${KERNEL}
739 @cd ${.CURDIR}/../sys/${MACHINE_ARCH}/conf && config ${KERNEL}
740 @cd ${.CURDIR}/../sys/compile/${KERNEL} && \
743 strip --strip-debug ${KERNEL} && \
744 cp ${KERNEL} ${RD}/kernels/${KERNEL}
747 # --==## Put a filesystem into a BOOTMFS kernel ##==--
750 @echo "Running doMFSKERN for ${FSIMAGE}"
751 @rm -f ${RD}/kernels/BOOTMFS.${FSIMAGE}
752 @cd ${.CURDIR}/../sys/${MACHINE_ARCH}/conf && \
753 sh ${.CURDIR}/scripts/dokern.sh ${BIGBOOT} < ${KERNCONF} > BOOTMFS
754 .if ${MACHINE_ARCH} == "i386"
755 @echo "options INTRO_USERCONFIG" >> ${.CURDIR}/../sys/i386/conf/BOOTMFS
758 @echo "options \"MD_ROOT_SIZE=`cat mfsroot.size`\"" >> \
759 ${.CURDIR}/../sys/${MACHINE_ARCH}/conf/BOOTMFS
761 @cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=BOOTMFS
762 @rm -rf ${RD}/image.${FSIMAGE}
763 @mkdir ${RD}/image.${FSIMAGE}
764 @strip ${RD}/kernels/BOOTMFS
765 @cp ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE}
766 mv ${RD}/kernels/BOOTMFS ${RD}/image.${FSIMAGE}/kernel
767 @echo "Setting up /boot directory for ${FSIMAGE} floppy"
768 @mkdir -p ${RD}/image.${FSIMAGE}/boot
769 @cp /boot/boot[12] /boot/loader ${RD}/image.${FSIMAGE}/boot
770 .if !defined(BIGBOOT)
771 @echo "load /kernel" > ${RD}/image.${FSIMAGE}/boot/loader.rc
772 @echo "echo \\007\\007" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
773 @echo "echo Please insert MFS root floppy and press enter:" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
774 @echo "read" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
775 @echo "load -t mfs_root /mfsroot" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
777 @echo "echo \\007\\007" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
778 @echo "autoboot 10" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
779 @touch ${RD}/image.${FSIMAGE}/boot/loader.config
780 .if ${MACHINE_ARCH} == "i386" && ${AUTO_KEYBOARD_DETECT}
781 @echo "-P" >> ${RD}/image.${FSIMAGE}/boot.config
784 @echo "Writing MFS image into kernel for ${FSIMAGE} floppy"
785 @./write_mfs_in_kernel ${RD}/image.${FSIMAGE}/kernel mfsroot
786 @cp ${RD}/image.${FSIMAGE}/kernel ${RD}/kernels/MFSKERNEL.${FSIMAGE}
788 @gzip -9v ${RD}/image.${FSIMAGE}/kernel
789 @touch ${RD}/image.${FSIMAGE}/kernel.config
790 @rm -f ${RD}/floppies/${FSIMAGE}.flp
792 sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/${FSIMAGE}.flp \
793 ${RD} ${MNT} ${BIGBOOTSIZE} ${RD}/image.${FSIMAGE} \
794 ${BOOTINODE} ${BIGBOOTLABEL}
796 sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/${FSIMAGE}.flp \
797 ${RD} ${MNT} ${BOOTSIZE} ${RD}/image.${FSIMAGE} \
798 ${BOOTINODE} ${BOOTLABEL}
800 @echo "Created ${RD}/floppies/${FSIMAGE}.flp"
802 .include <bsd.prog.mk>