Commit Graph

20 Commits

Author SHA1 Message Date
Ludovic Courtès 42ff7d3be6
mapped-devices: 'luks-device-mapping' checks its source device.
* gnu/system/mapped-devices.scm (check-luks-device): New procedure.
(luks-device-mapping)[check]: New field.
2017-12-22 09:48:38 +01:00
Ludovic Courtès 4ca90ff597
mapped-devices: Add 'location' and 'check' fields.
* gnu/system/mapped-devices.scm (<mapped-device>)[location]: New field.
(<mapped-device-type>)[check]: New field.
2017-12-22 09:48:36 +01:00
Ludovic Courtès 9b336338cd
system: Introduce a disjoint UUID type.
Conceptually a UUID is just a bytevector.  However, there's software out
there such as GRUB that relies on the string representation of different
UUID types (e.g., the string representation of DCE UUIDs differs from
that of ISO-9660 UUIDs, even if they are actually bytevectors of the
same length).  This new <uuid> record type allows us to preserve
information about the type of UUID so we can eventually convert it to a
string using the right representation.

* gnu/system/uuid.scm (<uuid>): New record type.
(bytevector->uuid): New procedure.
(uuid): Return calls to 'make-uuid'.
(uuid->string): Rewrite using 'match-lambda*' to accept a single 'uuid?'
argument.
* gnu/bootloader/grub.scm (grub-root-search): Check for 'uuid?' instead
of 'bytevector?'.
* gnu/system.scm (bootable-kernel-arguments): Check whether ROOT-DEVICE
is 'uuid?'.
(read-boot-parameters): Use 'bytevector->uuid' when the
store device is a bytevector.
(read-boot-parameters-file): Check for 'uuid?' instead of 'bytevector?'.
(device->sexp): New procedure.
(operating-system-boot-parameters-file): Use it for 'root-device' and
'store'.
(operating-system-bootcfg): Remove conditional in definition of
'root-device'.
* gnu/system/file-systems.scm (file-system->spec): Check for 'uuid?' on
DEVICE and take its bytevector.
* gnu/system/mapped-devices.scm (open-luks-device): Likewise.
* gnu/system/vm.scm (iso9660-image): Call 'uuid-bytevector' for the
 #:volume-uuid argument.
2017-09-11 22:24:46 +02:00
Mark H Weaver f45878a80d
mapped-devices: Cope with delayed appearance of LUKS source.
Fixes <https://bugs.gnu.org/27242>.

* gnu/system/mapped-devices.scm (open-luks-device): If
'find-partition-by-luks-uuid' fails, try again once per second, up to ten
times.
2017-06-07 19:03:03 -04:00
Ludovic Courtès d6d1cea624
mapped-devices: 'source' can be a list of strings.
Reported by myglc2 <myglc2@gmail.com>.

* gnu/system/mapped-devices.scm (<mapped-device>)[source]: Update
comment to note that this can be a list of strings.
2017-01-24 23:09:10 +01:00
Ludovic Courtès b7d408ec1b
mapped-devices: Use 'cryptsetup-static' in 'luks-device-mapping'.
* gnu/system/mapped-devices.scm (open-luks-device): Use
CRYPTSETUP-STATIC instead of CRYPTSETUP.  Use 'file-append'.
(close-luks-device): Likewise.
2016-11-23 21:13:18 +01:00
Ludovic Courtès 4ed2f515d6
mapped-devices: Use 'mdadm-static' in 'raid-device-mapping'.
* gnu/system/mapped-devices.scm (open-raid-device, close-raid-device):
Use MDADM-STATIC instead of MDADM.  Use 'file-append'.
2016-10-27 13:48:52 +02:00
Ludovic Courtès 6e52376d2e
mapped-devices: Properly open RAID devices.
This fixes a type error introduced in
7f8ad82bf2, given that SOURCES is a list.

* gnu/system/mapped-devices.scm (open-raid-device): Add 'apply'
invocation.
2016-10-04 19:51:53 +02:00
Ludovic Courtès 239c6e2762
system: Use 'source-module-closure' where needed.
* gnu/system/vm.scm (%vm-module-closure): Remove.
(expression->derivation-in-linux-vm): Use 'source-module-closure'
instead of %VM-MODULE-CLOSURE.
(qemu-image): Likewise.
* gnu/system/linux-initrd.scm (expression->initrd): Likewise.
(flat-linux-module-directory, base-initrd): Likewise.
* gnu/system/mapped-devices.scm (open-luks-device): Likewise.
2016-09-05 00:06:47 +02:00
Ludovic Courtès 10618627bf
mapped-devices: raid-device-mapping: Avoid non-top-level 'use-modules'.
Fixes <http://bugs.gnu.org/24135>.
Reported by myglc2 <myglc2@gmail.com>.

