From: Daan De Meyer Date: Mon, 18 Sep 2023 11:50:47 +0000 (+0200) Subject: Reuse host /tmp in bwrap() X-Git-Tag: v17~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28ccb67a92ece3b306d5c3ff354f0cd9d565f4e5;p=thirdparty%2Fmkosi.git Reuse host /tmp in bwrap() If we replace /tmp, we'll also make any directories located in /tmp inaccessible, e.g. the workspace directory. Work around the problem by reusing the host's /tmp. Fixes #1894 --- diff --git a/mkosi/run.py b/mkosi/run.py index a94c944d8..8f77a2598 100644 --- a/mkosi/run.py +++ b/mkosi/run.py @@ -294,11 +294,11 @@ def bwrap( "--ro-bind", "/var", "/var", "--ro-bind", "/run", "/run", "--bind", "/var/tmp", "/var/tmp", + "--bind", "/tmp", "/tmp", + "--bind", Path.cwd(), Path.cwd(), ] cmdline += [ - "--tmpfs", "/tmp", - "--bind", Path.cwd(), Path.cwd(), "--chdir", Path.cwd(), "--unshare-pid", "--unshare-ipc", @@ -332,7 +332,7 @@ def bwrap( cmdline += [ "--setenv", "PATH", f"{d}:{os.environ['PATH']}", *options, - "sh", "-c", "chmod 1777 /tmp /dev/shm && exec $0 \"$@\"", + "sh", "-c", "chmod 1777 /dev/shm && exec $0 \"$@\"", ] try: