aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2021-02-22 18:04:16 +0100
committerÁlvaro Fernández Rojas <noltari@gmail.com>2021-02-23 08:35:41 +0100
commiteb8726f9f43f9852d3ff8357278187ffa1eadf25 (patch)
treec4c05ae3672aa2cd0503bcd2fbce3a5eaa98c055 /include
parent3c1aabd445c5e83f9db2c8d5138df6b324e1df77 (diff)
downloadupstream-eb8726f9f43f9852d3ff8357278187ffa1eadf25.tar.gz
upstream-eb8726f9f43f9852d3ff8357278187ffa1eadf25.tar.bz2
upstream-eb8726f9f43f9852d3ff8357278187ffa1eadf25.zip
image: add ModelNameLimit16
This script returns the model name limited to 16 characters. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> (cherry-picked from 1235ea7c20)
Diffstat (limited to 'include')
-rw-r--r--include/image-commands.mk4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/image-commands.mk b/include/image-commands.mk
index c3f8b4b95a..51e745958e 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -3,6 +3,10 @@
IMAGE_KERNEL = $(word 1,$^)
IMAGE_ROOTFS = $(word 2,$^)
+define ModelNameLimit16
+$(shell expr substr "$(word 2, $(subst _, ,$(1)))" 1 16)
+endef
+
define rootfs_align
$(patsubst %-256k,0x40000,$(patsubst %-128k,0x20000,$(patsubst %-64k,0x10000,$(patsubst squashfs%,0x4,$(patsubst root.%,%,$(1))))))
endef