all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Hilton Chain via Guix-patches via <guix-patches@gnu.org>
To: 73494@debbugs.gnu.org
Cc: "Hilton Chain" <hako@ultrarare.space>,
	"Florian Pelz" <pelzflorian@pelzflorian.de>,
	"Ludovic Courtès" <ludo@gnu.org>,
	"Maxim Cournoyer" <maxim.cournoyer@gmail.com>
Subject: [bug#73494] [PATCH 1/2] file-systems: %base-file-systems: Add tmpfs /run.
Date: Thu, 26 Sep 2024 15:05:28 +0800	[thread overview]
Message-ID: <9769cf0f812d5e7e9fe38ed664809974101821e0.1727334105.git.hako@ultrarare.space> (raw)
In-Reply-To: <cover.1727331040.git.hako@ultrarare.space>

* gnu/system/file-systems (%runtime-variable-data): New variable.
(%base-file-systems): Add it.
* doc/guix.texi (File Systems): Document it.
* gnu/services.scm (cleanup-gexp): Adjust accordingly.

Change-Id: I3a95e49d396fbb2577026aefc247cfe996c5f267
---
 doc/guix.texi               |  5 +++++
 gnu/services.scm            |  5 +----
 gnu/system/file-systems.scm | 15 ++++++++++++++-
 3 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 52e36e4354..54edd14d1b 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -17988,6 +17988,11 @@ File Systems
 read-write in its own ``name space.''
 @end defvar
 
+@defvar %runtime-variable-data
+This file system is mounted as @file{/run} and contains system
+information data describing the system since it was booted.
+@end defvar
+
 @defvar %binary-format-file-system
 The @code{binfmt_misc} file system, which allows handling of arbitrary
 executable file types to be delegated to user space.  This requires the
diff --git a/gnu/services.scm b/gnu/services.scm
index 8a4002e072..ea855ad193 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -632,7 +632,7 @@ (define (cleanup-gexp _)
     #~(begin
         (use-modules (guix build utils))
 
-        ;; Clean out /tmp, /var/run, and /run.
+        ;; Clean out /tmp and /var/run.
         ;;
         ;; XXX This needs to happen before service activations, so it
         ;; has to be here, but this also implicitly assumes that /tmp
@@ -663,15 +663,12 @@ (define (cleanup-gexp _)
            (setlocale LC_CTYPE "en_US.utf8")
            (delete-file-recursively "/tmp")
            (delete-file-recursively "/var/run")
-           (delete-file-recursively "/run")
 
            ;; Note: The second argument to 'mkdir' is and'ed with umask,
            ;; hence the 'chmod' calls.
            (mkdir "/tmp" #o1777)
            (chmod "/tmp" #o1777)
            (mkdir "/var/run" #o755)
-           (chmod "/var/run" #o755)
-           (mkdir "/run" #o755)
            (chmod "/var/run" #o755))))))
 
 (define cleanup-service-type
diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index 4ea8237c70..65704d7681 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -82,6 +82,7 @@ (define-module (gnu system file-systems)
             %pseudo-terminal-file-system
             %tty-gid
             %immutable-store
+            %runtime-variable-data
             %control-groups
             %elogind-file-systems
 
@@ -448,6 +449,17 @@ (define %immutable-store
     (check? #f)
     (flags '(read-only bind-mount no-atime))))
 
+(define %runtime-variable-data
+  (file-system
+    (type "tmpfs")
+    (mount-point "/run")
+    (device "tmpfs")
+    (flags '(no-dev strict-atime))
+    (options "mode=0755,nr_inodes=800k,size=20%")
+    (needed-for-boot? #t)
+    (check? #f)
+    (create-mount-point? #t)))
+
 (define %control-groups
   ;; The cgroup2 file system.
   (list (file-system
@@ -497,7 +509,8 @@ (define %base-file-systems
         %debug-file-system
         %shared-memory-file-system
         %efivars-file-system
-        %immutable-store))
+        %immutable-store
+        %runtime-variable-data))
 
 (define %base-live-file-systems
   ;; This is the bare minimum to use live file-systems.

base-commit: 8576aaf5f90db9b385ea8cf6dc98bf3c062959dc
-- 
2.46.0





  reply	other threads:[~2024-09-26  7:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-26  6:44 [bug#73494] [PATCH 0/2] tmpfs /run Hilton Chain via Guix-patches via
2024-09-26  7:05 ` Hilton Chain via Guix-patches via [this message]
2024-09-26  7:05 ` [bug#73494] [PATCH 2/2] services: cleanup: Make /var/run a symlink of /run Hilton Chain via Guix-patches via
2024-09-29  3:18 ` [bug#73494] [PATCH 0/2] tmpfs /run Hilton Chain via Guix-patches via
2024-10-30  6:37   ` Maxim Cournoyer
2024-11-03 15:45     ` Hilton Chain via Guix-patches via
2024-11-04 12:12       ` Maxim Cournoyer
2024-11-04 12:12       ` Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9769cf0f812d5e7e9fe38ed664809974101821e0.1727334105.git.hako@ultrarare.space \
    --to=guix-patches@gnu.org \
    --cc=73494@debbugs.gnu.org \
    --cc=hako@ultrarare.space \
    --cc=ludo@gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    --cc=pelzflorian@pelzflorian.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.