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