Subject: iso.diff
To: None <tech-toolchain@NetBSD.org>
From: Jason R. Fink <jrf@NetBSD.org>
List: tech-toolchain
Date: 11/19/2004 08:27:34
--/04w6evG8XlLl3ft
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hello,

Attached is a diff that enables creating iso images from
build.sh. It can create bootable and non-bootable images.

I have tested it on sparc64 and i386 only. Testing on
other archs would be helpful and hints/bricks as appropiate
for any errors (of which, I am sure there are many).

Thanks,

 j

--/04w6evG8XlLl3ft
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="iso.diff"

Index: build.sh
===================================================================
RCS file: /cvsroot/src/build.sh,v
retrieving revision 1.134
diff -u -r1.134 build.sh
--- build.sh	13 Oct 2004 23:28:34 -0000	1.134
+++ build.sh	4 Nov 2004 03:15:33 -0000
@@ -125,6 +125,7 @@
 	do_kernel=false
 	do_releasekernel=false
 	do_install=false
+	do_iso=false
 	do_sets=false
 	do_sourcesets=false
 	do_params=false
@@ -382,6 +383,10 @@
     sets                Create binary sets in RELEASEDIR/MACHINE/binary/sets.
 			DESTDIR should be populated beforehand.
     sourcesets          Create source sets in RELEASEDIR/source/sets.
+    iso=type		Create an iso image type. If sourcesets are built
+			they are included. Valid types are:
+				boot [default]
+				noboot
     params              Display various make(1) parameters.
 
  Options:
@@ -638,6 +643,13 @@
 			    bomb "Must supply a directory with \`install=...'"
 			;;
 
+		iso|iso=*)
+			arg=${op#*=}
+			op=${op%%=*}
+			[ -n "${arg}" ] ||
+			op=boot
+			;;
+
 		*)
 			usage "Unknown operation \`${op}'"
 			;;
@@ -975,6 +987,19 @@
 	fi
 }
 
+mkiso()
+{
+	isotype=$1
+
+	if [ "${isotype}" = boot ]; then
+		MKBOOT=yes
+	else
+		MKBOOT=no
+	fi
+
+	${runcmd} cd etc && make iso-image
+}
+
 releasekernel()
 {
 	getkernelconf $1
@@ -1059,6 +1084,11 @@
 			installworld "${arg}"
 			;;
 
+		iso|iso=*)
+			arg=${op#*=}
+			mkiso "${arg}"
+			;;
+
 		*)
 			bomb "Unknown operation \`${op}'"
 			;;
Index: etc/Makefile
===================================================================
RCS file: /cvsroot/src/etc/Makefile,v
retrieving revision 1.292
diff -u -r1.292 Makefile
--- etc/Makefile	28 Jul 2004 11:35:44 -0000	1.292
+++ etc/Makefile	4 Nov 2004 03:15:35 -0000
@@ -382,7 +382,12 @@
 #	Note: At least mkisofs 2.0 should be used.
 #
 CDROM_NAME_ADD?=
