* gnu/build/file-systems.scm (%luks-endianness, %luks-header-size): New
macros.
(%luks-magic): New variable.
(sub-bytevector, read-luks-header, luks-header-uuid): New procedures.
(partition-predicate): Add 'read' parameter; wrap it with 'ENOENT-safe'.
Use it instead of 'read-ext2-superblock*'.
(read-ext2-superblock*): Remove.
(partition-label-predicate, partition-uuid-predicate): Pass
'read-ext2-superblock' as the first argument.
(partition-luks-uuid-predicate): New variable.
(find-partition-by-luks-uuid): New procedure.
* gnu/build/file-systems.scm (canonicalize-device-spec)[canonical-title]:
Use 'string->uuid' to check whether SPEC is a UUID.
When SPEC is a string and CANONICAL-TITLE is 'uuid, call 'string->uuid'.
* gnu/system.scm (operating-system-grub.cfg): Add 'root-device'
variable and use it for the "--root=" argument.
Reported by David Thompson <dthompson2@worcester.edu>
at <https://lists.gnu.org/archive/html/guix-devel/2015-10/msg00284.html>.
* gnu/build/file-systems.scm (mount-file-system): When SOURCE matches
'regular-file?', do not create MOUNT-POINT if it already exists. This
fixes a bug whereby we would be truncating MOUNT-POINT if it already
existed.
* gnu/build/file-systems.scm (regular-file?): New procedure.
(mount-file-system): Create a regular file instead of a directory when bind
mounting a regular file.
* gnu/build/file-systems.scm (read-ext2-superblock*, partition-predicate): New
procedures.
(partition-label-predicate): Rewrite in terms of 'partition-predicate'.
(partition-uuid-predicate, find-partition-by-uuid, uuid->string): New
procedures.
(%network-byte-order): New macro.
(canonicalize-device-spec)[canonical-title]: Check whether SPEC is a string.
[resolve]: New procedure.
Add 'uuid' case and use it.
* gnu/build/file-systems.scm: Import (guix build syscalls) when 'mount' is not
defined.
* gnu/system.scm (operating-system-activation-script): Include (guix build
syscalls) module in derivation.
Rather than expecting a pointer, the version of 'mount' in
guile-static-stripped now takes a string for the 'options' argument, just like
the 'mount' procedure in (guix build syscalls).
* gnu/packages/patches/guile-linux-syscalls.patch (mount): Expect a string or
#f for 'options' argument.
* gnu/build/file-systems.scm (mount-file-system): Use new 'mount' interface.
* gnu/build/file-systems.scm (MS_REMOUNT): New constant.
(mount-file-system): Add 'flags' local variable. When FLAGS has
MS_BIND & MS_RDONLY, call 'mount' with MS_REMOUNT.
* gnu/services/base.scm (file-system-service) <start>: Likewise.
* gnu/build/file-systems.scm (mount-file-system): When OPTIONS is false,
write "rw" to /etc/mtab. This fixes a bug whereby 'remove-from-mtab'
in (guix syscalls) would otherwise raise a 'match-error' because of
the missing field. This affected file systems mounted from the
initrd, such as devtmpfs, which has options == #f.