From c52a9cee53db1e16df0c23ec10e352248e5372f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 29 Aug 2025 11:13:05 +0200 Subject: =?UTF-8?q?linux-container:=20Export=20=E2=80=98%writable-/tmp?= =?UTF-8?q?=E2=80=99=20and=20use=20it.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes guix/guix#1994. * gnu/build/linux-container.scm (%writable-/tmp): New variable. * guix/scripts/environment.scm (launch-environment/container): Remove ‘tmpfs’ and use it. Adjust ‘file-system’ declaration for /run/user/$UID. * guix/scripts/home.scm (spawn-home-container): Likewise. Reported-by: Romain GARBAGE Change-Id: Ia8289fb5386971738caf2ccc1e815daa6ac28459 --- gnu/build/linux-container.scm | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gnu/build/linux-container.scm') diff --git a/gnu/build/linux-container.scm b/gnu/build/linux-container.scm index 3e5158c2fd7..b6f8563f7d0 100644 --- a/gnu/build/linux-container.scm +++ b/gnu/build/linux-container.scm @@ -30,6 +30,7 @@ unprivileged-user-namespace-supported? setgroups-supported? %namespaces + %writable-/tmp run-container call-with-container container-excursion @@ -387,6 +388,16 @@ if there are no child processes left." (+ 128 (or (status:term-sig status) (status:stop-sig status))))) +(define %writable-/tmp + ;; Writable and volatile /tmp. + (file-system + (device "none") + (mount-point "/tmp") + (type "tmpfs") + (flags '(no-suid no-dev)) + (options "mode=755,size=10%") + (check? #f))) + (define* (call-with-container mounts thunk #:key (namespaces %namespaces) (host-uids 1) (guest-uid 0) (guest-gid 0) (lock-mounts? #t) -- cgit v1.2.3