From ce267b3765ef1a6177971aa0042deaeec750ea97 Mon Sep 17 00:00:00 2001 From: Hilton Chain Date: Wed, 14 May 2025 21:35:31 +0800 Subject: [PATCH] system: Set "rootfstype" for tmpfs root file system. This commit adds configuration for tmpfs root file system. Since there's no file system information in boot parameters, not all tmpfs cases are handled. * gnu/system.scm (bootable-kernel-arguments): Check root file system for tmpfs and set "rootfstype". Change-Id: Ib14f6a9e4040535b3412ca9efa7e9b65c1dc8b39 --- gnu/system.scm | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/gnu/system.scm b/gnu/system.scm index 2beca4b6d08..a4e70f164a4 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -208,12 +208,21 @@ VERSION is the target version of the boot-parameters record." (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))) + (cond + ((string=? root "tmpfs") + ;; Required when using tmpfs as root file system. + ;; TODO: Include file system information in boot parameters, so that we + ;; can detect tmpfs by file system type instead of device name here. + '("rootfstype=tmpfs")) + ((string=? root "none") + ;; Ignore unhandled cases where the root is "none". This requires the + ;; user to set correct arguments. + '()) + (else + ;; 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")))))