diff mbox series

[3/4] classes: Prevent passing None to the runfvp environment

Message ID 20230123135018.3793393-3-peter.hoyes@arm.com
State New
Headers show
Series [1/4] arm/lib: Add XAUTHORITY to runfvp environment | expand

Commit Message

Peter Hoyes Jan. 23, 2023, 1:50 p.m. UTC
From: Peter Hoyes <Peter.Hoyes@arm.com>

FVP_ENV_PASSTHROUGH may contain variables that have not been set.
d.getVar returns None in this case. Detect this and skip setting the
variable in the model environment.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
---
 meta-arm/classes/fvpboot.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta-arm/classes/fvpboot.bbclass b/meta-arm/classes/fvpboot.bbclass
index 0c0f9d2d..da0580b0 100644
--- a/meta-arm/classes/fvpboot.bbclass
+++ b/meta-arm/classes/fvpboot.bbclass
@@ -73,7 +73,8 @@  python do_write_fvpboot_conf() {
 
     data["env"] = {}
     for var in d.getVar("FVP_ENV_PASSTHROUGH").split():
-        data["env"][var] = d.getVar(var)
+        if d.getVar(var) is not None:
+            data["env"][var] = d.getVar(var)
 
     os.makedirs(os.path.dirname(conffile), exist_ok=True)
     with open(conffile, "wt") as f: