From: Petr Štetiar Date: Thu, 28 Mar 2019 14:21:18 +0000 (+0000) Subject: build: image: add pad-to and pad-rootfs-squashfs helpers X-Git-Tag: v21.02.0-rc1~5711 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=97833a57eff148508b1dd1515c51fdb0f8619803;p=openwrt%2Fstaging%2Fchunkeey.git build: image: add pad-to and pad-rootfs-squashfs helpers For better reusability. Signed-off-by: Petr Štetiar --- diff --git a/include/image-commands.mk b/include/image-commands.mk index 8251a81400..06c084c48b 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -230,8 +230,7 @@ define Build/append-uboot endef define Build/pad-to - dd if=$@ of=$@.new bs=$(1) conv=sync - mv $@.new $@ + $(call Image/pad-to,$@,$(1)) endef define Build/pad-extra 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