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