build: image: add pad-to and pad-rootfs-squashfs helpers

For better reusability.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
master
Petr Štetiar 2019-03-28 14:21:18 +00:00
parent 9c8e0b0e8a
commit 97833a57ef
2 changed files with 10 additions and 2 deletions

View File

@ -230,8 +230,7 @@ define Build/append-uboot
endef endef
define Build/pad-to define Build/pad-to
dd if=$@ of=$@.new bs=$(1) conv=sync $(call Image/pad-to,$@,$(1))
mv $@.new $@
endef endef
define Build/pad-extra define Build/pad-extra

View File

@ -178,6 +178,15 @@ ifeq ($(strip $(call kernel_patchver_ge,4.18.0)),1)
-Wno-unique_unit_address -Wno-unique_unit_address
endif 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 # $(1) source dts file
# $(2) target dtb file # $(2) target dtb file
# $(3) extra CPP flags # $(3) extra CPP flags