linux-container: Export ‘%writable-/tmp’ and use it.

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 <romain.garbage@inria.fr>
Change-Id: Ia8289fb5386971738caf2ccc1e815daa6ac28459
This commit is contained in:
Ludovic Courtès 2025-08-29 11:13:05 +02:00
parent 6d242496db
commit c52a9cee53
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
3 changed files with 21 additions and 15 deletions

View file

@ -38,7 +38,9 @@
group-entry
write-passwd
write-group)
#:autoload (gnu build linux-container) (call-with-container %namespaces)
#:autoload (gnu build linux-container) (call-with-container
%namespaces
%writable-/tmp)
#:use-module ((gnu system) #:select (operating-system?
operating-system-user-services))
#:autoload (gnu system linux-container) (eval/container)
@ -353,11 +355,7 @@ immediately. Return the exit status of the process in the container."
#:namespaces (if network?
(delq 'net %namespaces) ; share host network
%namespaces)
#:mounts (list (file-system ;writable /tmp
(device "none")
(mount-point "/tmp")
(type "tmpfs")
(check? #f))
#:mounts (list %writable-/tmp
(file-system
(device "none")
(mount-point