image: add ModelNameLimit16
authorÁlvaro Fernández Rojas <noltari@gmail.com>
Mon, 22 Feb 2021 17:04:16 +0000 (18:04 +0100)
committerÁlvaro Fernández Rojas <noltari@gmail.com>
Mon, 22 Feb 2021 17:29:40 +0000 (18:29 +0100)
This script returns the model name limited to 16 characters.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
include/image-commands.mk

index c3f8b4b95a30eeecc4ff90892506f85100933ab9..51e745958e627a739fdb809ffbdee9216157527f 100644 (file)
@@ -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