diff options
| author | brook <brook@NetBSD.org> | 2022-08-21 15:01:08 +0000 |
|---|---|---|
| committer | brook <brook@NetBSD.org> | 2022-08-21 15:01:08 +0000 |
| commit | 682ebb1c17947bed680c55cc7c8c19b751e3844e (patch) | |
| tree | f03a4f696ddb6f3ef9ba7c2ed49bece636f5c896 | |
| parent | 4fdb353dce4e460ce4fe0ee91ab30e90ee49d8df (diff) | |
Create bootable images in ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/gzimg.
Release builds for arm platforms create compressed images in
${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/gzimg. However, in some
cases, e.g., armv7.img.gz, they are not bootable. Consequently, boot
blocks must be manually installed in the images, which is an extra
barrier for testing systems or adopting NetBSD. This has prompted
creation of external repositories, e.g., armbsd.org, to host a
collection of bootable images. However, this does not ease the burden
on developers compiling their own systems; for them, manual
installation of boot blocks is still required.
For arm platforms, etc/etc.evbarm/Makefile.inc contains the commands
used to create system images. Because installboot(8) can write boot
blocks directly to system images, a loop through possible boards can
create a series of bootable images during the normal build process.
In the case of many arm platforms, installboot(8) uses U-Boot boot
blocks, which are not part of the NetBSD source code. Developers can,
however, install as many U-Boot boot blocks as desired, either in the
default location of /usr/pkg/share/u-boot or in a set of directories
pointed to by the U-Boot search path, the INSTALLBOOT_UBOOT_PATHS
environment variable. For each board with an available boot block, a
board-specific bootable image will be created in
${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/gzimg. If a boot block is
not available, which is the typical situation currently, no additional
image will be created.
This facility creates opportunities to build bootable images for any
number of boards within the scope of a standard release build.
However, that is not required and will not occur without the
intervention of installing U-Boot boot blocks prior to the build.
| -rw-r--r-- | BUILDING | 7 | ||||
| -rw-r--r-- | etc/etc.evbarm/Makefile.inc | 22 | ||||
| -rw-r--r-- | share/man/man7/release.7 | 12 |
3 files changed, 39 insertions, 2 deletions
@@ -153,6 +153,13 @@ CONFIGURATION cannot usefully be set inside a Makefile, including mk.conf or ${MAKECONF}. + INSTALLBOOT_UBOOT_PATHS + A colon-separated list of search paths used by + installboot to find U-Boot packages; see + installboot(8). If appropriate U-Boot packages + are installed, bootable images are created as + part of a release. + "make" variables Several variables control the behavior of NetBSD builds. Unless otherwise specified, these variables may be set in either the process diff --git a/etc/etc.evbarm/Makefile.inc b/etc/etc.evbarm/Makefile.inc index 3f71de8bf16..4c0372916d6 100644 --- a/etc/etc.evbarm/Makefile.inc +++ b/etc/etc.evbarm/Makefile.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.126 2022/05/20 16:12:34 rin Exp $ +# $NetBSD: Makefile.inc,v 1.127 2022/08/21 15:01:08 brook Exp $ # # etc.evbarm/Makefile.inc -- evbarm-specific etc Makefile targets # @@ -92,6 +92,15 @@ IMAGE.dir= ${IMAGE.rel}/binary/gzimg 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 @@ __mkimage: .USE ${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 diff --git a/share/man/man7/release.7 b/share/man/man7/release.7 index 3aa85420d74..77214acc636 100644 --- a/share/man/man7/release.7 +++ b/share/man/man7/release.7 @@ -1,4 +1,4 @@ -.\" $NetBSD: release.7,v 1.39 2020/07/13 07:26:27 jruoho Exp $ +.\" $NetBSD: release.7,v 1.40 2022/08/21 15:01:08 brook Exp $ .\" .\" Copyright (c) 1997, 2000, 2005 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -261,6 +261,16 @@ PostScript version .It Sy binary/ system binaries .Bl -tag -width "SHA512/" +.It Sy gzimg/ +compressed system images +.Bl -tag -width "xserver.tgz" +.It Ao Em machine Ac Ns Pa .tar.gz +The primary system image on those platforms that provide them. These +images may not be bootable. +.It Ao Em machine Ac Ns Pa - Ns Ao Em board Ac Ns Pa .tar.gz +A bootable system image for a particular board, on platforms that +provide them. +.El .It Sy sets/ installation sets .Bl -tag -width "xserver.tgz" |
