diff --git a/nix/microvm/base.nix b/nix/microvm/base.nix index d40027f4..da3b56da 100644 --- a/nix/microvm/base.nix +++ b/nix/microvm/base.nix @@ -307,6 +307,13 @@ in { 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 @@ -323,5 +330,8 @@ in { "/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 index 6385ec69..697bcc9f 100755 --- a/spindle/engines/microvm/test-spindle-microvm.sh +++ b/spindle/engines/microvm/test-spindle-microvm.sh @@ -500,10 +500,16 @@ case "$http_version" in ;; 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" }