summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMathias Kresin <dev@kresin.me>2016-09-03 07:36:12 +0200
committerMathias Kresin <dev@kresin.me>2016-09-03 07:36:12 +0200
commitb99a93ebaf0dc34ab0de452e3034b28f21085988 (patch)
tree780a3bcdcbbf41c6be9ea3a3cb5f579c03042525 /include
parent5369a03d528312cfdab732d9e1e1a706185f5efb (diff)
downloadmaster-31e0f0ae-b99a93ebaf0dc34ab0de452e3034b28f21085988.tar.gz
master-31e0f0ae-b99a93ebaf0dc34ab0de452e3034b28f21085988.tar.bz2
master-31e0f0ae-b99a93ebaf0dc34ab0de452e3034b28f21085988.zip
image: add support for k unit suffix to pad-offset
Allows to specificy the padding and offset in kilobytes to be consistent with pad-to. Signed-off-by: Mathias Kresin <dev@kresin.me>
Diffstat (limited to 'include')
-rw-r--r--include/image-commands.mk4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/image-commands.mk b/include/image-commands.mk
index 40a9619c31..3b9ea3ccba 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