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