Previously a named socket such as /dev/log would fail
the 'regular-file?' test and we'd end up mkdir'ing it.
* gnu/build/file-systems.scm (regular-file?): Remove.
(mount-file-system): Change (regular-file? source)
to (not (file-is-directory? source)).
Fixes <http://bugs.gnu.org/25573>.
Reported by Alex Kost <alezost@gmail.com>.
* gnu/build/file-systems.scm (seek*): New procedure.
(read-superblock): Use it instead of 'seek' and ensure it returns
OFFSET.
* gnu/build/file-systems.scm (read-superblock,
null-terminated-latin1->string): New variables.
(sub-bytevector): Move to general section.
(ext2-superblock?, read-ext2-superblock): New variables.
(ext2-superblock-uuid, ext2-superblock-volume-name): Use
sub-bytevector and null-terminated-latin1->string.
(%ext2-sblock-magic, %ext2-sblock-creator-os, %ext2-sblock-uuid,
%ext2-sblock-volume-name): Inline constants.
(luks-superblock?, read-luks-header): New variables.
(%luks-header-size, %luks-magic): Inline.
(partition-label-predicate, partition-uuid-predicate,
luks-partition-uuid-predicate): Use new functions.
Previously, partitions of mdadm- or cryptsetup-produced block devices
would not be returned by 'disk-partitions'.
* gnu/build/file-systems.scm (disk-partitions)[last-character]: New
procedure.
[partition?]: Add 'name' parameter and rewrite. Adjust caller.
* gnu/build/file-systems.scm (ENOENT-safe): Silently ignore ENOMEDIUM.
* 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.