From 00f81fbdf7fba2a09ff83d14fc3b040e9ae63b42 Mon Sep 17 00:00:00 2001 From: Patrick Mochel Date: Mon, 4 Jan 2021 13:03:31 -0800 Subject: [PATCH] [tsmeta] Make sure we don't rename libubootenv The check that we use to identify U-Boot is simply whether the PN inherits 'uboot-config', because it was the only that thing that used it (and because the PN can be completely arbitrary). However, the recently introduced libubootenv also inherits it, so that was getting its CVE_PRODUCT erroneously set to 'u-boot'. The easiest fixup is to check whether the package *could* be built natively, since any of the u-boot firmware utilities are usually built for target and the host, but U-Boot itself *never* is. It's a naive assumption, but it should hold true. --- classes/tsmeta.bbclass | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/classes/tsmeta.bbclass b/classes/tsmeta.bbclass index 91621ab..2f7fdf4 100644 --- a/classes/tsmeta.bbclass +++ b/classes/tsmeta.bbclass @@ -237,9 +237,17 @@ def tsmeta_get_pn(d): def _get_cve_product(d): + def _has_native(d): + return ('native' in + oe.utils.squashspaces( + d.getVar('BBCLASSEXTEND') or '' + ).split(' ') + ) + cve_p = d.getVar('CVE_PRODUCT') if bb.data.inherits_class('uboot-config', d): - cve_p = 'u-boot' + if not _has_native(d): + cve_p = 'u-boot' if not cve_p: cve_p = d.getVar('PN') return cve_p