summaryrefslogtreecommitdiffstats
path: root/target/linux/ath79/image
diff options
context:
space:
mode:
authorTony Ambardar <itugrok@yahoo.com>2023-11-11 04:29:26 -0800
committerHauke Mehrtens <hauke@hauke-m.de>2023-11-26 18:37:20 +0100
commitb16e14a220fcab19e3145328057e7188f00b6a17 (patch)
tree7412f17f418fa7c01575843d11563790242e4742 /target/linux/ath79/image
parentc66511bc488c3665d47dd60baf981ca1c385c221 (diff)
downloadopenwrt-b16e14a220fcab19e3145328057e7188f00b6a17.tar.gz
openwrt-b16e14a220fcab19e3145328057e7188f00b6a17.tar.bz2
openwrt-b16e14a220fcab19e3145328057e7188f00b6a17.zip
image: use helper function for size units
Add the make function 'exp_units' for helping evaluate k/m/g size units in expressions, and use this to consistently replace many ad hoc substitutions like '$(subst k,* 1024,$(subst m, * 1024k,$(IMAGE_SIZE)))' in makefiles. Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Diffstat (limited to 'target/linux/ath79/image')
-rw-r--r--target/linux/ath79/image/generic.mk2
-rw-r--r--target/linux/ath79/image/nand.mk2
2 files changed, 2 insertions, 2 deletions
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index e435806c7b..68c4105561 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -85,7 +85,7 @@ define Build/mkmylofw_16m
let \
size="$$(stat -c%s $@)" \
- pad="$(subst k,* 1024,$(BLOCKSIZE))" \
+ pad="$(call exp_units,$(BLOCKSIZE))" \
pad="(pad - (size % pad)) % pad" \
newsize='size + pad' ; \
[ $$newsize -lt $$((0x660000)) ] && newsize=0x660000 ; \
diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk
index 5c9e190e19..bf2b1a1f8a 100644
--- a/target/linux/ath79/image/nand.mk
+++ b/target/linux/ath79/image/nand.mk
@@ -32,7 +32,7 @@ endef
define Build/zyxel-factory
let \
- maxsize="$(subst k,* 1024,$(RAS_ROOTFS_SIZE))"; \
+ maxsize="$(call exp_units,$(RAS_ROOTFS_SIZE))"; \
let size="$$(stat -c%s $@)"; \
if [ $$size -lt $$maxsize ]; then \
$(STAGING_DIR_HOST)/bin/mkrasimage \