+.if ${MKBOOT} != "no"
 CDROM.image=${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/cdrom/netbsd-${MACHINE}${CDROM_NAME_ADD}.iso
+.else
+CDROM.image=${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/cdrom/netbsd-${MACHINE}${CDROM_NAME_ADD}_noboot.iso
+.endif
+
 CDROM.dir=	cdrom.dir
 CDROM.pathlist=	cdrom.pathlist
 
Index: etc/etc.amd64/Makefile.inc
===================================================================
RCS file: /cvsroot/src/etc/etc.amd64/Makefile.inc,v
retrieving revision 1.3
diff -u -r1.3 Makefile.inc
--- etc/etc.amd64/Makefile.inc	18 Oct 2003 03:00:05 -0000	1.3
+++ etc/etc.amd64/Makefile.inc	4 Nov 2004 03:15:35 -0000
@@ -10,7 +10,9 @@
 INSTALLATION_DIRS+= 	installation/floppy
 
 # mkisofs arguments to generate bootable iso image
+.if ${MKBOOT} != "no"
 MKISOFS_FLAGS+=	-b ${MACHINE}/installation/floppy/boot-big.fs
+.endif
 
 snap_md_post:
 	${MAKESUMS} -t ${RELEASEDIR}/${MACHINE}/installation/floppy '*.fs'
Index: etc/etc.cats/Makefile.inc
===================================================================
RCS file: /cvsroot/src/etc/etc.cats/Makefile.inc,v
retrieving revision 1.13
diff -u -r1.13 Makefile.inc
--- etc/etc.cats/Makefile.inc	22 Mar 2003 00:13:35 -0000	1.13
+++ etc/etc.cats/Makefile.inc	4 Nov 2004 03:15:35 -0000
@@ -13,6 +13,8 @@
 snap_md_post:
 	${MAKESUMS} -t ${RELEASEDIR}/${MACHINE}/installation/kernel '*.gz'
 
+.if ${MKBOOT} != "no"
 iso-image-md-pre:
 	gzip -dc ${RELEASEDIR}/${MACHINE}/binary/kernel/netbsd.aout-INSTALL.gz \
 	    > ${CDROM.dir}/netbsd
+.endif
Index: etc/etc.i386/Makefile.inc
===================================================================
RCS file: /cvsroot/src/etc/etc.i386/Makefile.inc,v
retrieving revision 1.40
diff -u -r1.40 Makefile.inc
--- etc/etc.i386/Makefile.inc	23 Jul 2004 17:57:41 -0000	1.40
+++ etc/etc.i386/Makefile.inc	4 Nov 2004 03:15:35 -0000
@@ -22,6 +22,7 @@
 
 # For "make iso-image"
 # mkisofs arguments to generate bootable iso image
+.if ${MKBOOT} != "no"
 CDROM_BOOT_IMAGE?=	boot-big.fs
-
 MKISOFS_FLAGS+=	-b ${MACHINE}/installation/floppy/${CDROM_BOOT_IMAGE} -c boot.catalog
+.endif
Index: etc/etc.mac68k/Makefile.inc
===================================================================
RCS file: /cvsroot/src/etc/etc.mac68k/Makefile.inc,v
retrieving revision 1.17
diff -u -r1.17 Makefile.inc
--- etc/etc.mac68k/Makefile.inc	26 Jun 2004 16:09:09 -0000	1.17
+++ etc/etc.mac68k/Makefile.inc	4 Nov 2004 03:15:35 -0000
@@ -13,7 +13,9 @@
 snap_md_post:
 	${MAKESUMS} -t ${RELEASEDIR}/${MACHINE}/installation/instkernel '*.gz'
 
+.if ${MKBOOT} != "no"
 # For "make iso-image"
 # mkisofs arguments to create a hybrid (HFS/Rockridge) CD-ROM image.
 MKISOFS_FLAGS+=	-hfs --macbin \
 	-map ${RELEASEDIR}/${MACHINE}/installation/misc/extensions.map
+.endif
Index: etc/etc.prep/Makefile.inc
===================================================================
RCS file: /cvsroot/src/etc/etc.prep/Makefile.inc,v
retrieving revision 1.6
diff -u -r1.6 Makefile.inc
--- etc/etc.prep/Makefile.inc	3 Jan 2003 15:34:39 -0000	1.6
+++ etc/etc.prep/Makefile.inc	4 Nov 2004 03:15:35 -0000
@@ -10,7 +10,9 @@
 INSTALLATION_DIRS+=	installation/floppy
 
 # mkisofs arguments to generate bootable iso image
+.if ${MKBOOT} != "no"
 MKISOFS_FLAGS+= -prep-boot installation/floppy/sysinst.fs
+.endif
 
 snap_md_post:
 	${MAKESUMS} -t ${RELEASEDIR}/${MACHINE}/installation/floppy '*'
Index: etc/etc.sgimips/Makefile.inc
===================================================================
RCS file: /cvsroot/src/etc/etc.sgimips/Makefile.inc,v
retrieving revision 1.9
diff -u -r1.9 Makefile.inc
--- etc/etc.sgimips/Makefile.inc	15 Nov 2003 08:58:27 -0000	1.9
+++ etc/etc.sgimips/Makefile.inc	4 Nov 2004 03:15:35 -0000
@@ -13,6 +13,7 @@
 INSTALLATION_DIRS+=	installation/netboot \
 			installation/diskimage
 
+.if ${MKBOOT} != "no"
 iso-image-md-pre:
 	gzip -d -c ${RELEASEDIR}/${MACHINE}/binary/kernel/netbsd-INSTALL32_IP2x.gz > ${RELEASEDIR}/ip2x
 	gzip -d -c ${RELEASEDIR}/${MACHINE}/binary/kernel/netbsd-INSTALL32_IP3x.gz > ${RELEASEDIR}/ip3x
@@ -32,3 +33,4 @@
 	dd if=${CDROM.image} of=${SGI.image} bs=512 seek=3135
 	mv ${SGI.image} ${CDROM.image}
 	rm -f ${RELEASEDIR}/ip2x ${RELEASEDIR}/ip3x
+.endif
Index: etc/etc.sparc/Makefile.inc
===================================================================
RCS file: /cvsroot/src/etc/etc.sparc/Makefile.inc,v
retrieving revision 1.39
diff -u -r1.39 Makefile.inc
--- etc/etc.sparc/Makefile.inc	15 Dec 2003 19:36:16 -0000	1.39
+++ etc/etc.sparc/Makefile.inc	4 Nov 2004 03:15:36 -0000
@@ -44,6 +44,7 @@
 	${MAKESUMS} -t ${RELEASEDIR}/${MACHINE}/${dir} '*'
 .endfor
 
+.if ${MKBOOT} != "no"
 CDBOOTIMAGEDIR!= cd ${NETBSDSRCDIR}/distrib/sparc/bootfs && ${PRINTOBJDIR}
 CDBOOTIMAGE=	${CDBOOTIMAGEDIR}/boot.fs
 
@@ -51,3 +52,4 @@
 	SUNLABEL=${TOOL_SUNLABEL:Q} \
 	    ${HOST_SH} ${NETBSDSRCDIR}/distrib/common/sunbootcd.sh \
 	    ${CDROM.image} ${CDBOOTIMAGE} ${CDBOOTIMAGE} ${CDBOOTIMAGE}
+.endif
Index: etc/etc.sparc64/Makefile.inc
===================================================================
RCS file: /cvsroot/src/etc/etc.sparc64/Makefile.inc,v
retrieving revision 1.26
diff -u -r1.26 Makefile.inc
--- etc/etc.sparc64/Makefile.inc	3 Jan 2004 13:58:26 -0000	1.26
+++ etc/etc.sparc64/Makefile.inc	4 Nov 2004 03:15:36 -0000
@@ -71,6 +71,7 @@
 	${MAKESUMS} -t ${RELEASEDIR}/${MACHINE}/${dir} '*'
 .endfor
 
+.if ${MKBOOT} != "no"
 ISOBOOTFILEDIR!=cd ${.CURDIR}/../distrib/${MACHINE}/bootfs && ${PRINTOBJDIR}
 ISOBOOTFILE?=	${ISOBOOTFILEDIR}/boot.fs
 
@@ -78,3 +79,4 @@
 	SUNLABEL=${TOOL_SUNLABEL:Q} \
 	    ${HOST_SH} ${NETBSDSRCDIR}/distrib/common/sunbootcd.sh \
 	    ${CDROM.image} - - - - ${ISOBOOTFILE}
+.endif
Index: etc/etc.vax/Makefile.inc
===================================================================
RCS file: /cvsroot/src/etc/etc.vax/Makefile.inc,v
retrieving revision 1.21
diff -u -r1.21 Makefile.inc
--- etc/etc.vax/Makefile.inc	23 Mar 2004 22:35:30 -0000	1.21
+++ etc/etc.vax/Makefile.inc	4 Nov 2004 03:15:36 -0000
@@ -11,6 +11,7 @@
 			installation/miniroot	\
 			installation/netboot
 
+.if ${MKBOOT} != "no"
 iso-image-md-pre:
 	cp -f ${RELEASEDIR}/${MACHINE}/installation/netboot/install.ram.gz \
 	    ${CDROM.dir}/netbsd
@@ -18,3 +19,4 @@
 
 iso-image-md-post:
 	${TOOL_INSTALLBOOT} -m ${MACHINE} ${CDROM.image} ${DESTDIR}/usr/mdec/xxboot
+.endif
Index: share/mk/bsd.own.mk
===================================================================
RCS file: /cvsroot/src/share/mk/bsd.own.mk,v
retrieving revision 1.424
diff -u -r1.424 bsd.own.mk
--- share/mk/bsd.own.mk	7 Aug 2004 21:42:52 -0000	1.424
+++ share/mk/bsd.own.mk	4 Nov 2004 03:15:36 -0000
@@ -257,6 +257,11 @@
 
 .endif	# USETOOLS == yes						# }
 
+# 
+# Setup MKBOOT default
+#
+MKBOOT?=yes
+
 #
 # Targets to check if DESTDIR or RELEASEDIR is provided
 #

--/04w6evG8XlLl3ft--