[LEDE-DEV] [RFC 2/7] image: add support for kilobyte notation to pad-offset

Mathias Kresin dev at kresin.me
Sat Sep 3 01:52:37 PDT 2016


Allows to specificy the padding and offset in kilobytes to be
consistent with pad-to.

Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 include/image-commands.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/image-commands.mk b/include/image-commands.mk
index 40a9619..3b9ea3c 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -137,8 +137,8 @@ endef
 define Build/pad-offset
 	let \
 		size="$$(stat -c%s $@)" \
-		pad="$(word 1, $(1))" \
-		offset="$(word 2, $(1))" \
+		pad="$(subst k,* 1024,$(word 1, $(1)))" \
+		offset="$(subst k,* 1024,$(word 2, $(1)))" \
 		pad="(pad - ((size + offset) % pad)) % pad" \
 		newsize='size + pad'; \
 		dd if=$@ of=$@.new bs=$$newsize count=1 conv=sync
-- 
2.7.4




More information about the Lede-dev mailing list