shutdown: preserve console graphics mode across the exitrd handoff
make_console_stdio() forces KD_TEXT while reopening /dev/console. When systemd-shutdown enters the exitrd, this can expose the text console over a retained graphical shutdown splash. Let callers choose whether to switch to text mode, and preserve the mode for the exitrd handoff. Keep the existing text-mode behavior for manager reexecution and the crash shell. Restore text mode if executing /shutdown fails and before reporting a fatal error and freezing. Add an unsafe, nonparallel virtual-console regression test requiring explicit opt-in and an already-owned inactive VT in a disposable VM. Check graphics preservation and text restoration through a private /dev/console bind mount, retain stderr diagnostics, and restore the saved mode in the parent even if the child fails.
This commit is contained in:
+1
-1
@@ -2331,7 +2331,7 @@ static int do_reexecute(
|
||||
log_warning_errno(r, "Failed to move /run/systemd/ to /run/systemd.pre-switch-root/, ignoring: %m");
|
||||
|
||||
/* Reopen the console */
|
||||
(void) make_console_stdio();
|
||||
(void) make_console_stdio(/* switch_to_text= */ true);
|
||||
|
||||
i = 1; /* Leave args[0] empty for now. */
|
||||
for (int j = 1; j <= argc; j++)
|
||||
|
||||
Reference in New Issue
Block a user