From 51efdf1a27dd273b6e4c3ef6a058d620a778bad2 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Fri, 27 Sep 2024 15:45:14 +0200 Subject: [PATCH] Use setsid to get job control in debug shell --- lagarto-ox.nix | 1 + patches/stage-2-init.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lagarto-ox.nix b/lagarto-ox.nix index e1df79c..aa5ea7d 100644 --- a/lagarto-ox.nix +++ b/lagarto-ox.nix @@ -65,6 +65,7 @@ bootStage2 = pkgs.substituteAll { src = ./patches/stage-2-init.sh; shellDebug = "${pkgs.bashInteractive}/bin/bash"; + bashInteractive = "${pkgs.bashInteractive}"; shell = "${pkgs.bash}/bin/bash"; inherit (config.boot) readOnlyNixStore systemdExecutable extraSystemdUnitPaths; inherit (config.system.nixos) distroName; diff --git a/patches/stage-2-init.sh b/patches/stage-2-init.sh index d22470b..1c48d21 100755 --- a/patches/stage-2-init.sh +++ b/patches/stage-2-init.sh @@ -18,7 +18,8 @@ if [ "${IN_NIXOS_SYSTEMD_STAGE1:-}" != true ]; then set -x ;; debug2) - @shellDebug@ -i + export PATH="@bashInteractive@/bin:@systemConfig@/sw/bin:$PATH" + setsid bash -c "exec bash -l /dev/hvc0 2>/dev/hvc0" ;; esac done