From: Daan De Meyer Date: Sun, 15 Sep 2024 20:27:03 +0000 (+0200) Subject: Make sure /var/tmp is not an overlayfs unless required X-Git-Tag: v25~294^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3ecc852f64a166a35ffa4b58fe76ed5fd76573d;p=thirdparty%2Fmkosi.git Make sure /var/tmp is not an overlayfs unless required If we put an overlayfs on /var because the user provided files in /var via their sandbox tree, make sure /var/tmp is not an overlayfs unless really required so tools like systemd-repart can make full use of the underlying filesystem features which are disabled if /var/tmp is on an overlayfs. --- diff --git a/mkosi/run.py b/mkosi/run.py index 169948b1a..e580b36d9 100644 --- a/mkosi/run.py +++ b/mkosi/run.py @@ -571,6 +571,13 @@ def sandbox_cmd( else: cmdline += ["--tmpfs", Path("/") / d] + # If we put an overlayfs on /var, and /var/tmp is not in the sandbox tree, make sure /var/tmp is a bind mount + # of a regular empty directory instead of the overlays so tools like systemd-repart can use the underlying + # filesystem features from btrfs when using /var/tmp. + if overlay and not (overlay / "var/tmp").exists(): + tmp = stack.enter_context(vartmpdir()) + cmdline += ["--bind", tmp, "/var/tmp"] + yield [*cmdline, *options, "--"]