diff mbox series

[bug#65335,4/4] gnu: system: bootable-kernel-arguments: Ignore the "none" root case.

Message ID 8a425542b975f8c38457c4c12ed7c86d0df56325.1692178169.git.ngraves@ngraves.fr
State New
Headers show
Series Allow mounting root on tmpfs for impersistence | expand

Commit Message

Nicolas Graves Aug. 16, 2023, 9:29 a.m. UTC
---
 gnu/system.scm | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)
diff mbox series

Patch

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.