Skip to content

Commit

Permalink
[tsmeta] Make sure we don't rename libubootenv
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mochel-timesys committed Jan 4, 2021
1 parent 6d2441d commit 00f81fb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion classes/tsmeta.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 00f81fb

Please sign in to comment.