[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

06/10: gnu: linux-boot: Honor the "--root-options" kernel argument.

From: guix-commits
Subject: 06/10: gnu: linux-boot: Honor the "--root-options" kernel argument.
Date: Fri, 14 Feb 2020 10:55:38 -0500 (EST)

apteryx pushed a commit to branch allow-booting-from-btrfs-subvolume
in repository guix.

commit 67135c925b07f2e077b4cd852e07178691a10164
Author: Maxim Cournoyer <address@hidden>
AuthorDate: Tue Feb 11 14:14:36 2020 -0500

    gnu: linux-boot: Honor the "--root-options" kernel argument.
    * gnu/build/linux-boot.scm (boot-system): Parse the "--root-options" kernel
    argument, and use it when calling `mount-root-file-system'.  Update doc.
    * doc/guix.texi (Initial RAM Disk): Document the use of the "--root-options"
 doc/guix.texi            | 10 ++++++++++
 gnu/build/linux-boot.scm | 15 ++++++++++-----
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 5d526b1..d6bfbd7 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -25935,6 +25935,16 @@ Instruct the initial RAM disk as well as the 
@command{modprobe} command
 must be a comma-separated list of module names---e.g.,
+@item --root-options=@var{options}@dots{}
+@cindex mount options for the root file system, passed to initrd
+@cindex rootflags, initrd
+@cindex root-options, initrd
+This argument allows passing one or multiple file system specific mount
+options used by the initrd to mount the root file system.  @var{options}
+must be a comma-separated list of option names or option-value pairs.
+When unspecified, the value of the options field of the root file system
+of the operating system declaration is used.
 @item --repl
 Start a read-eval-print loop (REPL) from the initial RAM disk before it
 tries to load kernel modules and to mount the root file system.  Our
diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm
index 28697e7..f65e942 100644
--- a/gnu/build/linux-boot.scm
+++ b/gnu/build/linux-boot.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès 
 ;;; Copyright © 2017 Mathieu Othacehe <address@hidden>
 ;;; Copyright © 2019 Guillaume Le Vaillant <address@hidden>
+;;; Copyright © 2020 Maxim Cournoyer <address@hidden>
 ;;; This file is part of GNU Guix.
@@ -452,7 +453,8 @@ LINUX-MODULE-DIRECTORY, then installing KEYMAP-FILE with 
'loadkeys' (if
 KEYMAP-FILE is true), then setting up QEMU guest networking if
 QEMU-GUEST-NETWORKING? is true, calling PRE-MOUNT, mounting the file systems
 specified in MOUNTS, and finally booting into the new root if any.  The initrd
-supports kernel command-line options '--load', '--root', and '--repl'.
+supports kernel command-line options '--load', '--root', '--root-options' and
 Mount the root file system, specified by the '--root' command-line argument,
 if any.
@@ -490,10 +492,13 @@ upon error."
              (root-fs-options (if root-fs
                                   (file-system-options root-fs)
-             (root-options (if (null? root-fs-options)
-                               #f
-                               (file-system-options->str
-                                root-fs-options))))
+             ;; --root-options takes precedence over the 'options' field of the
+             ;; root <file-system> record.
+             (root-options (or (find-long-option "--root-options" args)
+                               (if (null? root-fs-options)
+                                   #f
+                                   (file-system-options->string
+                                    root-fs-options)))))
         (when (member "--repl" args)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]