Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src




> On Aug 22, 2022, at 8:34 AM, Martin Husemann <martin%duskware.de@localhost> wrote:
> 
> On Mon, Aug 22, 2022 at 08:27:18AM -0600, Brook Milligan wrote:
>> INSTALLBOOT_BOARDS is constructed dynamically from installboot, so it
>> is not really part of the current user interface.  
> 
> I would just drop the INSTALLBOOT_BOARDS != part and leave it to the
> user to pass a proper list via
> 
> 	build.sh -V INSTALLBOOT_BOARDS="pinebook pinebook-pro"
> 
> or similar. The for loop over the boards would just do nothing in the
> invocation w/o that -V.

Yes, an empty variable will skip the loop.  

However, that does not help people (the NetBSD build farm?, armbsd.org?) who want to release an entire collection of bootable images, which I think would be a really great service if anyone wishes to pick it up.

The installboot names of the images are not nearly as simple as you suggest above, and there are a number of variants.

Thus, I think it would be preferable to include an “all” option, which is the new behavior of “everything for which a U-Boot package is found”.

The patch below is what I am currently testing for this.  If this works and is reasonable, I’ll fix up the docs as well.

Thoughts?

Cheers,
Brook

Index: Makefile.inc
===================================================================
RCS file: /cvsroot/src/etc/etc.evbarm/Makefile.inc,v
retrieving revision 1.127
diff -u -r1.127 Makefile.inc
--- Makefile.inc	21 Aug 2022 15:01:08 -0000	1.127
+++ Makefile.inc	22 Aug 2022 15:17:25 -0000
@@ -92,14 +92,30 @@
 IMAGE.kern=	${IMAGE.rel}/binary/kernel
 IMAGE.instk=	${IMAGE.rel}/installation/instkernel
 
-# list of boards supported by installboot(8); a bootable image will be
-# created for each (if the corresponding U-Boot package is installed
-# in one of the directories listed in the environment variable
-# INSTALLBOOT_UBOOT_PATHS)
+# INSTALLBOOT_BOARDS: a list of boards to install bootable images for.
+# One of:
 #
-INSTALLBOOT_BOARDS!= \
+#   - none: do not install any bootable images
+#
+#   - all: install any bootable images from the list supported by
+#          installboot(8) for which a corresponding U-Boot package is
+#          installed in one of the directories listed in the
+#          environment variable INSTALLBOOT_UBOOT_PATHS
+#
+#   - list of boards: a list of boards (as recognized by
+#          installboot(8)) to install
+#
+#   - <undefined> or <empty>: same as none
+#
+__INSTALLBOOT_BOARDS!= \
 	${TOOL_INSTALLBOOT} -m ${MACHINE} 2>&1 \
 	| ${TOOL_AWK} 'BEGIN { FS=" " } { if (BOARDS) print $$1 } /^Known boards/{ BOARDS=1 }'
+.if !empty(_INSTALLBOOT_BOARDS:M[Nn][Oo][Nn][Ee])
+_INSTALLBOOT_BOARDS=
+.fi
+.if !empty(_INSTALLBOOT_BOARDS:M[Aa][Ll][Ll])
+_INSTALLBOOT_BOARDS=${__INSTALLBOOT_BOARDS}
+.fi
 
 __mkimage: .USE
 	TOOL_MAKE=${MAKE} \
@@ -121,7 +137,7 @@
 	    ${IMAGE.dir}/${.TARGET:S/smp_//}.img.gz
 	${TOOL_GZIP} -cd ${IMAGE.dir}/${.TARGET:S/smp_//}.img.gz \
 		> ${IMAGE.dir}/${.TARGET:S/smp_//}.img
-.for f in ${INSTALLBOOT_BOARDS}
+.for f in ${_INSTALLBOOT_BOARDS}
 	@echo "===> Making bootable image ${IMAGE.dir:T}/${.TARGET:S/smp_//}-${f}.img.gz"
 	@cp ${IMAGE.dir}/${.TARGET:S/smp_//}.img ${IMAGE.dir}/${.TARGET:S/smp_//}-${f}.img
 	@${TOOL_INSTALLBOOT} -m ${MACHINE} -o board=${f} \



Home | Main Index | Thread Index | Old Index