Skip to contentSkip to conversation

arm/lib: pass the PATH to fvp runner

PATCH Applied Clément Péron 3 participants 6 messages Mar 29, 2023 – May 25, 2023

v1 of 4 Applied Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 arm/lib: pass the PATH to fvp runner

When running an FVP machine the model executable need to be found in the PATH environement.

At the moment the script doesn't provide any PATH to the subprocess.

Add PATH to the allowed environement variable to be forwaded.

---
 meta-arm/lib/fvp/runner.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-arm/lib/fvp/runner.py +1 -1
index 28351a39..40ad1f3c 100644
@@ -63,7 +63,7 @@ class FVPRunner:
         # Pass through environment variables needed for GUI applications, such
         # as xterm, to work.
         env = config['env']
-        for name in ('DISPLAY', 'WAYLAND_DISPLAY'):
+        for name in ('DISPLAY', 'PATH', 'WAYLAND_DISPLAY'):
             if name in os.environ:
                 env[name] = os.environ[name]
 
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/2 scripts/runfvp: Fix KeyError exception when there is no FVP_CONSOLE provided

We access the dictionnary element that doesn't exist.

Use the get() method instead that will default the element to None if it doesn't exist.

---
 scripts/runfvp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/runfvp +2 -2
index c5a74b2f..ee60486c 100755
@@ -55,8 +55,8 @@ async def start_fvp(args, config, extra_args):
 
         if args.console:
             fvp.add_line_callback(lambda line: logger.debug(f"FVP output: {line}"))
-            expected_terminal = config["consoles"]["default"]
-            if not expected_terminal:
+            expected_terminal = config["consoles"].get("default")
+            if expected_terminal is None:
                 logger.error("--console used but FVP_CONSOLE not set in machine configuration")
                 return 1
             telnet = await fvp.create_telnet(expected_terminal)
Signature · 1 line
2.34.1
Reviewed-by on v1 2/2
#2 lore raw

Re: [meta-arm] [PATCH 2/2] scripts/runfvp: Fix KeyError exception when there is no FVP_CONSOLE provided

Quoted 6 lines · Clément Péron via lists.yoctoproject.org

We access the dictionnary element that doesn't exist.

Use the get() method instead that will default the element to None if it doesn't exist.

Quoted 28 lines
---
  scripts/runfvp | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
scripts/runfvp +2 -3
index c5a74b2f..ee60486c 100755
@@ -55,8 +55,8 @@ async def start_fvp(args, config, extra_args):
 
          if args.console:
              fvp.add_line_callback(lambda line: logger.debug(f"FVP output: {line}"))
-            expected_terminal = config["consoles"]["default"]
-            if not expected_terminal:
+            expected_terminal = config["consoles"].get("default")
+            if expected_terminal is None:
                  logger.error("--console used but FVP_CONSOLE not set in machine configuration")
                  return 1
              telnet = await fvp.create_telnet(expected_terminal)
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#4496): https://lists.yoctoproject.org/g/meta-arm/message/4496
Mute This Topic: https://lists.yoctoproject.org/mt/97926510/5715260
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-arm/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw
In reply to Clément Péron
Quoted 8 lines · Cl�ment P�ron

When running an FVP machine the model executable need to be found in the PATH environement.

At the moment the script doesn't provide any PATH to the subprocess.

Add PATH to the allowed environement variable to be forwaded.

This patch doesn't apply cleanly to the master branch. I think it's as simple as appending to the list of variables passed to the environment, but I'll leave it to you to confirm and test.

Thanks,
Jon

Quoted 21 lines
---
 meta-arm/lib/fvp/runner.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-arm/lib/fvp/runner.py +1 -1
index 28351a39..40ad1f3c 100644
@@ -63,7 +63,7 @@ class FVPRunner:
         # Pass through environment variables needed for GUI applications, such
         # as xterm, to work.
         env = config['env']
-        for name in ('DISPLAY', 'WAYLAND_DISPLAY'):
+        for name in ('DISPLAY', 'PATH', 'WAYLAND_DISPLAY'):
             if name in os.environ:
                 env[name] = os.environ[name]
 
Signature · 1 line
2.34.1
#4 lore raw
Quoted 6 lines · Jon Mason
Quoted 5 lines · Cl�ment P�ron

When running an FVP machine the model executable need to be found in the PATH environement.

At the moment the script doesn't provide any PATH to the subprocess.

Quoted 7 lines
Quoted 3 lines

Add PATH to the allowed environement variable to be forwaded.

This patch doesn't apply cleanly to the master branch. I think it's as simple as appending to the list of variables passed to the environment, but I'll leave it to you to confirm and test.

I attempted to update but it fails selftest
Anyway, it might be a starting point for you
https://gitlab.com/jonmason00/meta-arm/-/commits/master-next2

Quoted 26 lines

Thanks,
Jon

Quoted 21 lines
---
 meta-arm/lib/fvp/runner.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-arm/lib/fvp/runner.py +1 -1
index 28351a39..40ad1f3c 100644
@@ -63,7 +63,7 @@ class FVPRunner:
         # Pass through environment variables needed for GUI applications, such
         # as xterm, to work.
         env = config['env']
-        for name in ('DISPLAY', 'WAYLAND_DISPLAY'):
+        for name in ('DISPLAY', 'PATH', 'WAYLAND_DISPLAY'):
             if name in os.environ:
                 env[name] = os.environ[name]
 
Signature · 1 line
2.34.1
Applied
#5 lore raw
In reply to Clément Péron
Quoted 6 lines · Clément Péron

When running an FVP machine the model executable need to be found in the PATH environement.

At the moment the script doesn't provide any PATH to the subprocess.

Add PATH to the allowed environement variable to be forwaded.

Applied, thanks!

[1/2] arm/lib: pass the PATH to fvp runner

      commit: fa598021fb387e98bdb80861f245cc15acde4ca5
[2/2] scripts/runfvp: Fix KeyError exception when there is no FVP_CONSOLE provided
      commit: 316e02c0f13b473e916cd779e59f0d55d48e4962

Best regards,

Signature · 1 line
Jon Mason <[email protected]>