1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-07-15 15:37:15 +00:00

19 Commits

Author SHA1 Message Date
Ross Burton 2623e69db3 runfvp: check for telnet
Check for telnet on startup to avoid mysterious failures later when
telnet isn't available.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-04-26 09:00:09 -04:00
Ross Burton 952e04cd58 runfvp: propagate the exit code correctly
runfvp could encounter an error but the exit code remained as 0.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-04-26 09:00:09 -04:00
Ross Burton 4b8aeb6edc runfvp: fix undefined variable in terminal selection login
Since 10e60cc the terminal_map doesn't exist, this piece of code wasn't
updated.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-04-26 09:00:09 -04:00
Ross Burton 0ffbe558a0 runfvp: refactor terminal selection
Rewrite the terminal code to have a priority list of terminals when
selecting a default, allow the user to pick a default with a
configuration file, and add gnome-terminal to the list.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-04-26 09:00:09 -04:00
Ross Burton 5920774ada runfvp: don't use f-string when there's no expressions
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-04-26 09:00:09 -04:00
Ross Burton 55453024ee runfvp: don't hide output when using terminals
Only pass a console_cb if we're hooking up a console, so that the output
from the FVP is visible on the terminal.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-04-26 09:00:09 -04:00
Ross Burton c72527d6a5 runfvp: handle the fvp quitting before we kill it
Don't raise an exception if the FVP has quit before we get around to
killing it.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-04-26 09:00:09 -04:00
Ross Burton cc1c99f537 runfvp: add an asyncio TODO
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-04-26 09:00:09 -04:00
Peter Hoyes 8bccb38744 runfvp: Ensure new process group is in the foreground
When a new process group is created, it is launched in the background
and any attempt to access the session terminal triggers a SIGTTIN (for
stdin) or SIGTTOU (for stdout) signal. These are ignored in an
interactive shell, but the default signal behavior in a new job is to
send a SIGTSTP to the whole process group. This causes runfvp to hang
when executed via a subprocess when stdin is accessed.

After creating a new process group, use tcsetpgrp to make the new group
the foreground process for the terminal associated with stdin/stdout,
but only if stdin is a tty.

The documentation for tcsetgrp states that tcsetpgrp itself raises a
SIGTTOU signal, so set this signal to SIG_IGN.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: I349a825df7fcb8a3cedb81762b901c6f50fa53b5
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-11-01 21:01:40 -04:00
Ross Burton 0a64644bc9 runfvp: reset the process group on startup
So that it is easy to kill runfvp and everything it starts (such as
telnet or the FVP itself), reset the process group on startup.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-10-20 14:07:11 -04:00
Ross Burton b4bcb3d986 runfvp: use asyncio instead of selector
Using asyncio makes the code easier to understand.  Also start to expose
a callback for when consoles are opened.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-10-15 10:16:01 -04:00
Ross Burton 2ead4e6caa runfvp: exit cleanly if tinfoil cannot be imported
If bb.tinfoil cannot be imported, display a nice error instead of a
backtrace.

Change-Id: I20dab9dfdbd57c8e90c8321072bab4f70b8ace47
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-09-27 09:38:53 -04:00
Ross Burton cdc91df4fc runfvp: ensure the default terminal is usable
Pick a default terminal which will actually work, instead of defaulting
to xterm even if xterm isn't installed.

Also show the default in the --help output.

Change-Id: Ib3e7c32917725f404a171248549b6f9c0afe8158
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-09-27 09:38:53 -04:00
Ross Burton 7cb1866728 runfvp: refactor argument parsing
No behavioural changes, just cleanup.

Change-Id: I04d82512493a2f90e810198e520f672284cd3eb2
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-09-27 09:38:53 -04:00
Ross Burton c5465209c1 runfvp: handle control-c cleanly
If the script receives control-c, don't display the stack trace.

Change-Id: Id0ebf9476ecd685302723fde6a36c2e899d0f3eb
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-09-27 09:38:53 -04:00
Ross Burton 31458a1046 runfvp: drop --parameter, users can use -- --parameter
Now that arbitrary parameters can be passed to the FVP binary, runfvp
doesn't need to handle --parameter itself.

Anyone using runfvp --parameter should simply use runfvp -- --parameter.

Change-Id: I8a79200fe927c253308731e7e0cb228e53cd989a
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-13 14:17:55 -04:00
Ross Burton 56b0a992e1 runfvp: pass arbitrary options after -- to the FVP binary
To allow passing arbitrary options to the FVP binary, split the passed
options on --.  Anything before the separator is handled by runfvp,
anything afterwards is passed as-is to the FVP binary.

Change-Id: I686b2fb79d217e26988753be7bd067c638d69eac
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-13 14:17:55 -04:00
Ross Burton be0e4ca455 runfvp: exit with the return code of the FVP binary
Change-Id: If79e31e61110161c9a13dd512b0146d1d515d77a
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-06-13 14:17:55 -04:00
Ross Burton 0da1865ac8 scripts: add runfvp
runfvp is a script that reads existing .fvpconf files (as written by
fvpboot.bbclass) and executes the FVP binary appropriately.

By default the behaviour is the same as running a FVP by hand, but by
passing --console the first serial port is connected to stdin/stdout.

Change-Id: Ibd26867c09e8692be4c02a7ea13571dcfe36db9b
Signed-off-by: Ross Burton <ross.burton@arm.com>
2021-05-28 17:15:01 +01:00