GNU bug report logs - #65335
[PATCH 0/4] Allow mounting root on tmpfs for impersistence

Previous Next

Package: guix-patches;

Reported by: Nicolas Graves <ngraves <at> ngraves.fr>

Date: Wed, 16 Aug 2023 09:25:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 65335 in the body.
You can then email your comments to 65335 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Wed, 16 Aug 2023 09:25:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicolas Graves <ngraves <at> ngraves.fr>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 16 Aug 2023 09:25:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: guix-patches <at> gnu.org
Subject: [PATCH 0/4] Allow mounting root on tmpfs for impersistence
Date: Wed, 16 Aug 2023 11:24:34 +0200
This patch series allows the root to be mounted on tmpfs, and ensures directories that are needed are present. Once the persisting directories needed are configured (with btrfs for instance), one can mount root on tmpfs. These persisting directories should be at least /var/log (not needed, but safety requirement), /var/lib, /var/guix, but they are application-dependent (if using NetworkManager, /etc/NetworkManager; if guix offloading daemon is present, /etc/guix; the same goes for Docker...).

Nicolas Graves (4):
  file-systems: canonicalize-device-name: Ignore the "none" case.
  gnu: services: activation-script: Ensure /var/run existence.
  gnu: build: activate-current-system: Ensure directory existence.
  gnu: system: bootable-kernel-arguments: Ignore the "none" root case.

 gnu/build/activation.scm   |  1 +
 gnu/build/file-systems.scm |  8 ++++----
 gnu/services.scm           |  1 +
 gnu/system.scm             | 21 ++++++++++++---------
 4 files changed, 18 insertions(+), 13 deletions(-)


base-commit: 880ada0bdb9e694573ec42200d48658b27744b9b
prerequisite-patch-id: cccdad83975cbf04d7bd618c2c1a4b4de6fa7fd2
prerequisite-patch-id: 6f28833d2efa054d55126980f87ba4d2fdd13c6d
prerequisite-patch-id: afc6cadece838372370f7093f863ce8eaae7bc55
prerequisite-patch-id: b9330c12700355319c104aa3b493eafe03cbb619
prerequisite-patch-id: 46fa9c5a48fcc5b13409049b14b6e7314a6d6956
prerequisite-patch-id: 846f8b50b8de749caaa459b874087d06e15e0a80
prerequisite-patch-id: 023101e5a315951ce9786fb8230955c97001dac9
prerequisite-patch-id: d4b0193f128d8236026e079e746ea0cf6c4c0af0
prerequisite-patch-id: d73442d6d7c88e7375e9de0a9cd655cacb7766f9
prerequisite-patch-id: d8a56dd7bc6c1c3ba3ac0f77b2402b9c6469cfb2
prerequisite-patch-id: 3bc2b2eecd799be8d8b0f96b850ef83a6306dab7
prerequisite-patch-id: 798d4a277eff03a59339af4ebe19406682f361ab
prerequisite-patch-id: 3f65e9cdab64edeacfeb5748cd4fb130839b2b30
prerequisite-patch-id: 6f8225b63a1dd1866b05bb91544e49d7c096601c
prerequisite-patch-id: ff71ec9bdf6337390a720db4535268af271e32df
prerequisite-patch-id: c6b40cc38f5bdfab229ac3d7ed4346c5d9f1b2f7
prerequisite-patch-id: 9ab6dade9e641d5e667ba6a61dbfbb3d32c943a6
prerequisite-patch-id: 4fcae29a8f6dd95716669680141da315acaf6e59
prerequisite-patch-id: 0a5a6da0061188dc9be59bc9829db53288307c58
prerequisite-patch-id: 83c4b7d9d831990e4d37ba89c584d773c872ba6b
prerequisite-patch-id: 1c8dddf99041cf399b8836e3ad6721d7bbcebb7c
prerequisite-patch-id: 773df13cc85606b205d1d914e59525b7a6820a1d
prerequisite-patch-id: 6f8974ce8c0a3a25721a41781f9b0dfd61e96cf4
prerequisite-patch-id: d219948d28923c5ccd34b63f988032df33f2f336
prerequisite-patch-id: 0bd75bb28df9ccf3405caf8217d708afc978047d
prerequisite-patch-id: 26476dd782cf8f5e427d4bd36ac85957538a0aa3
prerequisite-patch-id: b5f87c460fd984c41fbb52e7e0dc305c20c46f22
prerequisite-patch-id: 5502b9c6a64abaca6a9921f25cd324869d26aa1e
prerequisite-patch-id: a7e84bb368349566e9a6fdbe49a371fdb464bb1e
prerequisite-patch-id: a84a766ceef6bedd5da3f9512c87a2c2a11ff33f
prerequisite-patch-id: 0175b2b1cbbc15c1c775147821715bca9e3303a3
prerequisite-patch-id: 9c20b408ac8aa275ecba58383d83be5cef7647df
prerequisite-patch-id: 836749cd3bd3b86f64de637c3c2df48a3608f09f
prerequisite-patch-id: 28ea1ddbef32a1bc9e908f3f9c7466953c60f13d
prerequisite-patch-id: 52a78e387e36e6408d7147950195d552e4e41528
prerequisite-patch-id: 87fee01a70d4b8cbfca44cc0a9c9f54471a92d18
prerequisite-patch-id: 8c8cdb345e815fc3332805ca224103f185d4a568
prerequisite-patch-id: 3434c5caf1eba9e9a64c673681e5911d2c1d9232
prerequisite-patch-id: c45bf303726fb3dacee01a66c0ff75105a81164d
prerequisite-patch-id: d44a1adb0404f23522aac21fa8a7f26be7ddabdc
prerequisite-patch-id: e422fe29bbcef80260b190637faa1a4953c3f1cb
prerequisite-patch-id: 285479a1a1e46e6f0f8aba5429edfa400c81b32b
prerequisite-patch-id: 30fcff6f8c9328c71d3fca609cddde0b56973bb7
prerequisite-patch-id: 70bb47ccac3375de893e4e640ce7c59369a05a39
prerequisite-patch-id: cc3d79386ca4a93146dc195cd5732764f1ac447f
prerequisite-patch-id: 2686866ec4bf08c7faa05b17cb84d9e0c13ec12c
prerequisite-patch-id: 369b61e07e3c90151a5414b784513b9ae3d3e978
prerequisite-patch-id: 065651c3a8cee63b725d7f86c080c274b494627e
prerequisite-patch-id: 1ee71844f0c9a0112a456e5b76079239906a7fb8
prerequisite-patch-id: c7b3d9c5bff04c16576781eff50ce37f7c49131c
prerequisite-patch-id: c8b8fe8dc51fea0b8a2626cf7031f01b6000e023
prerequisite-patch-id: 182e25335d4c357001f4f8bed2b3f89b91d9cae5
prerequisite-patch-id: c0ea00d5f4c6a83642a92c9341f0288fbfe3095a
prerequisite-patch-id: 795d31cc33a24a6a57e67af31b65acd8faa8187c
prerequisite-patch-id: 358af8aa7fa71b5cb8fbe6dde29d141bb7c57f1e
prerequisite-patch-id: b9ab3ee98a9d4ca518a4d99042982d64fbce5d05
prerequisite-patch-id: 12b76e9c2751da73ed64c9489b15f74ff17568cf
prerequisite-patch-id: eb618ab7b10483d917c308a38792af98baa517e2
prerequisite-patch-id: aca7b0d7b302853e522f47700d0780a96b4a72e6
prerequisite-patch-id: c6bbe6026bfcd2c9ff6e06efc5b8424a6943d1bf
prerequisite-patch-id: 1dc9b52f102fa787539119b849a14224ef7b4fa5
prerequisite-patch-id: 5f664cb2fd995a53765c5ffc19a708ac795cc0c4
prerequisite-patch-id: 8e234d0f4d93d2aad499eec8842be3d28da98707
prerequisite-patch-id: 40b6c9f09f27833367a71ec25d77afae4d2a835e
prerequisite-patch-id: 45e65ea00ece53f3496251401acd464081f8ca7a
--
2.41.0

