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