Index: etc/etc.evbarm/Makefile.inc
===================================================================
RCS file: /cvsroot/src/etc/etc.evbarm/Makefile.inc,v
retrieving revision 1.126
diff -u -r1.126 Makefile.inc
--- etc/etc.evbarm/Makefile.inc	20 May 2022 16:12:34 -0000	1.126
+++ etc/etc.evbarm/Makefile.inc	10 Jul 2022 21:49:08 -0000
@@ -92,6 +92,15 @@
 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!= \
+	${TOOL_INSTALLBOOT} -m ${MACHINE} 2>&1 \
+	| ${TOOL_AWK} 'BEGIN { FS=" " } { if (BOARDS) print $$1 } /^Known boards/{ BOARDS=1 }'
+
 __mkimage: .USE
 	TOOL_MAKE=${MAKE} \
 	TOOL_MAKEFS=${TOOL_MAKEFS} \
@@ -110,6 +119,17 @@
 	${HOST_SH} ${MKIMAGE} -x -h ${.TARGET:S/smp_//} -D ${DESTDIR} \
 	    -S ${NETBSDSRCDIR} -B ${IMAGEENDIAN} ${MKI_OPTS.${.TARGET}} \
 	    ${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}
+	@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} \
+			${IMAGE.dir}/${.TARGET:S/smp_//}-${f}.img \
+		&& ${TOOL_GZIP} -f ${IMAGE.dir}/${.TARGET:S/smp_//}-${f}.img \
+		|| rm ${IMAGE.dir}/${.TARGET:S/smp_//}-${f}.img
+.endfor
+	rm ${IMAGE.dir}/${.TARGET:S/smp_//}.img
 
 ARCHES.earmv4=		armv4
 ARCHES.earmv4eb=	armv4
