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