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=6.0-CURRENT 22# 23# Automatic SNAP versioning: 24DATE != date +%Y%m%d 25BASE = 6.0 26BUILDNAME?=${BASE}-${DATE}-SNAP 27# 28#CHROOTDIR=/junk/release 29# If this is a -stable snapshot, then set 30#RELEASETAG=RELENG_4 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_INFO \ 358 -DNO_LIB32 -DNO_MAN -DNO_NLS -DNO_PROFILE installworld \ 359 DESTDIR=${CHROOTDIR} 360 cd ${WORLDDIR} && ${NATIVEMAKE} distribution DESTDIR=${CHROOTDIR} 361 if [ -f /etc/resolv.conf ]; then \ 362 cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \ 363 fi 364.if defined(EXTLOCALDIR) 365 rm -rf ${CHROOTDIR}/usr/local 366 cd ${CHROOTDIR}/usr && cp -R -H ${EXTLOCALDIR} local 367.endif 368 rm -rf ${CHROOTDIR}/usr/src 369.if defined(EXTSRCDIR) 370 cd ${CHROOTDIR}/usr && \ 371 cp -R -H ${EXTSRCDIR} src 372.else 373 cd ${CHROOTDIR}/usr && \ 374 ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \ 375 co ${CVSCMDARGS} ${CVS_SRCARGS} ${RELEASESRCMODULE} 376.endif 377.if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES) 378.for p in ${LOCAL_PATCHES} 379 patch -d ${CHROOTDIR}/usr/${RELEASESRCMODULE} ${PATCH_FLAGS} < ${p} 380.endfor 381.endif 382.if defined(LOCAL_SCRIPT) 383 cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} \ 384 RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT} 385.endif 386 rm -rf ${CHROOTDIR}/usr/ports 387.if !defined(NOPORTSATALL) 388 cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \ 389 co ${CVSCMDARGS} ${CVS_PORTSARGS} ${RELEASEPORTSMODULE} 390.endif 391.if !defined(NODOC) 392 rm -rf ${CHROOTDIR}/usr/doc 393.if defined(EXTDOCDIR) 394 cd ${CHROOTDIR}/usr && cp -R -H ${EXTDOCDIR} doc 395.else 396 cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \ 397 co ${CVSCMDARGS} ${CVS_DOCARGS} ${RELEASEDOCMODULE} 398.endif 399 if [ -d ${RELEASEDISTFILES}/ ]; then \ 400 cp -rp ${RELEASEDISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \ 401 else \ 402 mkdir -p ${CHROOTDIR}/usr/ports/distfiles; \ 403 fi 404.if !defined(NO_PREFETCHDISTFILES) 405 @cd ${.CURDIR} && ${MAKE} fetch-distfiles 406.endif 407.endif 408.endif 409.if make(rerelease) 410.if !defined(RELEASENOUPDATE) 411.if !defined(RELEASETAG) 412 cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \ 413 update ${CVSCMDARGS} -P -d -A 414.else 415 cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \ 416 update ${CVSCMDARGS} -P -d -r ${RELEASETAG} 417.endif 418 rm -f ${CHROOTDIR}/tmp/.world_done 419.if !defined(NOPORTS) 420 cd ${CHROOTDIR}/usr/ports && ${CVSPREFIX} cvs -R ${CVSARGS} -q \ 421 update ${CVSCMDARGS} -P -d 422 rm -f ${CHROOTDIR}/tmp/.skip_ports_index 423.endif 424.if defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES" 425 for i in ${MINIMALDOCPORTS}; do \ 426 ( cd ${CHROOTDIR}/usr/$$i && ${CVSPREFIX} cvs -R ${CVSARGS} -q \ 427 update ${CVSCMDARGS} -P -d ) ; \ 428 done 429.endif 430.if !defined(NODOC) 431 cd ${CHROOTDIR}/usr/doc && ${CVSPREFIX} cvs -R ${CVSARGS} -q \ 432 update ${CVSCMDARGS} -P -d 433.endif 434.endif 435.endif 436 # Add version information to those things that need it. 437 if [ ! -f ${CHROOTDIR}/tmp/.world_done ]; then \ 438 cd ${CHROOTDIR}/usr/src/sys/conf && \ 439 mv newvers.sh foo && \ 440 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && \ 441 rm foo; \ 442 fi 443 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release 444 echo "#!/bin/sh" > ${_MK} 445 echo "set -ex" >> ${_MK} 446 echo "trap 'umount /dev || true' 0" >> ${_MK} 447 echo "_RELTARGET=\$${1:-doRELEASE}" >> ${_MK} 448.for var in \ 449 AUTO_KEYBOARD_DETECT \ 450 BUILDNAME \ 451 CD_PACKAGE_TREE \ 452 DISTRIBUTIONS \ 453 DOC_LANG \ 454 DOMINIMALDOCPORTS \ 455 EXTRA_SRC \ 456 FTP_PASSIVE_MODE \ 457 FTP_PROXY \ 458 HTTP_PROXY \ 459 KERNELS \ 460 KERNEL_FLAGS \ 461 MAKE_FLOPPIES \ 462 MAKE_ISOS \ 463 NOCDROM \ 464 NODOC \ 465 NOPORTS \ 466 NO_SHARED \ 467 NOSRC \ 468 NO_CPU_CFLAGS \ 469 NO_CPU_COPTFLAGS \ 470 NO_FLOPPIES \ 471 NO_SENDMAIL \ 472 RELEASETAG \ 473 RELNOTES_LANG \ 474 SEPARATE_LIVEFS \ 475 TARGET \ 476 TARGET_ARCH \ 477 WORLD_FLAGS 478.if defined(${var}) 479 echo "export ${var}=\"${${var}}\"" >> ${_MK} 480.endif 481.endfor 482 # Don't remove this, or the build will fall over! 483 echo "export RELEASEDIR=${_R}" >> ${_MK} 484 echo "export PATH=/bin:/usr/bin:/sbin:/usr/sbin:${LOCALDIR}" >> ${_MK} 485 echo "export MANBUILDCAT=YES" >> ${_MK} 486 # NB: these may fail if the host is running w/o devfs 487 echo "umount /dev >/dev/null 2>&1 || true" >> ${_MK} 488 echo "mount -t devfs devfs /dev >/dev/null 2>&1 || true" >> ${_MK} 489 echo "if [ -x /etc/rc.d/ldconfig ]; then" >> ${_MK} 490 echo " /etc/rc.d/ldconfig start" >> ${_MK} 491 echo "else" >> ${_MK} 492 echo " ldconfig /lib /usr/lib /usr/local/lib || true" >> ${_MK} 493 echo "fi" >> ${_MK} 494 echo "if [ ! -f /tmp/.world_done ]; then" >> ${_MK} 495 echo " cd /usr/src" >> ${_MK} 496 echo " ${CROSSMAKE} ${WORLD_FLAGS} -DNO_CLEAN buildworld && \\" >> ${_MK} 497 echo " touch /tmp/.world_done || exit 1" >> ${_MK} 498 echo "fi" >> ${_MK} 499 echo "if [ ! -f /tmp/.skip_ports_index ]; then" >> ${_MK} 500 echo " echo \">>> make index started on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK} 501 echo " for i in ${MAKEINDEXPORTS}" >> ${_MK} 502 echo " do" >> ${_MK} 503 echo " cd /usr/ports/\$${i}" >> ${_MK} 504 echo " env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \\" >> ${_MK} 505 echo " make all install clean BATCH=yes FORCE_PKG_REGISTER=yes" >> ${_MK} 506 echo " done" >> ${_MK} 507 echo " cd /usr/ports" >> ${_MK} 508 echo " rm -f INDEX*" >> ${_MK} 509 echo " make index -DINDEX_PRISTINE" >> ${_MK} 510 echo " rm -f INDEX*.tmp" >> ${_MK} 511 echo " touch /tmp/.skip_ports_index" >> ${_MK} 512 echo " echo \">>> make index finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK} 513 echo "fi" >> ${_MK} 514 echo "cd /usr/src/release" >> ${_MK} 515 echo "make obj" >> ${_MK} 516 echo "make \$${_RELTARGET}" >> ${_MK} 517 echo "echo \">>> make ${.TARGET} for ${TARGET} finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK} 518 chmod 755 ${_MK} 519.if defined(NOPORTS) 520 touch ${CHROOTDIR}/tmp/.skip_ports_index 521.endif 522 # Ensure md.ko is loaded if md(4) is not statically compiled into 523 # the kernel 524 -mdconfig 2>/dev/null 525 env -i /usr/sbin/chroot `dirname ${_MK}` /`basename ${_MK}` 526 527clean: 528 rm -rf ${CRUNCH_TARGETS:S/$/_crunch/} release.[0-8] ${EXTRAS} 529 530fetch-distfiles: 531 @for i in ${MAKEINDEXPORTS}; do \ 532 cd ${CHROOTDIR}/usr/ports/$$i && \ 533 make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \ 534 checksum-recursive ; \ 535 done 536 @for i in ${DOCPORTS}; do \ 537 cd ${CHROOTDIR}/usr/ports/$$i && \ 538 make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \ 539 WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes \ 540 checksum-recursive ; \ 541 done 542 543# Clean out ${_R} and make the directory structure. 544release.1: 545 mkdir -p ${_R} 546 -rm -rf ${_R}/* 2> /dev/null 547 -chflags -R noschg ${_R}/. 548 rm -rf ${_R}/* 549 mkdir ${RD} 550.if defined(MAKE_FLOPPIES) 551 mkdir ${RD}/floppies 552.endif 553 mkdir ${RD}/trees 554 mkdir ${RD}/kernels 555 for i in ${DISTRIBUTIONS}; do \ 556 mkdir ${RD}/trees/$$i && \ 557 mtree -deU -f ${MTREEFILES}/BSD.root.dist \ 558 -p ${RD}/trees/$$i > /dev/null && \ 559 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \ 560 -p ${RD}/trees/$$i/usr > /dev/null && \ 561 mtree -deU -f ${MTREEFILES}/BSD.include.dist \ 562 -p ${RD}/trees/$$i/usr/include > /dev/null && \ 563 mtree -deU -f ${MTREEFILES}/BSD.var.dist \ 564 -p ${RD}/trees/$$i/var > /dev/null ; \ 565 done 566 touch ${.TARGET} 567 568# Install the system into the various distributions. 569release.2: 570 cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/base 571 cd ${.CURDIR}/.. && ${CROSSMAKE} ${WORLD_FLAGS} distributeworld \ 572 DISTDIR=${RD}/trees 573 touch ${.TARGET} 574 575# Make and install the generic kernel(s). 576release.3: 577.for kernel in ${KERNELS} 578 cd ${.CURDIR}/..; \ 579 ${CROSSMAKE} ${KERNEL_FLAGS} -DNO_MODULES \ 580 KERNCONF=${kernel} INSTKERNNAME=${kernel} kernel \ 581 DESTDIR=${RD}/trees/base 582.endfor 583 # Install a standard boot kernel+modules. 584 cd ${.CURDIR}/..; \ 585 ${CROSSMAKE} ${KERNEL_FLAGS} \ 586 kernel \ 587 DESTDIR=${RD}/trees/base; \ 588 cd ${.CURDIR}/..; \ 589 ${CROSSMAKE} ${KERNEL_FLAGS} -DNO_MODULES \ 590 reinstallkernel -DINSTALL_DEBUG \ 591 DESTDIR=${RD}/trees/base 592 touch ${.TARGET} 593 594# Make and install the three crunched binaries which live on the floppies. 595# You are not supposed to like this :-) 596release.4: 597 rm -rf ${RD}/crunch 598 mkdir -p ${RD}/crunch 599.for j in ${CRUNCH_TARGETS} 600.if exists(${.CURDIR}/${TARGET}/${j}_crunch.conf) 601 rm -rf ${j}_crunch 602 mkdir ${j}_crunch 603 cd ${j}_crunch; ${WMAKEENV} crunchgen -o \ 604 ${.CURDIR}/${TARGET}/${j}_crunch.conf 605 cd ${j}_crunch; ${WMAKE} -f ${j}_crunch.mk subclean 606 cd ${.CURDIR}/..; ${BINMAKE} -f Makefile.inc1 _build-tools 607 cd ${j}_crunch; CFLAGS="-Os -pipe" ${WMAKE} -f ${j}_crunch.mk \ 608 -DNO_CPU_CFLAGS all 609 ${WMAKEENV} strip -R .comment ${j}_crunch/${j}_crunch 610 mv ${j}_crunch/${j}_crunch ${RD}/crunch/${j} 611.endif 612.endfor 613 touch ${.TARGET} 614 615# 616# --==## Fix up the distributions. ##==-- 617# 618release.5: 619 # Create any "synthetic dists" now. 620 @for i in ${DISTRIBUTIONS}; do \ 621 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \ 622 echo -n "Running $$i dist creation script... "; \ 623 env RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \ 624 echo "Done."; \ 625 fi \ 626 done \ 627 628 # Remove all the directories we don't need. 629 -cd ${RD}/trees && \ 630 (find ${OTHER_DISTS} -path '*/var/empty' | xargs chflags noschg; \ 631 find ${OTHER_DISTS} -depth -type d -print | xargs rmdir) 632 touch ${.TARGET} 633 634# 635# --==## Package up the tarballs from assembled trees ##==-- 636# 637release.6: 638 rm -rf ${RD}/dists 639 mkdir -p ${RD}/dists 640 @for i in ${DISTRIBUTIONS} ; \ 641 do \ 642 if [ -d ${RD}/trees/$${i} ] ; then \ 643 cd ${.CURDIR} && $(MAKE) doTARBALL \ 644 SD=${RD}/trees/$${i} \ 645 TN=$$i TD=$$i ARG="." && \ 646 echo "$${i} distribution is finished."; \ 647 fi ; \ 648 done 649.if !defined(NOPORTS) 650 # XXX: Inline stripped version of doTARBALL 651 @rm -rf ${RD}/dists/ports/ports* 652 @mkdir -p ${RD}/dists/ports 653 @echo rolling ports/ports tarball 654 @tar --exclude CVS --exclude 'ports/distfiles/*' \ 655 -czf ${RD}/dists/ports/ports.tgz -C /usr ports 656 @cp ${.CURDIR}/scripts/ports-install.sh ${RD}/dists/ports/install.sh 657 @(cd ${RD}/dists/ports; \ 658 rm -f CHECKSUM.MD5; \ 659 md5 * > CHECKSUM.MD5) 660 @echo "ports distribution is finished." 661.endif 662 touch ${.TARGET} 663 664 665# 666# --==## Make source dists ##==-- 667# 668release.7: 669.if !defined(NOSRC) 670 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \ 671 TD=src TN=sbase ARG="[A-Z]*" 672 @for i in `cd /usr/src && echo [a-z]*` ; do \ 673 if [ -d /usr/src/$$i ] ; then \ 674 cd ${.CURDIR} && $(MAKE) doTARBALL \ 675 TN=`echo s$$i | tr -d '.' | \ 676 sed -e 's/usr/u/' \ 677 -e 's/kerberos5/krb5/'` \ 678 SD=/usr/src TD=src ARG="$$i" ; \ 679 fi ; \ 680 done 681.if defined(EXTRA_SRC) 682 @set ${EXTRA_SRC} && \ 683 while [ $$# -ge 2 ] ; do \ 684 if [ -d /usr/src/$$1 ] ; then \ 685 cd ${.CURDIR} && $(MAKE) doTARBALL \ 686 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \ 687 fi && shift && shift ; \ 688 done 689.endif 690 (cd ${RD}/dists/src; rm -f CHECKSUM.MD5; md5 * > CHECKSUM.MD5) 691 @echo "src distribution is finished." 692.endif 693 touch ${.TARGET} 694 695# Build the memory root filesystem. 696release.8: 697 cp ${RD}/trees/base/etc/disktab /etc 698 rm -rf ${RD}/mfsfd 699 mkdir ${RD}/mfsfd 700 cd ${RD}/mfsfd && \ 701 mkdir -p etc/defaults dev mnt stand/etc/defaults stand/help 702 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \ 703 DIR=${RD}/mfsfd/stand ZIP=false 704 ( cd ${RD}/mfsfd && \ 705 for dir in bin sbin ; do \ 706 ln -sf /stand $$dir; \ 707 done ) 708 cp ${RD}/trees/base/sbin/dhclient-script ${RD}/mfsfd/stand 709.if ${TARGET} == "pc98" 710 cp ${.CURDIR}/../etc/defaults/pccard.conf \ 711 ${RD}/mfsfd/etc/defaults/pccard.conf 712.endif 713 cp ${.CURDIR}/../etc/usbd.conf ${RD}/mfsfd/etc/usbd.conf 714 ( for F in defaults/rc.conf netconfig protocols ; do \ 715 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \ 716 ${RD}/trees/base/etc/$$F > ${RD}/mfsfd/stand/etc/$$F ; \ 717 done ) 718 grep -E '^(ftp|nameserver|domain|sunrpc|cmd|nfsd)[^-\w]' \ 719 ${RD}/trees/base/etc/services | \ 720 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \ 721 > ${RD}/mfsfd/stand/etc/services 722 grep 'operator' ${RD}/trees/base/etc/group \ 723 > ${RD}/mfsfd/stand/etc/group 724 ln ${RD}/mfsfd/stand/etc/services ${RD}/mfsfd/etc/services 725 ln ${RD}/mfsfd/stand/etc/group ${RD}/mfsfd/etc/group 726 ln ${RD}/mfsfd/stand/etc/netconfig ${RD}/mfsfd/etc/netconfig 727 cp ${RD}/trees/base/COPYRIGHT ${RD}/mfsfd/stand/help/COPYRIGHT.hlp 728.if !defined(NODOC) 729 @for i in ${DIST_DOCS_ARCH_INDEP}; do \ 730 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \ 731 ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ 732 done 733 @for i in ${DIST_DOCS_ARCH_DEP}; do \ 734 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \ 735 ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ 736 done 737 @mv ${RD}/mfsfd/stand/help/INSTALLATION.TXT \ 738 ${RD}/mfsfd/stand/help/INSTALL.TXT 739.endif 740 -test -f ${.CURDIR}/install.cfg \ 741 && cp ${.CURDIR}/install.cfg ${RD}/mfsfd 742 @mkdir -p ${RD}/mfsfd/boot 743.if ${TARGET_ARCH} != "ia64" && ${TARGET_ARCH} != "powerpc" 744 @cp ${RD}/trees/base/boot/boot* ${RD}/mfsfd/boot 745.endif 746.if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64" 747 @cp ${RD}/trees/base/boot/mbr ${RD}/mfsfd/boot 748.endif 749 @tar --exclude CVS -cf - -C ${.CURDIR}/../usr.sbin/sysinstall help | \ 750 tar xf - -C ${RD}/mfsfd/stand 751 @mkdir -p ${RD}/mfsroot 752 sh -e ${DOFS_SH} ${RD}/mfsroot/mfsroot ${RD} ${MNT} \ 753 ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL} 754 @gzip -9fnv ${RD}/mfsroot/mfsroot 755 touch ${.TARGET} 756 757KERNFLOPPYSET= ${RD}/floppyset/kern/kernel.gz 758.if defined(SMALLFLOPPYSIZE) 759SMALLKERNFLOPPYSET= ${RD}/floppyset/kern-small/kernel.gz 760.endif 761.if defined(SPLIT_MFSROOT) 762MFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot/mfsroot.gz 763.if defined(SMALLFLOPPYSIZE) 764SMALLMFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot-small/mfsroot.gz 765.endif 766.endif 767 768# Build boot and install floppies. 769floppies.1: 770 @gzip -9nc ${RD}/trees/base/boot/kernel/kernel > ${RD}/kernels/kernel.gz 771 @echo "Making the kernel boot floppies..." 772 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern \ 773 FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz 774.if defined(SMALLFLOPPYSIZE) 775 @echo "Making the small kernel boot floppies..." 776 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern-small \ 777 FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz \ 778 FDSIZE="SMALL" 779.endif 780.if defined(SPLIT_MFSROOT) 781 @echo "Making the mfsroot boot floppies..." 782 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot \ 783 FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz 784.if defined(SMALLFLOPPYSIZE) 785 @echo "Making the small mfsroot boot floppies..." 786 @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot-small \ 787 FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz \ 788 FDSIZE="SMALL" 789.endif 790 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \ 791 KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \ 792 MFSROOTFILE="${MFSROOTFLOPPYSET}.split ${MFSROOTFLOPPYSET}.boot" 793.if defined(SMALLFLOPPYSIZE) 794 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \ 795 KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \ 796 MFSROOTFILE="${SMALLMFSROOTFLOPPYSET}.split ${SMALLMFSROOTFLOPPYSET}.boot" \ 797 FDSIZE="SMALL" 798.endif 799.else # !SPLIT_MFSROOT 800 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \ 801 KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \ 802 MFSROOTFILE=${RD}/mfsroot/mfsroot.gz 803.if defined(SMALLFLOPPYSIZE) 804 @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \ 805 KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \ 806 MFSROOTFILE=${RD}/mfsroot/mfsroot.gz \ 807 FDSIZE="SMALL" 808.endif 809.endif # SPLIT_MFSROOT 810 touch ${.TARGET} 811 812# Build fixit floppy. 813floppies.2: 814 @echo "Making fixit floppy." 815 @rm -rf ${RD}/fixitfd 816 @mkdir ${RD}/fixitfd 817 @cd ${RD}/fixitfd && \ 818 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \ 819 usr/share/misc 820 @cp ${RD}/trees/base/etc/spwd.db ${RD}/trees/base/etc/group \ 821 ${RD}/fixitfd/etc 822 @sed -e 's/#.*//' ${RD}/trees/base/etc/protocols \ 823 > ${RD}/fixitfd/etc/protocols 824 @sed -e 's/#.*//' ${RD}/trees/base/usr/share/misc/scsi_modes \ 825 > ${RD}/fixitfd/usr/share/misc/scsi_modes 826 @cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile 827 @cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services 828 @cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar 829 @chmod 555 ${RD}/fixitfd/stand/tar 830.if defined(SMALLFLOPPYSIZE) 831 @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit-small \ 832 DIR=${RD}/fixitfd/stand ZIP=false 833 @sh -e ${DOFS_SH} ${RD}/floppies/fixit-small.flp ${RD} ${MNT} \ 834 ${SMALLFLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${SMALLFLOPPYLABEL} 835 @rm -rf ${RD}/fixitfd/stand 836 @mkdir ${RD}/fixitfd/stand 837.endif 838 @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit \ 839 DIR=${RD}/fixitfd/stand ZIP=false 840 @sh -e ${DOFS_SH} ${RD}/floppies/fixit.flp ${RD} ${MNT} \ 841 ${FLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${FLOPPYLABEL} 842 touch ${.TARGET} 843 844# Do our last minute floppies directory setup 845floppies.3: 846.if !defined(NODOC) 847 @cp ${RND}/${RELNOTES_LANG}/installation/${TARGET}/article.txt \ 848 ${RD}/floppies/README.TXT 849 @(cd ${RD}/floppies; md5 README.TXT *.flp > CHECKSUM.MD5) 850.else 851 @(cd ${RD}/floppies; md5 *.flp > CHECKSUM.MD5) 852.endif 853 touch ${.TARGET} 854 855# 856# --==## Setup a suitable ftp-area ##==-- 857# 858ftp.1: 859 @echo "Setting up FTP distribution area" 860 @mkdir -p ${FD} 861 -@ln -s . ${FD}/${BUILDNAME} 862.if defined(MAKE_FLOPPIES) 863 @cd ${RD} && find floppies -print | cpio -dumpl ${FD} 864.endif 865 @cd ${RD}/dists && find . -print | cpio -dumpl ${FD} 866.if !defined(NODOC) 867 @for i in ${DIST_DOCS_ARCH_INDEP}; do \ 868 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \ 869 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ 870 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \ 871 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \ 872 done 873 @for i in ${DIST_DOCS_ARCH_DEP}; do \ 874 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \ 875 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ 876 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \ 877 ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \ 878 done 879 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${FD} 880 @mv ${FD}/INSTALLATION.TXT ${FD}/INSTALL.TXT 881 @mv ${FD}/INSTALLATION.HTM ${FD}/INSTALL.HTM 882.endif 883 @echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf 884 touch ${.TARGET} 885 886# Build a live filesystem cdrom image 887cdrom.1: 888 @echo "Building CDROM live filesystem image" 889 @mkdir -p ${CD_LIVEFS} 890 @for i in ${DISTRIBUTIONS} ; \ 891 do \ 892 if [ -d ${RD}/trees/$${i} ] ; then \ 893 chflags -R noschg ${RD}/trees/$${i} || true ; \ 894 ( cd ${RD}/trees/$${i} && \ 895 find . -depth -print | cpio -dumpl ${CD_LIVEFS} ) ; \ 896 fi \ 897 done 898 @rm -f ${CD_LIVEFS}/.profile 899 @cp ${.CURDIR}/fixit.profile ${CD_LIVEFS}/.profile 900 @ln -sf /rescue ${CD_LIVEFS}/stand 901.if ${TARGET} != "pc98" 902 @echo "Setting up CDROM boot area" 903 @rm -f ${CD_LIVEFS}/boot/loader.conf 904 @cp ${RD}/mfsroot/mfsroot.gz ${CD_LIVEFS}/boot/mfsroot.gz 905 @echo 'mfsroot_load="YES"' > ${CD_LIVEFS}/boot/loader.conf 906 @echo 'mfsroot_type="mfs_root"' >> ${CD_LIVEFS}/boot/loader.conf 907 @echo 'mfsroot_name="/boot/mfsroot"' >> ${CD_LIVEFS}/boot/loader.conf 908.if exists(${RD}/trees/base/boot/device.hints) 909 # Break the link to device.hints so we can modify it 910 @rm -f ${CD_LIVEFS}/boot/device.hints 911 @cp ${RD}/trees/base/boot/device.hints ${CD_LIVEFS}/boot/device.hints 912.if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64" 913 @echo 'hint.atkbd.0.flags="0x1"' >> ${CD_LIVEFS}/boot/device.hints 914.endif 915.endif 916.endif 917 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_LIVEFS}/cdrom.inf 918 touch ${.TARGET} 919 920# Build disc1 and disc2 cdrom images 921cdrom.2: 922 @echo "Building CDROM disc1 filesystem image" 923 @mkdir -p ${CD_DISC1}/${BUILDNAME} 924.if defined(MAKE_FLOPPIES) 925 @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1} 926.endif 927 @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}/${BUILDNAME} 928.if !defined(NODOC) 929 @for i in ${DIST_DOCS_ARCH_INDEP}; do \ 930 cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \ 931 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ 932 cp ${RND}/${RELNOTES_LANG}/$$i/article.html \ 933 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \ 934 done 935 @for i in ${DIST_DOCS_ARCH_DEP}; do \ 936 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \ 937 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ 938 cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \ 939 ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \ 940 done 941 @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DISC1} 942 @mv ${CD_DISC1}/INSTALLATION.TXT ${CD_DISC1}/INSTALL.TXT 943 @mv ${CD_DISC1}/INSTALLATION.HTM ${CD_DISC1}/INSTALL.HTM 944.endif 945 @echo "CD_VOLUME = 1" >> ${CD_DISC1}/cdrom.inf 946.if defined(SEPARATE_LIVEFS) 947 @cp -Rp ${CD_LIVEFS}/boot ${CD_DISC1} 948 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf 949.endif 950 @echo "Building CDROM disc2 filesystem image" 951 @mkdir -p ${CD_DISC2} 952 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf 953 @echo "CD_VOLUME = 2" >> ${CD_DISC2}/cdrom.inf 954.if !defined(NODOC) 955 @mkdir -p ${CD_DISC2}/usr/share/doc 956 @for i in `ls ${CD_LIVEFS}/usr/share/doc`; do \ 957 if [ -L ${CD_LIVEFS}/usr/share/doc/$$i -o \ 958 -d /usr/doc/$$i ]; then \ 959 mv ${CD_LIVEFS}/usr/share/doc/$$i \ 960 ${CD_DISC2}/usr/share/doc; \ 961 fi \ 962 done 963.endif 964 touch ${.TARGET} 965 966# 967# --==## Setup a suitable cdrom-area ##==-- 968# 969cdrom.3: 970.if defined(CD_BOOT) 971 @echo "Building bootonly CDROM filesystem image" 972 @mkdir -p ${CD_BOOT} 973 @cp -Rp ${CD_LIVEFS}/boot ${CD_BOOT} 974 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_BOOT}/cdrom.inf 975.if defined(MINIROOT) 976 @echo "Building bootonly UFS filesystem image" 977 @mkdir -p ${FD}/miniroot 978 @sh -e ${DOFS_SH} ${FD}/miniroot/miniroot.ufs \ 979 ${RD} ${MNT} 0 ${CD_BOOT} 8192 auto 980 @gzip -9v ${FD}/miniroot/miniroot.ufs 981.endif 982.endif 983 touch ${.TARGET} 984 985.if make(iso.1) 986.if defined(CD_PACKAGE_TREE) 987.if exists(${CD_PACKAGE_TREE}/disc1) 988CD_DISC1_PKGS= ${CD_PACKAGE_TREE}/disc1 989.endif 990.if exists(${CD_PACKAGE_TREE}/disc2) 991CD_DISC2_PKGS= ${CD_PACKAGE_TREE}/disc2 992.endif 993.endif 994.endif 995 996iso.1: 997.if exists(${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh) 998 @echo "Creating ISO images..." 999.if defined(CD_BOOT) 1000 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ 1001 FreeBSD_bootonly \ 1002 ${CD}/${BUILDNAME}-${TARGET}-bootonly.iso ${CD_BOOT} 1003.endif 1004 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ 1005 FreeBSD_Install \ 1006 ${CD}/${BUILDNAME}-${TARGET}-disc1.iso ${CD_DISC1} \ 1007 ${CD_DISC1_PKGS} 1008 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \ 1009 FreeBSD_Packages \ 1010 ${CD}/${BUILDNAME}-${TARGET}-disc2.iso ${CD_DISC2} \ 1011 ${CD_DISC2_PKGS} 1012.if defined(SEPARATE_LIVEFS) 1013 @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ 1014 FreeBSD_LiveFS \ 1015 ${CD}/${BUILDNAME}-${TARGET}-livefs.iso ${CD_LIVEFS} 1016.endif 1017 @echo "Generating MD5 sums..." 1018 @(cd ${CD} && md5 *.iso > ${BUILDNAME}-${TARGET}-iso.CHECKSUM.MD5) 1019 touch ${.TARGET} 1020.else 1021 @echo "Do not know how to create an ISO for ${TARGET_ARCH}." 1022.endif 1023 1024# 1025# --==## Documentation Project files such as the Handbook and FAQ ##==-- 1026# 1027doc.1: 1028 @echo "Making docs..." 1029 @for i in ${DOCPORTS}; do \ 1030 cd /usr/ports/$$i && \ 1031 env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \ 1032 make all install clean BATCH=yes WITHOUT_X11=yes JADETEX=no \ 1033 WITHOUT_PYTHON=yes FORCE_PKG_REGISTER=yes; \ 1034 done 1035 @cd /usr/doc && make all install 'FORMATS=html html-split txt' \ 1036 INSTALL_COMPRESSED='' DOCDIR=${RD}/trees/base/usr/share/doc \ 1037 URLS_ABSOLUTE=YES 1038 touch ${.TARGET} 1039 1040# 1041# --==## RELNOTESng: Next-generation replacements for *.TXT files ##==-- 1042# 1043doc.2: 1044 @echo "Making release documentation..." 1045 @cd ${.CURDIR}/doc && make all install clean 'FORMATS=html txt' \ 1046 INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${RND} 1047 touch ${.TARGET} 1048 1049# Various "subroutine" and other supporting targets. 1050 1051# RD= 1052# SD= 1053# TD= 1054# ARG= 1055doTARBALL: 1056.if !defined(SD) 1057 @echo "SD undefined in doTARBALL" && exit 1 1058.endif 1059.if !defined(TD) 1060 @echo "TD undefined in doTARBALL" && exit 1 1061.endif 1062.if !defined(ARG) 1063 @echo "ARG undefined in doTARBALL" && exit 1 1064.endif 1065 @rm -rf ${RD}/dists/${TD}/${TN}* 1066 @mkdir -p ${RD}/dists/${TD} 1067 @( cd ${SD} && \ 1068 tn=`echo ${TN} | tr 'A-Z' 'a-z' | cut -c1-8` && \ 1069 echo rolling ${TD}/$$tn tarball &&\ 1070 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \ 1071 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \ 1072 sh ${.CURDIR}/scripts/info.sh ${RD}/dists/${TD}/$$tn \ 1073 > ${RD}/dists/${TD}/$$tn.inf && \ 1074 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \ 1075 cp -p ${.CURDIR}/scripts/$${TD}-install.sh \ 1076 ${RD}/dists/${TD}/install.sh; \ 1077 fi && \ 1078 if [ "${SD}" != "/usr/src" ]; then \ 1079 mtree -c -i -p ${SD}/${ARG} \ 1080 -k gname,md5digest,mode,nlink,uname,size,link,type \ 1081 > ${RD}/dists/${TD}/$$tn.mtree ; \ 1082 else \ 1083 true; \ 1084 fi; \ 1085 ( cd ${RD}/dists/${TD}; \ 1086 rm -f CHECKSUM.MD5; \ 1087 md5 * > CHECKSUM.MD5 ) \ 1088 ) 1089 1090doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 \ 1091 release.5 release.6 release.7 release.8 ${EXTRAS} 1092 @echo "Release done" 1093 1094floppies: 1095 @rm -f release.4 release.8 floppies.[123] 1096 @cd ${.CURDIR} && ${MAKE} release.4 release.8 floppies.1 floppies.2 \ 1097 floppies.3 1098 @cd ${RD} && find floppies -print | cpio -dumpl ${FD} 1099 1100installCRUNCH: 1101.if !defined(CRUNCH) 1102 @echo "CRUNCH undefined in installCRUNCH" && exit 1 1103.endif 1104.if !defined(DIR) 1105 @echo "DIR undefined in installCRUNCH" && exit 1 1106.endif 1107.if !defined(ZIP) 1108 @echo "ZIP undefined in installCRUNCH" && exit 1 1109.endif 1110 @if ${ZIP} ; then \ 1111 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \ 1112 else \ 1113 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \ 1114 fi 1115 @chmod 555 ${DIR}/${CRUNCH}_crunch 1116 @if [ -f ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf ] ; then \ 1117 for i in `crunchgen -l ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf` ; do \ 1118 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \ 1119 done \ 1120 else \ 1121 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \ 1122 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \ 1123 done \ 1124 fi 1125 1126# 1127# --==## Build a floppy set for a splitfs file ##==-- 1128# 1129# FLOPPYBASE - basename of floppy image files 1130# FLOPPYDESC - description of floppy set 1131# SPLITFILE - filename of the file to split 1132# FDSIZE - if specified and "small", small floppy is created 1133 1134.if make(makeFloppySet) 1135SPLITDIR= ${RD}/floppyset/${FLOPPYBASE} 1136.if defined(FDSIZE) && ${FDSIZE} == "SMALL" 1137FLPSPLITSIZE= ${SMALLFLOPPYSPLITSIZE} 1138FLPSIZE= ${SMALLFLOPPYSIZE} 1139FLPLABEL= ${SMALLFLOPPYLABEL} 1140.else 1141FLPSPLITSIZE= ${FLOPPYSPLITSIZE} 1142FLPSIZE= ${FLOPPYSIZE} 1143FLPLABEL= ${FLOPPYLABEL} 1144.endif 1145.endif 1146 1147makeFloppySet: 1148.if !defined(FLOPPYBASE) 1149 @echo "FLOPPYBASE undefined in ${.TARGET}" && exit 1 1150.endif 1151.if !defined(FLOPPYDESC) 1152 @echo "FLOPPYDESC undefined in ${.TARGET}" && exit 1 1153.endif 1154.if !defined(SPLITFILE) 1155 @echo "SPLITFILE undefined in ${.TARGET}" && exit 1 1156.endif 1157 sh ${.CURDIR}/scripts/split-file.sh ${SPLITFILE} \ 1158 ${RD}/floppyset/${FLOPPYBASE} ${FLPSPLITSIZE} "${FLOPPYDESC}" 1159 ( splitfile=${SPLITDIR}/`basename ${SPLITFILE}`.split ; \ 1160 lines=`cat $${splitfile} | wc -l`; \ 1161 lines=$$(($$lines - 1)) ; \ 1162 for line in `jot $$lines`; do \ 1163 file=`head -n $$(($${line} + 1)) $${splitfile} | tail -1 | cut -f 1 -d ' '` ; \ 1164 sh -e ${DOFS_SH} ${RD}/floppies/${FLOPPYBASE}$${line}.flp \ 1165 ${RD} ${MNT} ${FLPSIZE} ${SPLITDIR}/$${file} \ 1166 ${BOOTINODE} ${FLPLABEL}; \ 1167 done ) 1168 1169# 1170# --==## Build a boot floppy ##==-- 1171# 1172# FSIMAGE - base floppy image name 1173# FDSIZE - if specified and "small", small floppy is created 1174# KERNFILE - path to kernel split file 1175# MFSROOTFILE - path to mfsroot split file 1176 1177.if make(buildBootFloppy) 1178IMAGEDIR= ${RD}/image.${FSIMAGE} 1179BOOTDIR= ${RD}/trees/base/boot 1180HINTSFILE= ${BOOTDIR}/device.hints 1181ACPI_KO= ${BOOTDIR}/kernel/acpi.ko 1182IMAGEFILE= ${RD}/floppies/${FSIMAGE}.flp 1183.if defined(FDSIZE) && ${FDSIZE} == "SMALL" 1184FLPSIZE= ${SMALLFLOPPYSIZE} 1185FLPLABEL= ${SMALLFLOPPYLABEL} 1186.else 1187FLPSIZE= ${FLOPPYSIZE} 1188FLPLABEL= ${FLOPPYLABEL} 1189.endif 1190.endif 1191 1192buildBootFloppy: 1193.if !defined(FSIMAGE) 1194 @echo "FSIMAGE undefined in ${.TARGET}" && exit 1 1195.endif 1196.if !defined(KERNFILE) 1197 @echo "KERNFILE undefined in ${.TARGET}" && exit 1 1198.endif 1199.if !defined(MFSROOTFILE) 1200 @echo "MFSROOTFILE undefined in ${.TARGET}" && exit 1 1201.endif 1202 @echo "Running ${.TARGET} for ${FSIMAGE}" 1203 @rm -rf ${IMAGEDIR} 1204 @mkdir ${IMAGEDIR} 1205 @echo "Setting up /boot directory for ${FSIMAGE} floppy" 1206 @mkdir -p ${IMAGEDIR}/boot 1207.if ${TARGET} == "i386" 1208 @${WMAKEENV} kgzip -v -l ${RD}/trees/base/usr/lib/kgzldr.o -o \ 1209 ${IMAGEDIR}/boot/loader ${BOOTDIR}/loader 1210.else 1211 @cp ${BOOTDIR}/loader ${IMAGEDIR}/boot 1212.endif 1213 @cp -Rp ${BOOTDIR}/*.4th ${BOOTDIR}/defaults ${BOOTDIR}/loader.help \ 1214 ${BOOTDIR}/loader.rc ${IMAGEDIR}/boot 1215.if exists(${HINTSFILE}) 1216 @cp ${HINTSFILE} ${IMAGEDIR}/boot/device.hints 1217.if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64" 1218 @echo 'hint.atkbd.0.flags="0x1"' >> ${IMAGEDIR}/boot/device.hints 1219.endif 1220 @gzip -9n ${IMAGEDIR}/boot/device.hints 1221.endif 1222 @gzip -9n ${IMAGEDIR}/boot/*.4th ${IMAGEDIR}/boot/loader.help \ 1223 ${IMAGEDIR}/boot/defaults/loader.conf 1224 @echo 'bootfile="/kernel"' > ${IMAGEDIR}/boot/loader.conf 1225.if exists(${ACPI_KO}) 1226 @gzip -9nc ${ACPI_KO} > ${IMAGEDIR}/acpi.ko.gz 1227 @echo 'acpi_load="YES"' >> ${IMAGEDIR}/boot/loader.conf 1228 @echo 'acpi_name="/acpi.ko"' >> ${IMAGEDIR}/boot/loader.conf 1229 @echo 'acpi_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf 1230.endif 1231 @echo 'mfsroot_load="YES"' >> ${IMAGEDIR}/boot/loader.conf 1232 @echo 'mfsroot_type="mfs_root"' >> ${IMAGEDIR}/boot/loader.conf 1233 @echo 'mfsroot_name="/mfsroot"' >> ${IMAGEDIR}/boot/loader.conf 1234.if !exists(${ACPI_KO}) 1235 @echo 'mfsroot_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf 1236.endif 1237.if ${TARGET_ARCH} == "i386" && ${AUTO_KEYBOARD_DETECT} 1238 @echo "-P" >> ${IMAGEDIR}/boot.config 1239.endif 1240 @rm -f ${IMAGEFILE} 1241 @cp ${KERNFILE} ${MFSROOTFILE} ${IMAGEDIR} 1242 sh -e ${DOFS_SH} ${IMAGEFILE} ${RD} ${MNT} ${FLPSIZE} ${IMAGEDIR} \ 1243 ${BOOTINODE} ${FLPLABEL} 1244 @echo "Created ${RD}/floppies/${FSIMAGE}.flp" 1245 1246.if make(package-split) 1247# Targets related to making a package split 1248# 1249# PKG_COPY instructs the script to copy the actual package files rather than 1250# make hard links 1251# PKG_TREE is the path to the package tree to be split 1252# PKG_DEST is the path to the destination tree to create the split in 1253# PKG_VERBOSE asks for verbose output of the layout process 1254# PKG_INDEX is the path to the INDEX file. By default ${PKG_TREE}/INDEX. 1255 1256.if defined(PKG_COPY) 1257PKG_DO_COPY= cp 1258.else 1259PKG_DO_COPY= ln 1260.endif 1261PKG_WRKIDX= ${PKG_DEST}/INDEX.master 1262PKG_ENV?= 1263.if defined(TARGET_ARCH) 1264PKG_ENV+= PKG_ARCH=${TARGET_ARCH} 1265.endif 1266.if defined(PKG_VERBOSE) 1267PKG_ENV+= PKG_VERBOSE=1 1268.endif 1269PKG_INDEX?= ${PKG_TREE}/INDEX 1270 1271package-split: 1272.if !defined(PKG_TREE) 1273 @echo "PKG_TREE must be defined" && exit 1 1274.endif 1275.if !defined(PKG_DEST) 1276 @echo "PKG_DEST must be defined" && exit 1 1277.endif 1278 @env ${PKG_ENV} python ${.CURDIR}/scripts/package-split.py \ 1279 ${PKG_INDEX} ${PKG_WRKIDX} 1280 @env ${PKG_ENV} sh ${.CURDIR}/scripts/package-trees.sh ${PKG_DO_COPY} \ 1281 ${PKG_WRKIDX} ${PKG_TREE} ${PKG_DEST} 1282.endif 1283 1284.include <bsd.obj.mk> 1285