[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
07/10: gnu: linux-boot: Filter out file system independent options.
From: |
guix-commits |
Subject: |
07/10: gnu: linux-boot: Filter out file system independent options. |
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 cb060af5ea56427e1fd63ced5f9c9edd3ae61f76
Author: Maxim Cournoyer <address@hidden>
AuthorDate: Tue Feb 11 14:27:19 2020 -0500
gnu: linux-boot: Filter out file system independent options.
This fixes an issue where options such as "defaults", which are understood
by
the command line program "mount", are not understood by the system call of
the
same name, which is used in the initial RAM disk.
* gnu/system/file-systems.scm (%file-system-independent-mount-options): New
variable.
(file-system-independent-mount-option?): New predicate.
* gnu/build/linux-boot.scm (boot-system): Use the above predicate to filter
out system independent mount options.
---
gnu/build/linux-boot.scm | 3 ++-
gnu/system/file-systems.scm | 17 +++++++++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm
index f65e942..8e55797 100644
--- a/gnu/build/linux-boot.scm
+++ b/gnu/build/linux-boot.scm
@@ -490,7 +490,8 @@ upon error."
(or (and=> root-fs file-system-flags)
'())))
(root-fs-options (if root-fs
- (file-system-options root-fs)
+ (remove file-system-independent-mount-option?
+ (file-system-options root-fs))
'()))
;; --root-options takes precedence over the 'options' field of the
;; root <file-system> record.
diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index 6dc0e68..2c3c159 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -46,6 +46,7 @@
file-system-location
file-system-type-predicate
+ file-system-independent-mount-option?
file-system-label
file-system-label?
@@ -565,4 +566,20 @@ system has the given TYPE."
(lambda (fs)
(string=? (file-system-type fs) type)))
+(define %file-system-independent-mount-options
+ ;; Taken from 'man 8 mount'.
+ '("async" "atime" "auto" "noatime" "noauto" "context" "defaults" "dev"
"nodev"
+ "diratime" "nodiratime" "dirsync" "exec" "noexec" "group" "iversion"
+ "noiversion" "mand" "nomand" "_netdev" "nofail" "relatime" "norelatime"
+ "strictatime" "nostrictatime" "lazytime" "nolazytime" "suid" "nosuid"
+ "silent" "loud" "owner" "remount" "ro" "rw" "sync" "user" "nouser"
"users"))
+
+(define (file-system-independent-mount-option? option)
+ "Predicate to check if a <file-system> option is file system independent."
+ (let ((option-name (if (pair? option)
+ (car option)
+ option)))
+ (or (string-prefix-ci? "x-" option-name)
+ (member option-name %file-system-independent-mount-options))))
+
;;; file-systems.scm ends here
- branch allow-booting-from-btrfs-subvolume created (now 6162b56), guix-commits, 2020/02/14
- 01/10: gnu: tests: Reduce the time required to run the system tests., guix-commits, 2020/02/14
- 02/10: gnu: linux-boot: Ensure volatile root is mounted read-only., guix-commits, 2020/02/14
- 03/10: file-systems: Add a 'file-system-device->string' procedure., guix-commits, 2020/02/14
- 06/10: gnu: linux-boot: Honor the "--root-options" kernel argument., guix-commits, 2020/02/14
- 09/10: scripts: system: Do not validate network file systems., guix-commits, 2020/02/14
- 07/10: gnu: linux-boot: Filter out file system independent options.,
guix-commits <=
- 04/10: gnu: linux-boot: Refactor boot-system., guix-commits, 2020/02/14
- 05/10: file-systems: Represent the file system options as an alist., guix-commits, 2020/02/14
- 10/10: gnu: Add fbset., guix-commits, 2020/02/14
- 08/10: bootloader: grub: Allow booting from a Btrfs subvolume., guix-commits, 2020/02/14