Skip to content

Commit 6ceaba0

Browse files
committed
driver/bareboxdriver: change default interrupt key to CTRL+D
For developer convenience, barebox v2022.11.0 onwards brings up network interfaces automatically in the background when the boot is aborted by user input. By the time a user then runs boot net for example, the seconds it takes for an Ethernet link to be established will have passed. The effects of this have already been seen in Labgrid; Commit 6f7bf66 ("driver/bareboxdriver: silence barebox in _await_prompt() and unsilence on boot()") changes the log level to suppress "ethX: N Mbps ... link detected" messages, but it leaves another problem unaddressed: A system that Labgrid aborts to run the boot command now behaves differently to a system that was left to boot normally, because network adapters are reconfigured that normally aren't. This bit me while trying to use Labgrid to debug a network issue in Linux as barebox ifup changed the Linux behavior. barebox v2025.03.0 introduces a new halt state that can be entered by ctrl-d that skips these automatic hooks. Using it should not introduce regressions for existing users, regardless of barebox version: - Prior to barebox v2025.01.0, the only options for an abort key were ctrl-c or any and both line feed and CTRL+D behave the same with either option. - After v2025.01.0, global.autoboot_abort_key can be set to an arbitrary single printable ASCII key and it seems not possible to set a new line this way. Signed-off-by: Ahmad Fatoum <[email protected]>
1 parent b1b4021 commit 6ceaba0

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGES.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
Release 25.1 (Unreleased)
2+
-------------------------
3+
4+
New Features in 25.1
5+
~~~~~~~~~~~~~~~~~~~~
6+
7+
- The default interrupt key for the `BareboxDriver` is now CTRL+D (``\x04``)
8+
instead of a line feed (``\n``). barebox v2025.03.0 onwards handles
9+
CTRL+D specially to halt autoboot countdown without running interactive
10+
hooks like bringing up network interfaces automatically.
11+
112
Release 25.0 (Released May 7, 2025)
213
-----------------------------------
314
As announced `before

labgrid/driver/bareboxdriver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class BareboxDriver(CommandMixin, Driver, CommandProtocol, LinuxBootProtocol):
3232
bindings = {"console": ConsoleProtocol, }
3333
prompt = attr.ib(default="", validator=attr.validators.instance_of(str))
3434
autoboot = attr.ib(default="stop autoboot", validator=attr.validators.instance_of(str))
35-
interrupt = attr.ib(default="\n", validator=attr.validators.instance_of(str))
35+
interrupt = attr.ib(default="\x04", validator=attr.validators.instance_of(str))
3636
bootstring = attr.ib(default=r"Linux version \d", validator=attr.validators.instance_of(str))
3737
password = attr.ib(default="", validator=attr.validators.instance_of(str))
3838
login_timeout = attr.ib(default=60, validator=attr.validators.instance_of(int))

0 commit comments

Comments
 (0)