1# $Id: Makefile,v 1.326 1997/10/03 14:05:29 markm Exp $ 2# 3# make release CHROOTDIR=/some/dir BUILDNAME=somename [ RELEASETAG=tag ] 4# 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 9# (default is HEAD). 10# 11# Please note: the vn driver must also be compiled into your kernel, 12# otherwise the target 'release.8' and possibly others will fail. 13# 14# Set these, release builder! 15# 16# Fixed version: 17#BUILDNAME=2.2-RELEASE 18# 19# Automatic SNAP versioning: 20DATE != date +%y%m%d 21BASE = 3.0 22BUILDNAME?=${BASE}-${DATE}-SNAP 23# 24#CHROOTDIR=/junk/release 25# If this is a RELEASE, then set 26#RELEASETAG=RELENG_2_2 27 28NODOC= YES 29 30# Things which without too much trouble can be considered variables 31# BIN_DISTS are special in that they get full /etc installation sets. 32# 33COMPAT_DISTS?= compat1x compat20 compat21 34OTHER_DISTS?= manpages catpages games proflibs dict info doc 35CRYPTO_DISTS?= krb des 36BIN_DISTS?= bin 37DISTRIBUTIONS?= ${BIN_DISTS} ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} 38KERNELS?= GENERIC 39 40# Extra source tarballs; each argument is a pair of source dir and 41# distribution name. The dist name should not exceed 7 characters 42# (another "s" for "source" will be prepended). 43EXTRA_SRC+= usr.sbin/sendmail/cf smailcf 44 45BOOT1= etc/protocols etc/rc.conf 46 47# mountpoint for filesystems. 48MNT= /mnt 49 50# other floppy parameters. 51FDSIZE= 1440 52FDLABEL= fd1440 53 54ZIPNSPLIT= gzip --no-name -9 -c | split -b 240640 - 55 56# Upper size for the mfs in the boot.flp kernel. 57# These are adjusted down to the minimum needed by doFS.sh. 58BOOTMFSSIZE= 1440 59MFSINODE= 7000 60FIXITINODE= 2000 61BOOTINODE= 100000 62 63# Things which may get you into trouble if you change them 64MTREEFILES= ${.CURDIR}/../etc/mtree 65RD= /R/stage 66FD= /R/ftp 67CD= /R/cdrom 68CD_DISC1= ${CD}/disc1 69CD_DISC2= ${CD}/disc2 70 71# ${BOOTSTRAPDIR} is for those utilities that refer to the hosting 72# environment, rather than the target environment. This is specifically 73# intended for kernel-dependent utilities that are used during the build. 74# 75# ${BOOTSTRAPDIR} is actually being used by prepending it to the normal 76# ${PATH}. Thus, it's also available to outside utilities like doFS.sh. 77BOOTSTRAPDIR= /bootstrap 78# 79# The mount subsystem has been changed between 2.2 and 3.0 by the 80# Lite2 import. 81BOOTSTRAPUTILS= /sbin/mount /sbin/umount 82# 83# 3.0 cpio tries to reference lchown(2) which is not available in 2.2 84BOOTSTRAPUTILS+= /usr/bin/cpio 85 86.if !defined(CRUNCH_TARGETS) 87CRUNCH_TARGETS= boot fixit 88.endif 89 90EXTRAS= cdrom.1 ftp.1 91 92.if !defined(NODOC) 93DOCREL= doc.1 94.endif 95 96REDO?= sysinstall 97REDOSED= sed -e 's/dirs/release.1/' -e 's/trees/release.2/' \ 98 -e 's/kerns/release.3/' -e 's/sysinstall/release.4/' \ 99 -e 's/fixup/release.5/' -e 's/tarbin/release.6/' \ 100 -e 's/tarsrc/release.7/' -e 's/boot\.flp/release.8/' \ 101 -e 's/fixit\.flp/release.9/' -e 's/ftp/ftp.1/' \ 102 -e 's/cdrom/cdrom.1/' 103 104REDOREDO!= echo ${REDO} | ${REDOSED} 105 106rerelease release: 107.if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT) 108 @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false 109.endif 110.if make(release) 111.if exists(${CHROOTDIR}) 112 chflags -R noschg ${CHROOTDIR}/. 113 -rm -rf ${CHROOTDIR} 114.endif 115 -mkdir -p ${CHROOTDIR} 116 cd ${.CURDIR}/../etc && ${MAKE} distrib-dirs DESTDIR=${CHROOTDIR} 117 cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR} 118 cd ${.CURDIR}/.. && ${MAKE} install DESTDIR=${CHROOTDIR} NOMAN=1 119 mkdir ${CHROOTDIR}/${BOOTSTRAPDIR} 120 for i in ${BOOTSTRAPUTILS} ; do \ 121 cp -p ${CHROOTDIR}$$i ${CHROOTDIR}/${BOOTSTRAPDIR} ; \ 122 done 123.if !defined(RELEASETAG) 124 cd ${CHROOTDIR}/usr && rm -rf src && \ 125 cvs -d ${CVSROOT} co -P src 126.if defined(INTCVSROOT) 127 cd ${CHROOTDIR}/usr && \ 128 cvs -d ${INTCVSROOT} co -P src/secure src/crypto 129.endif 130.else 131 cd ${CHROOTDIR}/usr && rm -rf src && \ 132 cvs -d ${CVSROOT} co -P -r ${RELEASETAG} src 133.if defined(INTCVSROOT) 134 cd ${CHROOTDIR}/usr && \ 135 cvs -d ${INTCVSROOT} co -P -r ${RELEASETAG} src/secure src/crypto 136.endif 137.endif 138.if defined(LOCAL_PATCHES) && exists(${LOCAL_PATCHES}) 139 cd ${CHROOTDIR}/usr/src && patch --silent < ${LOCAL_PATCHES} 140.endif 141.if !defined(NOPORTS) 142 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -d ${CVSROOT} co -P ports && cd ports && make readmes 143.endif 144.if !defined(NODOC) 145 cd ${CHROOTDIR}/usr && rm -rf doc && cvs -d ${CVSROOT} co -P doc 146.endif 147.endif 148.if make(rerelease) 149.if !defined(RELEASENOUPDATE) 150.if !defined(RELEASETAG) 151 cd ${CHROOTDIR}/usr/src && cvs -q update -P -d 152.else 153 cd ${CHROOTDIR}/usr/src && cvs -q update -P -d -r ${RELEASETAG} 154.endif 155.if !defined(NOPORTS) 156 cd ${CHROOTDIR}/usr/ports && cvs -q update -P -d 157.endif 158.if !defined(NODOC) 159 cd ${CHROOTDIR}/usr/doc && cvs -q update -P -d 160.endif 161.endif 162.endif 163 # Add version information to those things that need it. 164 ( cd ${CHROOTDIR}/usr/src/sys/conf && \ 165 mv newvers.sh foo && \ 166 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh&& rm foo ) 167 ( cd ${CHROOTDIR}/usr/src/release/sysinstall && \ 168 sed "s/__RELEASE/${BUILDNAME}/" version.h > version.h.new && \ 169 mv version.h.new version.h && \ 170 echo XXXX ) 171 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release 172 echo "#!/bin/sh" > ${CHROOTDIR}/mk 173 echo "set -ex" >> ${CHROOTDIR}/mk 174 echo "export CFLAGS='-O2 -pipe'" >> ${CHROOTDIR}/mk 175 echo "export DISTRIBUTIONS=\"${DISTRIBUTIONS}\"" >> ${CHROOTDIR}/mk 176 echo "export BUILDNAME=${BUILDNAME}" >> ${CHROOTDIR}/mk 177.if defined(RELEASETAG) 178 echo "export RELEASETAG=${RELEASETAG}" >> ${CHROOTDIR}/mk 179.endif 180.if defined(NOPORTS) 181 echo "export NOPORTS=${NOPORTS}" >> ${CHROOTDIR}/mk 182.endif 183.if defined(NODOC) 184 echo "export NODOC=${NODOC}" >> ${CHROOTDIR}/mk 185.endif 186.if defined(NOSRC) 187 echo "export NOSRC=${NOSRC}" >> ${CHROOTDIR}/mk 188.endif 189.if defined(NOSHARED) 190 echo "export NOSHARED=${NOSHARED}" >> ${CHROOTDIR}/mk 191.endif 192.if defined(BOOT_CONFIG) 193 echo "export BOOT_CONFIG=\"${BOOT_CONFIG}\"">> ${CHROOTDIR}/mk 194.endif 195 # Don't remove this, or the build will fall over! 196 echo "export RELEASEDIR=/R" >> ${CHROOTDIR}/mk 197 echo "export PATH=${BOOTSTRAPDIR}:$${PATH}" >> ${CHROOTDIR}/mk 198 echo "cd /usr/src" >> ${CHROOTDIR}/mk 199.if make(release) 200 # This eases bootstrapping from a more recent hosting environment: 201 echo "mkdir -p /usr/lib/compat" >> ${CHROOTDIR}/mk 202 echo "chflags noschg /usr/lib/lib*.so.*" >> ${CHROOTDIR}/mk 203 echo "mv /usr/lib/lib*.so.* /usr/lib/compat" >> ${CHROOTDIR}/mk 204 echo "ldconfig /usr/lib /usr/lib/compat" >> ${CHROOTDIR}/mk 205 echo "(cd include; make all install)" >> ${CHROOTDIR}/mk 206 echo "(cd etc; make distrib-dirs distribution)" >> ${CHROOTDIR}/mk 207 echo "make world" >> ${CHROOTDIR}/mk 208 echo "(cd etc; make distribution)" >> ${CHROOTDIR}/mk 209 # Now we've got our own shared libs, remove the bootstrapping 210 # libs again. 211 echo "rm -f /usr/lib/compat/*" >> ${CHROOTDIR}/mk 212 echo "ldconfig /usr/lib" >> ${CHROOTDIR}/mk 213.endif 214.if make(rerelease) 215 echo "make all install" >> ${CHROOTDIR}/mk 216.endif 217 echo "cd /usr/src/release/sysinstall" >> ${CHROOTDIR}/mk 218 echo "make obj" >> ${CHROOTDIR}/mk 219 echo "cd /usr/src/release" >> ${CHROOTDIR}/mk 220 echo "make objlink" >> ${CHROOTDIR}/mk 221 echo "(cd obj; rm -f ${REDOREDO})" >> ${CHROOTDIR}/mk 222 echo "make doRELEASE" >> ${CHROOTDIR}/mk 223 echo "echo make ${.TARGET} Finished" >> ${CHROOTDIR}/mk 224 chmod 755 ${CHROOTDIR}/mk 225 chroot ${CHROOTDIR} /mk 226 227clean: 228 rm -rf boot_crunch release.[0-9] 229 230# Clean out /R and make the directory structure. 231release.1: 232 -mkdir /R 233 chflags -R noschg /R/. 234 rm -rf /R/* 235 mkdir ${RD} 236 mkdir ${RD}/floppies 237 mkdir ${RD}/trees 238 mkdir ${RD}/dists 239 mkdir ${RD}/kernels 240 for i in ${DISTRIBUTIONS} ; do \ 241 mkdir ${RD}/trees/$$i && \ 242 mkdir ${RD}/dists/$$i && \ 243 mtree -deU -f ${MTREEFILES}/BSD.root.dist \ 244 -p ${RD}/trees/$$i > /dev/null && \ 245 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \ 246 -p ${RD}/trees/$$i/usr > /dev/null && \ 247 mtree -deU -f ${MTREEFILES}/BSD.include.dist \ 248 -p ${RD}/trees/$$i/usr/include > /dev/null && \ 249 mtree -deU -f ${MTREEFILES}/BSD.var.dist \ 250 -p ${RD}/trees/$$i/var > /dev/null ; \ 251 done 252 touch release.1 253 254# Install the system into the various distributions. 255release.2: 256 cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/bin 257 cd ${.CURDIR}/.. && make distribute DISTDIR=${RD}/trees 258.if exists(${.CURDIR}/../kerberosIV) && !defined(NOKERBEROS) 259 cd ${.CURDIR}/../kerberosIV && ( \ 260 make bootstrap &&\ 261 make obj all help-distribute DISTDIR=${RD}/trees &&\ 262 make kprog \ 263 ) 264.endif 265 chflags -R noschg ${RD}/trees 266 touch release.2 267 268# Make and install the generic kernel(s). 269release.3: 270.for kernel in ${KERNELS} 271 rm -f ${RD}/kernels/${kernel} 272 rm -rf ${.CURDIR}/../sys/compile/${kernel} 273 cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=${kernel} 274 rm -rf ${.CURDIR}/../sys/compile/${kernel} 275 ln -f ${RD}/kernels/${kernel} ${RD}/trees/bin/kernel.${kernel} 276.endfor 277 touch release.3 278 279# Make and install the three crunched binaries which live on the floppies. 280# You are not supposed to like this :-) 281# 282# NB: the "RELEASE_BUILD_FIXIT" magic prevents vi from including the 283# Tcl and Perl APIs. See also /usr/src/usr.bin/vi/Makefile. 284release.4: 285 @mkdir -p /stand 286 cd ${.CURDIR}/sysinstall && make obj depend all install 287 rm -rf ${RD}/crunch 288 mkdir -p ${RD}/crunch 289 export RELEASE_BUILD_FIXIT=noway ; \ 290 for j in ${CRUNCH_TARGETS} ; do \ 291 rm -rf $${j}_crunch && \ 292 mkdir $${j}_crunch && \ 293 ( cd $${j}_crunch && \ 294 crunchgen ${.CURDIR}/$${j}_crunch.conf && \ 295 ${MAKE} -f $${j}_crunch.mk all NOCRYPT=yes \ 296 "CFLAGS=${CFLAGS} -DCRUNCHED_BINARY") && \ 297 mv $${j}_crunch/$${j}_crunch ${RD}/crunch/$${j} && \ 298 true || { rm -rf $${j}_crunch ; false ; } ; \ 299 done 300 touch release.4 301 302# 303# --==## Fix up the distributions. ##==-- 304# 305release.5: 306 # Handle some grief caused by the munition braindeadness. 307 for i in sbin/init bin/ed ; do \ 308 ( cd ${.CURDIR}/../$$i; \ 309 make -DNOCRYPT clean all distribute DISTDIR=${RD}/trees ) ; \ 310 done 311 312 # Create any "synthetic dists" now. 313 @for i in ${DISTRIBUTIONS}; do \ 314 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \ 315 echo -n "Running $$i dist creation script... "; \ 316 env RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \ 317 echo "Done."; \ 318 fi \ 319 done \ 320 321 # Create symlinks for the MD5-based crypt lib, too. The 322 # automatically created links still point to the DES stuff, 323 # which went into its own distribution. 324 for i in ${RD}/trees/bin/usr/lib/libscrypt* ; do \ 325 c=`echo $$i | sed -e 's/libscrypt/libcrypt/'` ; \ 326 rm -f $$c ; \ 327 ln -s `basename $$i` $$c ; \ 328 done 329 330 # Remove all the directories we don't need. 331 -cd ${RD}/trees && \ 332 find ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} -depth -type d -print | xargs rmdir 333 touch release.5 334 335# 336# --==## Package up the tarballs from assembled trees ##==-- 337# 338release.6: 339 rm -rf ${RD}/dists 340 mkdir -p ${RD}/dists 341 @for i in ${DISTRIBUTIONS} ; \ 342 do \ 343 if [ -d ${RD}/trees/$${i} ] ; then \ 344 cd ${.CURDIR} && $(MAKE) doTARBALL \ 345 SD=${RD}/trees/$${i} \ 346 TN=$$i TD=$$i ARG="." && \ 347 echo "$${i} distribution is finished."; \ 348 fi ; \ 349 done 350 # More munition braindeadness. 351 ( cd ${RD}/dists && \ 352 if [ -f krb/krb.aa ] ; then mv krb/* des && rmdir krb ; fi ) 353 touch release.6 354 355 356# 357# --==## Make source dists ##==-- 358# 359release.7: 360.if !defined(NOSRC) 361 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \ 362 TD=src TN=sbase ARG="[A-Z]*" 363 @for i in `cd /usr/src && echo [a-z]* | sed -e s/contrib-crypto//` ; do \ 364 if [ -d /usr/src/$$i ] ; then \ 365 cd ${.CURDIR} && $(MAKE) doTARBALL \ 366 TN=`echo s$$i | tr -d '.' | sed 's/usr/u/'` \ 367 SD=/usr/src TD=src ARG="$$i" ; \ 368 fi ; \ 369 done 370.if defined(EXTRA_SRC) 371 @set ${EXTRA_SRC} && \ 372 while [ $$# -ge 2 ] ; do \ 373 if [ -d /usr/src/$$1 ] ; then \ 374 cd ${.CURDIR} && $(MAKE) doTARBALL \ 375 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \ 376 fi && shift && shift ; \ 377 done 378.endif 379 ( cd ${RD}/dists/src && \ 380 if [ -f ssecure.aa ] ; then mv ssecure.* ../des ; fi && \ 381 if [ -f scrypto.aa ] ; then mv scrypto.* ../des ; fi && \ 382 if [ -f ssecure.inf ] ; then mv ssecure.inf ../des ; fi && \ 383 if [ -f scrypto.inf ] ; then mv scrypto.inf ../des ; fi ; ) 384 @echo "src distribution is finished." 385.endif 386 touch release.7 387 388# Complete the bootfd 389# 390# Now, just to get this picture down once and for all: 391# 392# +------------------------------------------------------------------------+ 393# |boot.flp | 394# +-----+-----+------------------------------------------------------------+ 395# |boot1|boot2|floppy filesystem "bootfd" | 396# +-----+-----+-+--------------------------------------------------------+-+ 397# |kernel | 398# +------------+-----------------------------------------+-+ 399# |mfs filesystem "mfsfd" | 400# +-----------------------------------------+ 401# 402 403release.8: write_mfs_in_kernel dumpnlist 404 rm -rf ${RD}/mfsfd 405 mkdir ${RD}/mfsfd 406 cd ${RD}/mfsfd && \ 407 mkdir -p etc dev mnt stand/help 408 @cp ${.CURDIR}/../sys/i386/boot/biosboot/boot.help ${RD}/mfsfd/stand 409 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \ 410 DIR=${RD}/mfsfd/stand ZIP=false 411 ( cd ${RD}/trees/bin/dev && \ 412 ls console tty ttyv0 ttyv1 ttyv2 ttyv3 null zero \ 413 *[swo]d* cuaa[01] cuaa[23] fd[01] rfd[01] \ 414 cd0a mcd0a scd0a matcd0a wcd0c rst0 rft0 rwt0 | \ 415 cpio -dump ${RD}/mfsfd/dev ) 416 ( cd ${RD}/mfsfd/dev && rm -f *[swo]d*[bdefgh] ) 417 cd ${RD}/trees/bin && ls ${BOOT1} | cpio -dump ${RD}/mfsfd/stand 418 echo "nameserver 42/tcp name" > ${RD}/mfsfd/stand/etc/services 419 echo "ftp 21/tcp" >> ${RD}/mfsfd/stand/etc/services 420 echo "domain 53/tcp nameserver" >> ${RD}/mfsfd/stand/etc/services 421 echo "domain 53/udp nameserver" >> ${RD}/mfsfd/stand/etc/services 422 echo "cmd 514/tcp shell" >> ${RD}/mfsfd/stand/etc/services 423 gzip -c ${.CURDIR}/../COPYRIGHT > ${RD}/mfsfd/stand/help/COPYRIGHT.hlp.gz 424 -test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd 425 @echo "Making the regular boot floppy." 426 tar --exclude CVS -cf - -C ${.CURDIR}/sysinstall help | \ 427 tar xvf - -C ${RD}/mfsfd/stand 428 @echo "Compressing doc files..." 429 @gzip -9 ${RD}/mfsfd/stand/help/*.hlp 430 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${BOOTMFSSIZE} ${RD}/mfsfd \ 431 ${MFSINODE} minimum 432 mv fs-image fs-image.std 433 mv fs-image.size fs-image.std.size 434 cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=std 435 mv ${RD}/floppies/bootstd.flp ${RD}/floppies/boot.flp 436 @echo "Regular boot floppy made." 437 touch release.8 438 439# 440# --==## Create a fixit floppy ##==-- 441# 442release.9: 443 rm -rf ${RD}/fixitfd 444 mkdir ${RD}/fixitfd 445 cd ${RD}/fixitfd && \ 446 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \ 447 usr/share/misc 448 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=fixit \ 449 DIR=${RD}/fixitfd/stand ZIP=false 450 ( cd ${RD}/fixitfd/dev && \ 451 sed -e '/^PATH/s/^/#/' ${RD}/trees/bin/dev/MAKEDEV > MAKEDEV && \ 452 chmod 755 MAKEDEV && \ 453 sh MAKEDEV all ) 454 cp ${RD}/trees/bin/etc/spwd.db ${RD}/trees/bin/etc/group \ 455 ${RD}/trees/bin/etc/protocols ${RD}/fixitfd/etc 456 cp ${RD}/trees/bin/usr/share/misc/scsi_modes \ 457 ${RD}/fixitfd/usr/share/misc 458 cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile 459 cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services 460 cp ${.CURDIR}/tar.sh ${RD}/fixitfd/stand/tar 461 chmod 555 ${RD}/fixitfd/stand/tar 462 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${FDSIZE} ${RD}/fixitfd \ 463 ${FIXITINODE} ${FDLABEL} 464 mv fs-image ${RD}/floppies/fixit.flp 465# Do our last minute floppies directory setup in a convenient place. 466 cp ${.CURDIR}/README.TXT ${RD}/floppies/README.TXT 467 @(cd ${RD}/floppies; md5 * > CHECKSUM.MD5) 468 touch release.9 469 470# 471# --==## Setup a suitable ftp-area ##==-- 472# 473ftp.1: 474 mkdir -p ${FD} 475 cd ${RD} && find floppies -print | cpio -dumpl ${FD} 476 cd ${RD}/dists && find . -print | cpio -dumpl ${FD} 477 cp ${.CURDIR}/ABOUT.TXT ${FD}/ABOUT.TXT 478 cp ${.CURDIR}/sysinstall/help/readme.hlp ${FD}/README.TXT 479 cp ${.CURDIR}/sysinstall/help/hardware.hlp ${FD}/HARDWARE.TXT 480 cp ${.CURDIR}/sysinstall/help/install.hlp ${FD}/INSTALL.TXT 481 cp ${.CURDIR}/sysinstall/help/relnotes.hlp ${FD}/RELNOTES.TXT 482 echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf 483.if !defined(NOPORTS) 484 tar -cBf - -C ${CD_DISC1} ports | tar -xBf - -C ${FD} 485.endif 486 487# 488# --==## Setup a suitable cdrom-area ##==-- 489# 490cdrom.1: 491 mkdir -p ${CD_DISC1} ${CD_DISC2} 492 cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1} 493 cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1} 494 ln -f ${RD}/kernels/MFSKERNEL.std ${CD_DISC1}/kernel 495 ln -f ${RD}/trees/bin/usr/mdec/fbsdboot.exe ${CD_DISC1} 496 for i in ${DISTRIBUTIONS} ; \ 497 do \ 498 if [ -d ${RD}/trees/$${i} ] ; then \ 499 chflags -R noschg ${RD}/trees/$${i} ; \ 500 ( cd ${RD}/trees/$${i} && \ 501 find . -depth -print | cpio -dumpl ${CD_DISC2} ) ; \ 502 fi \ 503 done 504 rm -f ${CD_DISC2}/.profile 505 cp ${.CURDIR}/fixit.profile ${CD_DISC2}/.profile 506 echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf 507 echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf 508 cp ${.CURDIR}/ABOUT.TXT ${CD_DISC1}/ABOUT.TXT 509 cp ${.CURDIR}/sysinstall/help/readme.hlp ${CD_DISC1}/README.TXT 510 cp ${.CURDIR}/sysinstall/help/hardware.hlp ${CD_DISC1}/HARDWARE.TXT 511 cp ${.CURDIR}/sysinstall/help/install.hlp ${CD_DISC1}/INSTALL.TXT 512 cp ${.CURDIR}/sysinstall/help/relnotes.hlp ${CD_DISC1}/RELNOTES.TXT 513.if !defined(NOPORTS) 514 tar -cBf - -C /usr ports | tar xBpf - -C ${CD_DISC2} && \ 515 mkdir -p ${CD_DISC1}/ports && \ 516 tar -czf ${CD_DISC1}/ports/ports.tgz -C /usr ports && \ 517 cp ${.CURDIR}/scripts/ports-install.sh ${CD_DISC1}/ports/install.sh && \ 518 (cd ${CD_DISC1}/ports; md5 * > CHECKSUM.MD5) 519 ln -s ../ports ${CD_DISC2}/usr/ports 520.endif 521 522doc.1: 523 cd /usr/doc && make all distribute DISTDIR=${RD}/trees 524 525# Various "subroutine" and other supporting targets. 526 527doTARBALL: 528.if !defined(SD) 529 @echo "SD undefined in doTARBALL" && exit 1 530.endif 531.if !defined(TD) 532 @echo "TB undefined in doTARBALL" && exit 1 533.endif 534.if !defined(ARG) 535 @echo "ARG undefined in doTARBALL" && exit 1 536.endif 537 rm -rf ${RD}/dists/${TD}/${TN}* 538 mkdir -p ${RD}/dists/${TD} 539 ( cd ${SD} && \ 540 tn=`echo ${TN} | tr '[A-Z]' '[a-z]' | cut -c1-8` && \ 541 echo rolling ${TD}/$$tn tarball &&\ 542 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \ 543 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \ 544 sh ${.CURDIR}/info.sh ${RD}/dists/${TD}/$$tn > \ 545 ${RD}/dists/${TD}/$$tn.inf && \ 546 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \ 547 cp -p ${.CURDIR}/scripts/$${TD}-install.sh ${RD}/dists/${TD}/install.sh; \ 548 fi && \ 549 if [ "${SD}" != "/usr/src" ]; then \ 550 mtree -c -i -p ${SD}/${ARG} \ 551 -k gname,md5digest,mode,nlink,uname,size,link,type \ 552 > ${RD}/dists/${TD}/$$tn.mtree ; \ 553 else \ 554 true; \ 555 fi; \ 556 (cd ${RD}/dists/${TD}; \ 557 rm -f CHECKSUM.MD5; \ 558 md5 * > CHECKSUM.MD5) \ 559 ) 560 561doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 release.5 \ 562 release.6 release.7 release.8 release.9 563 cd ${.CURDIR} && ${MAKE} ${EXTRAS} 564 @echo "Release done" 565 566floppies: 567 cd ${.CURDIR} && ${MAKE} boot.flp 568 cd ${.CURDIR} && ${MAKE} fixit.flp 569 cd ${RD} && find floppies -print | cpio -dumpl ${FD} 570 571boot.flp: 572 rm -f release.4 release.8 573 cd ${.CURDIR} && ${MAKE} release.4 release.8 CRUNCH_TARGETS=boot 574 575fixit.flp: 576 rm -f release.4 release.9 577 cd ${.CURDIR} && ${MAKE} release.4 release.9 CRUNCH_TARGETS=fixit 578 579write_mfs_in_kernel: ${.CURDIR}/write_mfs_in_kernel.c 580 ${CC} ${CFLAGS} -o write_mfs_in_kernel ${.CURDIR}/write_mfs_in_kernel.c 581 582dumpnlist: ${.CURDIR}/dumpnlist.c 583 ${CC} ${CFLAGS} -o dumpnlist ${.CURDIR}/dumpnlist.c 584 585installCRUNCH: 586.if !defined(CRUNCH) 587 @echo "CRUNCH undefined in installCRUNCH" && exit 1 588.endif 589.if !defined(DIR) 590 @echo "DIR undefined in installCRUNCH" && exit 1 591.endif 592.if !defined(ZIP) 593 @echo "ZIP undefined in installCRUNCH" && exit 1 594.endif 595 if ${ZIP} ; then \ 596 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \ 597 else \ 598 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \ 599 fi 600 chmod 555 ${DIR}/${CRUNCH}_crunch 601 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \ 602 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \ 603 done 604 605# 606# --==## Compile a kernel by name ${KERNEL} ##==-- 607# 608# We don't erase the sys/compile/${KERNEL} directory, since somebody 609# may want to reuse it (release.8 presently) 610# 611doKERNEL: 612 rm -f ${RD}/kernels/${KERNEL} 613 cd ${.CURDIR}/../sys/i386/conf && config -n ${KERNEL} 614 cd ${.CURDIR}/../sys/compile/${KERNEL} && \ 615 make depend && \ 616 make kernel && \ 617 cp kernel ${RD}/kernels/${KERNEL} 618 619# 620# --==## Put a filesystem into a BOOTMFS kernel ##==-- 621# 622doMFSKERN: 623 @rm -f ${RD}/kernels/BOOTMFS.${FSIMAGE} 624 @rm -f /sys/compile/BOOTMFS/mfs_vfsops.o 625 @cd ${.CURDIR}/../sys/i386/conf && \ 626 sed -e '/SYSV/d' \ 627 -e '/pty/d' \ 628 -e '/PROCFS/d' \ 629 -e '/KTRACE/d' \ 630 -e 's/GENERIC/BOOTMFS/g' \ 631 -e '/maxusers/s/10/4/' < GENERIC > BOOTMFS && \ 632 echo "options MFS" >> BOOTMFS && \ 633 echo "options NFS_NOSERVER" >> BOOTMFS && \ 634 echo 'options "MAXCONS=4"' >> BOOTMFS && \ 635 echo "options USERCONFIG_BOOT" >> BOOTMFS 636 @echo "options \"MFS_ROOT=`cat fs-image.${FSIMAGE}.size`\"" >> \ 637 ${.CURDIR}/../sys/i386/conf/BOOTMFS 638 cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=BOOTMFS 639 @rm -rf ${RD}/boot.${FSIMAGE} 640 @mkdir ${RD}/boot.${FSIMAGE} 641 @mv ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE} 642 @cp ${RD}/kernels/BOOTMFS.${FSIMAGE} ${RD}/boot.${FSIMAGE}/kernel 643.if defined(BOOT_CONFIG) 644 @echo "${BOOT_CONFIG}" >${RD}/boot.${FSIMAGE}/boot.config 645.endif 646 @vnconfig /dev/vn0 fs-image.${FSIMAGE} 647 @mkdir -p /tmp/mnt_xx 648 @mount /dev/vn0 /tmp/mnt_xx 649 ./dumpnlist ${RD}/boot.${FSIMAGE}/kernel > /tmp/mnt_xx/stand/symbols 650 @umount /tmp/mnt_xx 651 @vnconfig -u /dev/vn0 652 @rmdir /tmp/mnt_xx 653 ./write_mfs_in_kernel ${RD}/boot.${FSIMAGE}/kernel \ 654 fs-image.${FSIMAGE} 655 kzip -v ${RD}/boot.${FSIMAGE}/kernel 656 @mv ${RD}/boot.${FSIMAGE}/kernel ${RD}/kernels/MFSKERNEL.${FSIMAGE} 657 @mv ${RD}/boot.${FSIMAGE}/kernel.kz ${RD}/boot.${FSIMAGE}/kernel 658 @cp ${.CURDIR}/../sys/i386/boot/biosboot/boot.help ${RD}/boot.${FSIMAGE} 659 @touch ${RD}/boot.${FSIMAGE}/boot.config 660 @touch ${RD}/boot.${FSIMAGE}/kernel.config 661 @rm -f ${RD}/floppies/boot${FSIMAGE}.flp 662 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${FDSIZE} ${RD}/boot.${FSIMAGE} \ 663 ${BOOTINODE} ${FDLABEL} 664 mv fs-image ${RD}/floppies/boot${FSIMAGE}.flp 665 666.include <bsd.prog.mk> 667