image.mk: add Build step pad-to
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 15 Jun 2015 07:45:36 +0000 (07:45 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 15 Jun 2015 07:45:36 +0000 (07:45 +0000)
pad-to can be used in a pipe to pad the image to a specific chunk-size.
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45980 3c298f89-4303-0410-b956-a3cf2f4a3e73

include/image.mk

index 287c679..814e7dc 100644 (file)
@@ -304,6 +304,11 @@ define Build/append-rootfs
        dd if=$(word 2,$^) $(if $(1),bs=$(1) conv=sync) >> $@
 endef
 
+define Build/pad-to
+       dd if=$@ of=$@.new bs=$(1) conv=sync
+       mv $@.new $@
+endef
+
 define Build/pad-rootfs
        $(call prepare_generic_squashfs,$@ $(1))
 endef