[PATCH 0/4] Allow mounting root on tmpfs for impersistence

  • Done
  • quality assurance status badge
Details
3 participants
  • Ludovic Courtès
  • Nicolas Graves
  • Scott Colby
Owner
unassigned
Submitted by
Nicolas Graves
Severity
normal
N
N
Nicolas Graves wrote on 16 Aug 2023 11:24
(address . guix-patches@gnu.org)
cover.1692176564.git.ngraves@ngraves.fr
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
N
N
Nicolas Graves wrote on 16 Aug 2023 11:29
[PATCH 1/4] file-systems: canonicalize-device-name: Ignore the "none" case.
(address . 65335@debbugs.gnu.org)(address . ngraves@ngraves.fr)
344951a96d504fb86db43c79262739f5a7c086bb.1692178169.git.ngraves@ngraves.fr
---
gnu/build/file-systems.scm | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

Toggle diff (30 lines)
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
N
N
Nicolas Graves wrote on 16 Aug 2023 11:29
[PATCH 2/4] gnu: services: activation-script: Ensure /var/run existence.
(address . 65335@debbugs.gnu.org)(address . ngraves@ngraves.fr)
f9281ceff2b8b01a6bf82403309419b90fa32ef2.1692178169.git.ngraves@ngraves.fr
---
gnu/services.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
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
N
N
Nicolas Graves wrote on 16 Aug 2023 11:29
[PATCH 4/4] gnu: system: bootable-kernel-arguments: Ignore the "none" root case.
(address . 65335@debbugs.gnu.org)(address . ngraves@ngraves.fr)
8a425542b975f8c38457c4c12ed7c86d0df56325.1692178169.git.ngraves@ngraves.fr
---
gnu/system.scm | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)

Toggle diff (34 lines)
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
N
N
Nicolas Graves wrote on 16 Aug 2023 11:29
[PATCH 3/4] gnu: build: activate-current-system: Ensure directory existence.
(address . 65335@debbugs.gnu.org)(address . ngraves@ngraves.fr)
d12675f1e10248277d424c2f366ee309c722dd9e.1692178169.git.ngraves@ngraves.fr
---
gnu/build/activation.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
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
N
N
Nicolas Graves wrote on 21 Aug 2023 00:15
Re: [bug#65335] [PATCH 0/4] Allow mounting root on tmpfs for impersistence
(address . 65335@debbugs.gnu.org)
877cppl5s5.fsf@ngraves.fr
On 2023-08-16 11:24, Nicolas Graves via Guix-patches via wrote:

Toggle quote (15 lines)
> 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
N
N
Nicolas Graves wrote on 21 Aug 2023 00:16
[PATCH v2 1/5] file-systems: canonicalize-device-name: Ignore the "none" case.
(address . 65335@debbugs.gnu.org)(address . ngraves@ngraves.fr)
b027cd64bb8e1af2bced790a54ff09c86474cec3.1692569807.git.ngraves@ngraves.fr
---
gnu/build/file-systems.scm | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

Toggle diff (95 lines)
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
N
N
Nicolas Graves wrote on 21 Aug 2023 00:16
[PATCH v2 2/5] gnu: services: activation-script: Ensure /var/run existence.
(address . 65335@debbugs.gnu.org)(address . ngraves@ngraves.fr)
9e7a3ce3a4f0cdaac19705fdbc7e5a2f91ef1c62.1692569807.git.ngraves@ngraves.fr
---
gnu/services.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
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
N
N
Nicolas Graves wrote on 21 Aug 2023 00:16
[PATCH v2 3/5] gnu: build: activate-current-system: Ensure directory existence.
(address . 65335@debbugs.gnu.org)(address . ngraves@ngraves.fr)
f12bfa26ab4f8c3ae63f9d52cc1d8db02b363f26.1692569807.git.ngraves@ngraves.fr
---
gnu/build/activation.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
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
N
N
Nicolas Graves wrote on 21 Aug 2023 00:16
[PATCH v2 4/5] gnu: system: bootable-kernel-arguments: Ignore the "none" root case.
(address . 65335@debbugs.gnu.org)(address . ngraves@ngraves.fr)
52095319ac7aefa59a081b87fd8609811a5e1cd2.1692569807.git.ngraves@ngraves.fr
---
gnu/system.scm | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)

