mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] test/strategy.py: optionally don't activate BareboxDriver
@ 2026-01-08 10:07 Sascha Hauer
  2026-01-08 14:42 ` Ahmad Fatoum
  2026-01-08 16:05 ` Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Sascha Hauer @ 2026-01-08 10:07 UTC (permalink / raw)
  To: Barebox List

When bootstrapping barebox on QEMU with my barebox-bringup utility it
brings it to the 'barebox' state before opening a console. The
BareboxDriver consumes all console messages in order to bring barebox
to the prompt. This is bad for interactive use where one wants to
see the console output right from the start.

Insert a 'on' state which brings up QEMU but doesn't activate the
BareboxDriver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 test/strategy.py | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/test/strategy.py b/test/strategy.py
index 0f1b761474..0ca08b0cdd 100644
--- a/test/strategy.py
+++ b/test/strategy.py
@@ -21,11 +21,12 @@ if match is None or int(match.group(1)) < 25:
 class Status(enum.Enum):
     unknown = 0
     off = 1
-    barebox = 2
-    qemu_dry_run = 3
-    qemu_interactive = 4
-    qemu_dump_dtb = 5
-    shell = 6
+    on = 2
+    barebox = 3
+    qemu_dry_run = 4
+    qemu_interactive = 5
+    qemu_dump_dtb = 6
+    shell = 7
 
 
 @target_factory.reg_driver
@@ -63,11 +64,13 @@ class BareboxTestStrategy(Strategy):
             self.target.deactivate(self.console)
             self.target.activate(self.power)
             self.power.off()
-        elif status == Status.barebox:
+        elif status == Status.on:
             self.transition(Status.off)  # pylint: disable=missing-kwoa
             self.target.activate(self.console)
             # cycle power
             self.power.cycle()
+        elif status == Status.barebox:
+            self.transition(Status.on)  # pylint: disable=missing-kwoa
             # interrupt barebox
             self.target.activate(self.barebox)
         elif status == Status.shell:
-- 
2.47.3




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] test/strategy.py: optionally don't activate BareboxDriver
  2026-01-08 10:07 [PATCH] test/strategy.py: optionally don't activate BareboxDriver Sascha Hauer
@ 2026-01-08 14:42 ` Ahmad Fatoum
  2026-01-08 16:05 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2026-01-08 14:42 UTC (permalink / raw)
  To: Sascha Hauer, Barebox List



On 1/8/26 11:07 AM, Sascha Hauer wrote:
> When bootstrapping barebox on QEMU with my barebox-bringup utility it
> brings it to the 'barebox' state before opening a console. The
> BareboxDriver consumes all console messages in order to bring barebox
> to the prompt. This is bad for interactive use where one wants to
> see the console output right from the start.
> 
> Insert a 'on' state which brings up QEMU but doesn't activate the
> BareboxDriver.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

> ---
>  test/strategy.py | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/test/strategy.py b/test/strategy.py
> index 0f1b761474..0ca08b0cdd 100644
> --- a/test/strategy.py
> +++ b/test/strategy.py
> @@ -21,11 +21,12 @@ if match is None or int(match.group(1)) < 25:
>  class Status(enum.Enum):
>      unknown = 0
>      off = 1
> -    barebox = 2
> -    qemu_dry_run = 3
> -    qemu_interactive = 4
> -    qemu_dump_dtb = 5
> -    shell = 6
> +    on = 2
> +    barebox = 3
> +    qemu_dry_run = 4
> +    qemu_interactive = 5
> +    qemu_dump_dtb = 6
> +    shell = 7
>  
>  
>  @target_factory.reg_driver
> @@ -63,11 +64,13 @@ class BareboxTestStrategy(Strategy):
>              self.target.deactivate(self.console)
>              self.target.activate(self.power)
>              self.power.off()
> -        elif status == Status.barebox:
> +        elif status == Status.on:
>              self.transition(Status.off)  # pylint: disable=missing-kwoa
>              self.target.activate(self.console)
>              # cycle power
>              self.power.cycle()
> +        elif status == Status.barebox:
> +            self.transition(Status.on)  # pylint: disable=missing-kwoa
>              # interrupt barebox
>              self.target.activate(self.barebox)
>          elif status == Status.shell:

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] test/strategy.py: optionally don't activate BareboxDriver
  2026-01-08 10:07 [PATCH] test/strategy.py: optionally don't activate BareboxDriver Sascha Hauer
  2026-01-08 14:42 ` Ahmad Fatoum
@ 2026-01-08 16:05 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2026-01-08 16:05 UTC (permalink / raw)
  To: Barebox List, Sascha Hauer


On Thu, 08 Jan 2026 11:07:39 +0100, Sascha Hauer wrote:
> When bootstrapping barebox on QEMU with my barebox-bringup utility it
> brings it to the 'barebox' state before opening a console. The
> BareboxDriver consumes all console messages in order to bring barebox
> to the prompt. This is bad for interactive use where one wants to
> see the console output right from the start.
> 
> Insert a 'on' state which brings up QEMU but doesn't activate the
> BareboxDriver.
> 
> [...]

Applied, thanks!

[1/1] test/strategy.py: optionally don't activate BareboxDriver
      https://git.pengutronix.de/cgit/barebox/commit/?id=624fd6ded3fc (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-01-08 16:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-08 10:07 [PATCH] test/strategy.py: optionally don't activate BareboxDriver Sascha Hauer
2026-01-08 14:42 ` Ahmad Fatoum
2026-01-08 16:05 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox