Skip to contentSkip to conversation

arm-bsp: Fix the PV variable for edk2

PATCH In review Khasim Mohammed 2 participants 2 messages Jun 15, 2020 – Jun 16, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm-bsp: Fix the PV variable for edk2

PV variable is being set as PV=git by bitbake which is incorrect. This patch fixes the PV variable.

Change-Id Ie5a0f8b753fc2f7ac103c6d024c7134f88264079
---
 meta-arm-bsp/recipes-bsp/uefi/edk2-firmware-n1sdp.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta-arm-bsp/recipes-bsp/uefi/edk2-firmware-n1sdp.inc +2 -1
index c8fc70a..3114c47 100644
@@ -16,4 +16,5 @@ EDK2_ARCH          = "AARCH64"
 
 COMPATIBLE_MACHINE = "n1sdp"
 
-PV ?= "201908+git${SRCPV}"
+SRCPV_COMBINED := "${@bb.fetch2.get_srcrev(d).replace('AUTOINC+','')}"
+PV = "201908+git${SRCPV_COMBINED}"
Signature · 1 line
2.17.1
#1 lore raw
Quoted 1 line · Khasim Mohammed

-PV ?= "201908+git${SRCPV}"

It's the ? which is the problem here, as bitbake.conf sets a value so ?= never happens.

PV = "1.2+git${SRCPV}" is the idiomatic way to do this. Grepping poky:

recipes-bsp/u-boot/libubootenv_0.2.bb:PV = "0.2+git${SRCPV}"

And another 30-odd instances.

You'll need to set SRCREV_FORMAT to define how the two srcrevs are turned into a PV:

SRCREV_FORMAT = "edk2_edk2-platforms"

But doing that results in a recursion error. I scratched my head over this for a minute before realising that it's actually pretty simple:
the SRC_URL uses destsuffix to control where the git modules are checked out too, with absolute paths via ${S}. ${S} contains ${PV}. ${PV} depends on the source references, so that's the loop.

So the simple fix is:
1) Turn the existing PV ?= into PV =
2) Set SRCREV_FORMAT
3) Use relative paths in destsuffix (e.g. destsuffix=edk2) as the paths are relative to ${WORKDIR}.

Ross