support/scripts/genimage.sh: support creating a bmap image

The patch adds the possibility to create, in addition to the usual
image, an image of type bmap that drastically reduces the amount of
data that needs to be written to an SD card, resulting in time
savings.

It looks at whether BR2_PACKAGE_HOST_BMAP_TOOLS is enabled to decide
whether it should or not generate bmap tool images. It generates bmap
images for all images referenced in the genimage configuration file,
as long as they exist in $(BINARIES_DIR).

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Dario Binacchi
2024-04-21 11:53:52 +02:00
committed by Thomas Petazzoni
parent 54c92715dd
commit 6889056f1e
+11
View File
@@ -46,3 +46,14 @@ genimage \
--inputpath "${BINARIES_DIR}" \
--outputpath "${BINARIES_DIR}" \
--config "${GENIMAGE_CFG}"
if grep -Eq "^BR2_PACKAGE_HOST_BMAP_TOOLS=y$" "${BR2_CONFIG}"; then
while IFS= read -r image; do
image_path="${BINARIES_DIR}/${image}"
if ! test -f "${image_path}"; then
continue
fi
bmaptool create "${image_path}" -o "${image_path}.bmap"
gzip -c "${image_path}" > "${image_path}.gz"
done < <(grep '^image ' "${GENIMAGE_CFG}" | cut -d ' ' -f 2)
fi