about summary refs log tree commit diff
path: root/tvix/tests/default.nix
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-09-24T20·01+0300
committerclbot <clbot@tvl.fyi>2023-09-25T10·49+0000
commit242949ecfbb913d0e1ac50153918f39c6107f21a (patch)
tree164a69716c7552d5922661f93b8d0df07e7085ca /tvix/tests/default.nix
parent05f42519b53575ad3235b5e0a0cd7d71f04076a5 (diff)
fix(tvix/tests/tvix-init): run as pid1, support init= r/6651
We were previously not running as PID1, but were executing things via
uinitcmd (by u-root init).
This had some problems - a real system pid1 really wants to be pid1.

u-root init itself seems to be too complicated to configure as a
chainloader, so instead, we just provide init/pid1 ourselves and do the
little bit of mount setup / stage 1 that's necessary.

`tvix.exec` is renamed to `tvix.run`, to further distinguish it from the
`exec` bash function.

Our init will now also power off the machine if the shell, or the custom
tvix.run command finished. In the case of switch_root (`init=` being
passed), we terminate before, so it's up to the real system anyways.

Change-Id: If00c0c11ca9393968e76ae0d131594b5c135fa48
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9454
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/tests/default.nix')
-rw-r--r--tvix/tests/default.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/tvix/tests/default.nix b/tvix/tests/default.nix
index 9e9a22a66221..875fe0b9f1bf 100644
--- a/tvix/tests/default.nix
+++ b/tvix/tests/default.nix
@@ -58,7 +58,7 @@ rec {
       export HOME=$(mktemp -d)
       export GOROOT="$(go env GOROOT)"
 
-      GO111MODULE=off GOPATH=/tmp/go GOPROXY=off ${uroot}/bin/u-root -files ./tvix-init -uinitcmd "/tvix-init" -o $out
+      GO111MODULE=off GOPATH=/tmp/go GOPROXY=off ${uroot}/bin/u-root -files ./tvix-init -initcmd "/tvix-init" -o $out
     '';
   };