From f9451de1e7eec7a34e1b6968df76f365555ed598 Mon Sep 17 00:00:00 2001 From: dawn Date: Mon, 29 Jun 2026 12:32:28 +0000 Subject: [PATCH] nix/microvm: make sure tmp is diskbacked Signed-off-by: dawn --- nix/microvm/base.nix | 10 ++++++++++ spindle/engines/microvm/test-spindle-microvm.sh | 8 +++++++- 2 file(s) changed, 17 insertion(s)(+), 1 deletion(s)(-) diff --git a/nix/microvm/base.nix b/nix/microvm/base.nix --- a/nix/microvm/base.nix +++ b/nix/microvm/base.nix @@ -307,6 +307,13 @@ options = ["bind"]; depends = ["/persist"]; }; + # bind mount /tmp so our tmp is disk backed... + fileSystems."/tmp" = { + device = "/persist/tmp"; + fsType = "none"; + options = ["bind"]; + depends = ["/persist"]; + }; # create bind sources before local-fs.target, which means we have to do this # at initrd time @@ -322,6 +329,9 @@ }; "/sysroot/persist/var".d = { mode = "0755"; + }; + "/sysroot/persist/tmp".d = { + mode = "1777"; }; }; } diff --git a/spindle/engines/microvm/test-spindle-microvm.sh b/spindle/engines/microvm/test-spindle-microvm.sh --- a/spindle/engines/microvm/test-spindle-microvm.sh +++ b/spindle/engines/microvm/test-spindle-microvm.sh @@ -500,10 +500,16 @@ ;; esac +if [ "$(stat -c %d /tmp)" = "$(stat -c %d /workspace)" ]; then + echo "tmp_on_persist=yes" +else + echo "tmp_on_persist=no" +fi + /run/current-system/sw/bin/nix-store --realise "$store_path" >/dev/null ' bash "$test_store_path") || return 1 - check_needles "$out" "^http_version=2(\\.0)?$" || return 1 + check_needles "$out" "^http_version=2(\\.0)?$" "^tmp_on_persist=yes$" || return 1 echo "success: store path realized from cache and cache proxy accepted cleartext HTTP/2" } -- tangled.sh