From patchwork Thu Mar 6 02:38:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hilton Chain X-Patchwork-Id: 39717 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1261027BBE2; Thu, 6 Mar 2025 02:40:50 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI, PDS_OTHER_BAD_TLD,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 995F627BBE9 for ; Thu, 6 Mar 2025 02:40:48 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tq19Z-0005Go-5c; Wed, 05 Mar 2025 21:40:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tq19X-0005GO-Ft for guix-patches@gnu.org; Wed, 05 Mar 2025 21:40:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tq19W-0005Tl-RB; Wed, 05 Mar 2025 21:40:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=+hYgIql8O1QiQx7epT66Kt9Jlij3iQazqc+pwblRp6c=; b=YZHRRsD3F5jaXkcWBfbInKjg1ADHe/Wg+NrpBa1EZnMRNSE2hs0itppPhz0D6FAx12nc61KhEzN/vvxhrUPzj3QfZ+EGRZpeJEliIyE1OYXGNFv7c/4mYhOx0/gSOJkd+MOak2/rQJRLCRR8WqWQjF/DcNPAsloiKgcXrVOP2aXmMYlpWkuZq2yY1IywB9W8whZNzUrQ2vwm3XHo8Io4wryElt/98DJNcX5DmL2FU0Mj35uZBlfyuARbs64wEhM6NsALX8rFgBuL3w4xpmFfhWhDUxIV+NLgB8M7jxEck7rFgCGNt4zYzqICmRY0+foJXdsn52WWOHdwKcsABuSRqw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tq19W-00024q-9M; Wed, 05 Mar 2025 21:40:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#73494] [PATCH v2 1/3] file-systems: %base-file-systems: Add tmpfs /run. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: hako@ultrarare.space, maxim.cournoyer@gmail.com, ludo@gnu.org, vagrant@debian.org, guix-patches@gnu.org Resent-Date: Thu, 06 Mar 2025 02:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73494 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73494@debbugs.gnu.org Cc: Hilton Chain , Maxim Cournoyer , Hilton Chain , Maxim Cournoyer , Ludovic =?utf-8?q?Court=C3=A8s?= , Vagrant Cascadian X-Debbugs-Original-Xcc: Hilton Chain , Maxim Cournoyer , Ludovic =?utf-8?q?Court=C3=A8s?= , Vagrant Cascadian Received: via spool by 73494-submit@debbugs.gnu.org id=B73494.17412287617884 (code B ref 73494); Thu, 06 Mar 2025 02:40:02 +0000 Received: (at 73494) by debbugs.gnu.org; 6 Mar 2025 02:39:21 +0000 Received: from localhost ([127.0.0.1]:40585 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tq18r-000235-7e for submit@debbugs.gnu.org; Wed, 05 Mar 2025 21:39:21 -0500 Received: from mx.boiledscript.com ([2a01:4f8:10b:392::42]:37896) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tq18o-00022h-J3 for 73494@debbugs.gnu.org; Wed, 05 Mar 2025 21:39:19 -0500 From: Hilton Chain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=mail; t=1741228756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+hYgIql8O1QiQx7epT66Kt9Jlij3iQazqc+pwblRp6c=; b=HKTE9bx+I4p7/ijHXzMBofhOUehlV/j6d9e3C7us2nWM/569hL57QIvKjDs4DGkU16/TPi oi+5c6ZD3FPvkS4CJTZx0adGv/q0Ft0zDSxtn0o0rRXG01XFekEGYskQhSeLsi0X96joi4 5GD2sJZ8I9Ho+OBzzjHpE5IYyFZ/fYB5xML7dMG2Hmh5ARWPbEM1wuPAgvbp4BOPWxCZnS /che0nqoxaldvnqPBs2A+tKlM9gIHhmKLI5yIX22v3o6UkZq/1oblgs2JLKkXIMKHMvFkZ lP4FZh/lrr5vARnzs6EUL1aGVMe+FkrAWqXhfU8pcUXs9J8RN8bX9KkgzPqgfQ== Date: Thu, 6 Mar 2025 10:38:39 +0800 Message-ID: <54efe155f37a018298290a7816eb56e34dcde838.1741228110.git.hako@ultrarare.space> In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 Modified-by: Maxim Cournoyer --- doc/guix.texi | 5 +++++ gnu/services.scm | 5 +---- gnu/system/file-systems.scm | 17 ++++++++++++++++- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 6844470ce2..70e5db4156 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -18228,6 +18228,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..b2766707a3 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,19 @@ (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") + ;; Don't use no-suid here as /run/privileged/bin may contain SUID + ;; executables. + (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 +511,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.