Commit Graph

10 Commits

Author SHA1 Message Date
David Thompson 8c812f2aee build: file-systems: Allow for bind mounting regular files.
* 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.
2015-08-08 14:04:00 -04:00
Ludovic Courtès 0ec5ee9486 file-systems: Implement partition lookup by UUID.
* 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.
2015-07-14 15:24:19 +02:00
Ludovic Courtès 2de3cd8972 file-systems: Use (guix build syscalls) at build time if needed.
* gnu/build/file-systems.scm: Wrap 'module-use!' statement in 'eval-when'.
2015-07-14 15:24:18 +02:00
David Thompson 85c3127fa9 build: file-systems: Import (guix build syscalls) for non-static Guiles.
* 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.
2015-07-09 08:23:03 -04:00
David Thompson 5fd77f3f43 gnu: Make 'mount' interface in static Guile consistent with Guix API.
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.
2015-06-19 07:49:18 -04:00
Ludovic Courtès b86fee7848 file-systems: Use a second 'mount' call for read-only bind mounts.
* 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.
2015-04-20 22:16:13 +02:00
宋文武 9331ba5dd9 linux-boot: Make /etc/mtab a symlink to /proc/self/mounts.
Fixes <http://bugs.gnu.org/19491>.

* gnu/build/linux-boot.scm (mount-root-file-system): Make /root/etc/mtab
  a symlink to /proc/self/mounts.
* gnu/build/file-systems.scm (mount-file-system): Don't update /etc/mtab.
* guix/build/syscalls.scm (mount, umount): Have #:update-mtab? default to
  #f.
2015-01-05 22:24:00 +08:00
Ludovic Courtès 1c27641f46 file-systems: Always write the options field in /etc/mtab.
* 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.
2014-11-20 21:14:39 +01:00
Ludovic Courtès 4359378a2c linux-boot: Ask fsck for a progress bar.
* gnu/build/file-systems.scm (check-file-system): Pass '-C 0' to FSCK.
  Suggested by Mark H. Weaver.
2014-09-19 21:51:36 +02:00
Ludovic Courtès e2f4b305d0 Move part of (gnu build linux-boot) to (gnu build file-systems).
* gnu/build/linux-boot.scm (%ext2-endianness, %ext2-sblock-magic,
  %ext2-sblock-creator-os, %ext2-sblock-uuid, %ext2-sblock-volume-name,
  read-ext2-superblock, ext2-superblock-uuid,
  ext2-superblock-volume-name, disk-partitions,
  partition-label-predicate, find-partition-by-label,
  canonicalize-device-spec, MS_RDONLY, MS_NOSUID, MS_NODEV, MS_NOEXEC,
  MS_BIND, MS_MOVE, bind-mount, check-file-system,
  mount-flags->bit-mask, mount-file-system): Move to...
* gnu/build/file-systems.scm: ... here.  New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
* gnu/services/base.scm: Use (gnu build file-systems).
* gnu/services/dmd.scm (dmd-configuration-file): Likewise.
* gnu/system.scm (operating-system-activation-script): Likewise.
* gnu/system/linux-initrd.scm (base-initrd): Likewise.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Likewise.
2014-09-03 15:43:07 +02:00