Toggle diff (34 lines)
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
N
N
Nicolas Graves wrote on 21 Aug 2023 00:16
[PATCH v2 5/5] gnu: home: symlink-manager: Allow dedicated device skip.
(address . 65335@debbugs.gnu.org)(address . ngraves@ngraves.fr)
108a67c0ef10e00162d81bcf7bc6243d6895c49b.1692569807.git.ngraves@ngraves.fr
---
gnu/home/services/symlink-manager.scm | 5 +++++
1 file changed, 5 insertions(+)

Toggle diff (18 lines)
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
L
L
Ludovic Courtès wrote on 21 Aug 2023 16:06
Re: bug#65335: [PATCH 0/4] Allow mounting root on tmpfs for impersistence
(name . Nicolas Graves)(address . ngraves@ngraves.fr)(address . 65335@debbugs.gnu.org)
87msyka3r7.fsf_-_@gnu.org
Hi,

Nicolas Graves <ngraves@ngraves.fr> skribis:

Toggle quote (17 lines)
> ---
> 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’.
L
L
Ludovic Courtès wrote on 21 Aug 2023 16:09
(name . Nicolas Graves)(address . ngraves@ngraves.fr)(address . 65335@debbugs.gnu.org)
87il98a3ne.fsf_-_@gnu.org
Nicolas Graves <ngraves@ngraves.fr> skribis:

Toggle quote (15 lines)
> ---
> 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’.
L
L
Ludovic Courtès wrote on 21 Aug 2023 16:09
(name . Nicolas Graves)(address . ngraves@ngraves.fr)(address . 65335@debbugs.gnu.org)
87edjwa3mr.fsf_-_@gnu.org
Nicolas Graves <ngraves@ngraves.fr> skribis:

Toggle quote (14 lines)
> ---
> 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.
L
L
Ludovic Courtès wrote on 21 Aug 2023 16:10
(name . Nicolas Graves)(address . ngraves@ngraves.fr)(address . 65335@debbugs.gnu.org)
87a5uka3kc.fsf_-_@gnu.org
Nicolas Graves <ngraves@ngraves.fr> skribis:

