summaryrefslogtreecommitdiff
path: root/gnu/system/mapped-devices.scm
AgeCommit message (Collapse)Author
2024-04-08mapped-devices: luks: Specify modules needed at the top-level.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/70266>. * gnu/system/mapped-devices.scm (luks-device-mapping)[modules]: New field. (open-luks-device): Remove non-top-level ‘use-modules’ form. * gnu/system/linux-initrd.scm (raw-initrd): Remove modules that were added specifically for ‘luks-device-mapping’. Change-Id: I4253c3dd5e3cbcee41ec84fd57227abd428d1bd6
2024-04-08mapped-devices: <mapped-device-type> can specify modules to import.Ludovic Courtès
* gnu/system/mapped-devices.scm (<mapped-device-type>)[modules]: New field. (device-mapping-service-type): Honor it. * gnu/system/linux-initrd.scm (raw-initrd): Likewise. Change-Id: Icc702cb6f281741975e33203f87fbc1ffa9856da
2024-01-14mapped-devices: Allow unlocking by a key file.Tomas Volf
Requiring the user to input their password in order to unlock a device is not always reasonable, so having an option to unlock the device using a key file is a nice quality of life change. * gnu/system/mapped-devices.scm (open-luks-device): Add #:key-file argument. (luks-device-mapping-with-options): New procedure. * doc/guix.texi (Mapped Devices): Describe the new procedure. Change-Id: I1de4e045f8c2c11f9a94f1656e839c785b0c11c4 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-04-08mapped-devices: Ensure 'cryptsetup open' gets a tty.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/54770>. Regression introduced in 400c9ed3d779308e56038305d40cd93acb496180. Previously, for an encrypted /home (say), "cryptsetup open" would be invoked by shepherd, with /dev/null as its standard input. It would thus run in non-interactive mode and, instead of asking for a passphrase, fail with: Nothing to read on input. This change ensures it runs in interactive mode. * gnu/build/file-systems.scm (system*/console, system*/tty): New procedures. * gnu/system/mapped-devices.scm (open-luks-device): Use 'system*/tty' instead of 'system*'.
2021-12-01gnu: system: Add LUKS2 support for the root file system.Josselin Poiret
* gnu/bootloader/grub.scm (grub-configuration-file): Add 'insmod luks2'. * gnu/system/mapped-devices.scm (open-luks-device): Create '/run/cryptsetup/' directory. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-01-13services: shepherd: 'shepherd-service-type' requires documentation.Ludovic Courtès
* gnu/services/shepherd.scm (shepherd-service-type): Require a 'description' form. * gnu/services/base.scm (root-file-system-service-type) (rngd-service-type, host-name-service-type): (virtual-terminal-service-type, console-keymap-service-type) (syslog-service-type, swap-service-type) (kmscon-service-type): Add description. * gnu/services/networking.scm (dhcp-client-service-type): Likewise. * gnu/system/install.scm (cow-store-service-type): Likewise. * gnu/system/linux-container.scm (dummy-networking-service-type): Likewise. * gnu/system/mapped-devices.scm (device-mapping-service-type): Likewise. * tests/guix-system.sh: Likewise.
2020-11-26mapped-devices: Add 'lvm-device-mapping'.Mikhail Tsykalov
* gnu/system/mapped-devices.scm (lvm-device-mapping, open-lvm-device, close-lvm-device): New variables. * gnu/tests/install.scm (%lvm-separate-home-os, %lvm-separate-home-os-source, %lvm-separate-home-installation-script, %test-lvm-separate-home-os): New variables. * gnu/system/linux-initrd.scm (raw-initrd): Add (srfi srfi-1) to initrd expression. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-11-26mapped-devices: Allow target to be list of strings.Mikhail Tsykalov
* gnu/system/mapped-devices.scm (<mapped-device>): Rename constructor to %mapped-device. [target]: Remove field. [targets]: New field. Adjust users. (mapped-device-compatibility-helper, mapped-device): New macros. (mapped-device-target): New deprecated procedure. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-07-25Use 'formatted-message' instead of '&message' where appropriate.Ludovic Courtès
* gnu.scm (%try-use-modules): Use 'formatted-message' instead of '&message'. * gnu/machine/digital-ocean.scm (maybe-raise-unsupported-configuration-error): Likewise. * gnu/machine/ssh.scm (machine-check-file-system-availability): Likewise. (machine-check-building-for-appropriate-system): Likewise. (deploy-managed-host): Likewise. (maybe-raise-unsupported-configuration-error): Likewise. * gnu/packages.scm (search-patch): Likewise. * gnu/services.scm (%service-with-default-value): Likewise. (files->etc-directory): Likewise. (fold-services): Likewise. * gnu/system.scm (locale-name->definition*): Likewise. * gnu/system/mapped-devices.scm (check-device-initrd-modules): Likewise. (check-luks-device): Likewise. * guix/channels.scm (latest-channel-instance): Likewise. * guix/cve.scm (json->cve-items): Likewise. * guix/git-authenticate.scm (commit-signing-key): Likewise. (commit-authorized-keys): Likewise. (authenticate-commit): Likewise. (verify-introductory-commit): Likewise. * guix/remote.scm (remote-pipe-for-gexp): Likewise. * guix/scripts/graph.scm (assert-package): Likewise. * guix/scripts/offload.scm (private-key-from-file*): Likewise. * guix/ssh.scm (authenticate-server*): Likewise. (open-ssh-session): Likewise. (remote-inferior): Likewise. * guix/ui.scm (matching-generations): Likewise. * guix/upstream.scm (package-update): Likewise. * tests/channels.scm ("latest-channel-instances, missing introduction for 'guix'"): Catch 'formatted-message?'. ("authenticate-channel, wrong first commit signer"): Likewise. * tests/lint.scm ("patches: not found"): Adjust message string. * tests/packages.scm ("patch not found yields a run-time error"): Catch 'formatted-message?'. * guix/lint.scm (check-patch-file-names): Handle 'formatted-message?'. (check-derivation): Ditto.
2020-07-25utils: Move '&fix-hint' to (guix diagnostics).Ludovic Courtès
* guix/utils.scm (&fix-hint): Move to... * guix/diagnostics.scm (&fix-hint): ... here. * gnu.scm: Adjust imports accordingly. * gnu/system/mapped-devices.scm: Likewise. * guix/channels.scm: Likewise. * guix/profiles.scm: Likewise. * guix/scripts/system/reconfigure.scm: Likewise. * guix/ssh.scm: Likewise.
2020-06-25services: Add missing (ice-9 format) import.Ludovic Courtès
These issues were reported by -Wformat, though they were harmless in practice because importing (ice-9 format) changes the global 'format' binding currently. * gnu/services/nix.scm: Import (ice-9 format). * gnu/services/web.scm: Likewise. * gnu/system/mapped-devices.scm: Likewise.
2019-03-13linux-modules: Factorize 'missing-modules'.Ludovic Courtès
* gnu/build/linux-modules.scm (missing-modules): New procedure. * gnu/system/mapped-devices.scm (check-device-initrd-modules): Use it.
2019-03-13Remove traces of "GuixSD".Ludovic Courtès
* gnu/bootloader/extlinux.scm (extlinux-configuration-file): Remove mentions of "GuixSD". * gnu/bootloader/grub.scm (install-grub-efi): Likewise. * gnu/build/vm.scm (make-iso9660-image): Change default #:volume-id to "Guix_image". (initialize-hard-disk): Search for the "Guix_image" label. * gnu/ci.scm (system-test-jobs, tarball-jobs): Remove "GuixSD". * gnu/installer/newt/welcome.scm (run-welcome-page): Likewise. * gnu/packages/audio.scm (supercollider)[description]: Likewise. * gnu/packages/curl.scm (curl): Likewise. * gnu/packages/emacs.scm (emacs): Likewise. * gnu/packages/gnome.scm (network-manager): Likewise. * gnu/packages/julia.scm (julia): Likewise. * gnu/packages/linux.scm (alsa-plugins): Likewise. (powertop, wireless-regdb): Likewise. * gnu/packages/package-management.scm (guix): Likewise. * gnu/packages/polkit.scm (polkit): Likewise. * gnu/packages/tex.scm (texlive-bin): Likewise. * gnu/services/base.scm (file-systems->fstab): Likewise. * gnu/services/cups.scm (%cups-activation): Likewise. * gnu/services/mail.scm (%dovecot-activation): Likewise. * gnu/services/messaging.scm (prosody-configuration)[log]: Likewise. * gnu/system/examples/vm-image.tmpl (vm-image-motd): Likewise. * gnu/system/install.scm (installation-os)[file-systems]: Change root file system label to "Guix_image". * gnu/system/mapped-devices.scm (check-device-initrd-modules): Remove "GuixSD". * gnu/system/vm.scm (system-docker-image): Likewise. (system-disk-image)[root-label]: Change to "Guix_image". * gnu/tests/install.scm (run-install): Remove "GuixSD". * guix/modules.scm (guix-module-name?): Likewise. * nix/libstore/optimise-store.cc: Likewise.
2018-09-23system: Mention '--skip-checks' in initrd diagnostics.Ludovic Courtès
* gnu/system/mapped-devices.scm (check-device-initrd-modules): Add note about '--skip-checks'.
2018-07-29linux-initrd: Report only missing modules, not all needed modules.Ludovic Courtès
Previously the warning would list all the required modules rather than just those that are missing. * gnu/system/mapped-devices.scm (check-device-initrd-modules): Compute 'missing' and report it.
2018-07-29linux-initrd: Try several file names when looking up modules.Ludovic Courtès
Fixes <https://bugs.gnu.org/31714>. Reported by Tonton <tonton@riseup.net>. * gnu/build/linux-modules.scm (find-module-file): New procedure. * gnu/system/linux-initrd.scm (flat-linux-module-directory)[build-exp]: Remove 'lookup' procedure and use 'find-module-file' instead. * gnu/system/mapped-devices.scm (check-device-initrd-modules): Add comment.
2018-07-29linux-initrd: Improve check of initrd modules.Ludovic Courtès
Previously we would not strip the ".ko" suffix if present. * gnu/build/linux-modules.scm (file-name->module-name): Export. * gnu/system/mapped-devices.scm (check-device-initrd-modules): Use 'file-name->module-name' instead of 'normalize-module-name'.
2018-06-14linux-initrd: Module check correctly handles hyphen vs. underscore.Ludovic Courtès
Fixes <https://bugs.gnu.org/31714>. Reported by Vagrant Cascadian <vagrant@debian.org> and Florian Pelz <pelzflorian@pelzflorian.de>. * gnu/system/mapped-devices.scm (check-device-initrd-modules): Pass LINUX-MODULES through 'normalize-module-name'. * gnu/build/linux-modules.scm (normalize-module-name): Export.
2018-03-15linux-initrd: Autoload known-module-aliases, again.Mark H Weaver
Fixes a regression introduced in 8ab10c19d72caab7459034a6e72b0117d7c5cec8. * gnu/system/mapped-devices.scm: Autoload 'known-module-aliases'.
2018-03-15linux-initrd: Move 'check-device-initrd-modules' elsewhere.Ludovic Courtès
This mostly reverts ca23693d280de5c4031058da4d3041d830080484, which introduced a circular dependency between (gnu system linux-initrd) and (gnu system mapped-devices). Reported by Eric Bavier. * gnu/system/linux-initrd.scm (check-device-initrd-modules): Move to... * gnu/system/mapped-devices.scm (check-device-initrd-modules): ... here. * po/guix/POTFILES.in: Adjust accordingly.
2018-03-07linux-initrd: Factorize 'check-device-initrd-modules'.Ludovic Courtès
* gnu/system/mapped-devices.scm (check-device-initrd-modules): Move to... * gnu/system/linux-initrd.scm (check-device-initrd-modules): ... here. New procedure. * po/guix/POTFILES.in: Add it. * guix/scripts/system.scm (check-initrd-modules)[check-device]: Remove. Use 'check-device-initrd-modules' instead.
2018-03-02guix system: Check for the lack of modules in the initrd.Ludovic Courtès
* guix/scripts/system.scm (check-mapped-devices): Take an OS instead of a list of <mapped-device>. Pass #:needed-for-boot? and #:initrd-modules to CHECK. (check-initrd-modules): New procedure. (perform-action): Move 'check-mapped-devices' call first. Add call to 'check-initrd-modules'. * gnu/system/mapped-devices.scm (check-device-initrd-modules): New procedure. (check-luks-device): Add #:initrd-modules and #:needed-for-boot?. Use them to call 'check-device-initrd-modules'.
2017-12-22mapped-devices: 'luks-device-mapping' checks its source device.Ludovic Courtès
* gnu/system/mapped-devices.scm (check-luks-device): New procedure. (luks-device-mapping)[check]: New field.
2017-12-22mapped-devices: Add 'location' and 'check' fields.Ludovic Courtès
* gnu/system/mapped-devices.scm (<mapped-device>)[location]: New field. (<mapped-device-type>)[check]: New field.
2017-09-11system: Introduce a disjoint UUID type.Ludovic Courtès
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-06-07mapped-devices: Cope with delayed appearance of LUKS source.Mark H Weaver
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-01-24mapped-devices: 'source' can be a list of strings.Ludovic Courtès
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.
2016-11-23mapped-devices: Use 'cryptsetup-static' in 'luks-device-mapping'.Ludovic Courtès
* gnu/system/mapped-devices.scm (open-luks-device): Use CRYPTSETUP-STATIC instead of CRYPTSETUP. Use 'file-append'. (close-luks-device): Likewise.
2016-10-27mapped-devices: Use 'mdadm-static' in 'raid-device-mapping'.Ludovic Courtès
* gnu/system/mapped-devices.scm (open-raid-device, close-raid-device): Use MDADM-STATIC instead of MDADM. Use 'file-append'.
2016-10-04mapped-devices: Properly open RAID devices.Ludovic Courtès
This fixes a type error introduced in 7f8ad82bf23b032ad6bd85bb1daa87cc83de509c, given that SOURCES is a list. * gnu/system/mapped-devices.scm (open-raid-device): Add 'apply' invocation.
2016-09-05system: Use 'source-module-closure' where needed.Ludovic Courtès
* 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-08-03mapped-devices: raid-device-mapping: Avoid non-top-level 'use-modules'.Ludovic Courtès
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-02mapped-devices: Bail out when RAID sources don't show up.Ludovic Courtès
* gnu/system/mapped-devices.scm (open-raid-device): Bail out after 20 loop iterations.
2016-08-02mapped-devices: Make RAID device opening message clearer.Ludovic Courtès
* 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-02mapped-devices: Do not always use (gnu build file-systems).Ludovic Courtès
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-07-25system: Add mapped devices for RAID.Andreas Enge
* 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-12services: <shepherd-service> no longer has an 'imported-modules' field.Ludovic Courtès
* 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-04-18mapped-devices: LUKS partitions can be designated by their UUID.Ludovic Courtès
* 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-18mapped-devices: 'mapped-device-service' takes a <mapped-device>.Ludovic Courtès
* 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-18services: Move 'device-mapping-service' to (gnu system mapped-devices).Ludovic Courtès
* 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-18system: Move 'luks-device-mapping' to (gnu system mapped-devices).Ludovic Courtès
* gnu/system.scm (open-luks-device, close-luks-device) (luks-device-mapping): Move to... * gnu/system/mapped-devices.scm: ... here. New file.
2016-04-18system: Add (gnu system mapped-devices).Ludovic Courtès
* 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.