aboutsummaryrefslogtreecommitdiffstats
path: root/include/image-commands.mk
diff options
context:
space:
mode:
authorMichael Pratt <mcpratt@pm.me>2022-12-21 21:33:04 -0500
committerHauke Mehrtens <hauke@hauke-m.de>2023-01-06 15:34:07 +0100
commitee87dbb3fef2c0771b20967ec4a8638fdab9c9bf (patch)
treebbd2db5ceff0d8810dce4032d77e3285e183b6d1 /include/image-commands.mk
parent1e3a8f454e46e6c235b972571761a0c6b23a3bfd (diff)
downloadupstream-ee87dbb3fef2c0771b20967ec4a8638fdab9c9bf.tar.gz
upstream-ee87dbb3fef2c0771b20967ec4a8638fdab9c9bf.tar.bz2
upstream-ee87dbb3fef2c0771b20967ec4a8638fdab9c9bf.zip
image: add gzip-filename build recipe
Some vendors use basic gzip metadata (original filename and timestamp) to verify valid images, along with the size of it's contents. Also, add a new device profile variable FACTORY_IMG_NAME which would be ideal to use with this new recipe. Signed-off-by: Michael Pratt <mcpratt@pm.me>
Diffstat (limited to 'include/image-commands.mk')
-rw-r--r--include/image-commands.mk9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/image-commands.mk b/include/image-commands.mk
index 15084093d2..ff8acf96c4 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -316,6 +316,15 @@ define Build/gzip
@mv $@.new $@
endef
+define Build/gzip-filename
+ @mkdir -p $@.tmp
+ @cp $@ $@.tmp/$(word 1,$(1))
+ $(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $@.tmp/$(word 1,$(1)) $(word 2,$(1)))
+ $(STAGING_DIR_HOST)/bin/gzip -f -9 -N -c $@.tmp/$(word 1,$(1)) $(word 2,$(1)) > $@.new
+ @mv $@.new $@
+ @rm -rf $@.tmp
+endef
+
define Build/install-dtb
$(call locked, \
$(foreach dts,$(DEVICE_DTS), \