Toggle quote (3 lines)
> + (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.
L
L
Ludovic Courtès wrote on 21 Aug 2023 16:12
(name . Nicolas Graves)(address . ngraves@ngraves.fr)
875y58a3ii.fsf_-_@gnu.org
Nicolas Graves <ngraves@ngraves.fr> skribis:

Toggle quote (18 lines)
> ---
> 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’.
L
L
Ludovic Courtès wrote on 21 Aug 2023 16:15
(name . Nicolas Graves)(address . ngraves@ngraves.fr)(address . 65335@debbugs.gnu.org)
871qfwa3d7.fsf_-_@gnu.org
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’.
L
L
Ludovic Courtès wrote on 9 Sep 2023 12:47
(name . Nicolas Graves)(address . ngraves@ngraves.fr)
87edj7zkqw.fsf_-_@gnu.org
Hi,

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

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

Toggle quote (23 lines)
> Nicolas Graves <ngraves@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’.
L
L
Ludovic Courtès wrote on 5 Oct 2023 15:07
(name . Nicolas Graves)(address . ngraves@ngraves.fr)
87edi96ww6.fsf_-_@gnu.org
Hi Nicolas,

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


Seems to me that little was missing.

Thanks in advance!

Ludo’.

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

Toggle quote (40 lines)
> Hi,
>
> (You forgot to Cc the bug in your reply, so our conversation went off
> the record…)
>
> Ludovic Courtès <ludo@gnu.org> skribis:
>
>> Nicolas Graves <ngraves@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’.
N
N
Nicolas Graves wrote on 5 Oct 2023 16:30
(name . Ludovic Courtès)(address . ludo@gnu.org)
877co1p2f9.fsf@ngraves.fr
On 2023-10-05 15:07, Ludovic Courtès wrote:

Toggle quote (8 lines)
> 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 :

Toggle quote (3 lines)
> 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.

Toggle quote (48 lines)
>
> Thanks in advance!
>
> Ludo’.
>
> Ludovic Courtès <ludo@gnu.org> skribis:
>
>> Hi,
>>
>> (You forgot to Cc the bug in your reply, so our conversation went off
>> the record…)
>>
>> Ludovic Courtès <ludo@gnu.org> skribis:
>>
>>> Nicolas Graves <ngraves@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
L
L
Ludovic Courtès wrote on 12 Oct 2023 08:55
(name . Nicolas Graves)(address . ngraves@ngraves.fr)
87lec8pbwn.fsf@gnu.org
Hi,

Nicolas Graves <ngraves@ngraves.fr> skribis:

Toggle quote (2 lines)
> On 2023-10-05 15:07, Ludovic Courtès wrote:

[...]

Toggle quote (6 lines)
>> 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’.
N
N
Nicolas Graves wrote on 4 Feb 03:19 +0100
[PATCH v3 1/5] gnu: build: file-systems: Extend tmpfs fallback.
(address . 65335@debbugs.gnu.org)
20240204022004.2785-1-ngraves@ngraves.fr
* 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(-)

Toggle diff (36 lines)
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@trudgian.net>
;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2022 Oleg Pykhalov <go.wigust@gmail.com>
+;;; Copyright © 2024 Nicolas Graves <ngraves@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
N
N
Nicolas Graves wrote on 4 Feb 03:19 +0100
[PATCH v3 2/5] gnu: services: Ensure /var/run existence in activation-script.
(address . 65335@debbugs.gnu.org)
20240204022004.2785-2-ngraves@ngraves.fr
* 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(-)

Toggle diff (42 lines)
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@gnu.org>
;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2024 Nicolas Graves <ngraves@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@dustycloud.org>
;;; Copyright © 2020, 2021 Brice Waegeneire <brice@waegenei.re>
;;; Copyright © 2023 Brian Cully <bjc@spork.org>
+;;; Copyright © 2024 Nicolas Graves <ngraves@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
N
N
Nicolas Graves wrote on 4 Feb 03:19 +0100
[PATCH v3 3/5] gnu: build: activation: Ensure /run existence.
(address . 65335@debbugs.gnu.org)
20240204022004.2785-3-ngraves@ngraves.fr
* 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(-)

Toggle diff (34 lines)
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@telenet.be>
;;; Copyright © 2020 Christine Lemmer-Webber <cwebber@dustycloud.org>
;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
+;;; Copyright © 2024 Nicolas Graves <ngraves@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
N
N
Nicolas Graves wrote on 4 Feb 03:19 +0100
[PATCH v3 4/5] gnu: system: bootable-kernel-arguments: Extend tmpfs fallback.
(address . 65335@debbugs.gnu.org)
20240204022004.2785-4-ngraves@ngraves.fr
* 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(-)

Toggle diff (42 lines)
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@telenet.be>
;;; Copyright © 2021 raid5atemyhomework <raid5atemyhomework@protonmail.com>
;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
+;;; Copyright © 2024 Nicolas Graves <ngraves@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
N
N
Nicolas Graves wrote on 4 Feb 03:19 +0100
[PATCH v3 5/5] gnu: home: symlink-manager: Allow busy device skip.
(address . 65335@debbugs.gnu.org)
20240204022004.2785-5-ngraves@ngraves.fr
* 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(+)

Toggle diff (27 lines)
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@trop.in>
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;; Copyright © 2022 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2024 Nicolas Graves <ngraves@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
N
N
Nicolas Graves wrote on 15 Feb 12:45 +0100
Re: [bug#65335] [PATCH 0/4] Allow mounting root on tmpfs for impersistence
(name . Ludovic Courtès)(address . ludo@gnu.org)
87wmr6vtm8.fsf@ngraves.fr
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:

Toggle quote (37 lines)
> Hi,
>
> Nicolas Graves <ngraves@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
L
L
Ludovic Courtès wrote on 19 Feb 18:48 +0100
(name . Nicolas Graves)(address . ngraves@ngraves.fr)
87il2kqr9j.fsf@gnu.org
Hi Nicolas,

Nicolas Graves <ngraves@ngraves.fr> skribis:

Toggle quote (3 lines)
> 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.

Toggle quote (2 lines)
> 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’.
Closed
N
N
Nicolas Graves wrote on 20 Feb 00:47 +0100
(name . Ludovic Courtès)(address . ludo@gnu.org)
87jzn0j9ss.fsf@ngraves.fr
On 2024-02-19 18:48, Ludovic Courtès wrote:

Toggle quote (19 lines)
> Hi Nicolas,
>
> Nicolas Graves <ngraves@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.

Toggle quote (7 lines)
>
> 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.
Toggle quote (5 lines)
>
> Thanks for all the work!
>
> Ludo’.

--
Best regards,
Nicolas Graves
Closed
S
S
Scott Colby wrote on 27 Mar 20:38 +0100
(address . control@debbugs.gnu.org)
61eaf483-d02f-4495-b25f-b47d3eceead1@app.fastmail.com
unarchive 65335
Attachment: file
S
S
Scott Colby wrote on 28 Mar 05:25 +0100
(address . 65335@debbugs.gnu.org)
8be93352-2e1e-4685-a794-1d17d7b31b90@app.fastmail.com
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
Attachment: file
?