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

From: Nicolas Graves <[email-masked]>
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