>From de7043998f2a2877f47e7952a435b711a0cbe9b5 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 11 Feb 2020 14:14:36 -0500 Subject: [PATCH 6/8] 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" argument. --- 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 5d526b1aee..d6bfbd7b55 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., @code{usbkbd,9pnet}. +@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 28697e7bbf..f65e942ebc 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 ;;; Copyright © 2019 Guillaume Le Vaillant +;;; Copyright © 2020 Maxim Cournoyer ;;; ;;; 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 +'--repl'. 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 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) (start-repl)) -- 2.25.0