From 3378c1a9c65a9eb8ef13d7d738473e435cbbe3b6 Mon Sep 17 00:00:00 2001 From: Nicolas Graves Date: Sun, 4 Feb 2024 03:19:56 +0100 Subject: system: Omit “root=” kernel argument when root device is “none”. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/system.scm (bootable-kernel-arguments): Fallback to tmpfs if root is "none". Change-Id: I35a656e71169dc786e5256d98a3c04c65043086d Signed-off-by: Ludovic Courtès --- 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 ;;; Copyright © 2021 raid5atemyhomework ;;; Copyright © 2023 Bruno Victal +;;; Copyright © 2024 Nicolas Graves ;;; ;;; 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. -- cgit v1.2.3