mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
file-systems: Add read-luks-partition-uuid.
Add a specific procedure to read luks partition uuid. * gnu/build/file-systems.scm (luks-partition-field-reader): New procedure ... (luks-partition-uuid-predicate): ... used here, (read-luks-partition-uuid): new exported procedure.
This commit is contained in:
parent
df3664f1ec
commit
8ae7044f1d
1 changed files with 8 additions and 3 deletions
|
@ -44,6 +44,7 @@ (define-module (gnu build file-systems)
|
|||
|
||||
read-partition-label
|
||||
read-partition-uuid
|
||||
read-luks-partition-uuid
|
||||
|
||||
bind-mount
|
||||
|
||||
|
@ -438,6 +439,12 @@ (define read-partition-label
|
|||
(define read-partition-uuid
|
||||
(cut read-partition-field <> %partition-uuid-readers))
|
||||
|
||||
(define luks-partition-field-reader
|
||||
(partition-field-reader read-luks-header luks-header-uuid))
|
||||
|
||||
(define read-luks-partition-uuid
|
||||
(cut read-partition-field <> (list luks-partition-field-reader)))
|
||||
|
||||
(define (partition-predicate reader =)
|
||||
"Return a predicate that returns true if the FIELD of partition header that
|
||||
was READ is = to the given value."
|
||||
|
@ -454,9 +461,7 @@ (define partition-uuid-predicate
|
|||
(partition-predicate read-partition-uuid uuid=?))
|
||||
|
||||
(define luks-partition-uuid-predicate
|
||||
(partition-predicate
|
||||
(partition-field-reader read-luks-header luks-header-uuid)
|
||||
uuid=?))
|
||||
(partition-predicate luks-partition-field-reader uuid=?))
|
||||
|
||||
(define (find-partition predicate)
|
||||
"Return the first partition found that matches PREDICATE, or #f if none
|
||||
|
|
Loading…
Reference in a new issue