diff options
Diffstat (limited to 'meta/classes-recipe/uboot-config.bbclass')
-rw-r--r-- | meta/classes-recipe/uboot-config.bbclass | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/meta/classes-recipe/uboot-config.bbclass b/meta/classes-recipe/uboot-config.bbclass index e55fc38b7c..bc20913f73 100644 --- a/meta/classes-recipe/uboot-config.bbclass +++ b/meta/classes-recipe/uboot-config.bbclass | |||
@@ -19,15 +19,20 @@ def removesuffix(s, suffix): | |||
19 | return s[:-len(suffix)] | 19 | return s[:-len(suffix)] |
20 | return s | 20 | return s |
21 | 21 | ||
22 | UBOOT_ENTRYPOINT ?= "20008000" | 22 | UBOOT_ENTRYPOINT ?= "0x20008000" |
23 | UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}" | 23 | UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}" |
24 | 24 | ||
25 | # When naming the files we install/deploy, the package version and revision | ||
26 | # are part of the filename. Create a single variable to represent this and | ||
27 | # allow it to be customized if desired. | ||
28 | UBOOT_VERSION ?= "${PV}-${PR}" | ||
29 | |||
25 | # Some versions of u-boot use .bin and others use .img. By default use .bin | 30 | # Some versions of u-boot use .bin and others use .img. By default use .bin |
26 | # but enable individual recipes to change this value. | 31 | # but enable individual recipes to change this value. |
27 | UBOOT_SUFFIX ??= "bin" | 32 | UBOOT_SUFFIX ??= "bin" |
28 | UBOOT_BINARY ?= "u-boot.${UBOOT_SUFFIX}" | 33 | UBOOT_BINARY ?= "u-boot.${UBOOT_SUFFIX}" |
29 | UBOOT_BINARYNAME ?= "${@os.path.splitext(d.getVar("UBOOT_BINARY"))[0]}" | 34 | UBOOT_BINARYNAME ?= "${@os.path.splitext(d.getVar("UBOOT_BINARY"))[0]}" |
30 | UBOOT_IMAGE ?= "${UBOOT_BINARYNAME}-${MACHINE}-${PV}-${PR}.${UBOOT_SUFFIX}" | 35 | UBOOT_IMAGE ?= "${UBOOT_BINARYNAME}-${MACHINE}-${UBOOT_VERSION}.${UBOOT_SUFFIX}" |
31 | UBOOT_SYMLINK ?= "${UBOOT_BINARYNAME}-${MACHINE}.${UBOOT_SUFFIX}" | 36 | UBOOT_SYMLINK ?= "${UBOOT_BINARYNAME}-${MACHINE}.${UBOOT_SUFFIX}" |
32 | UBOOT_MAKE_TARGET ?= "all" | 37 | UBOOT_MAKE_TARGET ?= "all" |
33 | 38 | ||
@@ -36,7 +41,7 @@ UBOOT_MAKE_TARGET ?= "all" | |||
36 | # purposes. | 41 | # purposes. |
37 | UBOOT_ELF ?= "" | 42 | UBOOT_ELF ?= "" |
38 | UBOOT_ELF_SUFFIX ?= "elf" | 43 | UBOOT_ELF_SUFFIX ?= "elf" |
39 | UBOOT_ELF_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}" | 44 | UBOOT_ELF_IMAGE ?= "u-boot-${MACHINE}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX}" |
40 | UBOOT_ELF_BINARY ?= "u-boot.${UBOOT_ELF_SUFFIX}" | 45 | UBOOT_ELF_BINARY ?= "u-boot.${UBOOT_ELF_SUFFIX}" |
41 | UBOOT_ELF_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_ELF_SUFFIX}" | 46 | UBOOT_ELF_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_ELF_SUFFIX}" |
42 | 47 | ||
@@ -49,7 +54,7 @@ SPL_BINARY ?= "" | |||
49 | SPL_DELIMITER ?= "${@'.' if d.getVar("SPL_SUFFIX") else ''}" | 54 | SPL_DELIMITER ?= "${@'.' if d.getVar("SPL_SUFFIX") else ''}" |
50 | SPL_BINARYFILE ?= "${@os.path.basename(d.getVar("SPL_BINARY"))}" | 55 | SPL_BINARYFILE ?= "${@os.path.basename(d.getVar("SPL_BINARY"))}" |
51 | SPL_BINARYNAME ?= "${@removesuffix(d.getVar("SPL_BINARYFILE"), "." + d.getVar("SPL_SUFFIX"))}" | 56 | SPL_BINARYNAME ?= "${@removesuffix(d.getVar("SPL_BINARYFILE"), "." + d.getVar("SPL_SUFFIX"))}" |
52 | SPL_IMAGE ?= "${SPL_BINARYNAME}-${MACHINE}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX}" | 57 | SPL_IMAGE ?= "${SPL_BINARYNAME}-${MACHINE}-${UBOOT_VERSION}${SPL_DELIMITER}${SPL_SUFFIX}" |
53 | SPL_SYMLINK ?= "${SPL_BINARYNAME}-${MACHINE}${SPL_DELIMITER}${SPL_SUFFIX}" | 58 | SPL_SYMLINK ?= "${SPL_BINARYNAME}-${MACHINE}${SPL_DELIMITER}${SPL_SUFFIX}" |
54 | 59 | ||
55 | # Additional environment variables or a script can be installed alongside | 60 | # Additional environment variables or a script can be installed alongside |
@@ -62,14 +67,14 @@ UBOOT_ENV ?= "" | |||
62 | UBOOT_ENV_SRC_SUFFIX ?= "cmd" | 67 | UBOOT_ENV_SRC_SUFFIX ?= "cmd" |
63 | UBOOT_ENV_SRC ?= "${UBOOT_ENV}.${UBOOT_ENV_SRC_SUFFIX}" | 68 | UBOOT_ENV_SRC ?= "${UBOOT_ENV}.${UBOOT_ENV_SRC_SUFFIX}" |
64 | UBOOT_ENV_BINARY ?= "${UBOOT_ENV}.${UBOOT_ENV_SUFFIX}" | 69 | UBOOT_ENV_BINARY ?= "${UBOOT_ENV}.${UBOOT_ENV_SUFFIX}" |
65 | UBOOT_ENV_IMAGE ?= "${UBOOT_ENV}-${MACHINE}-${PV}-${PR}.${UBOOT_ENV_SUFFIX}" | 70 | UBOOT_ENV_IMAGE ?= "${UBOOT_ENV}-${MACHINE}-${UBOOT_VERSION}.${UBOOT_ENV_SUFFIX}" |
66 | UBOOT_ENV_SYMLINK ?= "${UBOOT_ENV}-${MACHINE}.${UBOOT_ENV_SUFFIX}" | 71 | UBOOT_ENV_SYMLINK ?= "${UBOOT_ENV}-${MACHINE}.${UBOOT_ENV_SUFFIX}" |
67 | 72 | ||
68 | # U-Boot EXTLINUX variables. U-Boot searches for /boot/extlinux/extlinux.conf | 73 | # U-Boot EXTLINUX variables. U-Boot searches for /boot/extlinux/extlinux.conf |
69 | # to find EXTLINUX conf file. | 74 | # to find EXTLINUX conf file. |
70 | UBOOT_EXTLINUX_INSTALL_DIR ?= "/boot/extlinux" | 75 | UBOOT_EXTLINUX_INSTALL_DIR ?= "/boot/extlinux" |
71 | UBOOT_EXTLINUX_CONF_NAME ?= "extlinux.conf" | 76 | UBOOT_EXTLINUX_CONF_NAME ?= "extlinux.conf" |
72 | UBOOT_EXTLINUX_SYMLINK ?= "${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE}-${PR}" | 77 | UBOOT_EXTLINUX_SYMLINK ?= "${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE}-${UBOOT_VERSION}" |
73 | 78 | ||
74 | # Options for the device tree compiler passed to mkimage '-D' feature: | 79 | # Options for the device tree compiler passed to mkimage '-D' feature: |
75 | UBOOT_MKIMAGE_DTCOPTS ??= "" | 80 | UBOOT_MKIMAGE_DTCOPTS ??= "" |
@@ -101,12 +106,12 @@ python () { | |||
101 | # The "doc" varflag is special, we don't want to see it here | 106 | # The "doc" varflag is special, we don't want to see it here |
102 | ubootconfigflags.pop('doc', None) | 107 | ubootconfigflags.pop('doc', None) |
103 | ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split() | 108 | ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split() |
109 | recipename = d.getVar("PN") | ||
104 | 110 | ||
105 | if not ubootmachine and not ubootconfig: | 111 | if not ubootmachine and not ubootconfig: |
106 | PN = d.getVar("PN") | ||
107 | FILE = os.path.basename(d.getVar("FILE")) | 112 | FILE = os.path.basename(d.getVar("FILE")) |
108 | bb.debug(1, "To build %s, see %s for instructions on \ | 113 | bb.debug(1, "To build %s, see %s for instructions on \ |
109 | setting up your machine config" % (PN, FILE)) | 114 | setting up your machine config" % (recipename, FILE)) |
110 | raise bb.parse.SkipRecipe("Either UBOOT_MACHINE or UBOOT_CONFIG must be set in the %s machine configuration." % d.getVar("MACHINE")) | 115 | raise bb.parse.SkipRecipe("Either UBOOT_MACHINE or UBOOT_CONFIG must be set in the %s machine configuration." % d.getVar("MACHINE")) |
111 | 116 | ||
112 | if ubootmachine and ubootconfig: | 117 | if ubootmachine and ubootconfig: |
@@ -140,9 +145,12 @@ python () { | |||
140 | if not found: | 145 | if not found: |
141 | raise bb.parse.SkipRecipe("The selected UBOOT_CONFIG key %s has no match in %s." % (ubootconfig, ubootconfigflags.keys())) | 146 | raise bb.parse.SkipRecipe("The selected UBOOT_CONFIG key %s has no match in %s." % (ubootconfig, ubootconfigflags.keys())) |
142 | 147 | ||
143 | if len(ubootconfig) == 1: | 148 | # This recipe might be inherited e.g. by the kernel recipe via kernel-fitimage.bbclass |
144 | d.setVar('KCONFIG_CONFIG_ROOTDIR', os.path.join(d.getVar("B"), d.getVar("UBOOT_MACHINE").strip())) | 149 | # Ensure the uboot specific menuconfig settings do not leak into other recipes |
145 | else: | 150 | if 'u-boot' in recipename: |
146 | # Disable menuconfig for multiple configs | 151 | if len(ubootconfig) == 1: |
147 | d.setVar('KCONFIG_CONFIG_ENABLE_MENUCONFIG', "false") | 152 | d.setVar('KCONFIG_CONFIG_ROOTDIR', os.path.join("${B}", d.getVar("UBOOT_MACHINE").strip())) |
153 | else: | ||
154 | # Disable menuconfig for multiple configs | ||
155 | d.setVar('KCONFIG_CONFIG_ENABLE_MENUCONFIG', "false") | ||
148 | } | 156 | } |