]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
uboot-config.bbclass: Raise error for bad key
authorTom Hochstein <tom.hochstein@nxp.com>
Thu, 28 Jul 2022 18:44:36 +0000 (13:44 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 2 Aug 2022 10:29:57 +0000 (11:29 +0100)
If an invalid key is used, the class ignores the error, with an
indeterminate result. In my case, the problem surfaced in do_deploy:

```
| cp: cannot stat '/.../build/tmp/work/imx6qdlsabresd-fsl-linux-gnueabi/u-boot-imx-mfgtool/2022.04-r0/deploy-u-boot-imx-mfgtool/u-boot.imx': No such file or
| directory
```

The root cause of this was that the uboot config key did not match
a valid option. With the fix, the error is caught by the class:

```
ERROR: Nothing PROVIDES 'u-boot-imx-mfgtool'
u-boot-imx-mfgtool was skipped: The selected UBOOT_CONFIG key ['mfgtool'] has no match in dict_keys(['sd-fslc', 'sd-imx', 'sd-optee-imx', 'sata-imx', 'mfgtool-imx']).
```

Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
meta/classes/uboot-config.bbclass

index b9ad35821ac98fa853117f541f708a44f94d42cc..e8da8c7452ac4b2644ad9e0354d9b652015bf234 100644 (file)
@@ -125,5 +125,6 @@ python () {
                     else:
                         bb.debug(1, "Appending '%s' to UBOOT_BINARIES." % ubootbinary)
                         d.appendVar('UBOOT_BINARIES', ' ' + ubootbinary)
-                    break
+                    return
+        raise bb.parse.SkipRecipe("The selected UBOOT_CONFIG key %s has no match in %s." % (ubootconfig, ubootconfigflags.keys()))
 }