Skip to content

Commit ba7c10b

Browse files
committed
Make user input prompt appear automatically if autobooting fails
1 parent 7b2db2e commit ba7c10b

File tree

5 files changed

+12
-2
lines changed

5 files changed

+12
-2
lines changed

boards/qemu-aarch64/config.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
debug = true;
1313
linux = {
1414
kconfig = with lib.kernel; {
15-
GPIOLIB = yes;
15+
ARM_SCMI_TRANSPORT_VIRTIO = yes;
1616
GPIO_PL061 = yes;
1717
MEMORY_HOTPLUG = yes;
1818
MEMORY_HOTREMOVE = yes;

kernel-configs/aarch64.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
ARM_PSCI_CPUIDLE = yes;
2727
ARM_PSCI_FW = yes;
2828
ARM_SCMI_PROTOCOL = yes;
29+
ARM_SCMI_TRANSPORT_MAILBOX = yes;
30+
ARM_SCMI_TRANSPORT_SMC = yes;
2931
ARM_SCPI_PROTOCOL = yes;
3032
ARM_SMMU = yes;
3133
ARM_SMMU_V3 = yes;

src/console.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,8 +672,8 @@ pub fn handleStdin(self: *Console, boot_loaders: []*BootLoader) !?Event {
672672
// We may already have a prompt from a boot timeout, so don't print
673673
// a prompt if we already have one.
674674
if (self.tty == null) {
675+
try system.setConsole(.off);
675676
self.tty = try system.setupTty(IN, .user_input);
676-
std.log.debug("user presence detected", .{});
677677
self.shell.prompt(self.context);
678678
}
679679

src/tboot-loader.zig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,13 @@ fn run(self: *TbootLoader) !posix.RebootCommand {
285285
if (self.handleTimer()) |outcome| {
286286
return outcome;
287287
}
288+
// Autobooting did not work, thus we go into user input mode.
289+
// This will block on console input, though that is fine
290+
// because we don't have anything else to try since we've
291+
// already tried autobooting.
292+
else if (try self.handleConsoleInput()) |outcome| {
293+
return outcome;
294+
}
288295
} else {
289296
std.debug.panic("unknown event: {}", .{event});
290297
}

tests/module.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ let
44
in
55
{
66
virtualisation = {
7+
graphics = false;
78
directBoot.enable = false;
89
qemu.options = [
910
"-kernel ${tinyboot.linux}/kernel"

0 commit comments

Comments
 (0)