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