Hi!
John Darrington <[email protected]> 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’.