Subject: Re: Building a partial release?
To: None <current-users@NetBSD.org>
From: Alan Barrett <apb@cequrux.com>
List: current-users
Date: 10/06/2006 19:30:22
On Fri, 06 Oct 2006, Peter Seebach wrote:
> -current, as is fairly often the case, can't build a release, because
> some of the ramdisks are too big.
>
> I don't care, for my purposes.

Try the appended patch, and set IGNORE_BUILDFLOPPIES_ERRORS="-" in the
Makefiles for floppies that won't build.  (I haven't used this patch
myself for quite some time now, but it used to work.)

> Is there a simple way to cause "build.sh release" to build ONLY the
> CD-ROM boot image and GENERIC kernel, not the others for Xen, old
> laptops, and other weird stuff?  Naive attempts to simply dike out the
> excess floppies and ramdisks still fail on a "build.sh release".

Figuring out the right things to dike out is quite difficult, because
of not-always-obvious dependencies between kernels, ramdisk images, and
floppy images.  But it is possible.

--apb (Alan Barrett)

Index: distrib/common/Makefile.tarfloppy
--- distrib/common/Makefile.tarfloppy	4 May 2004 02:52:05 -0000	1.11
+++ distrib/common/Makefile.tarfloppy	8 Jan 2006 22:59:06 -0000
@@ -25,6 +25,12 @@
 #	FLOPPYPAD		If defined, pad the last floppy to ${FLOPPYSIZE}
 #	FLOPPYSUFFIX		Suffix of created floppies.
 #	FLOPPY_RELEASEDIR	Where to install release floppies.
+#	IGNORE_BUILDFLOPPIES_ERRORS
+#				If "-" then ignore errors.  (The most
+#				likely error is that the image is
+#				too large to fit on the specified
+#				number of disks.
+#				
 #
 
 .if !defined(_MAKEFILE_TARFLOPPY_)
@@ -63,6 +69,7 @@
 
 ${FLOPPYBASE}1${FLOPPYSUFFIX}: ${FLOPPYFILES} ${DISTRIBDIR}/common/buildfloppies.sh
 	${_MKTARGET_CREATE} "(from: ${FLOPPYFILES})"
+	${IGNORE_BUILDFLOPPIES_ERRORS}\
 	PAX=${TOOL_PAX:Q} ${HOST_SH} ${DISTRIBDIR}/common/buildfloppies.sh \
 	    ${FLOPPYINSTBOOT:D-i ${FLOPPYINSTBOOT}} ${FLOPPYPAD:D-p} \
 	    ${FLOPPYMAX:D-m ${FLOPPYMAX}} ${FLOPPYSUFFIX:D-s ${FLOPPYSUFFIX}} \
@@ -75,6 +82,7 @@
 
 .if defined(FLOPPY_RELEASEDIR)
 release:: check_RELEASEDIR .WAIT ${FLOPPYBASE}1${FLOPPYSUFFIX}
+	${IGNORE_BUILDFLOPPIES_ERRORS}\
 	if [ -e ${FLOPPYBASE}2${FLOPPYSUFFIX} ]; then \
 		${RELEASE_INSTALL} ${FLOPPYBASE}?${FLOPPYSUFFIX} \
 		    ${RELEASEDIR}/${MACHINE}/${FLOPPY_RELEASEDIR}; \
Index: distrib/common/buildfloppies.sh
--- distrib/common/buildfloppies.sh	10 Sep 2005 18:05:51 -0000	1.12
+++ distrib/common/buildfloppies.sh	8 Jan 2006 22:59:06 -0000
@@ -55,6 +55,10 @@
 	size		size of a floppy in 512 byte blocks
 	file [...]	file(s) to build
 _USAGE_
+# Exit status:
+#	0		success
+#	1		error
+#	2		image too big to fit on specified number of floppies
 	exit 1
 }
 
@@ -149,7 +153,7 @@
 	echo 1>&2 \
 	    "$prog: Image is ${excess} bytes ($(( ${excess} / 1024 )) KB)"\
 	    "too big to fit on ${maxdisks} disk"$(plural ${maxdisks})
-	exit 1
+	exit 2
 fi
 
 padto=$(( ${floppysize} * ${maxdisks} ))
Index: distrib/i386/floppies/bootfloppy-tiny/Makefile
--- distrib/i386/floppies/bootfloppy-tiny/Makefile	18 Nov 2002 12:39:46 -0000	1.13
+++ distrib/i386/floppies/bootfloppy-tiny/Makefile	8 Jan 2006 22:59:07 -0000
@@ -4,4 +4,6 @@
 FLOPPYSIZE=	2400
 FLOPPYKERNEL=	netbsd-INSTALL_TINY.gz
 
+IGNORE_BUILDFLOPPIES_ERRORS=	-
+
 .include "${.CURDIR}/../common/Makefile.bootfloppy"