--
Best regards,
Nicolas Graves




Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Wed, 16 Aug 2023 09:30:02 GMT) Full text and rfc822 format available.

Message #8 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 65335 <at> debbugs.gnu.org
Cc: ngraves <at> ngraves.fr
Subject: [PATCH 1/4] file-systems: canonicalize-device-name: Ignore the "none"
 case.
Date: Wed, 16 Aug 2023 11:29:26 +0200
---
 gnu/build/file-systems.scm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm
index 36a59f5f5c..e39bd31c3b 100644
--- a/gnu/build/file-systems.scm
+++ b/gnu/build/file-systems.scm
@@ -1021,8 +1021,8 @@ (define find-partition-by-luks-uuid
 
 (define (canonicalize-device-spec spec)
   "Return the device name corresponding to SPEC, which can be a <uuid>, a
-<file-system-label>, or a string (typically a /dev file name or an nfs-root
-containing ':/')."
+<file-system-label>, the string 'none' or another string (typically a /dev
+file name or an nfs-root containing ':/')."
   (define max-trials
     ;; Number of times we retry partition label resolution, 1 second per
     ;; trial.  Note: somebody reported a delay of 16 seconds (!) before their
@@ -1046,8 +1046,8 @@ (define (canonicalize-device-spec spec)
 
   (match spec
     ((? string?)
-     (if (string-contains spec ":/")
-         spec                  ; do not resolve NFS devices
+     (if (or (string-contains spec ":/") (string=? spec "none"))
+         spec                  ; do not resolve NFS / tmpfs devices
          ;; Nothing to do, but wait until SPEC shows up.
          (resolve identity spec identity)))
     ((? file-system-label?)

base-commit: 1a92b3f43c280f143b00f8bb95a173fb85e52664
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Wed, 16 Aug 2023 09:31:02 GMT) Full text and rfc822 format available.

Message #11 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 65335 <at> debbugs.gnu.org
Cc: ngraves <at> ngraves.fr
Subject: [PATCH 2/4] gnu: services: activation-script: Ensure /var/run
 existence.
Date: Wed, 16 Aug 2023 11:29:27 +0200
---
 gnu/services.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/services.scm b/gnu/services.scm
index 109e050a23..a992800796 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -670,6 +670,7 @@ (define (activation-script gexps)
                       ;; Make sure the user accounting database exists.  If it
                       ;; does not exist, 'setutxent' does not create it and
                       ;; thus there is no accounting at all.
+                      (mkdir-p "/var/run")
                       (close-port (open-file "/var/run/utmpx" "a0"))
 
                       ;; Same for 'wtmp', which is populated by mingetty et
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Wed, 16 Aug 2023 09:31:02 GMT) Full text and rfc822 format available.

Message #14 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 65335 <at> debbugs.gnu.org
Cc: ngraves <at> ngraves.fr
Subject: [PATCH 4/4] gnu: system: bootable-kernel-arguments: Ignore the "none"
 root case.
Date: Wed, 16 Aug 2023 11:29:29 +0200
---
 gnu/system.scm | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index 279b9df5c0..0d9e9ee5cf 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -198,15 +198,18 @@ (define* (bootable-kernel-arguments system root-device version)
   ;; compatibility when producing bootloader configurations for older
   ;; generations.
   (define version>0? (> version 0))
-  (list (string-append (if version>0? "root=" "--root=")
-                       ;; Note: Always use the DCE format because that's what
-                       ;; (gnu build linux-boot) expects for the 'root'
-                       ;; kernel command-line option.
-                       (file-system-device->string root-device
-                                                   #:uuid-type 'dce))
-        #~(string-append (if #$version>0? "gnu.system=" "--system=") #$system)
-        #~(string-append (if #$version>0? "gnu.load=" "--load=")
-                         #$system "/boot")))
+  (let ((root (file-system-device->string root-device
+                                          #:uuid-type 'dce)))
+    (append
+     (if (string=? root "none")
+         '() ;; Ignore the case where the root is "none" (typically tmpfs).
+         ;; Note: Always use the DCE format because that's what
+         ;; (gnu build linux-boot) expects for the 'root'
+         ;; kernel command-line option.
+         (list (string-append (if version>0? "root=" "--root=") root)))
+     (list #~(string-append (if #$version>0? "gnu.system=" "--system=") #$system)
+           #~(string-append (if #$version>0? "gnu.load=" "--load=")
+                            #$system "/boot")))))
 
 ;; System-wide configuration.
 
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Wed, 16 Aug 2023 09:31:03 GMT) Full text and rfc822 format available.

Message #17 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 65335 <at> debbugs.gnu.org
Cc: ngraves <at> ngraves.fr
Subject: [PATCH 3/4] gnu: build: activate-current-system: Ensure directory
 existence.
Date: Wed, 16 Aug 2023 11:29:28 +0200
---
 gnu/build/activation.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm
index eea2233563..759704ae03 100644
--- a/gnu/build/activation.scm
+++ b/gnu/build/activation.scm
@@ -408,6 +408,7 @@ (define* (activate-current-system
 
   (format #t "making '~a' the current system...~%" system)
 
+  (mkdir-p "/run")
   ;; Atomically make SYSTEM current.
   (let ((new (string-append %current-system ".new")))
     (symlink system new)
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Sun, 20 Aug 2023 22:16:01 GMT) Full text and rfc822 format available.

Message #20 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 65335 <at> debbugs.gnu.org
Subject: Re: [bug#65335] [PATCH 0/4] Allow mounting root on tmpfs for
 impersistence
Date: Mon, 21 Aug 2023 00:15:22 +0200
On 2023-08-16 11:24, Nicolas Graves via Guix-patches via wrote:

> This patch series allows the root to be mounted on tmpfs, and ensures directories that are needed are present. Once the persisting directories needed are configured (with btrfs for instance), one can mount root on tmpfs. These persisting directories should be at least /var/log (not needed, but safety requirement), /var/lib, /var/guix, but they are application-dependent (if using NetworkManager, /etc/NetworkManager; if guix offloading daemon is present, /etc/guix; the same goes for Docker...).
>
> Nicolas Graves (4):
>   file-systems: canonicalize-device-name: Ignore the "none" case.
>   gnu: services: activation-script: Ensure /var/run existence.
>   gnu: build: activate-current-system: Ensure directory existence.
>   gnu: system: bootable-kernel-arguments: Ignore the "none" root case.
>
>  gnu/build/activation.scm   |  1 +
>  gnu/build/file-systems.scm |  8 ++++----
>  gnu/services.scm           |  1 +
>  gnu/system.scm             | 21 ++++++++++++---------
>  4 files changed, 18 insertions(+), 13 deletions(-)
>

A new update with a little addition for the home symlink-manager, in the
same idea of enabling impermanence configurations on guix.

I've experienced a few issues with the home symlink-manager, in the case
where

To explain the use case for this last commit : in the hypothesis in
which we use a dedicated btrfs to save for instance the ~/.ssh or the
~/.local/share directory, when running guix home reconfigure, the
activation script will error before ending with an EBUSY error. This
will make the home reconfiguration fail, while the most sensible action
in this case is to ignore the deletion call and continue, just like when
a configuration directory is not empty.

This is not enough for enabling impermanence home configurations, but it
enables to reconfigure the home with btrfs subvolumes under ~. 

-- 
Best regards,
Nicolas Graves




Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Sun, 20 Aug 2023 22:18:02 GMT) Full text and rfc822 format available.

Message #23 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 65335 <at> debbugs.gnu.org
Cc: ngraves <at> ngraves.fr
Subject: [PATCH v2 1/5] file-systems: canonicalize-device-name: Ignore the
 "none" case.
Date: Mon, 21 Aug 2023 00:16:43 +0200
---
 gnu/build/file-systems.scm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm
index 36a59f5f5c..e39bd31c3b 100644
--- a/gnu/build/file-systems.scm
+++ b/gnu/build/file-systems.scm
@@ -1021,8 +1021,8 @@ (define find-partition-by-luks-uuid
 
 (define (canonicalize-device-spec spec)
   "Return the device name corresponding to SPEC, which can be a <uuid>, a
-<file-system-label>, or a string (typically a /dev file name or an nfs-root
-containing ':/')."
+<file-system-label>, the string 'none' or another string (typically a /dev
+file name or an nfs-root containing ':/')."
   (define max-trials
     ;; Number of times we retry partition label resolution, 1 second per
     ;; trial.  Note: somebody reported a delay of 16 seconds (!) before their
@@ -1046,8 +1046,8 @@ (define (canonicalize-device-spec spec)
 
   (match spec
     ((? string?)
-     (if (string-contains spec ":/")
-         spec                  ; do not resolve NFS devices
+     (if (or (string-contains spec ":/") (string=? spec "none"))
+         spec                  ; do not resolve NFS / tmpfs devices
          ;; Nothing to do, but wait until SPEC shows up.
          (resolve identity spec identity)))
     ((? file-system-label?)

base-commit: a0f5885fefd93a3859b6e4b82b18a6db9faeee05
prerequisite-patch-id: cccdad83975cbf04d7bd618c2c1a4b4de6fa7fd2
prerequisite-patch-id: 6f28833d2efa054d55126980f87ba4d2fdd13c6d
prerequisite-patch-id: afc6cadece838372370f7093f863ce8eaae7bc55
prerequisite-patch-id: b9330c12700355319c104aa3b493eafe03cbb619
prerequisite-patch-id: 46fa9c5a48fcc5b13409049b14b6e7314a6d6956
prerequisite-patch-id: 846f8b50b8de749caaa459b874087d06e15e0a80
prerequisite-patch-id: 023101e5a315951ce9786fb8230955c97001dac9
prerequisite-patch-id: d4b0193f128d8236026e079e746ea0cf6c4c0af0
prerequisite-patch-id: d73442d6d7c88e7375e9de0a9cd655cacb7766f9
prerequisite-patch-id: d8a56dd7bc6c1c3ba3ac0f77b2402b9c6469cfb2
prerequisite-patch-id: 3bc2b2eecd799be8d8b0f96b850ef83a6306dab7
prerequisite-patch-id: 798d4a277eff03a59339af4ebe19406682f361ab
prerequisite-patch-id: 3f65e9cdab64edeacfeb5748cd4fb130839b2b30
prerequisite-patch-id: 6f8225b63a1dd1866b05bb91544e49d7c096601c
prerequisite-patch-id: ff71ec9bdf6337390a720db4535268af271e32df
prerequisite-patch-id: c6b40cc38f5bdfab229ac3d7ed4346c5d9f1b2f7
prerequisite-patch-id: 9ab6dade9e641d5e667ba6a61dbfbb3d32c943a6
prerequisite-patch-id: 4fcae29a8f6dd95716669680141da315acaf6e59
prerequisite-patch-id: 0a5a6da0061188dc9be59bc9829db53288307c58
prerequisite-patch-id: 83c4b7d9d831990e4d37ba89c584d773c872ba6b
prerequisite-patch-id: 1c8dddf99041cf399b8836e3ad6721d7bbcebb7c
prerequisite-patch-id: 773df13cc85606b205d1d914e59525b7a6820a1d
prerequisite-patch-id: 6f8974ce8c0a3a25721a41781f9b0dfd61e96cf4
prerequisite-patch-id: d219948d28923c5ccd34b63f988032df33f2f336
prerequisite-patch-id: 0bd75bb28df9ccf3405caf8217d708afc978047d
prerequisite-patch-id: 26476dd782cf8f5e427d4bd36ac85957538a0aa3
prerequisite-patch-id: b5f87c460fd984c41fbb52e7e0dc305c20c46f22
prerequisite-patch-id: 5502b9c6a64abaca6a9921f25cd324869d26aa1e
prerequisite-patch-id: a7e84bb368349566e9a6fdbe49a371fdb464bb1e
prerequisite-patch-id: a84a766ceef6bedd5da3f9512c87a2c2a11ff33f
prerequisite-patch-id: 0175b2b1cbbc15c1c775147821715bca9e3303a3
prerequisite-patch-id: 9c20b408ac8aa275ecba58383d83be5cef7647df
prerequisite-patch-id: 836749cd3bd3b86f64de637c3c2df48a3608f09f
prerequisite-patch-id: 28ea1ddbef32a1bc9e908f3f9c7466953c60f13d
prerequisite-patch-id: 52a78e387e36e6408d7147950195d552e4e41528
prerequisite-patch-id: 87fee01a70d4b8cbfca44cc0a9c9f54471a92d18
prerequisite-patch-id: 8c8cdb345e815fc3332805ca224103f185d4a568
prerequisite-patch-id: 3434c5caf1eba9e9a64c673681e5911d2c1d9232
prerequisite-patch-id: c45bf303726fb3dacee01a66c0ff75105a81164d
prerequisite-patch-id: d44a1adb0404f23522aac21fa8a7f26be7ddabdc
prerequisite-patch-id: e422fe29bbcef80260b190637faa1a4953c3f1cb
prerequisite-patch-id: 285479a1a1e46e6f0f8aba5429edfa400c81b32b
prerequisite-patch-id: 30fcff6f8c9328c71d3fca609cddde0b56973bb7
prerequisite-patch-id: 70bb47ccac3375de893e4e640ce7c59369a05a39
prerequisite-patch-id: cc3d79386ca4a93146dc195cd5732764f1ac447f
prerequisite-patch-id: 2686866ec4bf08c7faa05b17cb84d9e0c13ec12c
prerequisite-patch-id: 369b61e07e3c90151a5414b784513b9ae3d3e978
prerequisite-patch-id: 065651c3a8cee63b725d7f86c080c274b494627e
prerequisite-patch-id: 1ee71844f0c9a0112a456e5b76079239906a7fb8
prerequisite-patch-id: c7b3d9c5bff04c16576781eff50ce37f7c49131c
prerequisite-patch-id: c8b8fe8dc51fea0b8a2626cf7031f01b6000e023
prerequisite-patch-id: 182e25335d4c357001f4f8bed2b3f89b91d9cae5
prerequisite-patch-id: c0ea00d5f4c6a83642a92c9341f0288fbfe3095a
prerequisite-patch-id: 795d31cc33a24a6a57e67af31b65acd8faa8187c
prerequisite-patch-id: 358af8aa7fa71b5cb8fbe6dde29d141bb7c57f1e
prerequisite-patch-id: b9ab3ee98a9d4ca518a4d99042982d64fbce5d05
prerequisite-patch-id: 12b76e9c2751da73ed64c9489b15f74ff17568cf
prerequisite-patch-id: eb618ab7b10483d917c308a38792af98baa517e2
prerequisite-patch-id: c6bbe6026bfcd2c9ff6e06efc5b8424a6943d1bf
prerequisite-patch-id: 1dc9b52f102fa787539119b849a14224ef7b4fa5
prerequisite-patch-id: 5f664cb2fd995a53765c5ffc19a708ac795cc0c4
prerequisite-patch-id: 8e234d0f4d93d2aad499eec8842be3d28da98707
prerequisite-patch-id: 40b6c9f09f27833367a71ec25d77afae4d2a835e
prerequisite-patch-id: 45e65ea00ece53f3496251401acd464081f8ca7a
prerequisite-patch-id: c3bc83367aa2aab9f121fe3bdbbd9e48dee860ea
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Sun, 20 Aug 2023 22:18:02 GMT) Full text and rfc822 format available.

Message #26 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 65335 <at> debbugs.gnu.org
Cc: ngraves <at> ngraves.fr
Subject: [PATCH v2 2/5] gnu: services: activation-script: Ensure /var/run
 existence.
Date: Mon, 21 Aug 2023 00:16:44 +0200
---
 gnu/services.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/services.scm b/gnu/services.scm
index eb9258977e..73235ac2b8 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -674,6 +674,7 @@ (define (activation-script gexps)
                       ;; Make sure the user accounting database exists.  If it
                       ;; does not exist, 'setutxent' does not create it and
                       ;; thus there is no accounting at all.
+                      (mkdir-p "/var/run")
                       (close-port (open-file "/var/run/utmpx" "a0"))
 
                       ;; Same for 'wtmp', which is populated by mingetty et
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Sun, 20 Aug 2023 22:18:03 GMT) Full text and rfc822 format available.

Message #29 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 65335 <at> debbugs.gnu.org
Cc: ngraves <at> ngraves.fr
Subject: [PATCH v2 3/5] gnu: build: activate-current-system: Ensure directory
 existence.
Date: Mon, 21 Aug 2023 00:16:45 +0200
---
 gnu/build/activation.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm
index eea2233563..759704ae03 100644
--- a/gnu/build/activation.scm
+++ b/gnu/build/activation.scm
@@ -408,6 +408,7 @@ (define* (activate-current-system
 
   (format #t "making '~a' the current system...~%" system)
 
+  (mkdir-p "/run")
   ;; Atomically make SYSTEM current.
   (let ((new (string-append %current-system ".new")))
     (symlink system new)
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Sun, 20 Aug 2023 22:18:03 GMT) Full text and rfc822 format available.

Message #32 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 65335 <at> debbugs.gnu.org
Cc: ngraves <at> ngraves.fr
Subject: [PATCH v2 4/5] gnu: system: bootable-kernel-arguments: Ignore the
 "none" root case.
Date: Mon, 21 Aug 2023 00:16:46 +0200
---
 gnu/system.scm | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index 279b9df5c0..0d9e9ee5cf 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -198,15 +198,18 @@ (define* (bootable-kernel-arguments system root-device version)
   ;; compatibility when producing bootloader configurations for older
   ;; generations.
   (define version>0? (> version 0))
-  (list (string-append (if version>0? "root=" "--root=")
-                       ;; Note: Always use the DCE format because that's what
-                       ;; (gnu build linux-boot) expects for the 'root'
-                       ;; kernel command-line option.
-                       (file-system-device->string root-device
-                                                   #:uuid-type 'dce))
-        #~(string-append (if #$version>0? "gnu.system=" "--system=") #$system)
-        #~(string-append (if #$version>0? "gnu.load=" "--load=")
-                         #$system "/boot")))
+  (let ((root (file-system-device->string root-device
+                                          #:uuid-type 'dce)))
+    (append
+     (if (string=? root "none")
+         '() ;; Ignore the case where the root is "none" (typically tmpfs).
+         ;; Note: Always use the DCE format because that's what
+         ;; (gnu build linux-boot) expects for the 'root'
+         ;; kernel command-line option.
+         (list (string-append (if version>0? "root=" "--root=") root)))
+     (list #~(string-append (if #$version>0? "gnu.system=" "--system=") #$system)
+           #~(string-append (if #$version>0? "gnu.load=" "--load=")
+                            #$system "/boot")))))
 
 ;; System-wide configuration.
 
-- 
2.41.0





Information forwarded to , guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Sun, 20 Aug 2023 22:18:03 GMT) Full text and rfc822 format available.

Message #35 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 65335 <at> debbugs.gnu.org
Cc: ngraves <at> ngraves.fr
Subject: [PATCH v2 5/5] gnu: home: symlink-manager: Allow dedicated device
 skip.
Date: Mon, 21 Aug 2023 00:16:47 +0200
---
 gnu/home/services/symlink-manager.scm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gnu/home/services/symlink-manager.scm b/gnu/home/services/symlink-manager.scm
index e4c931fbee..d3c4d01db4 100644
--- a/gnu/home/services/symlink-manager.scm
+++ b/gnu/home/services/symlink-manager.scm
@@ -157,6 +157,11 @@ (define (update-symlinks-script)
                            #t
                            (G_ "Skipping ~a (not an empty directory)... done\n")
                            directory))
+                         ((= EBUSY errno)
+                          (format
+                           #t
+                           (G_ "Skipping ~a (dedicated device)... done\n")
+                           directory))
                          ((= ENOENT errno) #t)
                          ((= ENOTDIR errno) #t)
                          (else
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Mon, 21 Aug 2023 14:08:02 GMT) Full text and rfc822 format available.

Message #38 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Nicolas Graves <ngraves <at> ngraves.fr>
Cc: 65335 <at> debbugs.gnu.org
Subject: Re: bug#65335: [PATCH 0/4] Allow mounting root on tmpfs for
 impersistence
Date: Mon, 21 Aug 2023 16:06:52 +0200
Hi,

Nicolas Graves <ngraves <at> ngraves.fr> skribis:

> ---
>  gnu/build/file-systems.scm | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm
> index 36a59f5f5c..e39bd31c3b 100644
> --- a/gnu/build/file-systems.scm
> +++ b/gnu/build/file-systems.scm
> @@ -1021,8 +1021,8 @@ (define find-partition-by-luks-uuid
>  
>  (define (canonicalize-device-spec spec)
>    "Return the device name corresponding to SPEC, which can be a <uuid>, a
> -<file-system-label>, or a string (typically a /dev file name or an nfs-root
> -containing ':/')."
> +<file-system-label>, the string 'none' or another string (typically a /dev
> +file name or an nfs-root containing ':/')."

LGTM.

However, my offer to write commit logs on your behalf has expired, so I
kindly invite you to write them.  :-)

See ‘C-x v l’ and the manual for details (info "(guix) Submitting
Patches").

TIA!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Mon, 21 Aug 2023 14:10:01 GMT) Full text and rfc822 format available.

Message #41 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Nicolas Graves <ngraves <at> ngraves.fr>
Cc: 65335 <at> debbugs.gnu.org
Subject: Re: bug#65335: [PATCH 0/4] Allow mounting root on tmpfs for
 impersistence
Date: Mon, 21 Aug 2023 16:09:09 +0200
Nicolas Graves <ngraves <at> ngraves.fr> skribis:

> ---
>  gnu/services.scm | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/gnu/services.scm b/gnu/services.scm
> index eb9258977e..73235ac2b8 100644
> --- a/gnu/services.scm
> +++ b/gnu/services.scm
> @@ -674,6 +674,7 @@ (define (activation-script gexps)
>                        ;; Make sure the user accounting database exists.  If it
>                        ;; does not exist, 'setutxent' does not create it and
>                        ;; thus there is no accounting at all.
> +                      (mkdir-p "/var/run")
>                        (close-port (open-file "/var/run/utmpx" "a0"))

Please move it before the comment, which talks about something else.

Should /var/run be removed (in the same commit) from ‘directives’ in
(gnu build install)?

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Mon, 21 Aug 2023 14:10:02 GMT) Full text and rfc822 format available.

Message #44 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Nicolas Graves <ngraves <at> ngraves.fr>
Cc: 65335 <at> debbugs.gnu.org
Subject: Re: bug#65335: [PATCH 0/4] Allow mounting root on tmpfs for
 impersistence
Date: Mon, 21 Aug 2023 16:09:32 +0200
Nicolas Graves <ngraves <at> ngraves.fr> skribis:

> ---
>  gnu/build/activation.scm | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm
> index eea2233563..759704ae03 100644
> --- a/gnu/build/activation.scm
> +++ b/gnu/build/activation.scm
> @@ -408,6 +408,7 @@ (define* (activate-current-system
>  
>    (format #t "making '~a' the current system...~%" system)
>  
> +  (mkdir-p "/run")

Same comment and question as for /var/run.




Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Mon, 21 Aug 2023 14:12:02 GMT) Full text and rfc822 format available.

Message #47 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Nicolas Graves <ngraves <at> ngraves.fr>
Cc: 65335 <at> debbugs.gnu.org
Subject: Re: bug#65335: [PATCH 0/4] Allow mounting root on tmpfs for
 impersistence
Date: Mon, 21 Aug 2023 16:10:59 +0200
Nicolas Graves <ngraves <at> ngraves.fr> skribis:

> +     (if (string=? root "none")
> +         '() ;; Ignore the case where the root is "none" (typically tmpfs).

Nitpick: please use a single semicolon for margin comments:

  '() ;like this

Otherwise LGTM.




Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Mon, 21 Aug 2023 14:13:02 GMT) Full text and rfc822 format available.

Message #50 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Nicolas Graves <ngraves <at> ngraves.fr>
Cc: 65335 <at> debbugs.gnu.org, Andrew Tropin <andrew <at> trop.in>, paren <at> disroot.org
Subject: Re: bug#65335: [PATCH 0/4] Allow mounting root on tmpfs for
 impersistence
Date: Mon, 21 Aug 2023 16:12:05 +0200
Nicolas Graves <ngraves <at> ngraves.fr> skribis:

> ---
>  gnu/home/services/symlink-manager.scm | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/gnu/home/services/symlink-manager.scm b/gnu/home/services/symlink-manager.scm
> index e4c931fbee..d3c4d01db4 100644
> --- a/gnu/home/services/symlink-manager.scm
> +++ b/gnu/home/services/symlink-manager.scm
> @@ -157,6 +157,11 @@ (define (update-symlinks-script)
>                             #t
>                             (G_ "Skipping ~a (not an empty directory)... done\n")
>                             directory))
> +                         ((= EBUSY errno)
> +                          (format
> +                           #t
> +                           (G_ "Skipping ~a (dedicated device)... done\n")
> +                           directory))

How does that relate to the rest of the patch series?  What does
“dedicate device” mean here?

Maybe add a comment giving some context.

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Mon, 21 Aug 2023 14:16:01 GMT) Full text and rfc822 format available.

Message #53 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Nicolas Graves <ngraves <at> ngraves.fr>
Cc: 65335 <at> debbugs.gnu.org
Subject: Re: bug#65335: [PATCH 0/4] Allow mounting root on tmpfs for
 impersistence
Date: Mon, 21 Aug 2023 16:15:16 +0200
A couple more things:

  1. Could you add a system test with / on tmpfs?  This can be done by
     calling ‘run-basic-test’ with a custom OS config where / is on
     tmpfs.

  2. Perhaps add a sentence or two under “operating-system Reference”
     stating that "/" can be on tmpfs and that its ‘device’ field must
     be “none” in that case.

Apart from these minor issues, it looks great to me!

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Sat, 09 Sep 2023 10:48:02 GMT) Full text and rfc822 format available.

Message #56 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Nicolas Graves <ngraves <at> ngraves.fr>
Cc: 65335 <at> debbugs.gnu.org, paren <at> disroot.org, Andrew Tropin <andrew <at> trop.in>
Subject: Re: bug#65335: [PATCH 0/4] Allow mounting root on tmpfs for
 impersistence
Date: Sat, 09 Sep 2023 12:47:19 +0200
Hi,

(You forgot to Cc the bug in your reply, so our conversation went off
the record…)

Ludovic Courtès <ludo <at> gnu.org> skribis:

> Nicolas Graves <ngraves <at> ngraves.fr> skribis:
>
>> ---
>>  gnu/home/services/symlink-manager.scm | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/gnu/home/services/symlink-manager.scm b/gnu/home/services/symlink-manager.scm
>> index e4c931fbee..d3c4d01db4 100644
>> --- a/gnu/home/services/symlink-manager.scm
>> +++ b/gnu/home/services/symlink-manager.scm
>> @@ -157,6 +157,11 @@ (define (update-symlinks-script)
>>                             #t
>>                             (G_ "Skipping ~a (not an empty directory)... done\n")
>>                             directory))
>> +                         ((= EBUSY errno)
>> +                          (format
>> +                           #t
>> +                           (G_ "Skipping ~a (dedicated device)... done\n")
>> +                           directory))
>
> How does that relate to the rest of the patch series?  What does
> “dedicate device” mean here?

Your use case is for when ~/.local (for instance) is a separate mount
point (an uncommon use case because mounting file systems on Linux
usually requires root privileges).

I’d suggested “dedicated device” → “underlying device is busy”, and a
short comment above explaining the kind of situation where this can
occur.

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Thu, 05 Oct 2023 13:08:02 GMT) Full text and rfc822 format available.

Message #59 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Nicolas Graves <ngraves <at> ngraves.fr>
Cc: 65335 <at> debbugs.gnu.org, Andrew Tropin <andrew <at> trop.in>, paren <at> disroot.org
Subject: Re: bug#65335: [PATCH 0/4] Allow mounting root on tmpfs for
 impersistence
Date: Thu, 05 Oct 2023 15:07:05 +0200
Hi Nicolas,

Did you have a chance to work on a revised version of this patch set?

  https://issues.guix.gnu.org/65335

Seems to me that little was missing.

Thanks in advance!

Ludo’.

Ludovic Courtès <ludo <at> gnu.org> skribis:

> Hi,
>
> (You forgot to Cc the bug in your reply, so our conversation went off
> the record…)
>
> Ludovic Courtès <ludo <at> gnu.org> skribis:
>
>> Nicolas Graves <ngraves <at> ngraves.fr> skribis:
>>
>>> ---
>>>  gnu/home/services/symlink-manager.scm | 5 +++++
>>>  1 file changed, 5 insertions(+)
>>>
>>> diff --git a/gnu/home/services/symlink-manager.scm b/gnu/home/services/symlink-manager.scm
>>> index e4c931fbee..d3c4d01db4 100644
>>> --- a/gnu/home/services/symlink-manager.scm
>>> +++ b/gnu/home/services/symlink-manager.scm
>>> @@ -157,6 +157,11 @@ (define (update-symlinks-script)
>>>                             #t
>>>                             (G_ "Skipping ~a (not an empty directory)... done\n")
>>>                             directory))
>>> +                         ((= EBUSY errno)
>>> +                          (format
>>> +                           #t
>>> +                           (G_ "Skipping ~a (dedicated device)... done\n")
>>> +                           directory))
>>
>> How does that relate to the rest of the patch series?  What does
>> “dedicate device” mean here?
>
> Your use case is for when ~/.local (for instance) is a separate mount
> point (an uncommon use case because mounting file systems on Linux
> usually requires root privileges).
>
> I’d suggested “dedicated device” → “underlying device is busy”, and a
> short comment above explaining the kind of situation where this can
> occur.
>
> Thanks,
> Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Thu, 05 Oct 2023 14:31:01 GMT) Full text and rfc822 format available.

Message #62 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 65335 <at> debbugs.gnu.org, Andrew Tropin <andrew <at> trop.in>, paren <at> disroot.org
Subject: Re: bug#65335: [PATCH 0/4] Allow mounting root on tmpfs for
 impersistence
Date: Thu, 05 Oct 2023 16:30:18 +0200
On 2023-10-05 15:07, Ludovic Courtès wrote:

> Hi Nicolas,
>
> Did you have a chance to work on a revised version of this patch set?
>
>   https://issues.guix.gnu.org/65335
>
> Seems to me that little was missing.

Indeed, I have to finish this among other things. I still use it locally
and it works well for system impermanence. 

I couldn't answer your following question :

>   Should /var/run be removed (in the same commit) from ‘directives’ in
>   (gnu build install)?

Maybe you can help a bit if you have worked on this, so that I
understand correctly if something should be done here or not. 

>
> Thanks in advance!
>
> Ludo’.
>
> Ludovic Courtès <ludo <at> gnu.org> skribis:
>
>> Hi,
>>
>> (You forgot to Cc the bug in your reply, so our conversation went off
>> the record…)
>>
>> Ludovic Courtès <ludo <at> gnu.org> skribis:
>>
>>> Nicolas Graves <ngraves <at> ngraves.fr> skribis:
>>>
>>>> ---
>>>>  gnu/home/services/symlink-manager.scm | 5 +++++
>>>>  1 file changed, 5 insertions(+)
>>>>
>>>> diff --git a/gnu/home/services/symlink-manager.scm b/gnu/home/services/symlink-manager.scm
>>>> index e4c931fbee..d3c4d01db4 100644
>>>> --- a/gnu/home/services/symlink-manager.scm
>>>> +++ b/gnu/home/services/symlink-manager.scm
>>>> @@ -157,6 +157,11 @@ (define (update-symlinks-script)
>>>>                             #t
>>>>                             (G_ "Skipping ~a (not an empty directory)... done\n")
>>>>                             directory))
>>>> +                         ((= EBUSY errno)
>>>> +                          (format
>>>> +                           #t
>>>> +                           (G_ "Skipping ~a (dedicated device)... done\n")
>>>> +                           directory))
>>>
>>> How does that relate to the rest of the patch series?  What does
>>> “dedicate device” mean here?
>>
>> Your use case is for when ~/.local (for instance) is a separate mount
>> point (an uncommon use case because mounting file systems on Linux
>> usually requires root privileges).
>>
>> I’d suggested “dedicated device” → “underlying device is busy”, and a
>> short comment above explaining the kind of situation where this can
>> occur.
>>
>> Thanks,
>> Ludo’.

-- 
Best regards,
Nicolas Graves




Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Thu, 12 Oct 2023 06:57:01 GMT) Full text and rfc822 format available.

Message #65 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Nicolas Graves <ngraves <at> ngraves.fr>
Cc: 65335 <at> debbugs.gnu.org, Andrew Tropin <andrew <at> trop.in>, paren <at> disroot.org
Subject: Re: bug#65335: [PATCH 0/4] Allow mounting root on tmpfs for
 impersistence
Date: Thu, 12 Oct 2023 08:55:52 +0200
Hi,

Nicolas Graves <ngraves <at> ngraves.fr> skribis:

> On 2023-10-05 15:07, Ludovic Courtès wrote:

[...]

>>   Should /var/run be removed (in the same commit) from ‘directives’ in
>>   (gnu build install)?
>
> Maybe you can help a bit if you have worked on this, so that I
> understand correctly if something should be done here or not. 

The directives in (gnu build install) specify files and directories that
should be created upfront when initializing a system—meaning when
running ‘guix system init’, or when populating a VM image.  The
boot/activation code assumes that these files already exist when the
system boots.

If we’re now creating /var/run in an activation snippet, then it no
longer needs to be here.

When doing such changes, I would suggest to at least run:

  make check-system TESTS=basic

to detect obvious mistakes, and perhaps run the “installed-os” test as
well (it’s much more expensive, so run it once you’re essentially done).

HTH!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Sun, 04 Feb 2024 02:21:02 GMT) Full text and rfc822 format available.

Message #68 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 65335 <at> debbugs.gnu.org
Cc: ludo <at> gnu.org, ngraves <at> ngraves.fr
Subject: [PATCH v3 1/5] gnu: build: file-systems: Extend tmpfs fallback.
Date: Sun,  4 Feb 2024 03:19:53 +0100
* gnu/build/file-systems (canonicalize-device-name): Fallback to tmpfs
if spec is "none".

Change-Id: Ia55c715d04c7611ba8c979f23f1ad4a8ed2e75b6
---
 gnu/build/file-systems.scm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm
index 36a59f5f5c..78d779f398 100644
--- a/gnu/build/file-systems.scm
+++ b/gnu/build/file-systems.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2019 David C. Trudgian <dave <at> trudgian.net>
 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;; Copyright © 2022 Oleg Pykhalov <go.wigust <at> gmail.com>
+;;; Copyright © 2024 Nicolas Graves <ngraves <at> ngraves.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1021,8 +1022,8 @@ (define find-partition-by-luks-uuid
 
 (define (canonicalize-device-spec spec)
   "Return the device name corresponding to SPEC, which can be a <uuid>, a
-<file-system-label>, or a string (typically a /dev file name or an nfs-root
-containing ':/')."
+<file-system-label>, the string 'none' or another string (typically a /dev
+file name or an nfs-root containing ':/')."
   (define max-trials
     ;; Number of times we retry partition label resolution, 1 second per
     ;; trial.  Note: somebody reported a delay of 16 seconds (!) before their
@@ -1046,8 +1047,8 @@ (define (resolve find-partition spec fmt)
 
   (match spec
     ((? string?)
-     (if (string-contains spec ":/")
-         spec                  ; do not resolve NFS devices
+     (if (or (string-contains spec ":/") (string=? spec "none"))
+         spec                  ; do not resolve NFS / tmpfs devices
          ;; Nothing to do, but wait until SPEC shows up.
          (resolve identity spec identity)))
     ((? file-system-label?)
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Sun, 04 Feb 2024 02:21:02 GMT) Full text and rfc822 format available.

Message #71 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 65335 <at> debbugs.gnu.org
Cc: ludo <at> gnu.org, ngraves <at> ngraves.fr
Subject: [PATCH v3 2/5] gnu: services: Ensure /var/run existence in
 activation-script.
Date: Sun,  4 Feb 2024 03:19:54 +0100
* gnu/services.scm (activation-script): Ensure /var/run existence.
* gnu/build/install.scm (evaluate-populate-directive)
[directives]: Remove directory /var/run.

Change-Id: I5fb93d33b6b1f045f1e5ba206b9b0b74b5184260
---
 gnu/build/install.scm | 2 +-
 gnu/services.scm      | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/build/install.scm b/gnu/build/install.scm
index d4982650c1..618a51af8e 100644
--- a/gnu/build/install.scm
+++ b/gnu/build/install.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2013-2020, 2022 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2016 Chris Marusich <cmmarusich <at> gmail.com>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2024 Nicolas Graves <ngraves <at> ngraves.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -134,7 +135,6 @@ (define (directives store)
     (directory "/var/guix/gcroots")
     (directory "/var/empty")                        ; for no-login accounts
     (directory "/var/db")                           ; for dhclient, etc.
-    (directory "/var/run")
     (directory "/run")
     (directory "/mnt")
     (directory "/var/guix/profiles/per-user/root" 0 0)
diff --git a/gnu/services.scm b/gnu/services.scm
index 23c3d8a9f4..59481af10f 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2020 Christine Lemmer-Webber <cwebber <at> dustycloud.org>
 ;;; Copyright © 2020, 2021 Brice Waegeneire <brice <at> waegenei.re>
 ;;; Copyright © 2023 Brian Cully <bjc <at> spork.org>
+;;; Copyright © 2024 Nicolas Graves <ngraves <at> ngraves.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -692,6 +693,7 @@ (define actions
                       (use-modules (gnu build activation)
                                    (guix build utils))
 
+                      (mkdir-p "/var/run")
                       ;; Make sure the user accounting database exists.  If it
                       ;; does not exist, 'setutxent' does not create it and
                       ;; thus there is no accounting at all.
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Sun, 04 Feb 2024 02:21:02 GMT) Full text and rfc822 format available.

Message #74 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 65335 <at> debbugs.gnu.org
Cc: ludo <at> gnu.org, ngraves <at> ngraves.fr
Subject: [PATCH v3 3/5] gnu: build: activation: Ensure /run existence.
Date: Sun,  4 Feb 2024 03:19:55 +0100
* gnu/build/activation.scm (activation-script): Ensure /var/run existence.
* gnu/build/install.scm (evaluate-populate-directive)
[directives]: Remove directory /run.

Change-Id: I19ca8e7605c0cff598ab89077a94e20390ba27b0
---
 gnu/build/activation.scm | 2 ++
 gnu/build/install.scm    | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm
index eea2233563..d8c0cd22a3 100644
--- a/gnu/build/activation.scm
+++ b/gnu/build/activation.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2021 Maxime Devos <maximedevos <at> telenet.be>
 ;;; Copyright © 2020 Christine Lemmer-Webber <cwebber <at> dustycloud.org>
 ;;; Copyright © 2021 Brice Waegeneire <brice <at> waegenei.re>
+;;; Copyright © 2024 Nicolas Graves <ngraves <at> ngraves.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -408,6 +409,7 @@ (define* (activate-current-system
 
   (format #t "making '~a' the current system...~%" system)
 
+  (mkdir-p "/run")
   ;; Atomically make SYSTEM current.
   (let ((new (string-append %current-system ".new")))
     (symlink system new)
diff --git a/gnu/build/install.scm b/gnu/build/install.scm
index 618a51af8e..0aa227b4d8 100644
--- a/gnu/build/install.scm
+++ b/gnu/build/install.scm
@@ -135,7 +135,6 @@ (define (directives store)
     (directory "/var/guix/gcroots")
     (directory "/var/empty")                        ; for no-login accounts
     (directory "/var/db")                           ; for dhclient, etc.
-    (directory "/run")
     (directory "/mnt")
     (directory "/var/guix/profiles/per-user/root" 0 0)
 
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Sun, 04 Feb 2024 02:21:03 GMT) Full text and rfc822 format available.

Message #77 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 65335 <at> debbugs.gnu.org
Cc: ludo <at> gnu.org, ngraves <at> ngraves.fr
Subject: [PATCH v3 4/5] gnu: system: bootable-kernel-arguments: Extend tmpfs
 fallback.
Date: Sun,  4 Feb 2024 03:19:56 +0100
* gnu/system.scm (bootable-kernel-arguments): Fallback to tmpfs
if root is "none".

Change-Id: I35a656e71169dc786e5256d98a3c04c65043086d
---
 gnu/system.scm | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index 3cd64a5c9f..aede35775e 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -15,6 +15,7 @@
 ;;; Copyright © 2021 Maxime Devos <maximedevos <at> telenet.be>
 ;;; Copyright © 2021 raid5atemyhomework <raid5atemyhomework <at> protonmail.com>
 ;;; Copyright © 2023 Bruno Victal <mirai <at> makinata.eu>
+;;; Copyright © 2024 Nicolas Graves <ngraves <at> ngraves.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -197,15 +198,18 @@ (define* (bootable-kernel-arguments system root-device version)
   ;; compatibility when producing bootloader configurations for older
   ;; generations.
   (define version>0? (> version 0))
-  (list (string-append (if version>0? "root=" "--root=")
-                       ;; Note: Always use the DCE format because that's what
-                       ;; (gnu build linux-boot) expects for the 'root'
-                       ;; kernel command-line option.
-                       (file-system-device->string root-device
-                                                   #:uuid-type 'dce))
-        #~(string-append (if #$version>0? "gnu.system=" "--system=") #$system)
-        #~(string-append (if #$version>0? "gnu.load=" "--load=")
-                         #$system "/boot")))
+  (let ((root (file-system-device->string root-device
+                                          #:uuid-type 'dce)))
+    (append
+     (if (string=? root "none")
+         '() ;  Ignore the case where the root is "none" (typically tmpfs).
+         ;; Note: Always use the DCE format because that's what
+         ;; (gnu build linux-boot) expects for the 'root'
+         ;; kernel command-line option.
+         (list (string-append (if version>0? "root=" "--root=") root)))
+     (list #~(string-append (if #$version>0? "gnu.system=" "--system=") #$system)
+           #~(string-append (if #$version>0? "gnu.load=" "--load=")
+                            #$system "/boot")))))
 
 ;; System-wide configuration.
 
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Sun, 04 Feb 2024 02:21:03 GMT) Full text and rfc822 format available.

Message #80 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 65335 <at> debbugs.gnu.org
Cc: ludo <at> gnu.org, ngraves <at> ngraves.fr
Subject: [PATCH v3 5/5] gnu: home: symlink-manager: Allow busy device skip.
Date: Sun,  4 Feb 2024 03:19:57 +0100
* gnu/home/services/symlink-manager.scm (update-symlinks-script):
Allow busy device skip.

Change-Id: Iff91c8a30309d25c02a8311d8d5ddbf54e90f5ad
---
 gnu/home/services/symlink-manager.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gnu/home/services/symlink-manager.scm b/gnu/home/services/symlink-manager.scm
index e4c931fbee..560e03a839 100644
--- a/gnu/home/services/symlink-manager.scm
+++ b/gnu/home/services/symlink-manager.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2021 Andrew Tropin <andrew <at> trop.in>
 ;;; Copyright © 2021 Xinglu Chen <public <at> yoctocell.xyz>
 ;;; Copyright © 2022 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2024 Nicolas Graves <ngraves <at> ngraves.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -157,6 +158,12 @@ (define (strip file)
                            #t
                            (G_ "Skipping ~a (not an empty directory)... done\n")
                            directory))
+                         ;; This happens when the directory is a mounted device.
+                         ((= EBUSY errno)
+                          (format
+                           #t
+                           (G_ "Skipping ~a (underlying device is busy)... done\n")
+                           directory))
                          ((= ENOENT errno) #t)
                          ((= ENOTDIR errno) #t)
                          (else
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Thu, 15 Feb 2024 11:46:01 GMT) Full text and rfc822 format available.

Message #83 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 65335 <at> debbugs.gnu.org, paren <at> disroot.org
Subject: Re: [bug#65335] [PATCH 0/4] Allow mounting root on tmpfs for
 impersistence
Date: Thu, 15 Feb 2024 12:45:19 +0100
Hi Ludo,

Just to tell that the v3 I sent a few weeks ago is indeed fully tested,
and that commit messages are properly written.

Should we also think about a blog post on impermanence like nix did?

Nicolas

On 2023-10-12 08:55, Ludovic Courtès wrote:

> Hi,
>
> Nicolas Graves <ngraves <at> ngraves.fr> skribis:
>
>> On 2023-10-05 15:07, Ludovic Courtès wrote:
>
> [...]
>
>>>   Should /var/run be removed (in the same commit) from ‘directives’ in
>>>   (gnu build install)?
>>
>> Maybe you can help a bit if you have worked on this, so that I
>> understand correctly if something should be done here or not. 
>
> The directives in (gnu build install) specify files and directories that
> should be created upfront when initializing a system—meaning when
> running ‘guix system init’, or when populating a VM image.  The
> boot/activation code assumes that these files already exist when the
> system boots.
>
> If we’re now creating /var/run in an activation snippet, then it no
> longer needs to be here.
>
> When doing such changes, I would suggest to at least run:
>
>   make check-system TESTS=basic
>
> to detect obvious mistakes, and perhaps run the “installed-os” test as
> well (it’s much more expensive, so run it once you’re essentially done).
>
> HTH!
>
> Ludo’.
>
>
>

-- 
Best regards,
Nicolas Graves




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Mon, 19 Feb 2024 17:50:02 GMT) Full text and rfc822 format available.

Notification sent to Nicolas Graves <ngraves <at> ngraves.fr>:
bug acknowledged by developer. (Mon, 19 Feb 2024 17:50:02 GMT) Full text and rfc822 format available.

Message #88 received at 65335-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Nicolas Graves <ngraves <at> ngraves.fr>
Cc: paren <at> disroot.org, 65335-done <at> debbugs.gnu.org
Subject: Re: [bug#65335] [PATCH 0/4] Allow mounting root on tmpfs for
 impersistence
Date: Mon, 19 Feb 2024 18:48:40 +0100
Hi Nicolas,

Nicolas Graves <ngraves <at> ngraves.fr> skribis:

> Just to tell that the v3 I sent a few weeks ago is indeed fully tested,
> and that commit messages are properly written.

Just pushed v3 as b1ec85533a63c10616d9260f90411ca6f362de00!

I did tweak the commit messages but that’s because I’m too picky :-) and
the changes were minor.

> Should we also think about a blog post on impermanence like nix did?

Yes, definitely!

There could also be a section in the manual with a complete OS
definition, to show how one can set up a volatile image.

Last, I realize there’s no system tests.  I’m not sure how to do that
(because system tests already run on a tmpfs overlay) but it’d be nice
to make sure “root=none” handling keeps working.

Thoughts?

Thanks for all the work!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Mon, 19 Feb 2024 23:49:02 GMT) Full text and rfc822 format available.

Message #91 received at 65335-done <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: paren <at> disroot.org, 65335-done <at> debbugs.gnu.org
Subject: Re: [bug#65335] [PATCH 0/4] Allow mounting root on tmpfs for
 impersistence
Date: Tue, 20 Feb 2024 00:47:47 +0100
On 2024-02-19 18:48, Ludovic Courtès wrote:

> Hi Nicolas,
>
> Nicolas Graves <ngraves <at> ngraves.fr> skribis:
>
>> Just to tell that the v3 I sent a few weeks ago is indeed fully tested,
>> and that commit messages are properly written.
>
> Just pushed v3 as b1ec85533a63c10616d9260f90411ca6f362de00!
>
> I did tweak the commit messages but that’s because I’m too picky :-) and
> the changes were minor.
>
>> Should we also think about a blog post on impermanence like nix did?
>
> Yes, definitely!
>
> There could also be a section in the manual with a complete OS
> definition, to show how one can set up a volatile image.

On my todo list, though my priority right now is node-build-system to
try and package zotero properly.

>
> Last, I realize there’s no system tests.  I’m not sure how to do that
> (because system tests already run on a tmpfs overlay) but it’d be nice
> to make sure “root=none” handling keeps working.
>
> Thoughts?

I don't have a better view on this than you have. Basically I mostly
test it directly since for most changes I can always roll-back. Indeed
here it doesn't seem straightforward to check it fully, we can still
test the function bootable-kernel-arguments, but it's not that useful.
>
> Thanks for all the work!
>
> Ludo’.

-- 
Best regards,
Nicolas Graves




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 19 Mar 2024 11:24:05 GMT) Full text and rfc822 format available.

bug unarchived. Request was from "Scott Colby" <scott <at> scolby.com> to control <at> debbugs.gnu.org. (Wed, 27 Mar 2024 22:36:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#65335; Package guix-patches. (Thu, 28 Mar 2024 07:05:02 GMT) Full text and rfc822 format available.

Message #98 received at 65335 <at> debbugs.gnu.org (full text, mbox):

From: "Scott Colby" <scott <at> scolby.com>
To: 65335 <at> debbugs.gnu.org
Subject: [PATCH 0/4] Allow mounting root on tmpfs for impersistence
Date: Thu, 28 Mar 2024 00:25:12 -0400
[Message part 1 (text/plain, inline)]
Hello,

I am interested in setting up my installation of Guix with root-on-tmpfs-style
"impermanence," so I was happy to see that these patches were merged.
Unfortunately, I cannot seem to make it work. My approach was to use a main
partition mounted at `/persistent` with directories underneath like
`/persistent/var/{log,lib,guix}` that were bind-mounted on top of the tmpfs at
`/`.

Not mentioned as far as I can see in this thread is what about `/gnu/store`.
Should that also be stored persistently or does it originate from inside
`/var/guix`? Originally I tried having `/gnu` be the persistent filesystem with
subdirectories `/gnu/persistent/var/...` and `/gnu/store`, but this interfered
with the `%immutable-store bind mount`.

Would you be so kind as to share a working configuration snippet using
root-on-tmpfs? (I understand if you're using btrfs subvolumes; it would still be
useful to me I think to see the configuration.)

Thanks,
Scott


[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 25 Apr 2024 11:25:25 GMT) Full text and rfc822 format available.

This bug report was last modified 8 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.