aboutsummaryrefslogtreecommitdiffstats
path: root/include/image.mk
diff options
context:
space:
mode:
authorPetr Štetiar <ynezz@true.cz>2019-03-28 14:21:18 +0000
committerPetr Štetiar <ynezz@true.cz>2019-06-25 14:12:22 +0000
commit97833a57eff148508b1dd1515c51fdb0f8619803 (patch)
tree0de377860ac83f7163a4a34fd0cafe588103aeeb /include/image.mk
parent9c8e0b0e8af9827dc83989f3b18b4b18c47eb554 (diff)
downloadupstream-97833a57eff148508b1dd1515c51fdb0f8619803.tar.gz
upstream-97833a57eff148508b1dd1515c51fdb0f8619803.tar.bz2
upstream-97833a57eff148508b1dd1515c51fdb0f8619803.zip
build: image: add pad-to and pad-rootfs-squashfs helpers
For better reusability. Signed-off-by: Petr Štetiar <ynezz@true.cz>
Diffstat (limited to 'include/image.mk')
-rw-r--r--include/image.mk9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/image.mk b/include/image.mk
index 530a2b1335..3680be2155 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -178,6 +178,15 @@ ifeq ($(strip $(call kernel_patchver_ge,4.18.0)),1)
-Wno-unique_unit_address
endif
+define Image/pad-to
+ dd if=$(1) of=$(1).new bs=$(2) conv=sync
+ mv $(1).new $(1)
+endef
+
+define Image/pad-root-squashfs
+ $(call Image/pad-to,$(KDIR)/root.squashfs,$(if $(1),$(1),$(CONFIG_TARGET_ROOTFS_PARTSIZE)M))
+endef
+
# $(1) source dts file
# $(2) target dtb file
# $(3) extra CPP flags