1# $FreeBSD$ 2# 3# make release [BUILDNAME=somename] CHROOTDIR=/some/dir 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 present in the kernel 13# (either by being compiled in or available as a kld(4) module), 14# otherwise the target 'release.8' and possibly others will fail. 15# 16# Note: If you add options to this file, please keep release(7) updated! 17# 18# Set these, release builder! 19# 20# Fixed version: 21#BUILDNAME=8.0-CURRENT 22# 23# Automatic SNAP versioning: 24DATE != date +%Y%m%d 25BASE = 8.0 26BUILDNAME?=${BASE}-${DATE}-SNAP 27# 28#CHROOTDIR=/junk/release 29# If this is a -stable snapshot, then set 30#RELEASETAG=RELENG_7 31# 32# To test a release with a source tree containing patches and 33# other work. This tree will get copied instead of getting the 34# src/ tree from a CVS checkout. For "rerelease", this will NOT 35# be copied; cvs update will be used instead. 36#EXTSRCDIR=/usr/src 37# 38# To use a checked-out ports collection directory instead of 39# checking out from a local CVS repository, set this option. 40#EXTPORTSDIR=/usr/ports 41# 42# To add other options to the CVS subcommands (co,up), set 43#CVSCMDARGS="-D '01/01/2002 00:00:00 UTC'" 44# 45# To add other options to the CVS command, set 46#CVSARGS="-lfq" 47# 48# To prefix the cvs command 49#CVSPREFIX="/usr/bin/time" 50# 51# Where the CVS repository is 52#CVSROOT="/home/ncvs" 53# 54# Non-zero if ${RELEASETAG} is in the form "RELENG_ver_RELEASE"; we 55# are building an official release. Otherwise, we are building for 56# a branch. 57.if defined(RELEASETAG) 58ISRELEASE!= expr "${RELEASETAG}" : '^RELENG_.*_RELEASE$$' || true 59.if ${ISRELEASE} != 0 60# Convert "RELENG_ver_RELEASE" to "RELEASE_ver" for ports and doc trees. 61AUXRELEASETAG!= echo ${RELEASETAG} | sed -e 's/^RELENG_/RELEASE_/' -e 's/_RELEASE$$//' 62DOCRELEASETAG?= ${AUXRELEASETAG} 63PORTSRELEASETAG?= ${AUXRELEASETAG} 64.endif 65.endif 66 67# If you want to pass flags to the world build such as -j X, use 68# WORLD_FLAGS. Similarly, you can specify make flags for kernel 69# builds via KERNEL_FLAGS. 70#WORLD_FLAGS=-j4 71#KERNEL_FLAGS=-j4 72 73TARGET_ARCH?= ${MACHINE_ARCH} 74.if ${TARGET_ARCH} == ${MACHINE_ARCH} 75TARGET?= ${MACHINE} 76.else 77TARGET?= ${TARGET_ARCH} 78.endif 79CROSSENV= TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET} 80CROSSMAKE= ${MAKE} ${CROSSENV} 81NATIVEMAKE= ${MAKE} TARGET_ARCH=${MACHINE_ARCH} TARGET=${MACHINE} 82 83# If you are using a local CVS repository with components stored in 84# non-standard modules, override these on the make commandline or 85# in the environment. 86RELEASESRCMODULE?= src 87RELEASEDOCMODULE?= doc 88RELEASEPORTSMODULE?= ports 89 90# Uncomment this to disable the doc.1 target. Docs normally require 91# the ports tree, so NOPORTS can be set together with NODOC in order 92# to have neither ports or docs. If only NOPORTS is set to YES, but 93# docs are still desired, the DOMINIMALDOCPORTS logic below will only 94# install the ports that are minimally required for the docs. This is 95# intended as a compromise, less disk space is required than for using 96# the entire ports collection (and much less time due to the huge number 97# of directories it would create), but still quite a bit as well as some 98# CPU cycles (some of the programs are C++, and things like ghostscript 99# belong to the required ports nevertheless). 100# 101# Setting this also disables building of release note documentation 102# (RELNOTESng). 103#NODOC= YES 104#NOPORTS= YES 105 106# When retrieving ports using the pkg_add -r method, set your proxies to these. 107# src/release/${arch}/mkisoimages.sh can use these. 108#HTTP_PROXY?= www.example.com 109#FTP_PROXY?= ftp.example.com 110 111# When creating ISO images, point ${CD_PACKAGE_TREE} to a directory containing 112# the package split by an earlier invocation of the 'package-split' target. 113#CD_PACKAGE_TREE= /path/to/pkg 114 115# Extra source tarballs; each argument is a pair of source dir and 116# distribution name. The dist name should not exceed 7 characters 117# (another "s" for "source" will be prepended). 118#EXTRA_SRC= games/fortune fortune 119 120# Modify this definition if you want the release notes 121# and other release documentation in a language other than English. 122RELNOTES_LANG?= en_US.ISO8859-1 123 124# As an alternative to installing the entire ports collection (which 125# can take a huge amount of time, in particular on slower disks), 126# setting ${MINIMALDOCPORTS} allows to install and build just those 127# ports that are really required for getting the docs up & running. 128.if defined(NOPORTS) && !defined(NODOC) 129DOMINIMALDOCPORTS= YES 130.include "Makefile.inc.docports" 131RELEASEPORTSMODULE= ${MINIMALDOCPORTS} 132.endif 133 134# Helper variable 135.if defined(NOPORTS) 136.if !defined(DOMINIMALDOCPORTS) || ${DOMINIMALDOCPORTS} != "YES" 137NOPORTSATALL= YES 138.endif 139.endif 140 141# 142# Doing 'make index' in /usr/ports requires Perl. 143MAKEINDEXPORTS= lang/perl5.8 144# By default, documentation (Handbook, FAQ, etc.) is built for all 145# the languages. To speed up building, set the DOC_LANG to just 146# the languages you need. (The language for the release notes is 147# controlled by the RELNOTES_LANG variable above.) 148#DOC_LANG= en_US.ISO8859-1 149DOCPORTS= textproc/docproj 150# Set this to wherever the distfiles required by release procedures. 151.if defined(DOCDISTFILES) 152# Respect DOCDISTFILES which is used before. 153RELEASEDISTFILES?= ${DOCDISTFILES} 154.else 155RELEASEDISTFILES?= ${.CURDIR}/../../ports/distfiles 156.endif 157# Set this to 1 if you want -P to be used for automatic keyboard detection 158# on the boot floppy. WARNING: Breaks on some Athlon (K7) motherboards. 159AUTO_KEYBOARD_DETECT?= 0 160 161.if !defined(NODOC) 162DIST_DOCS_ARCH_INDEP= hardware readme relnotes errata 163DIST_DOCS_ARCH_DEP= 164.endif 165 166# Things which without too much trouble can be considered variables 167# BASE_DISTS are special in that they get full /etc installation sets. 168# 169OTHER_DISTS?= catpages manpages games proflibs dict info doc ${ARCH_DISTS} 170BASE_DISTS?= base 171.if ${TARGET_ARCH} == "amd64" 172ARCH_DISTS?= lib32 173.endif 174DISTRIBUTIONS?= ${BASE_DISTS} ${OTHER_DISTS} 175 176# 177# Build and package both GENERIC and SMP kernels if the target 178# has both configuration files. Otherwise only GENERIC is done. 179# 180.if exists(${.CURDIR}/../sys/${TARGET}/conf/SMP) 181KERNELS_BASE?= GENERIC SMP 182.else 183KERNELS_BASE?= GENERIC 184.endif 185 186# mountpoint for filesystems. 187MNT= /mnt 188 189# Various floppy image parameters. 190# 191 192.undef MAKE_FLOPPIES 193.if ${TARGET_ARCH} == "i386" 194MAKE_FLOPPIES= true 195SEPARATE_LIVEFS= 196SPLIT_MFSROOT= 197.if ${TARGET} == "pc98" 198SMALLFLOPPYSIZE= 1200 199SMALLFLOPPYSPLITSIZE= 1152 200SMALLFLOPPYLABEL= fd1200 201SPLIT_MFSROOT= 202.endif 203FLOPPYSIZE= 1440 204FLOPPYSPLITSIZE= 1392 205FLOPPYINODE= 40000 206FLOPPYLABEL= fd1440 207BOOTINODE= 80000 208MFSSIZE= 4320 209MFSINODE= 8000 210MFSLABEL= minimum3 211.elif ${TARGET_ARCH} == "sparc64" 212DISKLABEL= sunlabel 213MFSSIZE= 4096 214MFSINODE= 8192 215MFSLABEL= auto 216MINIROOT= 217.elif ${TARGET_ARCH} == "ia64" 218DISKLABEL= "" 219MFSSIZE= 8192 220MFSINODE= 8192 221MFSLABEL= auto 222SEPARATE_LIVEFS= 223.elif ${TARGET_ARCH} == "amd64" 224MAKE_FLOPPIES= true 225FLOPPYSIZE= 1440 226FLOPPYSPLITSIZE= 1392 227FLOPPYINODE= 40000 228FLOPPYLABEL= fd1440 229BOOTINODE= 80000 230MFSSIZE= 4096 231MFSINODE= 8192 232MFSLABEL= auto 233SEPARATE_LIVEFS= 234SPLIT_MFSROOT= 235.elif ${TARGET_ARCH} == "powerpc" 236DISKLABEL= "" 237MFSSIZE= 4096 238MFSINODE= 8192 239MFSLABEL= auto 240SEPARATE_LIVEFS= 241.endif 242.if defined(NO_FLOPPIES) 243.undef MAKE_FLOPPIES 244.endif 245 246.if exists(/sbin/bsdlabel) 247DISKLABEL?= bsdlabel 248.else 249DISKLABEL?= disklabel 250.endif 251 252ZIPPER= gzip -9 --no-name 253ZIPNSPLIT= ${ZIPPER} -c | split -b 1392k - 254 255# Things which may get you into trouble if you change them 256MTREEFILES= ${.CURDIR}/../etc/mtree 257_R?= /R 258RD= ${_R}/stage 259RND= ${RD}/release.doc 260FD= ${_R}/ftp 261CD= ${_R}/cdrom 262CD_BOOT= ${CD}/bootonly 263CD_DISC1= ${CD}/disc1 264CD_DISC2= ${CD}/disc2 265.if !defined(NODOC) 266CD_DOCS= ${CD}/docs 267.endif 268.if defined(SEPARATE_LIVEFS) 269CD_LIVEFS= ${CD}/livefs 270.else 271CD_LIVEFS= ${CD_DISC1} 272.endif 273_MK?= ${CHROOTDIR}/mk 274 275# Where the bootstrap ports (see DOCPORTS) get installed. 276LOCALDIR= /usr/local/bin 277 278.if ${TARGET} != ${MACHINE} && ${DISKLABEL} == "bsdlabel" 279DOFS_SH= ${.CURDIR}/scripts/doFS.sh ${DISKLABEL} ${TARGET} 280.else 281DOFS_SH= ${.CURDIR}/scripts/doFS.sh ${DISKLABEL} "" 282.endif 283 284CRUNCH_TARGETS= boot 285.if ${TARGET_ARCH} == "i386" 286CRUNCH_TARGETS+=fixit 287.if ${TARGET} == "pc98" 288CRUNCH_TARGETS+=fixit-small 289.endif 290.endif 291 292.if defined(MAKE_FLOPPIES) 293EXTRAS= floppies.1 294.if ${TARGET_ARCH} == "i386" 295EXTRAS+= floppies.2 296.endif 297EXTRAS+= floppies.3 298.endif 299EXTRAS+= ftp.1 300.if !defined(NOCDROM) 301EXTRAS+= cdrom.1 cdrom.2 cdrom.3 302.if defined(MAKE_ISOS) 303EXTRAS+= iso.1 304.endif 305.if ${TARGET} == "pc98" 306BOOTABLE="-G" 307.else 308BOOTABLE="-b" 309.endif 310.endif 311 312.if !defined(NODOC) 313DOCREL= doc.1 doc.2 314.endif 315 316.if !make(release) && !make(rerelease) && !make(package-split) 317BINMAKE!= cd ${.CURDIR}/..; ${MAKE} -V BINMAKE 318WMAKEENV!= cd ${.CURDIR}/..; \ 319 ${BINMAKE} ${CROSSENV} -f Makefile.inc1 -V WMAKEENV 320WMAKE= ${WMAKEENV} ${BINMAKE} 321.endif 322 323CVS_SRCARGS= -P 324.if defined(RELEASETAG) 325CVS_SRCARGS+= -r ${RELEASETAG} 326.endif 327 328CVS_DOCARGS= -P 329.if defined(DOCRELEASETAG) 330CVS_DOCARGS+= -r ${DOCRELEASETAG} 331.endif 332 333CVS_PORTSARGS= -P 334.if defined(PORTSRELEASETAG) 335CVS_PORTSARGS+= -r ${PORTSRELEASETAG} 336.endif 337 338WORLDDIR?= ${.CURDIR}/.. 339 340release rerelease: 341.if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT) 342 @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false 343.endif 344.if defined(NOPORTSATALL) && !defined(NODOC) 345 @echo "Ports are required for building the docs. Either set NODOC or" 346 @echo "unset NOPORTS, or set at least DOMINIMALDOCPORTS to YES!" 347 @exit 1 348.endif 349.if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES) 350.for p in ${LOCAL_PATCHES} 351.if !exists(${p}) 352 @echo "The patch file ${p} does not exist!" 353 @exit 1 354.endif 355.endfor 356.endif 357.if defined(LOCAL_SCRIPT) && !exists(${LOCAL_SCRIPT}) 358 @echo "The local script ${LOCAL_SCRIPT} does not exist!" 359 @exit 1 360.endif 361.if make(release) 362.if exists(${CHROOTDIR}) 363# The first command will fail on a handful of files that have their schg 364# flags set. But it greatly speeds up the next two commands. 365 # NB: clear any vestigial devfs mount, just in case 366 -umount ${CHROOTDIR}/dev > /dev/null 2>&1 367 -rm -rf ${CHROOTDIR} 2>/dev/null 368 -chflags -R 0 ${CHROOTDIR}/. 369 -rm -rf ${CHROOTDIR} 370.endif 371 mkdir -p ${CHROOTDIR} 372 @echo ">>> make release for ${TARGET} started on `LC_ALL=C TZ=GMT date`" 373 cd ${WORLDDIR} && ${NATIVEMAKE} -DWITHOUT_GAMES -DWITHOUT_HTML -DWITHOUT_LIB32 \ 374 -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_PROFILE installworld DESTDIR=${CHROOTDIR} 375 cd ${WORLDDIR} && ${NATIVEMAKE} distribution DESTDIR=${CHROOTDIR} 376 if [ -f /etc/resolv.conf ]; then \ 377 cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \ 378 fi 379.if defined(EXTLOCALDIR) 380 rm -rf ${CHROOTDIR}/usr/local 381 cd ${CHROOTDIR}/usr && cp -R -H ${EXTLOCALDIR} local 382.endif 383 rm -rf ${CHROOTDIR}/usr/src 384.if defined(EXTSRCDIR) 385 cd ${CHROOTDIR}/usr && \ 386 cp -R -H ${EXTSRCDIR} src 387.else 388 cd ${CHROOTDIR}/usr && \ 389 ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \ 390 co ${CVSCMDARGS} ${CVS_SRCARGS} ${RELEASESRCMODULE} 391.endif 392.if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES) 393.for p in ${LOCAL_PATCHES} 394 patch -d ${CHROOTDIR}/usr/${RELEASESRCMODULE} ${PATCH_FLAGS} < ${p} 395.endfor 396.endif 397.if defined(LOCAL_SCRIPT) 398 cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} \ 399 RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT} 400.endif 401 rm -rf ${CHROOTDIR}/usr/ports 402.if !defined(NOPORTSATALL) 403.if defined(EXTPORTSDIR) 404 cd ${CHROOTDIR}/usr && cp -R -H ${EXTPORTSDIR} ports 405 # If there are distfiles downloaded removing them 406 rm -rf ports/distfiles/* 407.else 408 cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \ 409 co ${CVSCMDARGS} ${CVS_PORTSARGS} ${RELEASEPORTSMODULE} 410.endif 411.endif 412.if !defined(NODOC) 413 rm -rf ${CHROOTDIR}/usr/doc 414.if defined(EXTDOCDIR) 415 cd ${CHROOTDIR}/usr && cp -R -H ${EXTDOCDIR} doc 416.else 417 cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \ 418 co ${CVSCMDARGS} ${CVS_DOCARGS} ${RELEASEDOCMODULE} 419.endif 420 if [ -d ${RELEASEDISTFILES}/ ]; then \ 421 cp -rp ${RELEASEDISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \ 422 else \ 423 mkdir -p ${CHROOTDIR}/usr/ports/distfiles; \ 424 fi 425.if !defined(NO_PREFETCHDISTFILES) 426 @cd ${.CURDIR} && ${MAKE} fetch-distfiles 427.endif 428.endif 429.endif 430.if make(rerelease) 431.if !defined(RELEASENOUPDATE) && !defined(EXTSRCDIR) 432.if !defined(RELEASETAG) 433 cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \ 434 update ${CVSCMDARGS} -P -d -A 435.else 436 cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \ 437 update ${CVSCMDARGS} -P -d -r ${RELEASETAG} 438.endif 439 rm -f ${CHROOTDIR}/tmp/.world_done 440.if !defined(NOPORTS) && !defined(EXTPORTSDIR) 441 cd ${CHROOTDIR}/usr/ports && ${CVSPREFIX} cvs -R ${CVSARGS} -q \ 442 update ${CVSCMDARGS} -P -d 443 rm -f ${CHROOTDIR}/tmp/.skip_ports_index 444.endif 445.if defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES" 446 for i in ${MINIMALDOCPORTS}; do \ 447 ( cd ${CHROOTDIR}/usr/$$i && ${CVSPREFIX} cvs -R ${CVSARGS} -q \ 448 update ${CVSCMDARGS} -P -d ) ; \ 449 done 450.endif 451.if !defined(NODOC) 452 cd ${CHROOTDIR}/usr/doc && ${CVSPREFIX} cvs -R ${CVSARGS} -q \ 453 update ${CVSCMDARGS} -P -d 454.endif 455.endif 456.endif 457 # Add version information to those things that need it. 458 if [ ! -f ${CHROOTDIR}/tmp/.world_done ]; then \ 459 cd ${CHROOTDIR}/usr/src/sys/conf && \ 460 mv newvers.sh foo && \ 461 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && \ 462 rm foo; \ 463 fi 464 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release 465 echo "#!/bin/sh" > ${_MK} 466 echo "set -ex" >> ${_MK} 467 echo "trap 'umount /dev || true' 0" >> ${_MK} 468 echo "_RELTARGET=\$${1:-doRELEASE}" >> ${_MK} 469.for var in \ 470 AUTO_KEYBOARD_DETECT \ 471 BUILDNAME \ 472 CD_PACKAGE_TREE \ 473 DISTRIBUTIONS \ 474 DOC_LANG \ 475 DOMINIMALDOCPORTS \ 476 EXTRA_SRC \ 477 FTP_PASSIVE_MODE \ 478 FTP_PROXY \ 479 HTTP_PROXY \ 480 KERNELS \ 481 KERNELS_BASE \ 482 KERNEL_FLAGS \ 483 MAKE_FLOPPIES \ 484 MAKE_ISOS \ 485 NOCDROM \ 486 NODOC \ 487 NOPORTS \ 488 NO_SHARED \ 489 NOSRC \ 490 NO_CPU_CFLAGS \ 491 NO_CPU_COPTFLAGS \ 492 NO_FLOPPIES \ 493 RELEASETAG \ 494 RELNOTES_LANG \ 495 SEPARATE_LIVEFS \ 496 TARGET \ 497 TARGET_ARCH \ 498 WORLD_FLAGS 499.if defined(${var}) 500 echo "export ${var}=\"${${var}}\"" >> ${_MK} 501.endif 502.endfor 503 # Don't remove this, or the build will fall over! 504 echo "export RELEASEDIR=${_R}" >> ${_MK} 505 echo "export PATH=/bin:/usr/bin:/sbin:/usr/sbin:${LOCALDIR}" >> ${_MK} 506 echo "export MANBUILDCAT=YES" >> ${_MK} 507 # NB: these may fail if the host is running w/o devfs 508 echo "umount /dev >/dev/null 2>&1 || true" >> ${_MK} 509 echo "mount -t devfs devfs /dev >/dev/null 2>&1 || true" >> ${_MK} 510 echo "if [ ! -c /dev/null ]; then" >> ${_MK} 511 echo " echo /dev/null is not a device!" >> ${_MK} 512 echo " exit 1" >> ${_MK} 513 echo "fi" >> ${_MK} 514 echo "if [ -x /etc/rc.d/ldconfig ]; then" >> ${_MK} 515 echo " /etc/rc.d/ldconfig start" >> ${_MK} 516 echo "else" >> ${_MK} 517 echo " ldconfig /lib /usr/lib /usr/local/lib || true" >> ${_MK} 518 echo "fi" >> ${_MK} 519 echo "if [ ! -f /tmp/.world_done ]; then" >> ${_MK} 520 echo " cd /usr/src" >> ${_MK} 521 echo " ${CROSSMAKE} ${WORLD_FLAGS} -DNO_CLEAN buildworld && \\" >> ${_MK} 522 echo " touch /tmp/.world_done || exit 1" >> ${_MK} 523 echo "fi" >> ${_MK} 524 echo "if [ ! -f /tmp/.skip_ports_index ]; then" >> ${_MK} 525 echo " echo \">>> make index started on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK} 526 echo " for i in ${MAKEINDEXPORTS}" >> ${_MK} 527 echo " do" >> ${_MK} 528 echo " cd /usr/ports/\$${i}" >> ${_MK} 529 echo " env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \\" >> ${_MK} 530 echo " make all install clean BATCH=yes FORCE_PKG_REGISTER=yes" >> ${_MK} 531 echo " done" >> ${_MK} 532 echo " cd /usr/ports" >> ${_MK} 533 echo " rm -f INDEX*" >> ${_MK} 534 echo " make index -DINDEX_PRISTINE" >> ${_MK} 535 echo " rm -f INDEX*.tmp" >> ${_MK} 536 echo " touch /tmp/.skip_ports_index" >> ${_MK} 537 echo " echo \">>> make index finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK} 538 echo "fi" >> ${_MK} 539 echo "cd /usr/src/release" >> ${_MK} 540 echo "make obj" >> ${_MK} 541 echo "make \$${_RELTARGET}" >> ${_MK} 542 echo "echo \">>> make ${.TARGET} for ${TARGET} finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK} 543 chmod 755 ${_MK} 544.if defined(NOPORTS) 545 touch ${CHROOTDIR}/tmp/.skip_ports_index 546.endif 547 # Ensure md.ko is loaded if md(4) is not statically compiled into 548 # the kernel 549 -mdconfig 2>/dev/null 550 env -i /usr/sbin/chroot `dirname ${_MK}` /`basename ${_MK}` 551 552clean: 553 rm -rf ${CRUNCH_TARGETS:S/$/_crunch/} release.[0-8] ${EXTRAS} 554 555fetch-distfiles: 556 @for i in ${MAKEINDEXPORTS}; do \ 557 cd ${CHROOTDIR}/usr/ports/$$i && \ 558 make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \ 559 checksum-recursive ; \ 560 done 561 @for i in ${DOCPORTS}; do \ 562 cd ${CHROOTDIR}/usr/ports/$$i && \ 563 make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \ 564 WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes \ 565 checksum-recursive ; \ 566 done 567 568# Clean out ${_R} and make the directory structure. 569release.1: 570 mkdir -p ${_R} 571 -rm -rf ${_R}/* 2> /dev/null 572 -chflags -R noschg ${_R}/. 573 rm -rf ${_R}/* 574 mkdir ${RD} 575.if defined(MAKE_FLOPPIES) 576 mkdir ${RD}/floppies 577.endif 578 mkdir ${RD}/trees 579 for i in ${DISTRIBUTIONS}; do \ 580 mkdir ${RD}/trees/$$i && \ 581 mtree -deU -f ${MTREEFILES}/BSD.root.dist \ 582 -p ${RD}/trees/$$i > /dev/null && \ 583 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \ 584 -p ${RD}/trees/$$i/usr > /dev/null && \ 585 mtree -deU -f ${MTREEFILES}/BSD.include.dist \ 586 -p ${RD}/trees/$$i/usr/include > /dev/null && \ 587 mtree -deU -f ${MTREEFILES}/BSD.var.dist \ 588 -p ${RD}/trees/$$i/var > /dev/null ; \ 589 done 590 mkdir ${RD}/kernels 591 for i in ${KERNELS_BASE} ${KERNELS}; do \ 592 mkdir -p ${RD}/kernels/$${i}; \ 593 done 594 touch ${.TARGET} 595 596# Install the system into the various distributions. 597release.2: 598 cd ${.CURDIR}/.. && ${CROSSMAKE} distrib-dirs DESTDIR=${RD}/trees/base 599 cd ${.CURDIR}/.. && ${CROSSMAKE} ${WORLD_FLAGS} distributeworld \ 600 DISTDIR=${RD}/trees 601 touch ${.TARGET} 602 603# Make and install the generic kernel(s). 604release.3: 605.for kernel in ${KERNELS_BASE} ${KERNELS} 606 cd ${.CURDIR}/..; \ 607 ${CROSSMAKE} ${KERNEL_FLAGS} \ 608 KERNCONF=${kernel} kernel \ 609 DESTDIR=${RD}/kernels KODIR=/${kernel} 610.endfor 611 touch ${.TARGET} 612 613# Make and install the three crunched binaries which live on the floppies. 614# You are not supposed to like this :-) 615release.4: 616 rm -rf ${RD}/crunch 617 mkdir -p ${RD}/crunch 618.for j in ${CRUNCH_TARGETS} 619.if exists(${.CURDIR}/${TARGET}/${j}_crunch.conf) 620 rm -rf ${j}_crunch 621 mkdir ${j}_crunch 622 cd ${j}_crunch; ${WMAKEENV} MAKEFLAGS="-m ${.CURDIR}/../share/mk" \ 623 NO_WERROR= crunchgen -o \ 624 ${.CURDIR}/${TARGET}/${j}_crunch.conf 625 cd ${j}_crunch; ${WMAKE} -f ${j}_crunch.mk subclean 626 cd ${.CURDIR}/..; ${BINMAKE} -f Makefile.inc1 _build-tools 627 cd ${j}_crunch; CFLAGS="-Os -pipe" ${WMAKE} -f ${j}_crunch.mk \ 628 -DNO_CPU_CFLAGS all 629 ${WMAKEENV} strip -R .comment ${j}_crunch/${j}_crunch 630 mv ${j}_crunch/${j}_crunch ${RD}/crunch/${j} 631.endif 632.endfor 633 touch ${.TARGET} 634 635# 636# --==## Fix up the distributions. ##==-- 637# 638release.5: 639 # Create any "synthetic dists" now. 640 @for i in ${DISTRIBUTIONS}; do \ 641 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \ 642 echo -n "Running $$i dist creation script... "; \ 643 env RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \ 644 echo "Done."; \ 645 fi \ 646 done \ 647 648 # Remove all the directories we don't need. 649 -cd ${RD}/trees && \ 650 (find ${OTHER_DISTS} -path '*/var/empty' | xargs chflags noschg; \ 651 find ${OTHER_DISTS} -depth -type d -empty -print | xargs rmdir) 652 touch ${.TARGET} 653 654# 655# --==## Package up the tarballs from assembled trees ##==-- 656# 657release.6: 658 rm -rf ${RD}/dists 659 mkdir -p ${RD}/dists 660 @for i in ${DISTRIBUTIONS} ; \ 661 do \ 662 if [ -d ${RD}/trees/$${i} ] ; then \ 663 cd ${.CURDIR} && $(MAKE) doTARBALL \ 664 SD=${RD}/trees/$${i} \ 665 TN=$$i TD=$$i ARG="." && \ 666 echo "$${i} distribution is finished."; \ 667 fi ; \ 668 done 669 @for i in ${KERNELS_BASE} ${KERNELS} ; \ 670 do \ 671 if [ -d ${RD}/kernels/$${i} ] ; then \ 672 cd ${.CURDIR} && $(MAKE) doTARBALL \ 673 SD=${RD}/kernels \ 674 TN=$$i TD=kernels ARG="$$i" && \ 675 echo "$${i} distribution is finished."; \ 676 fi ; \ 677 done 678.if !defined(NOPORTS) 679 # XXX: Inline stripped version of doTARBALL 680 @rm -rf ${RD}/dists/ports/ports* 681 @mkdir -p ${RD}/dists/ports 682 @echo rolling ports/ports tarball 683 @tar --exclude CVS --exclude 'ports/distfiles/*' \ 684 -czf ${RD}/dists/ports/ports.tgz -C /usr ports 685 @cp ${.CURDIR}/scripts/ports-install.sh ${RD}/dists/ports/install.sh 686 @(cd ${RD}/dists/ports; \ 687 rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \ 688 md5 * > .CHECKSUM.MD5; \ 689 sha256 * > .CHECKSUM.SHA256; \ 690 mv .CHECKSUM.MD5 CHECKSUM.MD5; \ 691 mv .CHECKSUM.SHA256 CHECKSUM.SHA256) 692 @echo "ports distribution is finished." 693.endif 694 touch ${.TARGET} 695 696 697# 698# --==## Make source dists ##==-- 699# 700release.7: 701.if !defined(NOSRC) 702 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \ 703 TD=src TN=sbase ARG="[A-Z]*" 704 @for i in `cd /usr/src && echo [a-z]*` ; do \ 705 if [ -d /usr/src/$$i ] ; then \ 706 cd ${.CURDIR} && $(MAKE) doTARBALL \ 707 TN=`echo s$$i | tr -d '.' | \ 708 sed -e 's/usr/u/' \ 709 -e 's/kerberos5/krb5/'` \ 710 SD=/usr/src TD=src ARG="$$i" ; \ 711 fi ; \ 712 done 713.if defined(EXTRA_SRC) 714 @set ${EXTRA_SRC} && \ 715 while [ $$# -ge 2 ] ; do \ 716 if [ -d /usr/src/$$1 ] ; then \ 717 cd ${.CURDIR} && $(MAKE) doTARBALL \ 718 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \ 719 fi && shift && shift ; \ 720 done 721.endif 722 (cd ${RD}/dists/src; \ 723 rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \ 724 md5 * > .CHECKSUM.MD5; \ 725 sha256 * > .CHECKSUM.SHA256; \ 726 mv .CHECKSUM.MD5 CHECKSUM.MD5; \ 727 mv .CHECKSUM.SHA256 CHECKSUM.SHA256) 728 @echo "src distribution is finished." 729.endif 730 touch ${.TARGET} 731 732# Build the memory root filesystem. 733release.8: 734 cp ${RD}/trees/base/etc/disktab /etc 735 rm -rf ${RD}/mfsfd 736 mkdir ${RD}/mfsfd 737 cd ${RD}/mfsfd && \ 738 mkdir -p etc/defaults dev mnt stand/etc/defaults stand/help \ 739 var/empty 740 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \ 741 DIR=${RD}/mfsfd/stand ZIP=false 742 ( cd ${RD}/mfsfd && \ 743 for dir in bin sbin ; do \ 744 ln -sf /stand $$dir; \ 745 done ) 746 cp ${RD}/trees/base/sbin/dhclient-script ${RD}/mfsfd/stand 747 cp ${.CURDIR}/../etc/master.passwd ${RD}/mfsfd/etc/master.passwd 748 cp ${RD}/trees/base/etc/*pwd.db ${RD}/mfsfd/etc/ 749 ( for F in defaults/rc.conf netconfig protocols ; do \ 750 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \ 751 ${RD}/trees/base/etc/$$F > ${RD}/mfsfd/stand/etc/$$F ; \ 752 done ) 753 grep -E '^(ftp|nameserver|domain|sunrpc|cmd|nfsd)[^-\w]' \ 754 ${RD}/trees/base/etc/services | \ 755 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \ 756 > ${RD}/mfsfd/stand/etc/services 757 grep 'operator' ${RD}/trees/base/etc/group \ 758 > ${RD}/mfsfd/stand/etc/group 759 ln ${RD}/mfsfd/stand/etc/services ${RD}/mfsfd/etc/services 760 ln ${RD}/mfsfd/stand/etc/group ${RD}/mfsfd/etc/group 761 ln ${RD}/mfsfd/stand/etc/netconfig ${RD}/mfsfd/etc/netconfig 762 cp ${RD}/trees/base/COPYRIGHT ${RD}/mfsfd/stand/help/COPYRIGHT.hlp 763.if !defined(NODOC) 764 @for i in ${DIST_DOCS_ARCH_INDEP}; do \ 765 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \ 766 ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ 767 done 768 @for i in ${DIST_DOCS_ARCH_DEP}; do \ 769 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \ 770 ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ 771 done 772.endif 773 -test -f ${.CURDIR}/install.cfg \ 774 && cp ${.CURDIR}/install.cfg ${RD}/mfsfd 775 @mkdir -p ${RD}/mfsfd/boot 776.if ${TARGET_ARCH} != "ia64" && ${TARGET_ARCH} != "powerpc" 777 @cp ${RD}/trees/base/boot/boot* ${RD}/mfsfd/boot 778.endif 779.if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64" 780 @cp ${RD}/trees/base/boot/mbr ${RD}/mfsfd/boot 781.endif 782 @tar --exclude CVS -cf - -C ${.CURDIR}/../usr.sbin/sysinstall help | \ 783 tar xf - -C ${RD}/mfsfd/stand 784 @mkdir -p ${RD}/mfsroot 785 sh -e ${DOFS_SH} ${RD}/mfsroot/mfsroot ${RD} ${MNT} \ 786 ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL} 787 @${ZIPPER} -fv ${RD}/mfsroot/mfsroot 788 touch ${.TARGET} 789 790KERNFLOPPYSET= ${RD}/floppyset/kern/kernel.gz 791.if defined(SMALLFLOPPYSIZE) 792SMALLKERNFLOPPYSET= ${RD}/floppyset/kern-small/kernel.gz 793.endif 794.if defined(SPLIT_MFSROOT) 795MFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot/mfsroot.gz 796.if defined(SMALLFLOPPYSIZE) 797SMALLMFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot-small/mfsroot.gz 798.endif 799.endif 800 801# Build boot and install floppies. 802floppies.1: 803 @${ZIPPER} -c ${RD}/kernels/GENERIC/kernel > ${RD}/kernels/kernel.gz 804 @echo "Making the kernel boot floppies..." 805 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern \ 806 FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz 807.if defined(SMALLFLOPPYSIZE) 808 @echo "Making the small kernel boot floppies..." 809 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern-small \ 810 FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz \ 811 FDSIZE="SMALL" 812.endif 813.if defined(SPLIT_MFSROOT) 814 @echo "Making the mfsroot boot floppies..." 815 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot \ 816 FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz 817.if defined(SMALLFLOPPYSIZE) 818 @echo "Making the small mfsroot boot floppies..." 819 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot-small \ 820 FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz \ 821 FDSIZE="SMALL" 822.endif 823 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \ 824 KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \ 825 MFSROOTFILE="${MFSROOTFLOPPYSET}.split ${MFSROOTFLOPPYSET}.boot" 826.if defined(SMALLFLOPPYSIZE) 827 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \ 828 KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \ 829 MFSROOTFILE="${SMALLMFSROOTFLOPPYSET}.split ${SMALLMFSROOTFLOPPYSET}.boot" \ 830 FDSIZE="SMALL" 831.endif 832.else # !SPLIT_MFSROOT 833 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \ 834 KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \ 835 MFSROOTFILE=${RD}/mfsroot/mfsroot.gz 836.if defined(SMALLFLOPPYSIZE) 837 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \ 838 KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \ 839 MFSROOTFILE=${RD}/mfsroot/mfsroot.gz \ 840 FDSIZE="SMALL" 841.endif 842.endif # SPLIT_MFSROOT 843 touch ${.TARGET} 844 845# Build fixit floppy. 846floppies.2: 847 @echo "Making fixit floppy." 848 @rm -rf ${RD}/fixitfd 849 @mkdir ${RD}/fixitfd 850 @cd ${RD}/fixitfd && \ 851 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \ 852 usr/share/misc 853 @cp ${RD}/trees/base/etc/spwd.db ${RD}/trees/base/etc/group \ 854 ${RD}/fixitfd/etc 855 @sed -e 's/#.*//' ${RD}/trees/base/etc/protocols \ 856 > ${RD}/fixitfd/etc/protocols 857 @sed -e 's/#.*//' ${RD}/trees/base/usr/share/misc/scsi_modes \ 858 > ${RD}/fixitfd/usr/share/misc/scsi_modes 859 @cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile 860 @cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services 861 @cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar 862 @chmod 555 ${RD}/fixitfd/stand/tar 863.if defined(SMALLFLOPPYSIZE) 864 @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit-small \ 865 DIR=${RD}/fixitfd/stand ZIP=false 866 @sh -e ${DOFS_SH} ${RD}/floppies/fixit-small.flp ${RD} ${MNT} \ 867 ${SMALLFLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${SMALLFLOPPYLABEL} 868 @rm -rf ${RD}/fixitfd/stand 869 @mkdir ${RD}/fixitfd/stand 870.endif 871 @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit \ 872 DIR=${RD}/fixitfd/stand ZIP=false 873 @sh -e ${DOFS_SH} ${RD}/floppies/fixit.flp ${RD} ${MNT} \ 874 ${FLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${FLOPPYLABEL} 875 touch ${.TARGET} 876 877# Do our last minute floppies directory setup 878floppies.3: 879 @(cd ${RD}/floppies; md5 *.flp > CHECKSUM.MD5) 880 @(cd ${RD}/floppies; sha256 *.flp > CHECKSUM.SHA256) 881 touch ${.TARGET} 882 883# 884# --==## Setup a suitable ftp-area ##==-- 885# 886ftp.1: 887 @echo "Setting up FTP distribution area" 888 @mkdir -p ${FD} 889 -@ln -s . ${FD}/${BUILDNAME} 890.if defined(MAKE_FLOPPIES) 891 @cd ${RD} && find floppies -print | cpio -dumpl ${FD} 892.endif 893 @cd ${RD}/dists && find . -print | cpio -dumpl ${FD} 894.if !defined(NODOC) 895 @for i in ${DIST_DOCS_ARCH_INDEP}; do \ 896 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \ 897 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ 898 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \ 899 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \ 900 done 901 @for i in ${DIST_DOCS_ARCH_DEP}; do \ 902 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \ 903 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ 904 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \ 905 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \ 906 done 907 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${FD} 908.endif 909 @echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf 910 touch ${.TARGET} 911 912# Build a live filesystem cdrom image 913cdrom.1: 914 @echo "Building CDROM live filesystem image" 915 @mkdir -p ${CD_LIVEFS} 916 @for i in ${DISTRIBUTIONS} ; \ 917 do \ 918 if [ -d ${RD}/trees/$${i} ] ; then \ 919 chflags -R noschg ${RD}/trees/$${i} || true ; \ 920 ( cd ${RD}/trees/$${i} && \ 921 find . -depth -print | cpio -dumpl ${CD_LIVEFS} ) ; \ 922 fi \ 923 done 924 @echo "Copy GENERIC kernel to boot area" 925 @cp -Rp ${RD}/kernels/GENERIC/ ${CD_LIVEFS}/boot/kernel 926 @rm -f ${CD_LIVEFS}/boot/kernel/*.symbols 927 @rm -f ${CD_LIVEFS}/.profile 928 @cp ${.CURDIR}/fixit.profile ${CD_LIVEFS}/.profile 929 @ln -sf /rescue ${CD_LIVEFS}/stand 930 @echo "Setting up CDROM boot area" 931 @rm -f ${CD_LIVEFS}/boot/loader.conf 932 @cp ${RD}/mfsroot/mfsroot.gz ${CD_LIVEFS}/boot/mfsroot.gz 933 @echo 'mfsroot_load="YES"' > ${CD_LIVEFS}/boot/loader.conf 934 @echo 'mfsroot_type="mfs_root"' >> ${CD_LIVEFS}/boot/loader.conf 935 @echo 'mfsroot_name="/boot/mfsroot"' >> ${CD_LIVEFS}/boot/loader.conf 936.if exists(${RD}/trees/base/boot/device.hints) 937 # Break the link to device.hints so we can modify it 938 @rm -f ${CD_LIVEFS}/boot/device.hints 939 @cp ${RD}/trees/base/boot/device.hints ${CD_LIVEFS}/boot/device.hints 940.endif 941 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_LIVEFS}/cdrom.inf 942 touch ${.TARGET} 943 944# Build disc1 and disc2 cdrom images 945cdrom.2: 946 @echo "Building CDROM disc1 filesystem image" 947 @mkdir -p ${CD_DISC1}/${BUILDNAME} 948.if defined(MAKE_FLOPPIES) 949 @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1} 950.endif 951 @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}/${BUILDNAME} 952.if !defined(NODOC) 953 @for i in ${DIST_DOCS_ARCH_INDEP}; do \ 954 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \ 955 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ 956 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \ 957 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \ 958 done 959 @for i in ${DIST_DOCS_ARCH_DEP}; do \ 960 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \ 961 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ 962 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \ 963 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \ 964 done 965 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DISC1} 966.endif 967.if defined(SEPARATE_LIVEFS) 968 @cp -Rp ${CD_LIVEFS}/boot ${CD_DISC1} 969 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf 970.endif 971 @echo "CD_VOLUME = 1" >> ${CD_DISC1}/cdrom.inf 972 @echo "Building CDROM disc2 filesystem image" 973 @mkdir -p ${CD_DISC2} 974 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf 975 @echo "CD_VOLUME = 2" >> ${CD_DISC2}/cdrom.inf 976.if !defined(NODOC) 977 echo "Building CDROM docs filesystem image" 978 @mkdir -p ${CD_DOCS} 979 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DOCS}/cdrom.inf 980 @mkdir -p ${CD_DOCS}/usr/share/doc 981 @for i in `ls ${CD_LIVEFS}/usr/share/doc`; do \ 982 if [ -L ${CD_LIVEFS}/usr/share/doc/$$i -o \ 983 -d /usr/doc/$$i ]; then \ 984 mv ${CD_LIVEFS}/usr/share/doc/$$i \ 985 ${CD_DOCS}/usr/share/doc; \ 986 fi \ 987 done 988.endif 989 touch ${.TARGET} 990 991# 992# --==## Setup a suitable cdrom-area ##==-- 993# 994cdrom.3: 995.if defined(CD_BOOT) 996 @echo "Building bootonly CDROM filesystem image" 997 @mkdir -p ${CD_BOOT} 998 @cp -Rp ${CD_LIVEFS}/boot ${CD_BOOT} 999 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_BOOT}/cdrom.inf 1000.if defined(MINIROOT) 1001 @echo "Building bootonly UFS filesystem image" 1002 @mkdir -p ${FD}/miniroot 1003 @sh -e ${DOFS_SH} ${FD}/miniroot/miniroot.ufs \ 1004 ${RD} ${MNT} 0 ${CD_BOOT} 8192 auto 1005 @${ZIPPER} -v ${FD}/miniroot/miniroot.ufs 1006.endif 1007.endif 1008 touch ${.TARGET} 1009 1010.if make(iso.1) 1011.if defined(CD_PACKAGE_TREE) 1012.if exists(${CD_PACKAGE_TREE}/disc1) 1013CD_DISC1_PKGS= ${CD_PACKAGE_TREE}/disc1 1014.endif 1015.if exists(${CD_PACKAGE_TREE}/disc2) 1016CD_DISC2_PKGS= ${CD_PACKAGE_TREE}/disc2 1017.endif 1018.endif 1019.endif 1020 1021iso.1: 1022.if exists(${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh) 1023 @echo "Creating ISO images..." 1024.if defined(CD_BOOT) 1025 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ 1026 FreeBSD_bootonly \ 1027 ${CD}/${BUILDNAME}-${TARGET}-bootonly.iso ${CD_BOOT} 1028.endif 1029 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ 1030 FreeBSD_Install \ 1031 ${CD}/${BUILDNAME}-${TARGET}-disc1.iso ${CD_DISC1} \ 1032 ${CD_DISC1_PKGS} 1033 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \ 1034 FreeBSD_Packages \ 1035 ${CD}/${BUILDNAME}-${TARGET}-disc2.iso ${CD_DISC2} \ 1036 ${CD_DISC2_PKGS} 1037.if !defined(NODOC) 1038 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \ 1039 FreeBSD_Documentation \ 1040 ${CD}/${BUILDNAME}-${TARGET}-docs.iso ${CD_DOCS} 1041.endif 1042.if defined(SEPARATE_LIVEFS) 1043 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ 1044 FreeBSD_LiveFS \ 1045 ${CD}/${BUILDNAME}-${TARGET}-livefs.iso ${CD_LIVEFS} 1046.endif 1047 @echo "Generating MD5 and SHA256 sums..." 1048 @(cd ${CD} && md5 *.iso > ${BUILDNAME}-${TARGET}-iso.CHECKSUM.MD5) 1049 @(cd ${CD} && sha256 *.iso > ${BUILDNAME}-${TARGET}-iso.CHECKSUM.SHA256) 1050 touch ${.TARGET} 1051.else 1052 @echo "Do not know how to create an ISO for ${TARGET_ARCH}." 1053.endif 1054 1055# 1056# --==## Documentation Project files such as the Handbook and FAQ ##==-- 1057# 1058doc.1: 1059 @echo "Making docs..." 1060 @for i in ${DOCPORTS}; do \ 1061 cd /usr/ports/$$i && \ 1062 env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \ 1063 make all install clean BATCH=yes WITHOUT_X11=yes JADETEX=no \ 1064 WITHOUT_PYTHON=yes FORCE_PKG_REGISTER=yes; \ 1065 done 1066 @cd /usr/doc && make all install 'FORMATS=html html-split txt' \ 1067 INSTALL_COMPRESSED='' DOCDIR=${RD}/trees/base/usr/share/doc \ 1068 URLS_ABSOLUTE=YES 1069 touch ${.TARGET} 1070 1071# 1072# --==## RELNOTESng: Next-generation replacements for *.TXT files ##==-- 1073# 1074doc.2: 1075 @echo "Making release documentation..." 1076 @cd ${.CURDIR}/doc && make all install clean 'FORMATS=html txt' \ 1077 INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${RND} 1078 touch ${.TARGET} 1079 1080# Various "subroutine" and other supporting targets. 1081 1082# RD= 1083# SD= 1084# TD= 1085# ARG= 1086doTARBALL: 1087.if !defined(SD) 1088 @echo "SD undefined in doTARBALL" && exit 1 1089.endif 1090.if !defined(TD) 1091 @echo "TD undefined in doTARBALL" && exit 1 1092.endif 1093.if !defined(ARG) 1094 @echo "ARG undefined in doTARBALL" && exit 1 1095.endif 1096 @rm -rf ${RD}/dists/${TD}/${TN}* 1097 @mkdir -p ${RD}/dists/${TD} 1098 @( cd ${SD} && \ 1099 tn=`echo ${TN} | tr 'A-Z' 'a-z'` && \ 1100 echo rolling ${TD}/$$tn tarball &&\ 1101 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \ 1102 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \ 1103 sh ${.CURDIR}/scripts/info.sh ${RD}/dists/${TD}/$$tn \ 1104 > ${RD}/dists/${TD}/$$tn.inf && \ 1105 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \ 1106 cp -p ${.CURDIR}/scripts/$${TD}-install.sh \ 1107 ${RD}/dists/${TD}/install.sh && \ 1108 chmod +x ${RD}/dists/${TD}/install.sh; \ 1109 fi && \ 1110 if [ "${SD}" != "/usr/src" ]; then \ 1111 mtree -c -i -p ${SD}/${ARG} \ 1112 -k gname,md5digest,mode,nlink,uname,size,link,type \ 1113 > ${RD}/dists/${TD}/$$tn.mtree ; \ 1114 else \ 1115 true; \ 1116 fi; \ 1117 ( cd ${RD}/dists/${TD}; \ 1118 rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \ 1119 md5 * > .CHECKSUM.MD5; \ 1120 sha256 * > .CHECKSUM.SHA256; \ 1121 mv .CHECKSUM.MD5 CHECKSUM.MD5; \ 1122 mv .CHECKSUM.SHA256 CHECKSUM.SHA256) \ 1123 ) 1124 1125doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 \ 1126 release.5 release.6 release.7 release.8 ${EXTRAS} 1127 @echo "Release done" 1128 1129floppies: 1130 @rm -f release.4 release.8 floppies.[123] 1131 @cd ${.CURDIR} && ${MAKE} release.4 release.8 floppies.1 floppies.2 \ 1132 floppies.3 1133 @cd ${RD} && find floppies -print | cpio -dumpl ${FD} 1134 1135installCRUNCH: 1136.if !defined(CRUNCH) 1137 @echo "CRUNCH undefined in installCRUNCH" && exit 1 1138.endif 1139.if !defined(DIR) 1140 @echo "DIR undefined in installCRUNCH" && exit 1 1141.endif 1142.if !defined(ZIP) 1143 @echo "ZIP undefined in installCRUNCH" && exit 1 1144.endif 1145 @if ${ZIP} ; then \ 1146 ${ZIPPER} < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \ 1147 else \ 1148 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \ 1149 fi 1150 @chmod 555 ${DIR}/${CRUNCH}_crunch 1151 @if [ -f ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf ] ; then \ 1152 for i in `crunchgen -l ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf` ; do \ 1153 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \ 1154 done \ 1155 else \ 1156 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \ 1157 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \ 1158 done \ 1159 fi 1160 1161# 1162# --==## Build a floppy set for a splitfs file ##==-- 1163# 1164# FLOPPYBASE - basename of floppy image files 1165# FLOPPYDESC - description of floppy set 1166# SPLITFILE - filename of the file to split 1167# FDSIZE - if specified and "small", small floppy is created 1168 1169.if make(makeFloppySet) 1170SPLITDIR= ${RD}/floppyset/${FLOPPYBASE} 1171.if defined(FDSIZE) && ${FDSIZE} == "SMALL" 1172FLPSPLITSIZE= ${SMALLFLOPPYSPLITSIZE} 1173FLPSIZE= ${SMALLFLOPPYSIZE} 1174FLPLABEL= ${SMALLFLOPPYLABEL} 1175.else 1176FLPSPLITSIZE= ${FLOPPYSPLITSIZE} 1177FLPSIZE= ${FLOPPYSIZE} 1178FLPLABEL= ${FLOPPYLABEL} 1179.endif 1180.endif 1181 1182makeFloppySet: 1183.if !defined(FLOPPYBASE) 1184 @echo "FLOPPYBASE undefined in ${.TARGET}" && exit 1 1185.endif 1186.if !defined(FLOPPYDESC) 1187 @echo "FLOPPYDESC undefined in ${.TARGET}" && exit 1 1188.endif 1189.if !defined(SPLITFILE) 1190 @echo "SPLITFILE undefined in ${.TARGET}" && exit 1 1191.endif 1192 sh ${.CURDIR}/scripts/split-file.sh ${SPLITFILE} \ 1193 ${RD}/floppyset/${FLOPPYBASE} ${FLPSPLITSIZE} "${FLOPPYDESC}" 1194 ( splitfile=${SPLITDIR}/`basename ${SPLITFILE}`.split ; \ 1195 lines=`cat $${splitfile} | wc -l`; \ 1196 lines=$$(($$lines - 1)) ; \ 1197 for line in `jot $$lines`; do \ 1198 file=`head -n $$(($${line} + 1)) $${splitfile} | tail -1 | cut -f 1 -d ' '` ; \ 1199 sh -e ${DOFS_SH} ${RD}/floppies/${FLOPPYBASE}$${line}.flp \ 1200 ${RD} ${MNT} ${FLPSIZE} ${SPLITDIR}/$${file} \ 1201 ${BOOTINODE} ${FLPLABEL}; \ 1202 done ) 1203 1204# 1205# --==## Build a boot floppy ##==-- 1206# 1207# FSIMAGE - base floppy image name 1208# FDSIZE - if specified and "small", small floppy is created 1209# KERNFILE - path to kernel split file 1210# MFSROOTFILE - path to mfsroot split file 1211 1212.if make(buildBootFloppy) 1213IMAGEDIR= ${RD}/image.${FSIMAGE} 1214BOOTDIR= ${RD}/trees/base/boot 1215HINTSFILE= ${BOOTDIR}/device.hints 1216ACPI_KO= ${RD}/kernels/GENERIC/acpi.ko 1217IMAGEFILE= ${RD}/floppies/${FSIMAGE}.flp 1218.if defined(FDSIZE) && ${FDSIZE} == "SMALL" 1219FLPSIZE= ${SMALLFLOPPYSIZE} 1220FLPLABEL= ${SMALLFLOPPYLABEL} 1221.else 1222FLPSIZE= ${FLOPPYSIZE} 1223FLPLABEL= ${FLOPPYLABEL} 1224.endif 1225.endif 1226 1227buildBootFloppy: 1228.if !defined(FSIMAGE) 1229 @echo "FSIMAGE undefined in ${.TARGET}" && exit 1 1230.endif 1231.if !defined(KERNFILE) 1232 @echo "KERNFILE undefined in ${.TARGET}" && exit 1 1233.endif 1234.if !defined(MFSROOTFILE) 1235 @echo "MFSROOTFILE undefined in ${.TARGET}" && exit 1 1236.endif 1237 @echo "Running ${.TARGET} for ${FSIMAGE}" 1238 @rm -rf ${IMAGEDIR} 1239 @mkdir ${IMAGEDIR} 1240 @echo "Setting up /boot directory for ${FSIMAGE} floppy" 1241 @mkdir -p ${IMAGEDIR}/boot 1242.if ${TARGET} == "i386" 1243 @${WMAKEENV} kgzip -v -l ${RD}/trees/base/usr/lib/kgzldr.o -o \ 1244 ${IMAGEDIR}/boot/loader ${BOOTDIR}/loader 1245.else 1246 @cp ${BOOTDIR}/loader ${IMAGEDIR}/boot 1247.endif 1248 @cp -Rp ${BOOTDIR}/*.4th ${BOOTDIR}/defaults ${BOOTDIR}/loader.help \ 1249 ${BOOTDIR}/loader.rc ${IMAGEDIR}/boot 1250.if exists(${HINTSFILE}) 1251 @cp ${HINTSFILE} ${IMAGEDIR}/boot/device.hints 1252 @${ZIPPER} ${IMAGEDIR}/boot/device.hints 1253.endif 1254 @${ZIPPER} ${IMAGEDIR}/boot/*.4th ${IMAGEDIR}/boot/loader.help \ 1255 ${IMAGEDIR}/boot/defaults/loader.conf 1256 @echo 'bootfile="/kernel"' > ${IMAGEDIR}/boot/loader.conf 1257.if exists(${ACPI_KO}) 1258 @${ZIPPER} -c ${ACPI_KO} > ${IMAGEDIR}/acpi.ko.gz 1259 @echo 'acpi_load="YES"' >> ${IMAGEDIR}/boot/loader.conf 1260 @echo 'acpi_name="/acpi.ko"' >> ${IMAGEDIR}/boot/loader.conf 1261 @echo 'acpi_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf 1262.endif 1263 @echo 'mfsroot_load="YES"' >> ${IMAGEDIR}/boot/loader.conf 1264 @echo 'mfsroot_type="mfs_root"' >> ${IMAGEDIR}/boot/loader.conf 1265 @echo 'mfsroot_name="/mfsroot"' >> ${IMAGEDIR}/boot/loader.conf 1266.if !exists(${ACPI_KO}) 1267 @echo 'mfsroot_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf 1268.endif 1269.if defined(SPLIT_MFSROOT) 1270 @echo 'mfsroot_after="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf 1271.endif 1272.if ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "amd64" 1273.if ${AUTO_KEYBOARD_DETECT} 1274 @echo "-P" >> ${IMAGEDIR}/boot.config 1275.endif 1276.endif 1277 @rm -f ${IMAGEFILE} 1278 @cp ${KERNFILE} ${MFSROOTFILE} ${IMAGEDIR} 1279 sh -e ${DOFS_SH} ${IMAGEFILE} ${RD} ${MNT} ${FLPSIZE} ${IMAGEDIR} \ 1280 ${BOOTINODE} ${FLPLABEL} 1281 @echo "Created ${RD}/floppies/${FSIMAGE}.flp" 1282 1283.if make(package-split) 1284# Targets related to making a package split 1285# 1286# PKG_COPY instructs the script to copy the actual package files rather than 1287# make hard links 1288# PKG_TREE is the path to the package tree to be split 1289# PKG_DEST is the path to the destination tree to create the split in 1290# PKG_VERBOSE asks for verbose output of the layout process 1291# PKG_INDEX is the path to the INDEX file. By default ${PKG_TREE}/INDEX. 1292 1293.if defined(PKG_COPY) 1294PKG_DO_COPY= cp 1295.else 1296PKG_DO_COPY= ln 1297.endif 1298PKG_WRKIDX= ${PKG_DEST}/INDEX.master 1299PKG_ENV?= 1300.if defined(TARGET_ARCH) 1301PKG_ENV+= PKG_ARCH=${TARGET_ARCH} 1302.endif 1303.if defined(PKG_VERBOSE) 1304PKG_ENV+= PKG_VERBOSE=1 1305.endif 1306PKG_INDEX?= ${PKG_TREE}/INDEX 1307 1308package-split: 1309.if !defined(PKG_TREE) 1310 @echo "PKG_TREE must be defined" && exit 1 1311.endif 1312.if !defined(PKG_DEST) 1313 @echo "PKG_DEST must be defined" && exit 1 1314.endif 1315 @env ${PKG_ENV} python ${.CURDIR}/scripts/package-split.py \ 1316 ${PKG_INDEX} ${PKG_WRKIDX} 1317 @env ${PKG_ENV} sh ${.CURDIR}/scripts/package-trees.sh ${PKG_DO_COPY} \ 1318 ${PKG_WRKIDX} ${PKG_TREE} ${PKG_DEST} 1319.endif 1320 1321.include <bsd.obj.mk> 1322