diff options
author | Jérôme Petazzoni <jerome.petazzoni@gmail.com> | 2021-12-24T15·11+0100 |
---|---|---|
committer | Vincent Ambo <mail@tazj.in> | 2021-12-24T19·19+0300 |
commit | 7433d620bbe82fb2642097226a580b96487f32c0 (patch) | |
tree | f166c719dfc6c0c22be471671bf315733febc357 | |
parent | 15f79e1364410bc78d1d734f4af7617f2ab8e432 (diff) |
feat: add /tmp
Examples of programs that fail when /tmp doesn't exist: - terraform - anything using mktemp and similar helpers
-rw-r--r-- | tools/nixery/prepare-image/prepare-image.nix | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/nixery/prepare-image/prepare-image.nix b/tools/nixery/prepare-image/prepare-image.nix index 56f9e7a3bf5c..acd1430548b2 100644 --- a/tools/nixery/prepare-image/prepare-image.nix +++ b/tools/nixery/prepare-image/prepare-image.nix @@ -133,14 +133,16 @@ let name = "bulk-layers"; paths = allContents.contents; - # Ensure that there is always a /usr/bin/env for shell scripts - # that require it. + # Provide a few essentials that many programs expect: + # - a /tmp directory, + # - a /usr/bin/env for shell scripts that require it. # - # Note that images which do not actually contain `coreutils` will - # still have this symlink, but it will be dangling. + # Note that in images that do not actually contain `coreutils`, + # /usr/bin/env will be a dangling symlink. # - # TODO(tazjin): Don't link this if coreutils is not included. + # TODO(tazjin): Don't link /usr/bin/env if coreutils is not included. postBuild = '' + mkdir -p $out/tmp mkdir -p $out/usr/bin ln -s ${coreutils}/bin/env $out/usr/bin/env ''; |