From 55e21617d68073077fdc9f35307e94859ec7a6c4 Mon Sep 17 00:00:00 2001 From: Guillaume Le Vaillant Date: Mon, 2 Dec 2019 21:15:50 +0100 Subject: linux-boot: Don't ignore flags when mounting root file system. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/build/linux-boot.scm (mount-root-file-system): Add the 'flags' keyword argument and use it when mounting the root file system. (boot-system): Pass the root file system flags to 'mount-root-file-system'. Signed-off-by: Ludovic Courtès --- gnu/build/linux-boot.scm | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index 950a3507f2..3d40a7d05d 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -358,10 +358,10 @@ (define (pidof program) (filter-map string->number (scandir "/proc"))))) (define* (mount-root-file-system root type - #:key volatile-root? options) - "Mount the root file system of type TYPE at device ROOT. If VOLATILE-ROOT? -is true, mount ROOT read-only and make it an overlay with a writable tmpfs -using the kernel built-in overlayfs. OPTIONS indicates the options to use + #:key volatile-root? (flags 0) options) + "Mount the root file system of type TYPE at device ROOT. If VOLATILE-ROOT? is +true, mount ROOT read-only and make it an overlay with a writable tmpfs using +the kernel built-in overlayfs. FLAGS and OPTIONS indicates the options to use to mount ROOT." (if volatile-root? @@ -384,7 +384,7 @@ (define* (mount-root-file-system root type "lowerdir=/real-root,upperdir=/rw-root/upper,workdir=/rw-root/work")) (begin (check-file-system root type) - (mount root "/root" type 0 options))) + (mount root "/root" type flags options))) ;; Make sure /root/etc/mtab is a symlink to /proc/self/mounts. (false-if-exception @@ -474,6 +474,13 @@ (define root-fs-type mounts) "ext4")) + (define root-fs-flags + (mount-flags->bit-mask (or (any (lambda (fs) + (and (root-mount-point? fs) + (file-system-flags fs))) + mounts) + '()))) + (define root-fs-options (any (lambda (fs) (and (root-mount-point? fs) @@ -533,6 +540,7 @@ (define root-fs-options (mount-root-file-system (canonicalize-device-spec root) root-fs-type #:volatile-root? volatile-root? + #:flags root-fs-flags #:options root-fs-options)) (mount "none" "/root" "tmpfs")) -- cgit v1.2.3