guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] gnu: Mark /gnu/store as needed for boot.


From: Ludovic Courtès
Subject: Re: [PATCH] gnu: Mark /gnu/store as needed for boot.
Date: Sat, 14 Jan 2017 22:30:43 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Hi!

John Darrington <address@hidden> skribis:

> * gnu/system/file-systems.scm (all-subpaths): New procedure.
> (file-system-needed-for-boot?): Use it to check for ancestors
> of %store-directory.

I guess the idea is to have ‘needed-for-boot?’ automatically set for
users who store /gnu or /gnu/store on a separate partition, right?

In ‘%separate-store-os’ in (gnu tests install), it is set explicitly:

    (file-systems (cons* (file-system
                           (device "root-fs")
                           (title 'label)
                           (mount-point "/")
                           (type "ext4"))
                         (file-system
                           (device "store-fs")
                           (title 'label)
                           (mount-point "/gnu")
                           (type "ext4")
                           (needed-for-boot? #t)) ;definitely!
                         %base-file-systems))

Making it automatic can help though.

>  (define-inlinable (file-system-needed-for-boot? fs)
> -  "Return true if FS has the 'needed-for-boot?' flag set, or if it's the root
> -file system."
> +  "Return true if FS has the 'needed-for-boot?' flag set, or if it holds
> +the store directory."
>    (or (%file-system-needed-for-boot? fs)
> -      (string=? "/" (file-system-mount-point fs))))
> +      (member (file-system-mount-point fs) (all-subpaths 
> (%store-directory)))))

The problem is that we need to exclude bind mounts, as done in
‘store-file-system’ in (gnu system).

What about:

  (define (file-system-needed-for-boot? fs)
    (or (%file-system-needed-for-boot? fs)
        (and (string-prefix? (file-system-mount-point fs) (%store-directory))
             (not (memq 'bind-mount (file-system-flags fs))))))

?

Thanks,
Ludo’.



reply via email to

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