[openwrt/openwrt] image: add ModelNameLimit16

LEDE Commits lede-commits at lists.infradead.org
Tue Feb 23 02:38:05 EST 2021


noltari pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/eb8726f9f43f9852d3ff8357278187ffa1eadf25

commit eb8726f9f43f9852d3ff8357278187ffa1eadf25
Author: Álvaro Fernández Rojas <noltari at gmail.com>
AuthorDate: Mon Feb 22 18:04:16 2021 +0100

    image: add ModelNameLimit16
    
    This script returns the model name limited to 16 characters.
    
    Signed-off-by: Álvaro Fernández Rojas <noltari at gmail.com>
    (cherry-picked from 1235ea7c20)
---
 include/image-commands.mk | 4 ++++
 1 file changed, 4 insertions(+)

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



More information about the lede-commits mailing list