summaryrefslogtreecommitdiffstats
path: root/meta/classes/uboot-config.bbclass
diff options
context:
space:
mode:
authorStefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>2021-09-01 12:29:54 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-02 12:12:08 +0100
commit7c08a9e3cd169b6b9d208a570ed7cb2c3384361a (patch)
tree773eb4ae118067419140aa7758dfa6da008fad93 /meta/classes/uboot-config.bbclass
parentb8b43622e81065c7c97732b066d319483fb08446 (diff)
downloadpoky-7c08a9e3cd169b6b9d208a570ed7cb2c3384361a.tar.gz
u-boot: Make SPL suffix configurable
Make the SPL suffix configurable via SPL_SUFFIX variable to support SPL binaries with suffix. The suffix is optional and empty per default. The delimiter in front of the suffix is added automatically if the suffix is not empty. A new variable SPL_BINARYFILE contains the binary file name inclusive optional delimiter and suffix and the old variable SPL_BINARYNAME contains only the name of the binary without directory, delimiter and specified suffix. This behavior is backward compatible with empty SPL_SUFFIX variable. (From OE-Core rev: e4cfec633c20d6406523da905530e887b853f7ed) Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/uboot-config.bbclass')
-rw-r--r--meta/classes/uboot-config.bbclass14
1 files changed, 11 insertions, 3 deletions
diff --git a/meta/classes/uboot-config.bbclass b/meta/classes/uboot-config.bbclass
index 451db0c650..e9e7148f0d 100644
--- a/meta/classes/uboot-config.bbclass
+++ b/meta/classes/uboot-config.bbclass
@@ -11,6 +11,11 @@
11# 11#
12# Copyright 2013, 2014 (C) O.S. Systems Software LTDA. 12# Copyright 2013, 2014 (C) O.S. Systems Software LTDA.
13 13
14def removesuffix(s, suffix):
15 if suffix and s.endswith(suffix):
16 return s[:-len(suffix)]
17 return s
18
14# Some versions of u-boot use .bin and others use .img. By default use .bin 19# Some versions of u-boot use .bin and others use .img. By default use .bin
15# but enable individual recipes to change this value. 20# but enable individual recipes to change this value.
16UBOOT_SUFFIX ??= "bin" 21UBOOT_SUFFIX ??= "bin"
@@ -33,10 +38,13 @@ UBOOT_ELF_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_ELF_SUFFIX}"
33# should be packaged along with the u-boot binary as well as placed in the 38# should be packaged along with the u-boot binary as well as placed in the
34# deploy directory. For those versions they can set the following variables 39# deploy directory. For those versions they can set the following variables
35# to allow packaging the SPL. 40# to allow packaging the SPL.
41SPL_SUFFIX ?= ""
36SPL_BINARY ?= "" 42SPL_BINARY ?= ""
37SPL_BINARYNAME ?= "${@os.path.basename(d.getVar("SPL_BINARY"))}" 43SPL_DELIMITER ?= "${@'.' if d.getVar("SPL_SUFFIX") else ''}"
38SPL_IMAGE ?= "${SPL_BINARYNAME}-${MACHINE}-${PV}-${PR}" 44SPL_BINARYFILE ?= "${@os.path.basename(d.getVar("SPL_BINARY"))}"
39SPL_SYMLINK ?= "${SPL_BINARYNAME}-${MACHINE}" 45SPL_BINARYNAME ?= "${@removesuffix(d.getVar("SPL_BINARYFILE"), "." + d.getVar("SPL_SUFFIX"))}"
46SPL_IMAGE ?= "${SPL_BINARYNAME}-${MACHINE}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX}"
47SPL_SYMLINK ?= "${SPL_BINARYNAME}-${MACHINE}${SPL_DELIMITER}${SPL_SUFFIX}"
40 48
41# Additional environment variables or a script can be installed alongside 49# Additional environment variables or a script can be installed alongside
42# u-boot to be used automatically on boot. This file, typically 'uEnv.txt' 50# u-boot to be used automatically on boot. This file, typically 'uEnv.txt'