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