Author: nbd
Date: 2015-01-17 22:19:24 +0100 (Sat, 17 Jan 2015)
New Revision: 44012

Modified:
   trunk/include/image.mk
Log:
build: add image makefile helper function for pading with an offset

Signed-off-by: Felix Fietkau <[email protected]>

Modified: trunk/include/image.mk
===================================================================
--- trunk/include/image.mk      2015-01-17 19:10:40 UTC (rev 44011)
+++ trunk/include/image.mk      2015-01-17 21:19:24 UTC (rev 44012)
@@ -307,6 +307,17 @@
        $(call prepare_generic_squashfs,$@)
 endef
 
+define Build/pad-offset
+       let \
+               size="$$(stat -c%s $@)" \
+               pad="$(word 1, $(1))" \
+               offset="$(word 2, $(1))" \
+               pad="(pad - ((size + offset) % pad)) % pad" \
+               newsize='size + pad'; \
+               dd if=$@ [email protected] bs=$$newsize count=1 conv=sync
+       mv [email protected] $@
+endef
+
 define Build/check-size
        @[ $$(($(subst k,* 1024,$(subst m, * 1024k,$(1))))) -gt "$$(stat -c%s 
$@)" ] || { \
                echo "WARNING: Image file $@ is too big"; \
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to