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