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