Przeglądaj źródła

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

For better reusability.

Signed-off-by: Petr Štetiar <[email protected]>
Petr Štetiar 7 lat temu
rodzic
commit
97833a57ef
2 zmienionych plików z 10 dodań i 2 usunięć
  1. 1 2
      include/image-commands.mk
  2. 9 0
      include/image.mk

+ 1 - 2
include/image-commands.mk

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

+ 9 - 0
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