1# $Id: Makefile,v 1.385 1998/09/15 10:24:23 gibbs Exp $ 2# 3# make release CHROOTDIR=/some/dir BUILDNAME=somename [ RELEASETAG=tag ] 4# 5# Where "/some/dir" is the pathname of a directory on a some 6# filesystem with at least 600MB of free space, "somename" is what 7# you want the release to call itself and, optionally, which CVS "tag" 8# name should be used when checking out the sources to build the release 9# (default is HEAD). 10# 11# Please note: the vn driver must also be compiled into your kernel, 12# otherwise the target 'release.8' and possibly others will fail. 13# 14# Set these, release builder! 15# 16# Fixed version: 17#BUILDNAME=2.2-RELEASE 18# 19# Automatic SNAP versioning: 20DATE != date +%Y%m%d 21BASE = 3.0 22BUILDNAME?=${BASE}-${DATE}-SNAP 23# 24#CHROOTDIR=/junk/release 25# If this is a RELEASE, then set 26#RELEASETAG=RELENG_2_2 27 28# If you are using a local CVS repository with components stored in 29# non-standard modules, override these on the make commandline or 30# in the environment. 31RELEASESRCMODULE?= src 32RELEASEDOCMODULE?= doc 33RELEASEPORTSMODULE?= ports 34 35# Unless set elsewhere, indicate the object format we'll be using. 36OBJFORMAT?= elf 37 38# Uncomment this to disable the doc.1 target. It is also an ERROR 39# to set NOPORTS and not set NODOC since docs depend on ports. 40#NODOC= YES 41#NOPORTS= YES 42# Comment the following if you want the release documentation to be 43# in English only. 44ALLLANG= yes 45DOCPORTS= archivers/unzip textproc/jade textproc/iso8879 \ 46 textproc/linuxdoc textproc/docbook textproc/sgmlformat 47 48# Things which without too much trouble can be considered variables 49# BIN_DISTS are special in that they get full /etc installation sets. 50# 51COMPAT_DISTS?= compat1x compat20 compat21 52OTHER_DISTS?= manpages catpages games proflibs dict info doc 53CRYPTO_DISTS?= krb des 54BIN_DISTS?= bin 55DISTRIBUTIONS?= ${BIN_DISTS} ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} 56KERNELS?= GENERIC 57 58# Extra source tarballs; each argument is a pair of source dir and 59# distribution name. The dist name should not exceed 7 characters 60# (another "s" for "source" will be prepended). 61EXTRA_SRC+= usr.sbin/sendmail/cf smailcf 62 63BOOT1= etc/protocols etc/rc.conf 64 65# mountpoint for filesystems. 66MNT= /mnt 67 68# other floppy parameters. 69FDSIZE= 1440 70FDLABEL= fd1440 71 72ZIPNSPLIT= gzip --no-name -9 -c | split -b 240640 - 73 74# Upper size for the mfs in the boot.flp kernel. 75# These are adjusted down to the minimum needed by doFS.sh. 76BOOTMFSSIZE= 1440 77MFSINODE= 8000 78FIXITINODE= 2000 79BOOTINODE= 1000000 80 81VNDEVICE?= vn0 82 83# Things which may get you into trouble if you change them 84MTREEFILES= ${.CURDIR}/../etc/mtree 85RD= /R/stage 86FD= /R/ftp 87CD= /R/cdrom 88CD_DISC1= ${CD}/disc1 89CD_DISC2= ${CD}/disc2 90 91# Where the bootstrap ports (see DOCPORTS) get installed. 92LOCALDIR= /usr/local/bin 93 94# ${BOOTSTRAPDIR} is for those utilities that refer to the hosting 95# environment, rather than the target environment. This is specifically 96# intended for kernel-dependent utilities that are used during the build. 97# 98# ${BOOTSTRAPDIR} is actually being used by prepending it to the normal 99# ${PATH}. Thus, it's also available to outside utilities like doFS.sh. 100BOOTSTRAPDIR= /bootstrap 101# 102# The mount subsystem has been changed between 2.2 and 3.0 by the 103# Lite2 import. 104BOOTSTRAPUTILS= /sbin/mount /sbin/umount 105# 106# 3.0 cpio tries to reference lchown(2) which is not available in 2.2 107BOOTSTRAPUTILS+= /usr/bin/cpio 108 109.if !defined(CRUNCH_TARGETS) 110CRUNCH_TARGETS= boot fixit 111.endif 112 113EXTRAS= cdrom.1 ftp.1 114 115.if !defined(NODOC) 116DOCREL= doc.1 117.endif 118 119REDO?= sysinstall 120REDOSED= sed -e 's/dirs/release.1/' -e 's/trees/release.2/' \ 121 -e 's/kerns/release.3/' -e 's/sysinstall/release.4/' \ 122 -e 's/fixup/release.5/' -e 's/tarbin/release.6/' \ 123 -e 's/tarsrc/release.7/' -e 's/boot\.flp/release.8/' \ 124 -e 's/fixit\.flp/release.9/' -e 's/ftp/ftp.1/' \ 125 -e 's/cdrom/cdrom.1/' 126 127REDOREDO!= echo ${REDO} | ${REDOSED} 128 129rerelease release: 130.if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT) 131 @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false 132.endif 133.if make(release) 134.if exists(${CHROOTDIR}) 135# The first command will fail on a handful of files that have their schg 136# flags set. But it greatly speeds up the next two commands. 137 -rm -rf ${CHROOTDIR} 138 -chflags -R noschg ${CHROOTDIR}/. 139 -rm -rf ${CHROOTDIR} 140.endif 141 -mkdir -p ${CHROOTDIR} 142 cd ${.CURDIR}/../etc && ${MAKE} distrib-dirs DESTDIR=${CHROOTDIR} 143 cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR} 144 cd ${.CURDIR}/.. && ${MAKE} installworld DESTDIR=${CHROOTDIR} NOMAN=1 145 mkdir ${CHROOTDIR}/${BOOTSTRAPDIR} 146 for i in ${BOOTSTRAPUTILS} ; do \ 147 cp -p ${CHROOTDIR}$$i ${CHROOTDIR}/${BOOTSTRAPDIR} ; \ 148 done 149.if !defined(RELEASETAG) 150 cd ${CHROOTDIR}/usr && rm -rf src && \ 151 cvs -R -d ${CVSROOT} co -P ${RELEASESRCMODULE} 152.else 153 cd ${CHROOTDIR}/usr && rm -rf src && \ 154 cvs -R -d ${CVSROOT} co -P -r ${RELEASETAG} ${RELEASESRCMODULE} 155.endif 156.if defined(LOCAL_PATCHES) && exists(${LOCAL_PATCHES}) 157 cd ${CHROOTDIR}/usr/src && patch --silent < ${LOCAL_PATCHES} 158.endif 159.if defined(LOCAL_SCRIPT) && exists(${LOCAL_SCRIPT}) 160 cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT} 161.endif 162.if !defined(NOPORTS) 163 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P ${RELEASEPORTSMODULE} && cd ports && make readmes PORTSDIR=${CHROOTDIR}/usr/ports 164.endif 165.if !defined(NODOC) 166 cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co -P ${RELEASEDOCMODULE} 167 cd ${CHROOTDIR}/usr/ports && for i in ${DOCPORTS}; do \ 168 (cd $$i; make fetch MASTER_SITE_OVERRIDE=file:/usr/ports/distfiles/ \ 169 DISTDIR=${CHROOTDIR}/usr/ports/distfiles ); \ 170 done 171.endif 172.endif 173.if make(rerelease) 174.if !defined(RELEASENOUPDATE) 175.if !defined(RELEASETAG) 176 cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d 177.else 178 cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d -r ${RELEASETAG} 179.endif 180.if !defined(NOPORTS) 181 cd ${CHROOTDIR}/usr/ports && cvs -R -q update -P -d 182.endif 183.if !defined(NODOC) 184 cd ${CHROOTDIR}/usr/doc && cvs -R -q update -P -d 185.endif 186.endif 187.endif 188 # Add version information to those things that need it. 189 ( cd ${CHROOTDIR}/usr/src/sys/conf && \ 190 mv newvers.sh foo && \ 191 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh&& rm foo ) 192 ( cd ${CHROOTDIR}/usr/src/release/sysinstall && \ 193 sed "s/__RELEASE/${BUILDNAME}/" version.h > version.h.new && \ 194 mv version.h.new version.h && \ 195 echo XXXX ) 196 echo OBJFORMAT=${OBJFORMAT} > ${CHROOTDIR}/etc/objformat 197 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release 198 echo "#!/bin/sh" > ${CHROOTDIR}/mk 199 echo "set -ex" >> ${CHROOTDIR}/mk 200 echo "export CFLAGS='-O2 -pipe'" >> ${CHROOTDIR}/mk 201 echo "export DISTRIBUTIONS=\"${DISTRIBUTIONS}\"" >> ${CHROOTDIR}/mk 202 echo "export BUILDNAME=${BUILDNAME}" >> ${CHROOTDIR}/mk 203 echo "export VNDEVICE=${VNDEVICE}" >> ${CHROOTDIR}/mk 204 echo "export OBJFORMAT=${OBJFORMAT}" >> ${CHROOTDIR}/mk 205.if defined(RELEASETAG) 206 echo "export RELEASETAG=${RELEASETAG}" >> ${CHROOTDIR}/mk 207.endif 208.if defined(NOPORTS) 209 echo "export NOPORTS=${NOPORTS}" >> ${CHROOTDIR}/mk 210.endif 211.if defined(NODOC) 212 echo "export NODOC=${NODOC}" >> ${CHROOTDIR}/mk 213.endif 214.if defined(ALLLANG) 215 echo "export ALLLANG=${ALLLANG}" >> ${CHROOTDIR}/mk 216.endif 217.if defined(NOSRC) 218 echo "export NOSRC=${NOSRC}" >> ${CHROOTDIR}/mk 219.endif 220.if defined(NOSHARED) 221 echo "export NOSHARED=${NOSHARED}" >> ${CHROOTDIR}/mk 222.endif 223.if defined(BOOT_CONFIG) 224 echo "export BOOT_CONFIG=\"${BOOT_CONFIG}\"">> ${CHROOTDIR}/mk 225.endif 226 # Don't remove this, or the build will fall over! 227 echo "export RELEASEDIR=/R" >> ${CHROOTDIR}/mk 228 echo "export PATH=${BOOTSTRAPDIR}:$${PATH}:${LOCALDIR}" >> ${CHROOTDIR}/mk 229 echo "cd /usr/src" >> ${CHROOTDIR}/mk 230.if make(release) 231 echo "(cd etc; make distrib-dirs distribution)" >> ${CHROOTDIR}/mk 232 echo "make world" >> ${CHROOTDIR}/mk 233.endif 234.if make(rerelease) 235 echo "make all install" >> ${CHROOTDIR}/mk 236.endif 237 echo "cd /usr/src/release/sysinstall" >> ${CHROOTDIR}/mk 238 echo "make obj" >> ${CHROOTDIR}/mk 239 echo "cd /usr/src/release" >> ${CHROOTDIR}/mk 240 echo "make objlink" >> ${CHROOTDIR}/mk 241 echo "(cd obj; rm -f ${REDOREDO})" >> ${CHROOTDIR}/mk 242 echo "make doRELEASE" >> ${CHROOTDIR}/mk 243 echo "echo make ${.TARGET} Finished" >> ${CHROOTDIR}/mk 244 chmod 755 ${CHROOTDIR}/mk 245 chroot ${CHROOTDIR} /mk 246 247clean: 248 rm -rf boot_crunch release.[0-9] 249 250# Clean out /R and make the directory structure. 251release.1: 252 -mkdir /R 253 chflags -R noschg /R/. 254 rm -rf /R/* 255 mkdir ${RD} 256 mkdir ${RD}/floppies 257 mkdir ${RD}/trees 258 mkdir ${RD}/dists 259 mkdir ${RD}/kernels 260 for i in ${DISTRIBUTIONS} ; do \ 261 mkdir ${RD}/trees/$$i && \ 262 mkdir ${RD}/dists/$$i && \ 263 mtree -deU -f ${MTREEFILES}/BSD.root.dist \ 264 -p ${RD}/trees/$$i > /dev/null && \ 265 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \ 266 -p ${RD}/trees/$$i/usr > /dev/null && \ 267 mtree -deU -f ${MTREEFILES}/BSD.include.dist \ 268 -p ${RD}/trees/$$i/usr/include > /dev/null && \ 269 mtree -deU -f ${MTREEFILES}/BSD.var.dist \ 270 -p ${RD}/trees/$$i/var > /dev/null ; \ 271 done 272 touch release.1 273 274# Install the system into the various distributions. 275release.2: 276 cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/bin 277 cd ${.CURDIR}/.. && make distribute DISTDIR=${RD}/trees 278.if exists(${.CURDIR}/../kerberosIV) && !defined(NOKERBEROS) 279 cd ${.CURDIR}/../kerberosIV && ( \ 280 make bootstrap &&\ 281 make obj all help-distribute DISTDIR=${RD}/trees &&\ 282 make kprog \ 283 ) 284.endif 285 # XXX until lkm and mdec gets populated again by some other means 286.if ${MACHINE_ARCH} == "i386" 287 cd ${.CURDIR}/.. && OBJFORMAT=aout MAKEOBJDIRPREFIX=/usr/obj/aout \ 288 NOTOOLS=1 NOSECURE=1 NOCRYPT=1 \ 289 make -f Makefile.inc1 legacy-install DESTDIR=${RD}/trees/bin 290.endif 291 chflags -R noschg ${RD}/trees 292 touch release.2 293 294# Make and install the generic kernel(s). 295release.3: 296.for kernel in ${KERNELS} 297 rm -f ${RD}/kernels/${kernel} 298 rm -rf ${.CURDIR}/../sys/compile/${kernel} 299 cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=${kernel} 300 rm -rf ${.CURDIR}/../sys/compile/${kernel} 301 ln -f ${RD}/kernels/${kernel} ${RD}/trees/bin/kernel.${kernel} 302.endfor 303 touch release.3 304 305# Make and install the three crunched binaries which live on the floppies. 306# You are not supposed to like this :-) 307# 308# NB: the "RELEASE_BUILD_FIXIT" magic prevents vi from including the 309# Tcl and Perl APIs. See also /usr/src/usr.bin/vi/Makefile. 310release.4: 311 @mkdir -p /stand 312 cd ${.CURDIR}/sysinstall && make obj depend all install 313 rm -rf ${RD}/crunch 314 mkdir -p ${RD}/crunch 315 export RELEASE_BUILD_FIXIT=noway ; \ 316 for j in ${CRUNCH_TARGETS} ; do \ 317 rm -rf $${j}_crunch && \ 318 mkdir $${j}_crunch && \ 319 ( cd $${j}_crunch && \ 320 crunchgen ${.CURDIR}/$${j}_crunch.conf && \ 321 ${MAKE} -DRELEASE_CRUNCH -f $${j}_crunch.mk subclean all \ 322 NOCRYPT=yes "CFLAGS=${CFLAGS} -DCRUNCHED_BINARY") && \ 323 mv $${j}_crunch/$${j}_crunch ${RD}/crunch/$${j} && \ 324 true || { rm -rf $${j}_crunch ; false ; } ; \ 325 done 326 touch release.4 327 328# 329# --==## Fix up the distributions. ##==-- 330# 331release.5: 332 # Handle some grief caused by the munition braindeadness. 333 for i in sbin/init bin/ed usr.sbin/ppp ; do \ 334 ( cd ${.CURDIR}/../$$i; \ 335 make -DNOCRYPT clean all distribute DISTDIR=${RD}/trees ) ; \ 336 done 337 338 # Create any "synthetic dists" now. 339 @for i in ${DISTRIBUTIONS}; do \ 340 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \ 341 echo -n "Running $$i dist creation script... "; \ 342 env OBJFORMAT=${OBJFORMAT} RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \ 343 echo "Done."; \ 344 fi \ 345 done \ 346 347 # Create symlinks for the MD5-based crypt lib, too. The 348 # automatically created links still point to the DES stuff, 349 # which went into its own distribution. 350 for i in ${RD}/trees/bin/usr/lib/libscrypt* ; do \ 351 c=`echo $$i | sed -e 's/libscrypt/libcrypt/'` ; \ 352 rm -f $$c ; \ 353 ln -s `basename $$i` $$c ; \ 354 done 355 356 # Remove all the directories we don't need. 357 -cd ${RD}/trees && \ 358 find ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} -depth -type d -print | xargs rmdir 359 touch release.5 360 361# 362# --==## Package up the tarballs from assembled trees ##==-- 363# 364release.6: 365 rm -rf ${RD}/dists 366 mkdir -p ${RD}/dists 367 @for i in ${DISTRIBUTIONS} ; \ 368 do \ 369 if [ -d ${RD}/trees/$${i} ] ; then \ 370 cd ${.CURDIR} && $(MAKE) doTARBALL \ 371 SD=${RD}/trees/$${i} \ 372 TN=$$i TD=$$i ARG="." && \ 373 echo "$${i} distribution is finished."; \ 374 fi ; \ 375 done 376 # More munition braindeadness. 377 ( cd ${RD}/dists && \ 378 if [ -f krb/krb.aa ] ; then mv krb/* des && rmdir krb ; fi ) 379 touch release.6 380 381 382# 383# --==## Make source dists ##==-- 384# 385release.7: 386.if !defined(NOSRC) 387 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \ 388 TD=src TN=sbase ARG="[A-Z]*" 389 @for i in `cd /usr/src && echo [a-z]*` ; do \ 390 if [ -d /usr/src/$$i ] ; then \ 391 cd ${.CURDIR} && $(MAKE) doTARBALL \ 392 TN=`echo s$$i | tr -d '.' | sed 's/usr/u/'` \ 393 SD=/usr/src TD=src ARG="$$i" ; \ 394 fi ; \ 395 done 396.if defined(EXTRA_SRC) 397 @set ${EXTRA_SRC} && \ 398 while [ $$# -ge 2 ] ; do \ 399 if [ -d /usr/src/$$1 ] ; then \ 400 cd ${.CURDIR} && $(MAKE) doTARBALL \ 401 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \ 402 fi && shift && shift ; \ 403 done 404.endif 405 ( cd ${RD}/dists/src && \ 406 if [ -f ssecure.aa ] ; then mv ssecure.* ../des ; fi && \ 407 if [ -f scrypto.aa ] ; then mv scrypto.* ../des ; fi && \ 408 if [ -f skerbero.aa ] ; then mv skerbero.* ../des ; fi ; ) 409 @echo "src distribution is finished." 410.endif 411 touch release.7 412 413# Complete the bootfd 414# 415# Now, just to get this picture down once and for all: 416# 417# +------------------------------------------------------------------------+ 418# |boot.flp | 419# +-----+-----+------------------------------------------------------------+ 420# |boot1|boot2|floppy filesystem "bootfd" | 421# +-----+-----+-+--------------------------------------------------------+-+ 422# |kernel | 423# +------------+-----------------------------------------+-+ 424# |mfs filesystem "mfsfd" | 425# +-----------------------------------------+ 426# 427 428release.8: write_mfs_in_kernel dumpnlist 429 rm -rf ${RD}/mfsfd 430 mkdir ${RD}/mfsfd 431 cd ${RD}/mfsfd && \ 432 mkdir -p etc dev mnt stand/help 433 @cp ${.CURDIR}/../sys/i386/boot/biosboot/boot.help ${RD}/mfsfd/stand 434 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \ 435 DIR=${RD}/mfsfd/stand ZIP=false 436 ( cd ${RD}/trees/bin/dev && \ 437 ls console tty ttyv0 ttyv1 ttyv2 ttyv3 null zero | \ 438 cpio -dump ${RD}/mfsfd/dev ) 439 ( cd ${RD}/mfsfd/dev && rm -f *[swo]d*[bdefgh] ) 440 cd ${RD}/trees/bin && ls ${BOOT1} | cpio -dump ${RD}/mfsfd/stand 441 echo "nameserver 42/tcp name" > ${RD}/mfsfd/stand/etc/services 442 echo "ftp 21/tcp" >> ${RD}/mfsfd/stand/etc/services 443 echo "domain 53/tcp nameserver" >> ${RD}/mfsfd/stand/etc/services 444 echo "domain 53/udp nameserver" >> ${RD}/mfsfd/stand/etc/services 445 echo "cmd 514/tcp shell" >> ${RD}/mfsfd/stand/etc/services 446 gzip -c ${.CURDIR}/../COPYRIGHT > ${RD}/mfsfd/stand/help/COPYRIGHT.hlp.gz 447 -test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd 448 @echo "Making the regular boot floppy." 449 tar --exclude CVS -cf - -C ${.CURDIR}/sysinstall help | \ 450 tar xvf - -C ${RD}/mfsfd/stand 451 @echo "Compressing doc files..." 452 @gzip -9 ${RD}/mfsfd/stand/help/*.hlp 453 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${BOOTMFSSIZE} ${RD}/mfsfd \ 454 ${MFSINODE} minimum 455 mv fs-image fs-image.std 456 mv fs-image.size fs-image.std.size 457 cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=std 458 mv ${RD}/floppies/bootstd.flp ${RD}/floppies/boot.flp 459 @echo "Regular boot floppy made." 460 touch release.8 461 462# 463# --==## Create a fixit floppy ##==-- 464# 465release.9: 466 rm -rf ${RD}/fixitfd 467 mkdir ${RD}/fixitfd 468 cd ${RD}/fixitfd && \ 469 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \ 470 usr/share/misc usr/mdec 471 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=fixit \ 472 DIR=${RD}/fixitfd/stand ZIP=false 473 ( cd ${RD}/fixitfd/dev && \ 474 sed -e '/^PATH/s/^/#/' ${RD}/trees/bin/dev/MAKEDEV > MAKEDEV && \ 475 chmod 755 MAKEDEV && \ 476 sh MAKEDEV all ) 477 cp ${RD}/trees/bin/etc/spwd.db ${RD}/trees/bin/etc/group \ 478 ${RD}/trees/bin/etc/protocols ${RD}/fixitfd/etc 479 cp ${RD}/trees/bin/usr/share/misc/scsi_modes \ 480 ${RD}/fixitfd/usr/share/misc 481 cp ${RD}/trees/bin/usr/mdec/boot[12] ${RD}/fixitfd/usr/mdec 482 for type in fd od sd wd ; do \ 483 ( cd ${RD}/fixitfd/usr/mdec && ln -s boot1 $${type}boot && \ 484 ln -s boot2 boot$${type} ) ; \ 485 done 486 cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile 487 cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services 488 cp ${.CURDIR}/tar.sh ${RD}/fixitfd/stand/tar 489 chmod 555 ${RD}/fixitfd/stand/tar 490 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${FDSIZE} ${RD}/fixitfd \ 491 ${FIXITINODE} ${FDLABEL} 492 mv fs-image ${RD}/floppies/fixit.flp 493# Do our last minute floppies directory setup in a convenient place. 494 cp ${.CURDIR}/README.TXT ${RD}/floppies/README.TXT 495 @(cd ${RD}/floppies; md5 * > CHECKSUM.MD5) 496 touch release.9 497 498# 499# --==## Setup a suitable ftp-area ##==-- 500# 501ftp.1: 502 mkdir -p ${FD} 503 cd ${RD} && find floppies -print | cpio -dumpl ${FD} 504 cd ${RD}/dists && find . -print | cpio -dumpl ${FD} 505 cp ${.CURDIR}/ABOUT.TXT ${FD}/ABOUT.TXT 506 cp ${.CURDIR}/ERRATA.TXT ${FD}/ERRATA.TXT 507 cp ${.CURDIR}/LAYOUT.TXT ${FD}/LAYOUT.TXT 508 cp ${.CURDIR}/sysinstall/help/readme.hlp ${FD}/README.TXT 509 cp ${.CURDIR}/sysinstall/help/hardware.hlp ${FD}/HARDWARE.TXT 510 cp ${.CURDIR}/sysinstall/help/install.hlp ${FD}/INSTALL.TXT 511 cp ${.CURDIR}/sysinstall/help/relnotes.hlp ${FD}/RELNOTES.TXT 512 cp ${.CURDIR}/sysinstall/help/trouble.hlp ${FD}/TROUBLE.TXT 513 cp ${.CURDIR}/sysinstall/help/upgrade.hlp ${FD}/UPGRADE.TXT 514 515 echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf 516.if !defined(NOPORTS) 517 tar -cBf - -C ${CD_DISC1} ports | tar -xBf - -C ${FD} 518.endif 519 520# 521# --==## Setup a suitable cdrom-area ##==-- 522# 523cdrom.1: 524 mkdir -p ${CD_DISC1} ${CD_DISC2} 525 cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1} 526 cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1} 527 ln -f ${RD}/kernels/MFSKERNEL.std ${CD_DISC1}/kernel 528 ln -f ${RD}/trees/bin/usr/mdec/fbsdboot.exe ${CD_DISC1} 529 for i in ${DISTRIBUTIONS} ; \ 530 do \ 531 if [ -d ${RD}/trees/$${i} ] ; then \ 532 chflags -R noschg ${RD}/trees/$${i} ; \ 533 ( cd ${RD}/trees/$${i} && \ 534 find . -depth -print | cpio -dumpl ${CD_DISC2} ) ; \ 535 fi \ 536 done 537 rm -f ${CD_DISC2}/.profile 538 cp ${.CURDIR}/fixit.profile ${CD_DISC2}/.profile 539 echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf 540 echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf 541 cp ${.CURDIR}/ABOUT.TXT ${CD_DISC1}/ABOUT.TXT 542 cp ${.CURDIR}/ERRATA.TXT ${CD_DISC1}/ERRATA.TXT 543 cp ${.CURDIR}/LAYOUT.TXT ${CD_DISC1}/LAYOUT.TXT 544 cp ${.CURDIR}/sysinstall/help/readme.hlp ${CD_DISC1}/README.TXT 545 cp ${.CURDIR}/sysinstall/help/hardware.hlp ${CD_DISC1}/HARDWARE.TXT 546 cp ${.CURDIR}/sysinstall/help/install.hlp ${CD_DISC1}/INSTALL.TXT 547 cp ${.CURDIR}/sysinstall/help/relnotes.hlp ${CD_DISC1}/RELNOTES.TXT 548 cp ${.CURDIR}/sysinstall/help/trouble.hlp ${CD_DISC1}/TROUBLE.TXT 549 cp ${.CURDIR}/sysinstall/help/upgrade.hlp ${CD_DISC1}/UPGRADE.TXT 550 551.if !defined(NOPORTS) 552 -rm -rf /usr/ports/distfiles/* 553 tar -cBf - -C /usr ports | tar xBpf - -C ${CD_DISC2} && \ 554 mkdir -p ${CD_DISC1}/ports && \ 555 tar -czf ${CD_DISC1}/ports/ports.tgz -C /usr ports && \ 556 cp ${.CURDIR}/scripts/ports-install.sh ${CD_DISC1}/ports/install.sh && \ 557 (cd ${CD_DISC1}/ports; md5 * > CHECKSUM.MD5) 558 ln -s ../ports ${CD_DISC2}/usr/ports 559.endif 560 561doc.1: 562 for i in ${DOCPORTS}; do \ 563 cd /usr/ports/$$i && make all install clean FORCE_PKG_REGISTER=yes; \ 564 done 565 cd /usr/doc && make all distribute DISTDIR=${RD}/trees 566 567# Various "subroutine" and other supporting targets. 568 569doTARBALL: 570.if !defined(SD) 571 @echo "SD undefined in doTARBALL" && exit 1 572.endif 573.if !defined(TD) 574 @echo "TB undefined in doTARBALL" && exit 1 575.endif 576.if !defined(ARG) 577 @echo "ARG undefined in doTARBALL" && exit 1 578.endif 579 rm -rf ${RD}/dists/${TD}/${TN}* 580 mkdir -p ${RD}/dists/${TD} 581 ( cd ${SD} && \ 582 tn=`echo ${TN} | tr '[A-Z]' '[a-z]' | cut -c1-8` && \ 583 echo rolling ${TD}/$$tn tarball &&\ 584 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \ 585 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \ 586 sh ${.CURDIR}/info.sh ${RD}/dists/${TD}/$$tn > \ 587 ${RD}/dists/${TD}/$$tn.inf && \ 588 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \ 589 cp -p ${.CURDIR}/scripts/$${TD}-install.sh ${RD}/dists/${TD}/install.sh; \ 590 fi && \ 591 if [ "${SD}" != "/usr/src" ]; then \ 592 mtree -c -i -p ${SD}/${ARG} \ 593 -k gname,md5digest,mode,nlink,uname,size,link,type \ 594 > ${RD}/dists/${TD}/$$tn.mtree ; \ 595 else \ 596 true; \ 597 fi; \ 598 (cd ${RD}/dists/${TD}; \ 599 rm -f CHECKSUM.MD5; \ 600 md5 * > CHECKSUM.MD5) \ 601 ) 602 603.if ${MACHINE_ARCH} == "i386" 604doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 release.5 \ 605 release.6 release.7 release.8 release.9 606 cd ${.CURDIR} && ${MAKE} ${EXTRAS} 607 @echo "Release done" 608.endif 609 610.if ${MACHINE_ARCH} == "alpha" 611doRELEASE: release.1 release.2 ${DOCREL} release.5 release.6 release.7 612 cd ${.CURDIR} && ${MAKE} ${EXTRAS} 613 @echo "Release done" 614.endif 615 616floppies: 617 cd ${.CURDIR} && ${MAKE} boot.flp 618 cd ${.CURDIR} && ${MAKE} fixit.flp 619 cd ${RD} && find floppies -print | cpio -dumpl ${FD} 620 621boot.flp: 622 rm -f release.4 release.8 623 cd ${.CURDIR} && ${MAKE} release.4 release.8 CRUNCH_TARGETS=boot 624 625fixit.flp: 626 rm -f release.4 release.9 627 cd ${.CURDIR} && ${MAKE} release.4 release.9 CRUNCH_TARGETS=fixit 628 629write_mfs_in_kernel: ${.CURDIR}/write_mfs_in_kernel.c 630 ${CC} ${CFLAGS} -o write_mfs_in_kernel ${.CURDIR}/write_mfs_in_kernel.c 631 632dumpnlist: ${.CURDIR}/dumpnlist.c 633 ${CC} ${CFLAGS} -o dumpnlist ${.CURDIR}/dumpnlist.c 634 635installCRUNCH: 636.if !defined(CRUNCH) 637 @echo "CRUNCH undefined in installCRUNCH" && exit 1 638.endif 639.if !defined(DIR) 640 @echo "DIR undefined in installCRUNCH" && exit 1 641.endif 642.if !defined(ZIP) 643 @echo "ZIP undefined in installCRUNCH" && exit 1 644.endif 645 if ${ZIP} ; then \ 646 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \ 647 else \ 648 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \ 649 fi 650 chmod 555 ${DIR}/${CRUNCH}_crunch 651 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \ 652 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \ 653 done 654 655# 656# --==## Compile a kernel by name ${KERNEL} ##==-- 657# 658# We don't erase the sys/compile/${KERNEL} directory, since somebody 659# may want to reuse it (release.8 presently) 660# 661doKERNEL: 662 rm -f ${RD}/kernels/${KERNEL} 663 cd ${.CURDIR}/../sys/i386/conf && config ${KERNEL} 664 cd ${.CURDIR}/../sys/compile/${KERNEL} && \ 665 make depend && \ 666 make kernel && \ 667 cp kernel ${RD}/kernels/${KERNEL} 668 669# 670# --==## Put a filesystem into a BOOTMFS kernel ##==-- 671# 672doMFSKERN: 673 @rm -f ${RD}/kernels/BOOTMFS.${FSIMAGE} 674 @rm -f /sys/compile/BOOTMFS/mfs_vfsops.o 675 @cd ${.CURDIR}/../sys/i386/conf && \ 676 sed -e '/pty/d' \ 677 -e '/pass0/d' \ 678 -e '/PROCFS/d' \ 679 -e '/SYSVSHM/d' \ 680 -e '/KTRACE/d' \ 681 -e '/MATH_EMULATE/d' \ 682 -e 's/GENERIC/BOOTMFS/g' \ 683 -e '/maxusers/s/10/4/' < GENERIC > BOOTMFS && \ 684 echo "options MFS" >> BOOTMFS && \ 685 echo "options NFS_NOSERVER" >> BOOTMFS && \ 686 echo 'options "MAXCONS=4"' >> BOOTMFS && \ 687 echo "options SCSI_NO_OP_STRINGS" >> BOOTMFS && \ 688 echo "options SCSI_NO_SENSE_STRINGS" >> BOOTMFS && \ 689 echo "options USERCONFIG_BOOT" >> BOOTMFS 690 @echo "options \"MFS_ROOT=`cat fs-image.${FSIMAGE}.size`\"" >> \ 691 ${.CURDIR}/../sys/i386/conf/BOOTMFS 692 cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=BOOTMFS 693 @rm -rf ${RD}/boot.${FSIMAGE} 694 @mkdir ${RD}/boot.${FSIMAGE} 695 @mv ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE} 696 @cp ${RD}/kernels/BOOTMFS.${FSIMAGE} ${RD}/boot.${FSIMAGE}/kernel 697.if defined(BOOT_CONFIG) 698 @echo "${BOOT_CONFIG}" >${RD}/boot.${FSIMAGE}/boot.config 699.endif 700 @vnconfig /dev/${VNDEVICE} fs-image.${FSIMAGE} 701 @mkdir -p /tmp/mnt_xx 702 @mount /dev/${VNDEVICE} /tmp/mnt_xx 703 ./dumpnlist ${RD}/boot.${FSIMAGE}/kernel > /tmp/mnt_xx/stand/symbols 704 @umount /tmp/mnt_xx 705 @vnconfig -u /dev/${VNDEVICE} 706 @rmdir /tmp/mnt_xx 707 ./write_mfs_in_kernel ${RD}/boot.${FSIMAGE}/kernel \ 708 fs-image.${FSIMAGE} 709 kzip -v ${RD}/boot.${FSIMAGE}/kernel 710 @mv ${RD}/boot.${FSIMAGE}/kernel ${RD}/kernels/MFSKERNEL.${FSIMAGE} 711 @mv ${RD}/boot.${FSIMAGE}/kernel.kz ${RD}/boot.${FSIMAGE}/kernel 712 @cp ${.CURDIR}/../sys/i386/boot/biosboot/boot.help ${RD}/boot.${FSIMAGE} 713 @printf \\a\\a\\a >> ${RD}/boot.${FSIMAGE}/boot.help 714 @touch ${RD}/boot.${FSIMAGE}/boot.config 715 @touch ${RD}/boot.${FSIMAGE}/kernel.config 716 @rm -f ${RD}/floppies/boot${FSIMAGE}.flp 717 sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${FDSIZE} ${RD}/boot.${FSIMAGE} \ 718 ${BOOTINODE} ${FDLABEL} 719 mv fs-image ${RD}/floppies/boot${FSIMAGE}.flp 720 721.include <bsd.prog.mk> 722