Makefile revision 93406
1# $FreeBSD: head/release/Makefile 93406 2002-03-30 02:31:17Z murray $ 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= 4000 154MFSINODE= 8000 155SMALLBOOTLABEL= fd1200 156BOOTLABEL= fd1440 157FIXITLABEL= fd1440 158MFSLABEL= minimum3 159.else 160BOOTSIZE= 1440 161FIXITSIZE= 1440 162MFSSIZE= 4320 163BIGBOOTSIZE= 2880 164BOOTINODE= 80000 165FIXITINODE= 4000 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= 4000 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} installworld DESTDIR=${CHROOTDIR} NOMAN=1 272 mkdir ${CHROOTDIR}/${BOOTSTRAPDIR} 273 for i in ${BOOTSTRAPUTILS} ; do \ 274 cp -p ${CHROOTDIR}$$i ${CHROOTDIR}/${BOOTSTRAPDIR} ; \ 275 done 276.if !defined(RELEASETAG) 277 cd ${CHROOTDIR}/usr && rm -rf src && \ 278 cvs -R -d ${CVSROOT} co -P ${RELEASESRCMODULE} 279.else 280 cd ${CHROOTDIR}/usr && rm -rf src && \ 281 cvs -R -d ${CVSROOT} co -P -r ${RELEASETAG} ${RELEASESRCMODULE} 282.endif 283.if defined(LOCAL_PATCHES) && exists(${LOCAL_PATCHES}) 284 cd ${CHROOTDIR}/usr/src && patch ${PATCH_FLAGS} < ${LOCAL_PATCHES} 285.endif 286.if defined(LOCAL_SCRIPT) && exists(${LOCAL_SCRIPT}) 287 cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT} 288.endif 289.if !defined(NOPORTS) 290.if defined(PORTSRELEASETAG) 291 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P -r ${PORTSRELEASETAG} ${RELEASEPORTSMODULE} && cd ports && ${MAKEREADMES} 292.else 293 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P ${RELEASEPORTSMODULE} && cd ports && ${MAKEREADMES} 294.endif 295.elif defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES" 296.if defined(PORTSRELEASETAG) 297 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P -r ${PORTSRELEASETAG} ${MINIMALDOCPORTS} 298.else 299 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P ${MINIMALDOCPORTS} 300.endif 301.endif 302.if !defined(NODOC) 303.if defined(DOCRELEASETAG) 304 cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co -P -r ${DOCRELEASETAG} ${RELEASEDOCMODULE} 305.else 306 cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co -P ${RELEASEDOCMODULE} 307.endif 308 if [ -d ${RELEASEDISTFILES}/ ]; then \ 309 cp -rp ${RELEASEDISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \ 310 else \ 311 mkdir -p ${CHROOTDIR}/usr/ports/distfiles; \ 312 fi 313.endif 314.endif 315.if make(rerelease) 316.if !defined(RELEASENOUPDATE) 317.if !defined(RELEASETAG) 318 cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d 319.else 320 cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d -r ${RELEASETAG} 321.endif 322.if !defined(NOPORTS) 323 cd ${CHROOTDIR}/usr/ports && cvs -R -q update -P -d 324.endif 325.if defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES" 326 for i in ${MINIMALDOCPORTS}; do \ 327 ( cd ${CHROOTDIR}/usr/$$i && cvs -R -q update -P -d ) ; \ 328 done 329.endif 330.if !defined(NODOC) 331 cd ${CHROOTDIR}/usr/doc && cvs -R -q update -P -d 332.endif 333.endif 334.endif 335 # Add version information to those things that need it. 336 ( cd ${CHROOTDIR}/usr/src/sys/conf && \ 337 mv newvers.sh foo && \ 338 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && rm foo ) 339 echo OBJFORMAT=${OBJFORMAT} > ${CHROOTDIR}/etc/objformat 340 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release 341 echo "#!/bin/sh" > ${CHROOTDIR}/mk 342 echo "set -ex" >> ${CHROOTDIR}/mk 343 echo "_RELTARGET=\$${1:-doRELEASE}" >> ${CHROOTDIR}/mk 344 echo "export CFLAGS='-O -pipe'" >> ${CHROOTDIR}/mk 345 echo "export WITHOUT_X11=YES" >> ${CHROOTDIR}/mk 346 echo "export DISTRIBUTIONS=\"${DISTRIBUTIONS}\"" >> ${CHROOTDIR}/mk 347 echo "export BUILDNAME=${BUILDNAME}" >> ${CHROOTDIR}/mk 348 echo "export OBJFORMAT=${OBJFORMAT}" >> ${CHROOTDIR}/mk 349.if defined(RELEASETAG) 350 echo "export RELEASETAG=\"${RELEASETAG}\"" >> ${CHROOTDIR}/mk 351.endif 352.if defined(NOPORTS) 353 echo "export NOPORTS=${NOPORTS}" >> ${CHROOTDIR}/mk 354.endif 355.if defined(MAKE_ISOS) 356 echo "export MAKE_ISOS=${MAKE_ISOS}" >> ${CHROOTDIR}/mk 357.endif 358.if defined(DOMINIMALDOCPORTS) 359 echo "export DOMINIMALDOCPORTS=${DOMINIMALDOCPORTS}" >> ${CHROOTDIR}/mk 360.endif 361.if defined(NODOC) 362 echo "export NODOC=${NODOC}" >> ${CHROOTDIR}/mk 363.endif 364.if defined(ALLLANG) && ${ALLLANG} != "NO" && ${ALLLANG} != "no" 365 echo "export ALLLANG=${ALLLANG}" >> ${CHROOTDIR}/mk 366.else 367 echo "export DOC_LANG=en_US.ISO8859-1" >> ${CHROOTDIR}/mk 368.endif 369.if defined(NOSRC) 370 echo "export NOSRC=${NOSRC}" >> ${CHROOTDIR}/mk 371.endif 372.if defined(RELNOTES_LANG) 373 echo "export RELNOTES_LANG=${RELNOTES_LANG}" >> ${CHROOTDIR}/mk 374.else 375 echo "export RELNOTES_LANG=en_US.ISO8859-1" >> ${CHROOTDIR}/mk 376.endif 377.if defined(NOSHARED) 378 echo "export NOSHARED=${NOSHARED}" >> ${CHROOTDIR}/mk 379.endif 380.if defined(BOOT_CONFIG) 381 echo "export BOOT_CONFIG=\"${BOOT_CONFIG}\"">> ${CHROOTDIR}/mk 382.endif 383.if defined(KERNEL_FLAGS) 384 echo "export KERNEL_FLAGS=\"${KERNEL_FLAGS}\"" >> ${CHROOTDIR}/mk 385.endif 386 # Don't remove this, or the build will fall over! 387 echo "export RELEASEDIR=${_R}" >> ${CHROOTDIR}/mk 388 echo "export PATH=${BOOTSTRAPDIR}:$${PATH}:${LOCALDIR}" >> ${CHROOTDIR}/mk 389 echo "export TMPDIR=/tmp" >> ${CHROOTDIR}/mk 390 echo "if [ ! -f /tmp/.world_done ]; then" >> ${CHROOTDIR}/mk 391 echo " cd /usr/src" >> ${CHROOTDIR}/mk 392.if make(release) 393 echo " (cd etc; make distrib-dirs distribution)" >> ${CHROOTDIR}/mk 394 echo " make ${WORLD_FLAGS} world && \\" >> ${CHROOTDIR}/mk 395.endif 396.if make(rerelease) 397 echo " make ${WORLD_FLAGS} all install && \\" >> ${CHROOTDIR}/mk 398.endif 399 echo " touch /tmp/.world_done" >> ${CHROOTDIR}/mk 400 echo "fi" >> ${CHROOTDIR}/mk 401 echo "cd /usr/src/release" >> ${CHROOTDIR}/mk 402 echo "make obj" >> ${CHROOTDIR}/mk 403 echo "make \$${_RELTARGET}" >> ${CHROOTDIR}/mk 404 echo "echo \">>> make ${.TARGET} finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${CHROOTDIR}/mk 405 chmod 755 ${CHROOTDIR}/mk 406 chroot ${CHROOTDIR} /mk 407 408clean: 409 rm -rf boot_crunch release.[0-9] 410 411# Clean out ${_R} and make the directory structure. 412release.1: 413 mkdir -p ${_R} 414 -rm -rf ${_R}/* 2> /dev/null 415 -chflags -R noschg ${_R}/. 416 rm -rf ${_R}/* 417 mkdir ${RD} 418 mkdir ${RD}/floppies 419 mkdir ${RD}/trees 420 mkdir ${RD}/dists 421 mkdir ${RD}/kernels 422 for i in ${DISTRIBUTIONS} ; do \ 423 mkdir ${RD}/trees/$$i && \ 424 mkdir ${RD}/dists/$$i && \ 425 mtree -deU -f ${MTREEFILES}/BSD.root.dist \ 426 -p ${RD}/trees/$$i > /dev/null && \ 427 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \ 428 -p ${RD}/trees/$$i/usr > /dev/null && \ 429 mtree -deU -f ${MTREEFILES}/BSD.include.dist \ 430 -p ${RD}/trees/$$i/usr/include > /dev/null && \ 431 mtree -deU -f ${MTREEFILES}/BSD.var.dist \ 432 -p ${RD}/trees/$$i/var > /dev/null ; \ 433 done 434 touch release.1 435 436# Install the system into the various distributions. 437release.2: 438 cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/bin 439 cd ${.CURDIR}/.. && make distribworld DISTDIR=${RD}/trees 440.if exists(${.CURDIR}/../kerberosIV) && exists(${.CURDIR}/../crypto) && !defined(NOKERBEROS) 441 cd ${.CURDIR}/../kerberosIV && ( \ 442 make bootstrap &&\ 443 make obj all help-distribute DISTDIR=${RD}/trees &&\ 444 make kprog \ 445 ) 446.endif 447.if exists(${.CURDIR}/../kerberos5) && exists(${.CURDIR}/../crypto) && !defined(NOKERBEROS) 448 cd ${.CURDIR}/../kerberos5 && ( \ 449 make bootstrap &&\ 450 make obj all help-distribute DISTDIR=${RD}/trees &&\ 451 make kprog \ 452 ) 453.endif 454 -chflags -R noschg ${RD}/trees 455 touch release.2 456 457# Make and install the generic kernel(s). 458release.3: 459.for kernel in ${KERNELS} 460 -chflags -R noschg ${RD}/kernels/${kernel} 461 rm -rf ${RD}/kernels/${kernel} 462 rm -rf ${.CURDIR}/../sys/${MACHINE}/compile/${kernel} 463 cd ${.CURDIR} && ${MAKE} doSTDKERNEL KERNEL=${kernel} KODIR=/${kernel} 464 rm -rf ${.CURDIR}/../sys/${MACHINE}/compile/${kernel} 465 -mkdir ${RD}/trees/bin/boot/${kernel} 466 cp -p ${RD}/kernels/${kernel}/kernel ${RD}/trees/bin/boot/${kernel} 467.endfor 468 # Install a standard boot kernel+modules 469 mkdir -p ${RD}/trees/bin/boot/kernel 470 cp -Rp ${RD}/kernels/GENERIC/* ${RD}/trees/bin/boot/kernel 471 touch release.3 472 473# Make and install the three crunched binaries which live on the floppies. 474# You are not supposed to like this :-) 475release.4: 476 @mkdir -p /stand 477 rm -rf ${RD}/crunch 478 mkdir -p ${RD}/crunch 479 for j in ${CRUNCH_TARGETS} ; do \ 480 rm -rf $${j}_crunch && \ 481 mkdir $${j}_crunch && \ 482 ( cd $${j}_crunch && \ 483 ( ( [ -f ${.CURDIR}/${MACHINE}/$${j}_crunch.conf ] && \ 484 crunchgen ${.CURDIR}/${MACHINE}/$${j}_crunch.conf ) || \ 485 ( crunchgen ${.CURDIR}/$${j}_crunch.conf ) ) && \ 486 ${MAKE} -f $${j}_crunch.mk subclean all ) && \ 487 mv $${j}_crunch/$${j}_crunch ${RD}/crunch/$${j} && \ 488 true || { rm -rf $${j}_crunch ; false ; } ; \ 489 done 490 touch release.4 491 492# 493# --==## Fix up the distributions. ##==-- 494# 495release.5: 496 # Handle some grief caused by the munition braindeadness. 497 for i in ${FIXCRYPTO}; do \ 498 ( cd ${.CURDIR}/../$$i; \ 499 make -DNOCRYPT clean all distribute DISTDIR=${RD}/trees ) ; \ 500 done 501 502 # Create any "synthetic dists" now. 503 @for i in ${DISTRIBUTIONS}; do \ 504 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \ 505 echo -n "Running $$i dist creation script... "; \ 506 env OBJFORMAT=${OBJFORMAT} RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \ 507 echo "Done."; \ 508 fi \ 509 done \ 510 511 # Remove all the directories we don't need. 512 -cd ${RD}/trees && \ 513 find ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} -depth -type d -print | xargs rmdir 514 touch release.5 515 516# 517# --==## Package up the tarballs from assembled trees ##==-- 518# 519release.6: 520 rm -rf ${RD}/dists 521 mkdir -p ${RD}/dists 522 @for i in ${DISTRIBUTIONS} ; \ 523 do \ 524 if [ -d ${RD}/trees/$${i} ] ; then \ 525 cd ${.CURDIR} && $(MAKE) doTARBALL \ 526 SD=${RD}/trees/$${i} \ 527 TN=$$i TD=$$i ARG="." && \ 528 echo "$${i} distribution is finished."; \ 529 fi ; \ 530 done 531 # More munition braindeadness. 532 ( cd ${RD}/dists && \ 533 if [ -f krb4/krb4.aa ] ; then \ 534 mv krb4/krb4.* crypto && \ 535 cat krb4/CHECKSUM.MD5 >> crypto/CHECKSUM.MD5 && \ 536 rm -r krb4; \ 537 fi ) 538 ( cd ${RD}/dists && \ 539 if [ -f krb5/krb5.aa ] ; then \ 540 mv krb5/krb5.* crypto && \ 541 cat krb5/CHECKSUM.MD5 >> crypto/CHECKSUM.MD5 && \ 542 rm -r krb5; \ 543 fi ) 544 touch release.6 545 546 547# 548# --==## Make source dists ##==-- 549# 550release.7: 551.if !defined(NOSRC) 552 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \ 553 TD=src TN=sbase ARG="[A-Z]*" 554 @for i in `cd /usr/src && echo [a-z]*` ; do \ 555 if [ -d /usr/src/$$i ] ; then \ 556 cd ${.CURDIR} && $(MAKE) doTARBALL \ 557 TN=`echo s$$i | tr -d '.' | \ 558 sed -e 's/usr/u/' \ 559 -e 's/kerberosIV/krb4/' \ 560 -e 's/kerberos5/krb5/'` \ 561 SD=/usr/src TD=src ARG="$$i" ; \ 562 fi ; \ 563 done 564.if defined(EXTRA_SRC) 565 @set ${EXTRA_SRC} && \ 566 while [ $$# -ge 2 ] ; do \ 567 if [ -d /usr/src/$$1 ] ; then \ 568 cd ${.CURDIR} && $(MAKE) doTARBALL \ 569 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \ 570 fi && shift && shift ; \ 571 done 572.endif 573 if [ -d ${RD}/dists/crypto ] ; then ( cd ${RD}/dists/src && \ 574 if [ -f ssecure.aa ] ; then mv ssecure.* ../crypto ; fi && \ 575 if [ -f scrypto.aa ] ; then mv scrypto.* ../crypto ; fi && \ 576 if [ -f skrb4.aa ] ; then mv skrb4.* ../crypto ; fi && \ 577 if [ -f skrb5.aa ] ; then mv skrb5.* ../crypto ; fi ; \ 578 cd ${RD}/dists/crypto; rm -f CHECKSUM.MD5; \ 579 md5 * > CHECKSUM.MD5 ) ; fi 580 (cd ${RD}/dists/src; rm -f CHECKSUM.MD5; md5 * > CHECKSUM.MD5) 581 @echo "src distribution is finished." 582.endif 583 touch release.7 584 585# Complete the bootfd 586# 587# Now, just to get this picture down once and for all: 588# 589# +------------------------------------------------------------------------+ 590# |boot.flp | 591# +-----+-----+------------------------------------------------------------+ 592# |boot1|boot2|floppy filesystem "bootfd" | 593# +-----+-----+-+----------------------+---------------------------------+-+ 594# |kernel.gz |mfsroot.gz | 595# +----------------------+---------------------------------+ 596# 597 598release.8: 599 rm -rf ${RD}/mfsfd 600 mkdir ${RD}/mfsfd 601 cd ${RD}/mfsfd && \ 602 mkdir -p etc/defaults dev mnt stand/help 603 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \ 604 DIR=${RD}/mfsfd/stand ZIP=false 605 ( cd ${RD}/trees/bin/dev && \ 606 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 | \ 607 cpio -dump ${RD}/mfsfd/dev ) 608 ( cd ${RD}/mfsfd/dev && rm -f *[swo]d*[bdefgh] ) 609 ( cd ${RD}/mfsfd && \ 610 for dir in bin sbin ; do \ 611 ln -sf /stand $$dir; \ 612 done ) 613 cp /sbin/dhclient-script ${RD}/mfsfd/stand 614.if ${MACHINE_ARCH} == "i386" 615 cp ${.CURDIR}/../etc/defaults/pccard.conf ${RD}/mfsfd/etc/defaults/pccard.conf 616.endif 617 cp ${.CURDIR}/../etc/usbd.conf ${RD}/mfsfd/etc/usbd.conf 618 cd ${RD}/trees/bin && ls ${BOOT1} | cpio -dump ${RD}/mfsfd/stand 619 ( for F in netconfig protocols ; do \ 620 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \ 621 ${RD}/trees/bin/etc/$$F > ${RD}/mfsfd/stand/etc/$$F ; \ 622 done ) 623 grep -E '^(ftp|nameserver|domain|sunrpc|cmd|nfsd)[^-\w]' \ 624 ${.CURDIR}/../etc/services | \ 625 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \ 626 > ${RD}/mfsfd/stand/etc/services 627 ln ${RD}/mfsfd/stand/etc/services ${RD}/mfsfd/etc/services 628 ln ${RD}/mfsfd/stand/etc/netconfig ${RD}/mfsfd/etc/netconfig 629 gzip -9c ${.CURDIR}/../COPYRIGHT > ${RD}/mfsfd/stand/help/COPYRIGHT.hlp.gz 630.if !defined(NODOC) 631 @for i in ${DIST_DOCS_ARCH_INDEP}; do \ 632 gzip -9c ${RND}/${RELNOTES_LANG}/$$i/article.txt > ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT.gz; \ 633 done 634 @for i in ${DIST_DOCS_ARCH_DEP}; do \ 635 gzip -9c ${RND}/${RELNOTES_LANG}/$$i/${MACHINE_ARCH}/article.txt > ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT.gz; \ 636 done 637 @mv ${RD}/mfsfd/stand/help/INSTALLATION.TXT.gz ${RD}/mfsfd/stand/help/INSTALL.TXT.gz 638.endif 639 -test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd 640 @mkdir -p ${RD}/mfsfd/boot 641 @cp /boot/boot* ${RD}/mfsfd/boot 642.if ${MACHINE} == "i386" 643 @cp /boot/mbr ${RD}/mfsfd/boot 644.endif 645 @cp /boot/loader.help ${RD}/mfsfd/boot 646 @cd ${.CURDIR} && ${MAKE} createBOOTMFS 647.if exists(${.CURDIR}/${MACHINE}/drivers.conf) 648 @cd ${.CURDIR} && ${MAKE} doMODULES KERNEL=BOOTMFS KERNEL_KO=BOOTMFS KODIR="" 649.endif 650 @echo "Making the regular boot floppy." 651 @tar --exclude CVS -cf - -C /usr/src/usr.sbin/sysinstall help | \ 652 tar xf - -C ${RD}/mfsfd/stand 653 @echo "Compressing doc files..." 654 @gzip -9 ${RD}/mfsfd/stand/help/*.hlp 655.if ${MACHINE_ARCH} == "alpha" 656 rm -rf ${RD}/mfsfd/stand/help/* 657.endif 658.if exists(${.CURDIR}/${MACHINE}/drivers.conf) 659 @mkdir -p ${RD}/mfsfd/stand/modules 660 @perl ${.CURDIR}/scripts/driver-copy2.pl \ 661 ${.CURDIR}/${MACHINE}/drivers.conf \ 662 ${RD}/kernels ${RD}/mfsfd/stand/modules 663.endif 664 sh -e ${.CURDIR}/scripts/doFS.sh -s mfsroot ${RD} ${MNT} \ 665 ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL} 666 @gzip -9vc mfsroot > mfsroot.gz 667.if ${MACHINE} == "pc98" 668 @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/mfsroot.flp \ 669 ${RD} ${MNT} ${SMALLBOOTSIZE} mfsroot.gz \ 670 ${BOOTINODE} ${SMALLBOOTLABEL} 671 @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=kern-small FDSIZE=SMALL 672 @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=kern 673.else 674 @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/mfsroot.flp \ 675 ${RD} ${MNT} ${BOOTSIZE} mfsroot.gz ${BOOTINODE} ${BOOTLABEL} 676 @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=kern 677 @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=boot FDSIZE=BIG 678.endif 679 @rm mfsroot mfsroot.gz 680 @echo "Regular and MFS boot floppies made." 681 touch release.8 682 683# 684# --==## Create a fixit floppy ##==-- 685# 686release.9: 687 @echo "Making fixit floppy." 688 @rm -rf ${RD}/fixitfd 689 @mkdir ${RD}/fixitfd 690 @cd ${RD}/fixitfd && \ 691 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \ 692 usr/share/misc 693 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=fixit \ 694 DIR=${RD}/fixitfd/stand ZIP=false 695 @( cd ${RD}/fixitfd/dev && \ 696 cp ${RD}/trees/bin/dev/MAKEDEV MAKEDEV && \ 697 chmod 755 MAKEDEV && \ 698 sh MAKEDEV fixit ) 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 "echo \\007\\007" >> ${RD}/image.${FSIMAGE}/boot/loader.rc 1014 @echo "autoboot 10" >> ${RD}/image.${FSIMAGE}/boot/loader.rc 1015.if ${MACHINE_ARCH} == "i386" && ${AUTO_KEYBOARD_DETECT} 1016 @echo "-P" >> ${RD}/image.${FSIMAGE}/boot.config 1017.endif 1018 @gzip -9v ${RD}/image.${FSIMAGE}/kernel 1019 @rm -f ${RD}/floppies/${FSIMAGE}.flp 1020.if defined(FDSIZE) && ${FDSIZE} == "BIG" 1021 @cp mfsroot.gz ${RD}/image.${FSIMAGE} 1022 sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/${FSIMAGE}.flp \ 1023 ${RD} ${MNT} ${BIGBOOTSIZE} ${RD}/image.${FSIMAGE} \ 1024 ${BOOTINODE} ${BIGBOOTLABEL} 1025.elif defined(FDSIZE) && ${FDSIZE} == "SMALL" 1026 sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/${FSIMAGE}.flp \ 1027 ${RD} ${MNT} ${SMALLBOOTSIZE} ${RD}/image.${FSIMAGE} \ 1028 ${BOOTINODE} ${SMALLBOOTLABEL} 1029.else 1030 sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/${FSIMAGE}.flp \ 1031 ${RD} ${MNT} ${BOOTSIZE} ${RD}/image.${FSIMAGE} \ 1032 ${BOOTINODE} ${BOOTLABEL} 1033.endif 1034 @echo "Created ${RD}/floppies/${FSIMAGE}.flp" 1035 1036.include <bsd.prog.mk> 1037