Makefile revision 95307
1# $FreeBSD: head/release/Makefile 95307 2002-04-23 09:24:00Z ru $ 2# 3# make release CHROOTDIR=/some/dir BUILDNAME=somename CVSROOT=/cvs/dir \ 4# [ RELEASETAG=tag ] 5# 6# Where "/some/dir" is the pathname of a directory on a some filesystem with 7# at least 1000MB of free space, "somename" is what you want the release to 8# call itself, "/cvs/dir" is where our source repo resides and, optionally, 9# which CVS "tag" name should be used when checking out the sources to build 10# the release (default is HEAD). 11# 12# Please note: the md(4) driver must be compiled into your kernel 13# or available as a kld(4)-style kernel module, 14# otherwise the target 'release.8' and possibly others will fail. 15# 16# Note: "/some/dir" cannot reside on a filesystem mounted with 17# the "nodev" option, otherwise the chrooted "buildworld" will likely 18# fail. 19# 20# Note: If you add options to this file, please keep release(7) updated! 21# 22# Set these, release builder! 23# 24# Fixed version: 25#BUILDNAME=5.0-RELEASE 26# 27# Automatic SNAP versioning: 28DATE != date +%Y%m%d 29BASE = 5.0 30BUILDNAME?=${BASE}-${DATE}-SNAP 31# 32#CHROOTDIR=/junk/release 33# If this is a -stable snapshot, then set 34#RELEASETAG=RELENG_4 35# 36# Non-zero if ${RELEASETAG} is in the form "RELENG_ver_RELEASE"; we 37# are building an official release. Otherwise, we are building for 38# a branch. 39.if defined(RELEASETAG) 40ISRELEASE!= expr "${RELEASETAG}" : '^RELENG_.*_RELEASE$$' || true 41.if ${ISRELEASE} != 0 42# Convert "RELENG_ver_RELEASE" to "RELEASE_ver" for ports and doc trees. 43AUXRELEASETAG!= echo ${RELEASETAG} | sed -e 's/^RELENG_/RELEASE_/' -e 's/_RELEASE$$//' 44DOCRELEASETAG?= ${AUXRELEASETAG} 45PORTSRELEASETAG?= ${AUXRELEASETAG} 46.endif 47.endif 48 49KERNCONF?=GENERIC 50 51# If you want to pass flags to the world build such as -j X, use 52# WORLD_FLAGS. Similarly, you can specify make flags for kernel 53# builds via KERNEL_FLAGS. 54#WORLD_FLAGS=-j4 55#KERNEL_FLAGS=-j4 56 57# If you are using a local CVS repository with components stored in 58# non-standard modules, override these on the make commandline or 59# in the environment. 60RELEASESRCMODULE?= src 61RELEASEDOCMODULE?= doc 62RELEASEPORTSMODULE?= ports 63 64# Unless set elsewhere, indicate the object format we'll be using. 65OBJFORMAT?= elf 66 67# Uncomment this to disable the doc.1 target. Docs normally require 68# the ports tree, so NOPORTS can be set together with NODOC in order 69# to have neither ports or docs. If only NOPORTS is set to YES, but 70# docs are still desired, the DOMINIMALDOCPORTS logic below will only 71# install the ports that are minimally required for the docs. This is 72# intended as a compromise, less disk space is required than for using 73# the entire ports collection (und much less time due to the huge number 74# of directories it would create), but still quite a bit as well as some 75# CPU cycles (some of the programs are C++, and things like ghostscript 76# belong to the required ports nevertheless). 77# 78# Setting this also disables building of release note documentation 79# (RELNOTESng). 80#NODOC= YES 81#NOPORTS= YES 82 83# Uncomment and modify this definition if you want the release notes 84# and other release documentation in a language other than English. 85#RELNOTES_LANG= en_US.ISO8859-1 86 87# As an alternative to installing the entire ports collection (which 88# can take a huge amount of time, in particular on slower disks), 89# setting ${MINIMALDOCPORTS} allows to install and build just those 90# ports that are really required for getting the docs up & running. 91.if defined(NOPORTS) && !defined(NODOC) 92DOMINIMALDOCPORTS= YES 93.include "Makefile.inc.docports" 94.endif 95 96# Helper variable 97.if defined(NOPORTS) 98.if !defined(DOMINIMALDOCPORTS) || ${DOMINIMALDOCPORTS} != "YES" 99NOPORTSATALL= YES 100.endif 101.endif 102 103# Set ALLLANG=no if you want the documentation (e.g. Handbook, FAQ) to be 104# in English only. The language for the release notes is controlled 105# by the RELNOTES_LANG variable above. 106ALLLANG?= yes 107DOCPORTS= textproc/docproj 108# Set this to wherever the distfiles required by release procedures. 109.if defined(DOCDISTFILES) 110# Respect DOCDISTFILES which is used before. 111RELEASEDISTFILES?= ${DOCDISTFILES} 112.else 113RELEASEDISTFILES?= ${.CURDIR}/../../ports/distfiles 114.endif 115# Set this to 1 if you want -P to be used for automatic keyboard detection 116# on the boot floppy. WARNING: Breaks on some Athlon (K7) motherboards. 117AUTO_KEYBOARD_DETECT?= 0 118 119.if !defined(NODOC) 120DIST_DOCS_ARCH_INDEP= readme errata 121DIST_DOCS_ARCH_DEP= installation relnotes hardware 122.endif 123 124# Things which without too much trouble can be considered variables 125# BIN_DISTS are special in that they get full /etc installation sets. 126# 127.if ${MACHINE_ARCH} == "i386" 128COMPAT_DISTS?= compat1x compat20 compat21 compat22 compat3x compat4x 129.else 130COMPAT_DISTS?= compat4x 131.endif 132OTHER_DISTS?= manpages catpages games proflibs dict info doc 133CRYPTO_DISTS?= crypto krb4 krb5 134BIN_DISTS?= bin 135DISTRIBUTIONS?= ${BIN_DISTS} ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} 136KERNELS?= GENERIC 137 138BOOT1= etc/defaults/rc.conf 139 140# mountpoint for filesystems. 141MNT= /mnt 142 143# Various floppy image parameters. 144# 145 146.if ${MACHINE_ARCH} == "i386" 147.if ${MACHINE} == "pc98" 148SMALLBOOTSIZE= 1200 149BOOTSIZE= 1440 150FIXITSIZE= 1440 151MFSSIZE= 4320 152BOOTINODE= 80000 153FIXITINODE= 40000 154MFSINODE= 8000 155SMALLBOOTLABEL= fd1200 156BOOTLABEL= fd1440 157FIXITLABEL= fd1440 158MFSLABEL= minimum3 159.else 160BOOTSIZE= 1440 161FIXITSIZE= 1440 162MFSSIZE= 4320 163BIGBOOTSIZE= 2880 164BOOTINODE= 80000 165FIXITINODE= 40000 166MFSINODE= 8000 167BOOTLABEL= fd1440 168FIXITLABEL= fd1440 169MFSLABEL= minimum3 170BIGBOOTLABEL= minimum2 171.endif 172.elif ${MACHINE_ARCH} == "alpha" 173BOOTSIZE= 1440 174FIXITSIZE= 2880 175MFSSIZE= 4320 176BIGBOOTSIZE= 2880 177BOOTINODE= 80000 178FIXITINODE= 40000 179MFSINODE= 8000 180BOOTLABEL= fd1440 181FIXITLABEL= minimum2 182MFSLABEL= auto 183BIGBOOTLABEL= minimum2 184.endif 185 186ZIPNSPLIT= gzip --no-name -9 -c | split -b 240640 - 187 188# Things that need to be compiled without crypto support in releases 189.if !defined(FIXCRYPTO) 190FIXCRYPTO= bin/ed usr.sbin/ppp usr.sbin/pppd usr.sbin/tcpdump/tcpdump 191.if !defined(NO_SENDMAIL) 192FIXCRYPTO+= usr.sbin/sendmail 193.endif 194.endif 195 196 197# Things which may get you into trouble if you change them 198MTREEFILES= ${.CURDIR}/../etc/mtree 199_R?= /R 200RD= ${_R}/stage 201RND= ${RD}/release.doc 202FD= ${_R}/ftp 203CD= ${_R}/cdrom 204CD_DISC1= ${CD}/disc1 205CD_DISC2= ${CD}/disc2 206 207# Where the bootstrap ports (see DOCPORTS) get installed. 208LOCALDIR= /usr/local/bin 209 210# ${BOOTSTRAPDIR} is for those utilities that refer to the hosting 211# environment, rather than the target environment. This is specifically 212# intended for kernel-dependent utilities that are used during the build. 213# 214# ${BOOTSTRAPDIR} is actually being used by prepending it to the normal 215# ${PATH}. Thus, it's also available to outside utilities like doFS.sh. 216BOOTSTRAPDIR= /bootstrap 217# 218# The mount subsystem has been changed between 2.2 and 3.0 by the 219# Lite2 import. 220BOOTSTRAPUTILS= /sbin/mount /sbin/umount 221# 222# 3.0 cpio tries to reference lchown(2) which is not available in 2.2 223BOOTSTRAPUTILS+= /usr/bin/cpio 224 225.if !defined(CRUNCH_TARGETS) 226CRUNCH_TARGETS= boot fixit 227.endif 228 229EXTRAS= cdrom.1 ftp.1 230.if defined(MAKE_ISOS) 231EXTRAS+= iso.1 232.if ${MACHINE} != "pc98" 233BOOTABLE="-b" 234.endif 235.endif 236 237.if !defined(NODOC) 238DOCREL= doc.1 doc.2 239.endif 240 241.if !defined(NOPORTREADMES) 242MAKEREADMES= make readmes PORTSDIR=${CHROOTDIR}/usr/ports 243.else 244MAKEREADMES= true 245.endif 246 247rerelease release: 248.if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT) 249 @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false 250.endif 251.if defined(NOPORTSATALL) && !defined(NODOC) 252 @echo "Ports are required for building the docs. Either set NODOC or" 253 @echo "unset NOPORTS, or set at least DOMINIMALDOCPORTS to YES!" 254 @exit 1 255.endif 256.if make(release) 257.if exists(${CHROOTDIR}) 258# The first command will fail on a handful of files that have their schg 259# flags set. But it greatly speeds up the next two commands. 260 -rm -rf ${CHROOTDIR} 2>/dev/null 261 -chflags -R noschg ${CHROOTDIR}/. 262 -rm -rf ${CHROOTDIR} 263.endif 264 mkdir -p ${CHROOTDIR} 265 @echo ">>> make release started on `LC_ALL=C TZ=GMT date`" 266 cd ${.CURDIR}/../etc && ${MAKE} distrib-dirs DESTDIR=${CHROOTDIR} 267 cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR} 268 if [ -f /etc/resolv.conf ]; then \ 269 cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \ 270 fi 271 cd ${.CURDIR}/.. && ${MAKE} -DNOHTML -DNOINFO -DNOMAN installworld \ 272 DESTDIR=${CHROOTDIR} 273 mkdir ${CHROOTDIR}/${BOOTSTRAPDIR} 274 for i in ${BOOTSTRAPUTILS} ; do \ 275 cp -p ${CHROOTDIR}$$i ${CHROOTDIR}/${BOOTSTRAPDIR} ; \ 276 done 277.if !defined(RELEASETAG) 278 cd ${CHROOTDIR}/usr && rm -rf src && \ 279 cvs -R -d ${CVSROOT} co -P ${RELEASESRCMODULE} 280.else 281 cd ${CHROOTDIR}/usr && rm -rf src && \ 282 cvs -R -d ${CVSROOT} co -P -r ${RELEASETAG} ${RELEASESRCMODULE} 283.endif 284.if defined(LOCAL_PATCHES) && exists(${LOCAL_PATCHES}) 285 cd ${CHROOTDIR}/usr/src && patch ${PATCH_FLAGS} < ${LOCAL_PATCHES} 286.endif 287.if defined(LOCAL_SCRIPT) && exists(${LOCAL_SCRIPT}) 288 cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT} 289.endif 290.if !defined(NOPORTS) 291.if defined(PORTSRELEASETAG) 292 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P -r ${PORTSRELEASETAG} ${RELEASEPORTSMODULE} && cd ports && ${MAKEREADMES} 293.else 294 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P ${RELEASEPORTSMODULE} && cd ports && ${MAKEREADMES} 295.endif 296.elif defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES" 297.if defined(PORTSRELEASETAG) 298 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P -r ${PORTSRELEASETAG} ${MINIMALDOCPORTS} 299.else 300 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P ${MINIMALDOCPORTS} 301.endif 302.endif 303.if !defined(NODOC) 304.if defined(DOCRELEASETAG) 305 cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co -P -r ${DOCRELEASETAG} ${RELEASEDOCMODULE} 306.else 307 cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co -P ${RELEASEDOCMODULE} 308.endif 309 if [ -d ${RELEASEDISTFILES}/ ]; then \ 310 cp -rp ${RELEASEDISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \ 311 else \ 312 mkdir -p ${CHROOTDIR}/usr/ports/distfiles; \ 313 fi 314.endif 315.endif 316.if make(rerelease) 317.if !defined(RELEASENOUPDATE) 318.if !defined(RELEASETAG) 319 cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d 320.else 321 cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d -r ${RELEASETAG} 322.endif 323.if !defined(NOPORTS) 324 cd ${CHROOTDIR}/usr/ports && cvs -R -q update -P -d 325.endif 326.if defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES" 327 for i in ${MINIMALDOCPORTS}; do \ 328 ( cd ${CHROOTDIR}/usr/$$i && cvs -R -q update -P -d ) ; \ 329 done 330.endif 331.if !defined(NODOC) 332 cd ${CHROOTDIR}/usr/doc && cvs -R -q update -P -d 333.endif 334.endif 335.endif 336 # Add version information to those things that need it. 337 ( cd ${CHROOTDIR}/usr/src/sys/conf && \ 338 mv newvers.sh foo && \ 339 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && rm foo ) 340 echo OBJFORMAT=${OBJFORMAT} > ${CHROOTDIR}/etc/objformat 341 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release 342 echo "#!/bin/sh" > ${CHROOTDIR}/mk 343 echo "set -ex" >> ${CHROOTDIR}/mk 344 echo "_RELTARGET=\$${1:-doRELEASE}" >> ${CHROOTDIR}/mk 345 echo "export CFLAGS='-O -pipe'" >> ${CHROOTDIR}/mk 346 echo "export WITHOUT_X11=YES" >> ${CHROOTDIR}/mk 347 echo "export DISTRIBUTIONS=\"${DISTRIBUTIONS}\"" >> ${CHROOTDIR}/mk 348 echo "export BUILDNAME=${BUILDNAME}" >> ${CHROOTDIR}/mk 349 echo "export OBJFORMAT=${OBJFORMAT}" >> ${CHROOTDIR}/mk 350.if defined(RELEASETAG) 351 echo "export RELEASETAG=\"${RELEASETAG}\"" >> ${CHROOTDIR}/mk 352.endif 353.if defined(NOPORTS) 354 echo "export NOPORTS=${NOPORTS}" >> ${CHROOTDIR}/mk 355.endif 356.if defined(MAKE_ISOS) 357 echo "export MAKE_ISOS=${MAKE_ISOS}" >> ${CHROOTDIR}/mk 358.endif 359.if defined(DOMINIMALDOCPORTS) 360 echo "export DOMINIMALDOCPORTS=${DOMINIMALDOCPORTS}" >> ${CHROOTDIR}/mk 361.endif 362.if defined(NODOC) 363 echo "export NODOC=${NODOC}" >> ${CHROOTDIR}/mk 364.endif 365.if defined(ALLLANG) && ${ALLLANG} != "NO" && ${ALLLANG} != "no" 366 echo "export ALLLANG=${ALLLANG}" >> ${CHROOTDIR}/mk 367.else 368 echo "export DOC_LANG=en_US.ISO8859-1" >> ${CHROOTDIR}/mk 369.endif 370.if defined(NOSRC) 371 echo "export NOSRC=${NOSRC}" >> ${CHROOTDIR}/mk 372.endif 373.if defined(RELNOTES_LANG) 374 echo "export RELNOTES_LANG=${RELNOTES_LANG}" >> ${CHROOTDIR}/mk 375.else 376 echo "export RELNOTES_LANG=en_US.ISO8859-1" >> ${CHROOTDIR}/mk 377.endif 378.if defined(NOSHARED) 379 echo "export NOSHARED=${NOSHARED}" >> ${CHROOTDIR}/mk 380.endif 381.if defined(BOOT_CONFIG) 382 echo "export BOOT_CONFIG=\"${BOOT_CONFIG}\"">> ${CHROOTDIR}/mk 383.endif 384.if defined(KERNEL_FLAGS) 385 echo "export KERNEL_FLAGS=\"${KERNEL_FLAGS}\"" >> ${CHROOTDIR}/mk 386.endif 387 # Don't remove this, or the build will fall over! 388 echo "export RELEASEDIR=${_R}" >> ${CHROOTDIR}/mk 389 echo "export PATH=${BOOTSTRAPDIR}:$${PATH}:${LOCALDIR}" >> ${CHROOTDIR}/mk 390 echo "export TMPDIR=/tmp" >> ${CHROOTDIR}/mk 391 echo "if [ ! -f /tmp/.world_done ]; then" >> ${CHROOTDIR}/mk 392 echo " cd /usr/src" >> ${CHROOTDIR}/mk 393.if make(release) 394 echo " (cd etc; make distrib-dirs distribution)" >> ${CHROOTDIR}/mk 395 echo " make ${WORLD_FLAGS} world && \\" >> ${CHROOTDIR}/mk 396.endif 397.if make(rerelease) 398 echo " make ${WORLD_FLAGS} -DNOCLEAN world && \\" >> ${CHROOTDIR}/mk 399.endif 400 echo " touch /tmp/.world_done" >> ${CHROOTDIR}/mk 401 echo "fi" >> ${CHROOTDIR}/mk 402 echo "cd /usr/src/release" >> ${CHROOTDIR}/mk 403 echo "make obj" >> ${CHROOTDIR}/mk 404 echo "make \$${_RELTARGET}" >> ${CHROOTDIR}/mk 405 echo "echo \">>> make ${.TARGET} finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${CHROOTDIR}/mk 406 chmod 755 ${CHROOTDIR}/mk 407 chroot ${CHROOTDIR} /mk 408 409clean: 410 rm -rf boot_crunch release.[0-9] 411 412# Clean out ${_R} and make the directory structure. 413release.1: 414 mkdir -p ${_R} 415 -rm -rf ${_R}/* 2> /dev/null 416 -chflags -R noschg ${_R}/. 417 rm -rf ${_R}/* 418 mkdir ${RD} 419 mkdir ${RD}/floppies 420 mkdir ${RD}/trees 421 mkdir ${RD}/dists 422 mkdir ${RD}/kernels 423 for i in ${DISTRIBUTIONS} ; do \ 424 mkdir ${RD}/trees/$$i && \ 425 mkdir ${RD}/dists/$$i && \ 426 mtree -deU -f ${MTREEFILES}/BSD.root.dist \ 427 -p ${RD}/trees/$$i > /dev/null && \ 428 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \ 429 -p ${RD}/trees/$$i/usr > /dev/null && \ 430 mtree -deU -f ${MTREEFILES}/BSD.include.dist \ 431 -p ${RD}/trees/$$i/usr/include > /dev/null && \ 432 mtree -deU -f ${MTREEFILES}/BSD.var.dist \ 433 -p ${RD}/trees/$$i/var > /dev/null ; \ 434 done 435 touch release.1 436 437# Install the system into the various distributions. 438release.2: 439 cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/bin 440 cd ${.CURDIR}/.. && make distribworld DISTDIR=${RD}/trees 441.if exists(${.CURDIR}/../kerberosIV) && exists(${.CURDIR}/../crypto) && !defined(NOKERBEROS) 442 cd ${.CURDIR}/../kerberosIV && ( \ 443 make bootstrap &&\ 444 make obj all help-distribute DISTDIR=${RD}/trees &&\ 445 make kprog \ 446 ) 447.endif 448.if exists(${.CURDIR}/../kerberos5) && exists(${.CURDIR}/../crypto) && !defined(NOKERBEROS) 449 cd ${.CURDIR}/../kerberos5 && ( \ 450 make bootstrap &&\ 451 make obj all help-distribute DISTDIR=${RD}/trees &&\ 452 make kprog \ 453 ) 454.endif 455 -chflags -R noschg ${RD}/trees 456 touch release.2 457 458# Make and install the generic kernel(s). 459release.3: 460.for kernel in ${KERNELS} 461 -chflags -R noschg ${RD}/kernels/${kernel} 462 rm -rf ${RD}/kernels/${kernel} 463 rm -rf ${.CURDIR}/../sys/${MACHINE}/compile/${kernel} 464 cd ${.CURDIR} && ${MAKE} doSTDKERNEL KERNEL=${kernel} KODIR=/${kernel} 465 rm -rf ${.CURDIR}/../sys/${MACHINE}/compile/${kernel} 466 -mkdir ${RD}/trees/bin/boot/${kernel} 467 cp -p ${RD}/kernels/${kernel}/kernel ${RD}/trees/bin/boot/${kernel} 468.endfor 469 # Install a standard boot kernel+modules 470 mkdir -p ${RD}/trees/bin/boot/kernel 471 cp -Rp ${RD}/kernels/GENERIC/* ${RD}/trees/bin/boot/kernel 472 touch release.3 473 474# Make and install the three crunched binaries which live on the floppies. 475# You are not supposed to like this :-) 476release.4: 477 @mkdir -p /stand 478 rm -rf ${RD}/crunch 479 mkdir -p ${RD}/crunch 480 for j in ${CRUNCH_TARGETS} ; do \ 481 rm -rf $${j}_crunch && \ 482 mkdir $${j}_crunch && \ 483 ( cd $${j}_crunch && \ 484 ( ( [ -f ${.CURDIR}/${MACHINE}/$${j}_crunch.conf ] && \ 485 crunchgen ${.CURDIR}/${MACHINE}/$${j}_crunch.conf ) || \ 486 ( crunchgen ${.CURDIR}/$${j}_crunch.conf ) ) && \ 487 ${MAKE} -f $${j}_crunch.mk subclean all ) && \ 488 mv $${j}_crunch/$${j}_crunch ${RD}/crunch/$${j} && \ 489 true || { rm -rf $${j}_crunch ; false ; } ; \ 490 done 491 touch release.4 492 493# 494# --==## Fix up the distributions. ##==-- 495# 496release.5: 497 # Handle some grief caused by the munition braindeadness. 498 for i in ${FIXCRYPTO}; do \ 499 ( cd ${.CURDIR}/../$$i; \ 500 make -DNOCRYPT clean all distribute DISTDIR=${RD}/trees ) ; \ 501 done 502 503 # Create any "synthetic dists" now. 504 @for i in ${DISTRIBUTIONS}; do \ 505 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \ 506 echo -n "Running $$i dist creation script... "; \ 507 env OBJFORMAT=${OBJFORMAT} RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \ 508 echo "Done."; \ 509 fi \ 510 done \ 511 512 # Remove all the directories we don't need. 513 -cd ${RD}/trees && \ 514 find ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} -depth -type d -print | xargs rmdir 515 touch release.5 516 517# 518# --==## Package up the tarballs from assembled trees ##==-- 519# 520release.6: 521 rm -rf ${RD}/dists 522 mkdir -p ${RD}/dists 523 @for i in ${DISTRIBUTIONS} ; \ 524 do \ 525 if [ -d ${RD}/trees/$${i} ] ; then \ 526 cd ${.CURDIR} && $(MAKE) doTARBALL \ 527 SD=${RD}/trees/$${i} \ 528 TN=$$i TD=$$i ARG="." && \ 529 echo "$${i} distribution is finished."; \ 530 fi ; \ 531 done 532 # More munition braindeadness. 533 ( cd ${RD}/dists && \ 534 if [ -f krb4/krb4.aa ] ; then \ 535 mv krb4/krb4.* crypto && \ 536 cat krb4/CHECKSUM.MD5 >> crypto/CHECKSUM.MD5 && \ 537 rm -r krb4; \ 538 fi ) 539 ( cd ${RD}/dists && \ 540 if [ -f krb5/krb5.aa ] ; then \ 541 mv krb5/krb5.* crypto && \ 542 cat krb5/CHECKSUM.MD5 >> crypto/CHECKSUM.MD5 && \ 543 rm -r krb5; \ 544 fi ) 545 touch release.6 546 547 548# 549# --==## Make source dists ##==-- 550# 551release.7: 552.if !defined(NOSRC) 553 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \ 554 TD=src TN=sbase ARG="[A-Z]*" 555 @for i in `cd /usr/src && echo [a-z]*` ; do \ 556 if [ -d /usr/src/$$i ] ; then \ 557 cd ${.CURDIR} && $(MAKE) doTARBALL \ 558 TN=`echo s$$i | tr -d '.' | \ 559 sed -e 's/usr/u/' \ 560 -e 's/kerberosIV/krb4/' \ 561 -e 's/kerberos5/krb5/'` \ 562 SD=/usr/src TD=src ARG="$$i" ; \ 563 fi ; \ 564 done 565.if defined(EXTRA_SRC) 566 @set ${EXTRA_SRC} && \ 567 while [ $$# -ge 2 ] ; do \ 568 if [ -d /usr/src/$$1 ] ; then \ 569 cd ${.CURDIR} && $(MAKE) doTARBALL \ 570 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \ 571 fi && shift && shift ; \ 572 done 573.endif 574 if [ -d ${RD}/dists/crypto ] ; then ( cd ${RD}/dists/src && \ 575 if [ -f ssecure.aa ] ; then mv ssecure.* ../crypto ; fi && \ 576 if [ -f scrypto.aa ] ; then mv scrypto.* ../crypto ; fi && \ 577 if [ -f skrb4.aa ] ; then mv skrb4.* ../crypto ; fi && \ 578 if [ -f skrb5.aa ] ; then mv skrb5.* ../crypto ; fi ; \ 579 cd ${RD}/dists/crypto; rm -f CHECKSUM.MD5; \ 580 md5 * > CHECKSUM.MD5 ) ; fi 581 (cd ${RD}/dists/src; rm -f CHECKSUM.MD5; md5 * > CHECKSUM.MD5) 582 @echo "src distribution is finished." 583.endif 584 touch release.7 585 586# Complete the bootfd 587# 588# Now, just to get this picture down once and for all: 589# 590# +------------------------------------------------------------------------+ 591# |boot.flp | 592# +-----+-----+------------------------------------------------------------+ 593# |boot1|boot2|floppy filesystem "bootfd" | 594# +-----+-----+-+----------------------+---------------------------------+-+ 595# |kernel.gz |mfsroot.gz | 596# +----------------------+---------------------------------+ 597# 598 599release.8: 600 rm -rf ${RD}/mfsfd 601 mkdir ${RD}/mfsfd 602 cd ${RD}/mfsfd && \ 603 mkdir -p etc/defaults dev mnt stand/help 604 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \ 605 DIR=${RD}/mfsfd/stand ZIP=false 606 ( cd ${RD}/trees/bin/dev && \ 607 ls console tty bpf0 ttyd0 ttyv0 ttyv1 ttyv2 ttyv3 null zero card0 card1 card2 card3 usb usb0 uhid0 ums0 ulpt0 ugen0 kbd0 kmem mem xpt0 | \ 608 cpio -dump ${RD}/mfsfd/dev ) 609 ( cd ${RD}/mfsfd/dev && rm -f *[swo]d*[bdefgh] ) 610 ( cd ${RD}/mfsfd && \ 611 for dir in bin sbin ; do \ 612 ln -sf /stand $$dir; \ 613 done ) 614 cp /sbin/dhclient-script ${RD}/mfsfd/stand 615.if ${MACHINE_ARCH} == "i386" 616 cp ${.CURDIR}/../etc/defaults/pccard.conf ${RD}/mfsfd/etc/defaults/pccard.conf 617.endif 618 cp ${.CURDIR}/../etc/usbd.conf ${RD}/mfsfd/etc/usbd.conf 619 cd ${RD}/trees/bin && ls ${BOOT1} | cpio -dump ${RD}/mfsfd/stand 620 ( for F in netconfig protocols ; do \ 621 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \ 622 ${RD}/trees/bin/etc/$$F > ${RD}/mfsfd/stand/etc/$$F ; \ 623 done ) 624 grep -E '^(ftp|nameserver|domain|sunrpc|cmd|nfsd)[^-\w]' \ 625 ${.CURDIR}/../etc/services | \ 626 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \ 627 > ${RD}/mfsfd/stand/etc/services 628 ln ${RD}/mfsfd/stand/etc/services ${RD}/mfsfd/etc/services 629 ln ${RD}/mfsfd/stand/etc/netconfig ${RD}/mfsfd/etc/netconfig 630 gzip -9c ${.CURDIR}/../COPYRIGHT > ${RD}/mfsfd/stand/help/COPYRIGHT.hlp.gz 631.if !defined(NODOC) 632 @for i in ${DIST_DOCS_ARCH_INDEP}; do \ 633 gzip -9c ${RND}/${RELNOTES_LANG}/$$i/article.txt > ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT.gz; \ 634 done 635 @for i in ${DIST_DOCS_ARCH_DEP}; do \ 636 gzip -9c ${RND}/${RELNOTES_LANG}/$$i/${MACHINE_ARCH}/article.txt > ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT.gz; \ 637 done 638 @mv ${RD}/mfsfd/stand/help/INSTALLATION.TXT.gz ${RD}/mfsfd/stand/help/INSTALL.TXT.gz 639.endif 640 -test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd 641 @mkdir -p ${RD}/mfsfd/boot 642 @cp /boot/boot* ${RD}/mfsfd/boot 643.if ${MACHINE} == "i386" 644 @cp /boot/mbr ${RD}/mfsfd/boot 645.endif 646 @cp /boot/loader.help ${RD}/mfsfd/boot 647 @cd ${.CURDIR} && ${MAKE} createBOOTMFS 648.if exists(${.CURDIR}/${MACHINE}/drivers.conf) 649 @cd ${.CURDIR} && ${MAKE} doMODULES KERNEL=BOOTMFS KERNEL_KO=BOOTMFS KODIR="" 650.endif 651 @echo "Making the regular boot floppy." 652 @tar --exclude CVS -cf - -C /usr/src/usr.sbin/sysinstall help | \ 653 tar xf - -C ${RD}/mfsfd/stand 654 @echo "Compressing doc files..." 655 @gzip -9 ${RD}/mfsfd/stand/help/*.hlp 656.if ${MACHINE_ARCH} == "alpha" 657 rm -rf ${RD}/mfsfd/stand/help/* 658.endif 659.if exists(${.CURDIR}/${MACHINE}/drivers.conf) 660 @mkdir -p ${RD}/mfsfd/stand/modules 661 @perl ${.CURDIR}/scripts/driver-copy2.pl \ 662 ${.CURDIR}/${MACHINE}/drivers.conf \ 663 ${RD}/kernels ${RD}/mfsfd/stand/modules 664.endif 665 sh -e ${.CURDIR}/scripts/doFS.sh -s mfsroot ${RD} ${MNT} \ 666 ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL} 667 @gzip -9vc mfsroot > mfsroot.gz 668.if ${MACHINE} == "pc98" 669 @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/mfsroot.flp \ 670 ${RD} ${MNT} ${SMALLBOOTSIZE} mfsroot.gz \ 671 ${BOOTINODE} ${SMALLBOOTLABEL} 672 @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=kern-small FDSIZE=SMALL 673 @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=kern 674.else 675 @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/mfsroot.flp \ 676 ${RD} ${MNT} ${BOOTSIZE} mfsroot.gz ${BOOTINODE} ${BOOTLABEL} 677 @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=kern 678 @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=boot FDSIZE=BIG 679.endif 680 @rm mfsroot mfsroot.gz 681 @echo "Regular and MFS boot floppies made." 682 touch release.8 683 684# 685# --==## Create a fixit floppy ##==-- 686# 687release.9: 688 @echo "Making fixit floppy." 689 @rm -rf ${RD}/fixitfd 690 @mkdir ${RD}/fixitfd 691 @cd ${RD}/fixitfd && \ 692 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \ 693 usr/share/misc 694 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=fixit \ 695 DIR=${RD}/fixitfd/stand ZIP=false 696 @( cd ${RD}/fixitfd/dev && \ 697 cp ${RD}/trees/bin/dev/MAKEDEV MAKEDEV && \ 698 chmod 755 MAKEDEV) 699 @cp ${RD}/trees/bin/etc/spwd.db ${RD}/trees/bin/etc/group \ 700 ${RD}/trees/bin/etc/protocols ${RD}/fixitfd/etc 701 @cp ${RD}/trees/bin/usr/share/misc/scsi_modes \ 702 ${RD}/fixitfd/usr/share/misc 703 @cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile 704 @cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services 705 @cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar 706 @chmod 555 ${RD}/fixitfd/stand/tar 707 @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/fixit.flp ${RD} \ 708 ${MNT} ${FIXITSIZE} ${RD}/fixitfd ${FIXITINODE} ${FIXITLABEL} 709# Do our last minute floppies directory setup in a convenient place. 710.if !defined(NODOC) 711 @cp ${RND}/${RELNOTES_LANG}/installation/${MACHINE_ARCH}/article.txt \ 712 ${RD}/floppies/README.TXT 713 @(cd ${RD}/floppies; md5 README.TXT *.flp > CHECKSUM.MD5) 714.else 715 @(cd ${RD}/floppies; md5 *.flp > CHECKSUM.MD5) 716.endif 717 touch release.9 718 719# 720# --==## Setup a suitable ftp-area ##==-- 721# 722ftp.1: 723 @echo "Setting up FTP distribution area" 724 @mkdir -p ${FD} 725 -@ln -s . ${FD}/${BUILDNAME} 726 @cd ${RD} && find floppies -print | cpio -dumpl ${FD} 727 @cd ${RD}/dists && find . -print | cpio -dumpl ${FD} 728.if !defined(NODOC) 729 @for i in ${DIST_DOCS_ARCH_INDEP}; do \ 730 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ 731 cp ${RND}/${RELNOTES_LANG}/$$i/article.html ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \ 732 done 733 @for i in ${DIST_DOCS_ARCH_DEP}; do \ 734 cp ${RND}/${RELNOTES_LANG}/$$i/${MACHINE_ARCH}/article.txt ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ 735 cp ${RND}/${RELNOTES_LANG}/$$i/${MACHINE_ARCH}/article.html ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \ 736 done 737 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${FD} 738 @mv ${FD}/INSTALLATION.TXT ${FD}/INSTALL.TXT 739 @mv ${FD}/INSTALLATION.HTM ${FD}/INSTALL.HTM 740.endif 741 @echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf 742.if !defined(NOPORTS) 743 @tar --exclude CVS -cBf - -C ${CD_DISC1} ports | tar -xBf - -C ${FD} 744.endif 745 touch ftp.1 746 747# 748# --==## Setup a suitable cdrom-area ##==-- 749# 750cdrom.1: 751 @echo "Setting up CDROM distribution area" 752 @mkdir -p ${CD_DISC1} ${CD_DISC2} 753 @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1} 754 @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1} 755 @for i in ${DISTRIBUTIONS} ; \ 756 do \ 757 if [ -d ${RD}/trees/$${i} ] ; then \ 758 chflags -R noschg ${RD}/trees/$${i} || true ; \ 759 ( cd ${RD}/trees/$${i} && \ 760 find . -depth -print | cpio -dumpl ${CD_DISC2} ) ; \ 761 fi \ 762 done 763 @rm -f ${CD_DISC2}/.profile 764 @cp ${.CURDIR}/fixit.profile ${CD_DISC2}/.profile 765 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf 766 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf 767.if !defined(NODOC) 768 @for i in ${DIST_DOCS_ARCH_INDEP}; do \ 769 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ 770 cp ${RND}/${RELNOTES_LANG}/$$i/article.html ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \ 771 done 772 @for i in ${DIST_DOCS_ARCH_DEP}; do \ 773 cp ${RND}/${RELNOTES_LANG}/$$i/${MACHINE_ARCH}/article.txt ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ 774 cp ${RND}/${RELNOTES_LANG}/$$i/${MACHINE_ARCH}/article.html ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \ 775 done 776 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DISC1} 777 @mv ${CD_DISC1}/INSTALLATION.TXT ${CD_DISC1}/INSTALL.TXT 778 @mv ${CD_DISC1}/INSTALLATION.HTM ${CD_DISC1}/INSTALL.HTM 779.endif 780.if ${MACHINE} != "pc98" 781 @echo "Setting up /boot" 782 @cp -Rp ${CD_DISC2}/boot ${CD_DISC1} 783 @ln -f ${RD}/image.boot/mfsroot.gz ${CD_DISC1}/boot/mfsroot.gz 784 @ln -f ${CD_DISC1}/boot/mfsroot.gz ${CD_DISC2}/boot/mfsroot.gz 785 @echo 'mfsroot_load="YES"' > ${CD_DISC1}/boot/loader.conf 786 @echo 'mfsroot_type="mfs_root"' >> ${CD_DISC1}/boot/loader.conf 787 @echo 'mfsroot_name="/boot/mfsroot"' >> ${CD_DISC1}/boot/loader.conf 788 @ln -f ${CD_DISC1}/boot/loader.conf ${CD_DISC2}/boot/loader.conf 789.endif 790.if ${MACHINE} == "i386" 791 @mkdir -p ${CD_DISC2}/floppies 792 @cp ${CD_DISC1}/floppies/boot.flp ${CD_DISC2}/floppies 793.endif 794.if !defined(NOPORTS) 795 @mkdir -p ${CD_DISC1}/ports && \ 796 tar --exclude CVS --exclude 'ports/distfiles/*' -czf \ 797 ${CD_DISC1}/ports/ports.tgz -C /usr ports && \ 798 cp ${.CURDIR}/scripts/ports-install.sh ${CD_DISC1}/ports/install.sh \ 799 && (cd ${CD_DISC1}/ports; md5 * > CHECKSUM.MD5) 800.endif 801 touch cdrom.1 802 803iso.1: 804 @if [ -r ${.CURDIR}/${MACHINE_ARCH}/mkisoimages.sh ]; then \ 805 echo "Creating ISO images..."; \ 806 sh ${.CURDIR}/${MACHINE_ARCH}/mkisoimages.sh ${BOOTABLE} \ 807 fbsd_miniinst ${CD}/miniinst.iso ${CD_DISC1}; \ 808 sh ${.CURDIR}/${MACHINE_ARCH}/mkisoimages.sh ${BOOTABLE} \ 809 fbsd_livefs ${CD}/disc2.iso ${CD_DISC2}; \ 810 if [ "x${CD_EXTRA_BITS}" != "x" ]; then \ 811 sh ${.CURDIR}/${MACHINE_ARCH}/mkisoimages.sh ${BOOTABLE} \ 812 fbsd_boot ${CD}/disc1.iso ${CD_DISC1} ${CD_EXTRA_BITS}; \ 813 && false; \ 814 fi \ 815 else \ 816 echo "Do not know how to create an ISO for ${MACHINE_ARCH}."; \ 817 fi 818 touch iso.1 819 820# 821# --==## Documentation Project files such as the Handbook and FAQ ##==-- 822# 823doc.1: 824 @echo "Making docs..." 825 @for i in ${DOCPORTS}; do \ 826 cd /usr/ports/$$i && make all install clean BATCH=yes JADETEX=no FORCE_PKG_REGISTER=yes; \ 827 done 828 @cd /usr/doc && make all install 'FORMATS=html html-split txt' INSTALL_COMPRESSED='' DOCDIR=${RD}/trees/bin/usr/share/doc 829 touch doc.1 830 831# 832# --==## RELNOTESng: Next-generation replacements for *.TXT files ##==-- 833# 834doc.2: 835 @echo "Making release documentation..." 836 @cd ${.CURDIR}/doc && make all install clean 'FORMATS=html txt' INSTALL_COMPRESSED='' DOCDIR=${RND} 837 touch doc.2 838 839# Various "subroutine" and other supporting targets. 840 841# RD= 842# SD= 843# TD= 844# ARG= 845doTARBALL: 846.if !defined(SD) 847 @echo "SD undefined in doTARBALL" && exit 1 848.endif 849.if !defined(TD) 850 @echo "TD undefined in doTARBALL" && exit 1 851.endif 852.if !defined(ARG) 853 @echo "ARG undefined in doTARBALL" && exit 1 854.endif 855 @rm -rf ${RD}/dists/${TD}/${TN}* 856 @mkdir -p ${RD}/dists/${TD} 857 @( cd ${SD} && \ 858 tn=`echo ${TN} | tr '[A-Z]' '[a-z]' | cut -c1-8` && \ 859 echo rolling ${TD}/$$tn tarball &&\ 860 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \ 861 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \ 862 sh ${.CURDIR}/scripts/info.sh ${RD}/dists/${TD}/$$tn > \ 863 ${RD}/dists/${TD}/$$tn.inf && \ 864 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \ 865 cp -p ${.CURDIR}/scripts/$${TD}-install.sh ${RD}/dists/${TD}/install.sh; \ 866 fi && \ 867 if [ "${SD}" != "/usr/src" ]; then \ 868 mtree -c -i -p ${SD}/${ARG} \ 869 -k gname,md5digest,mode,nlink,uname,size,link,type \ 870 > ${RD}/dists/${TD}/$$tn.mtree ; \ 871 else \ 872 true; \ 873 fi; \ 874 (cd ${RD}/dists/${TD}; \ 875 rm -f CHECKSUM.MD5; \ 876 md5 * > CHECKSUM.MD5) \ 877 ) 878 879doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 release.5 \ 880 release.6 release.7 release.8 release.9 881 @cd ${.CURDIR} && ${MAKE} ${EXTRAS} 882 @echo "Release done" 883 884floppies: 885 @cd ${.CURDIR} && ${MAKE} boot.flp 886 @cd ${.CURDIR} && ${MAKE} fixit.flp 887 @cd ${RD} && find floppies -print | cpio -dumpl ${FD} 888 889boot.flp: 890 @rm -f release.4 release.8 891 @cd ${.CURDIR} && ${MAKE} release.4 release.8 CRUNCH_TARGETS=boot 892 893fixit.flp: 894 @rm -f release.4 release.9 895 @cd ${.CURDIR} && ${MAKE} release.4 release.9 CRUNCH_TARGETS=fixit 896 897installCRUNCH: 898.if !defined(CRUNCH) 899 @echo "CRUNCH undefined in installCRUNCH" && exit 1 900.endif 901.if !defined(DIR) 902 @echo "DIR undefined in installCRUNCH" && exit 1 903.endif 904.if !defined(ZIP) 905 @echo "ZIP undefined in installCRUNCH" && exit 1 906.endif 907 @if ${ZIP} ; then \ 908 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \ 909 else \ 910 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \ 911 fi 912 @chmod 555 ${DIR}/${CRUNCH}_crunch 913 @if [ -f ${.CURDIR}/${MACHINE}/${CRUNCH}_crunch.conf ] ; then \ 914 for i in `crunchgen -l ${.CURDIR}/${MACHINE}/${CRUNCH}_crunch.conf` ; do \ 915 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \ 916 done \ 917 else \ 918 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \ 919 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \ 920 done \ 921 fi 922 923# 924# --==## BOOTMFS config file ##==-- 925# 926 927createBOOTMFS: 928 @cd ${.CURDIR}/../sys/${MACHINE}/conf && \ 929 sh ${.CURDIR}/${MACHINE_ARCH}/dokern.sh ${FDSIZE} < ${KERNCONF} > BOOTMFS && \ 930 [ -r ${KERNCONF}.hints ] && cp ${KERNCONF}.hints BOOTMFS.hints 931.if 0 && ${MACHINE_ARCH} == "i386" 932 @echo "options INTRO_USERCONFIG" >> \ 933 ${.CURDIR}/../sys/${MACHINE}/conf/BOOTMFS 934.endif 935.if exists(${.CURDIR}/${MACHINE}/drivers.conf) 936 @perl ${.CURDIR}/scripts/driver-remove.pl \ 937 ${.CURDIR}/${MACHINE}/drivers.conf \ 938 ${.CURDIR}/../sys/${MACHINE}/conf/BOOTMFS 939.endif 940 941# 942# --==## Compile a kernel by name ${KERNEL} ##==-- 943# 944# We don't erase the sys/${MACHINE}/compile/${KERNEL} directory, since somebody 945# may want to reuse it (release.8 presently) 946# 947doKERNEL: 948 @rm -f ${RD}/kernels/${KERNEL} 949 @cd ${.CURDIR}/../sys/${MACHINE}/conf && config ${KERNEL} 950 @cd ${.CURDIR}/../sys/${MACHINE}/compile/${KERNEL} && \ 951 make kernel-depend && \ 952 make -DNO_WERROR ${KERNEL_FLAGS} ${KERNEL_KO} && \ 953 make kernel-reinstall DESTDIR=${RD}/kernels && \ 954 [ -r ${.CURDIR}/../sys/${MACHINE}/conf/${KERNEL}.hints ] && \ 955 cp ${.CURDIR}/../sys/${MACHINE}/conf/${KERNEL}.hints ${RD}/kernels 956 957doMODULES: 958 @rm -f ${RD}/kernels/*.ko 959 @cd ${.CURDIR}/../sys/${MACHINE}/conf && config ${KERNEL} 960 @cd ${.CURDIR}/../sys/${MACHINE}/compile/${KERNEL} && \ 961 make modules-depend && \ 962 make -DNO_WERROR ${KERNEL_FLAGS} modules && \ 963 make modules-reinstall DESTDIR=${RD}/kernels && \ 964 965doSTDKERNEL: 966 @rm -f ${RD}/kernels/${KERNEL} 967 @cd ${.CURDIR}/../sys/${MACHINE}/conf && config ${KERNEL} 968 @cd ${.CURDIR}/../sys/${MACHINE}/compile/${KERNEL} && \ 969 make depend && \ 970 make -DNO_WERROR ${KERNEL_FLAGS} KERNEL=${KERNEL} && \ 971 make KERNEL=${KERNEL} DESTDIR=${RD}/kernels install && \ 972 [ -r ${.CURDIR}/../sys/${MACHINE}/conf/${KERNEL}.hints ] && \ 973 cp ${.CURDIR}/../sys/${MACHINE}/conf/${KERNEL}.hints ${RD}/kernels 974 @-cd ${.CURDIR}/../sys/${MACHINE}/compile/${KERNEL} && \ 975 make KERNEL=${KERNEL} DESTDIR=${RD}/kernels \ 976 kernel-reinstall.debug 977 978# 979# --==## Put a filesystem into a BOOTMFS kernel ##==-- 980# 981doMFSKERN: 982 @echo "Running doMFSKERN for ${FSIMAGE}" 983 @rm -f ${RD}/kernels/BOOTMFS.${FSIMAGE} 984 @cd ${.CURDIR} && ${MAKE} createBOOTMFS 985 @cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=BOOTMFS KERNEL_KO=BOOTMFS KODIR="" 986 @rm -rf ${RD}/image.${FSIMAGE} 987 @mkdir ${RD}/image.${FSIMAGE} 988 @cd ${RD}/kernels && \ 989 (chflags noschg BOOTMFS || true) && \ 990 strip BOOTMFS && \ 991 cp BOOTMFS BOOTMFS.${FSIMAGE} && \ 992 [ -r BOOTMFS.hints ] && mv BOOTMFS.hints BOOTMFS.${FSIMAGE}.hints 993 mv ${RD}/kernels/BOOTMFS ${RD}/image.${FSIMAGE}/kernel 994 @echo "Setting up /boot directory for ${FSIMAGE} floppy" 995 @mkdir -p ${RD}/image.${FSIMAGE}/boot 996.if ${MACHINE} == "i386" 997 @kgzip -vo ${RD}/image.${FSIMAGE}/boot/loader /boot/loader 998.else 999 @cp /boot/loader ${RD}/image.${FSIMAGE}/boot 1000.endif 1001 @[ -r ${RD}/kernels/BOOTMFS.${FSIMAGE}.hints ] && \ 1002 sed -e '/^hint/s/^/set /' -e '/^#/d' \ 1003 ${RD}/kernels/BOOTMFS.${FSIMAGE}.hints > \ 1004 ${RD}/image.${FSIMAGE}/boot/device.hints && \ 1005 echo "include /boot/device.hints" > ${RD}/image.${FSIMAGE}/boot/loader.rc 1006 @echo "load /kernel" >> ${RD}/image.${FSIMAGE}/boot/loader.rc 1007.if !defined(FDSIZE) || ${FDSIZE} != "BIG" 1008 @echo "echo \\007\\007" >> ${RD}/image.${FSIMAGE}/boot/loader.rc 1009 @echo "echo Please insert MFS root floppy and press enter:" >> ${RD}/image.${FSIMAGE}/boot/loader.rc 1010 @echo "read" >> ${RD}/image.${FSIMAGE}/boot/loader.rc 1011.endif 1012 @echo "load -t mfs_root /mfsroot" >> ${RD}/image.${FSIMAGE}/boot/loader.rc 1013 @echo "set hint.acpi.0.disable=1" >> ${RD}/image.${FSIMAGE}/boot/loader.rc 1014 @echo "echo \\007\\007" >> ${RD}/image.${FSIMAGE}/boot/loader.rc 1015 @echo "autoboot 10" >> ${RD}/image.${FSIMAGE}/boot/loader.rc 1016.if ${MACHINE_ARCH} == "i386" && ${AUTO_KEYBOARD_DETECT} 1017 @echo "-P" >> ${RD}/image.${FSIMAGE}/boot.config 1018.endif 1019 @gzip -9v ${RD}/image.${FSIMAGE}/kernel 1020 @rm -f ${RD}/floppies/${FSIMAGE}.flp 1021.if defined(FDSIZE) && ${FDSIZE} == "BIG" 1022 @cp mfsroot.gz ${RD}/image.${FSIMAGE} 1023 sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/${FSIMAGE}.flp \ 1024 ${RD} ${MNT} ${BIGBOOTSIZE} ${RD}/image.${FSIMAGE} \ 1025 ${BOOTINODE} ${BIGBOOTLABEL} 1026.elif defined(FDSIZE) && ${FDSIZE} == "SMALL" 1027 sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/${FSIMAGE}.flp \ 1028 ${RD} ${MNT} ${SMALLBOOTSIZE} ${RD}/image.${FSIMAGE} \ 1029 ${BOOTINODE} ${SMALLBOOTLABEL} 1030.else 1031 sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/${FSIMAGE}.flp \ 1032 ${RD} ${MNT} ${BOOTSIZE} ${RD}/image.${FSIMAGE} \ 1033 ${BOOTINODE} ${BOOTLABEL} 1034.endif 1035 @echo "Created ${RD}/floppies/${FSIMAGE}.flp" 1036 1037.include <bsd.prog.mk> 1038