* gnu/system/mapped-devices.scm (open-raid-device): Avoid non-top-level
'use-modules' form.
2016-08-03 00:07:06 +02:00
Ludovic Courtès 873b51b340
mapped-devices: Bail out when RAID sources don't show up.
* gnu/system/mapped-devices.scm (open-raid-device): Bail out after 20
loop iterations.
2016-08-02 13:53:25 +02:00
Ludovic Courtès 7f8ad82bf2
mapped-devices: Make RAID device opening message clearer.
* gnu/system/mapped-devices.scm (open-raid-device): Rename 'source' to
'sources'.  Make 'waiting' message more informative.
(close-raid-device): Rename 'source' to 'sources'.
2016-08-02 13:53:25 +02:00
Ludovic Courtès dfe06f6e7f
mapped-devices: Do not always use (gnu build file-systems).
Fixes <http://bugs.gnu.org/24129>.
Reported by myglc2 <myglc2@gmail.com>.

* gnu/system/mapped-devices.scm (device-mapping-service-type): Remove
'modules' field from 'shepherd-service' form.
(open-luks-device): Add 'use-modules' form.
2016-08-02 13:53:25 +02:00
Andreas Enge 97c8aef15d
system: Add mapped devices for RAID.
* gnu/system/mapped-devices.scm (raid-device-mapping, open-raid-device,
close-raid-device): New variables.
* doc/guix.texi (Mapped Devices): Add documentation for RAID devices,
reorganize documentation for LUKS devices.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2016-07-25 22:22:21 +02:00
Ludovic Courtès a91c3fc727
services: <shepherd-service> no longer has an 'imported-modules' field.
* gnu/services/shepherd.scm (<shepherd-service>)[imported-modules]:
Remove.
(%default-imported-modules): Make private.
(shepherd-service-file): Use 'with-imported-modules'.
(shepherd-configuration-file): Remove 'modules' and the calls to
'imported-modules' and 'compiled-modules'.  Use
'with-imported-modules' instead.
* doc/guix.texi (Shepherd Services): Adjust accordingly.
* gnu/services/base.scm (file-system-shepherd-service): Use
'with-imported-modules'.  Remove 'imported-modules' field.
* gnu/system/mapped-devices.scm (device-mapping-service-type): Remove
'imported-modules'.
(open-luks-device): Use 'with-imported-modules'.
* gnu/tests.scm (marionette-shepherd-service): Remove 'imported-modules'
field and use 'with-imported-modules'.
2016-07-12 22:47:08 +02:00
Ludovic Courtès ffba7d498d mapped-devices: LUKS partitions can be designated by their UUID.
* gnu/system/mapped-devices.scm (device-mapping-service-type): Add
'modules' and 'imported-modules' fields to 'shepherd-service'.
(open-luks-device): Use 'find-partition-by-luks-uuid' to lookup the
partition when SOURCE is a bytevector.
* gnu/system/linux-initrd.scm (base-initrd): Augment 'use-modules'
form.
* doc/guix.texi (Mapped Devices): Give example with a UUID.
2016-04-18 01:24:06 +02:00
Ludovic Courtès 4da8c19e83 mapped-devices: 'mapped-device-service' takes a <mapped-device>.
* gnu/system/mapped-devices.scm (device-mapping-service): Take a
<mapped-device> instead of 3 parameters.
(device-mapping-service-type): Adjust accordingly.
* gnu/system.scm (device-mapping-services): Adjust accordingly.
2016-04-18 01:24:06 +02:00
Ludovic Courtès 1ea507bce2 services: Move 'device-mapping-service' to (gnu system mapped-devices).
* gnu/services/base.scm (device-mapping-service-type)
(device-mapping-service): Move to...
* gnu/system/mapped-devices.scm (device-mapping-service-type):
(device-mapping-service): ... here.  New variables.
2016-04-18 01:24:06 +02:00
Ludovic Courtès 374f14c265 system: Move 'luks-device-mapping' to (gnu system mapped-devices).
* gnu/system.scm (open-luks-device, close-luks-device)
(luks-device-mapping): Move to...
* gnu/system/mapped-devices.scm: ... here.  New file.
2016-04-18 01:24:06 +02:00
Ludovic Courtès 060d62a740 system: Add (gnu system mapped-devices).
* gnu/system/file-systems.scm (<mapped-device>, <mapped-device-type>):
Move to...
* gnu/system/mapped-devices.scm: ... here.  New file.
* gnu/system.scm, gnu/services/base.scm,
gnu/system/linux-initrd.scm: Use it.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
* gnu.scm (%public-modules): Add it.
2016-04-18 01:24:06 +02:00