summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorAdrian Freihofer <adrian.freihofer@siemens.com>2024-09-03 22:48:29 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-09-04 12:38:44 +0100
commit19931344ade6044cd6e3a01af452315910d36ec2 (patch)
tree2269714b14fe1567e221a685c073c316b68e2183 /meta
parentb182a015b08c9f74f517e30a8f1856ce06566fcd (diff)
downloadpoky-19931344ade6044cd6e3a01af452315910d36ec2.tar.gz
uboot-config: fix devtool modify with kernel-fitimage
How to reproduce: - UBOOT_CONFIG must be used. With UBOOT_MACHINE it works fine. A simple example based on oe-core is to modify the beaglebone-yocto.conf file like this: -UBOOT_MACHINE = "am335x_evm_defconfig" +UBOOT_CONFIG = "foo" +UBOOT_CONFIG[foo] = "am335x_evm_defconfig" - A build configuration which inherits the kernel-fitimage.bbclass is needed. For example: MACHINE = "beaglebone-yocto" KERNEL_IMAGETYPE = "Image" KERNEL_IMAGETYPES += " fitImage " KERNEL_CLASSES = " kernel-fitimage " devtool modify linux-yocto devtool build linux-yocto ... | cp: cannot stat '.../linux-yocto-6.6.21+git/am335x_evm_defconfig/.config': No such file or directory | WARNING: .../linux-yocto/6.6.21+git/temp/run.do_configure.2081673:172 exit 1 from 'cp .../linux-yocto-6.6.21+git/am335x_evm_defconfig/.config .../build/workspace/sources/linux-yocto/.config.baseline' The reason for this problem is that the uboot-config.bbclass sets the variable KCONFIG_CONFIG_ROOTDIR to a path that makes sense for u-boot, but not for other recipes. However, the kernel-fitimage.bbclasse, for example, inherits the uboot-config.bbclass, which brings the u-boot-specific path into the kernel build context. This change removes the uboot-specific KCONFIG_CONFIG_ROOTDIR path from recipes other than u-boot itself. (From OE-Core rev: b23581a22619c52724c8e078f29e871e2ee74259) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes-recipe/uboot-config.bbclass17
1 files changed, 10 insertions, 7 deletions
diff --git a/meta/classes-recipe/uboot-config.bbclass b/meta/classes-recipe/uboot-config.bbclass
index e55fc38b7c..bf21961977 100644
--- a/meta/classes-recipe/uboot-config.bbclass
+++ b/meta/classes-recipe/uboot-config.bbclass
@@ -101,12 +101,12 @@ python () {
101 # The "doc" varflag is special, we don't want to see it here 101 # The "doc" varflag is special, we don't want to see it here
102 ubootconfigflags.pop('doc', None) 102 ubootconfigflags.pop('doc', None)
103 ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split() 103 ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split()
104 recipename = d.getVar("PN")
104 105
105 if not ubootmachine and not ubootconfig: 106 if not ubootmachine and not ubootconfig:
106 PN = d.getVar("PN")
107 FILE = os.path.basename(d.getVar("FILE")) 107 FILE = os.path.basename(d.getVar("FILE"))
108 bb.debug(1, "To build %s, see %s for instructions on \ 108 bb.debug(1, "To build %s, see %s for instructions on \
109 setting up your machine config" % (PN, FILE)) 109 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")) 110 raise bb.parse.SkipRecipe("Either UBOOT_MACHINE or UBOOT_CONFIG must be set in the %s machine configuration." % d.getVar("MACHINE"))
111 111
112 if ubootmachine and ubootconfig: 112 if ubootmachine and ubootconfig:
@@ -140,9 +140,12 @@ python () {
140 if not found: 140 if not found:
141 raise bb.parse.SkipRecipe("The selected UBOOT_CONFIG key %s has no match in %s." % (ubootconfig, ubootconfigflags.keys())) 141 raise bb.parse.SkipRecipe("The selected UBOOT_CONFIG key %s has no match in %s." % (ubootconfig, ubootconfigflags.keys()))
142 142
143 if len(ubootconfig) == 1: 143 # 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())) 144 # Ensure the uboot specific menuconfig settings do not leak into other recipes
145 else: 145 if 'u-boot' in recipename:
146 # Disable menuconfig for multiple configs 146 if len(ubootconfig) == 1:
147 d.setVar('KCONFIG_CONFIG_ENABLE_MENUCONFIG', "false") 147 d.setVar('KCONFIG_CONFIG_ROOTDIR', os.path.join(d.getVar("B"), d.getVar("UBOOT_MACHINE").strip()))
148 else:
149 # Disable menuconfig for multiple configs
150 d.setVar('KCONFIG_CONFIG_ENABLE_MENUCONFIG', "false")
148} 151}