Commit Graph

269 Commits

Author SHA1 Message Date
Oleg Pykhalov 519e1e3eb8
scripts: system: Build layered images.
* guix/scripts/system.scm (show-help, %docker-format-options, %options,
%default-options, show-docker-format-options,
show-docker-format-options/detailed, process-action): Handle '--max-layers'
option.
* gnu/system/image.scm (system-docker-image): Same.
* gnu/image.scm (<image>)[max-layers]: New record field.

Change-Id: I2726655aefd6688b976057fd5a38e9972ebfc292
2024-01-08 21:22:44 +03:00
Simon Tournier 6c5516ab83
scripts: system: Handle EPIPE errors when displaying help.
* guix/scripts/system.scm (%options): Handle EPIPE errors when displaying help.
2023-10-17 14:52:05 +02:00
Mathieu Othacehe e5ed1712da
image: Introduce the mbr-hybrid-raw image type.
Until 209204e23b and
d57cab7641, the default image type used by "guix
system image" was an MBR image with an ESP partition.

Having both an MBR image and an ESP partition is handy because the image will
boot on most x86 based systems using legacy BIOS and/or UEFI.

We now have a distinction between MBR images and EFI images. Introduce a new
MBR hybrid image type and default to it to restore the default behaviour.

This also fixes the images section of (gnu ci) that was trying to install a
BIOS bootloader on an EFI, GPT image and failing to do so.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2023-09-20 09:38:36 +02:00
Josselin Poiret d57cab7641
image: Add mbr-raw-image-type and use by default.
* gnu/system/image.scm (mbr-disk-image, mbr-raw-image-type): New variables.
(qcow2-image-type): Inherit mbr-disk-image.
* guix/scripts/system.scm (%default-options): Use mbr-raw-image-type by
default.
* gnu/tests/install.scm (run-install): Use mbr-raw in the tests.
* doc/guix-cookbook.texi (Guix System Image API): Update the list of image
types.
* doc/guix.texi (Invoking guix system, System Images, image-type Reference):
Add mbr-raw and switch documented default to it.
2023-08-25 14:24:21 +02:00
Ludovic Courtès 5652c2e147
system: Do not check initrd modules for pseudo file systems.
Reported by hako on #guix.

* gnu/machine/ssh.scm (machine-check-initrd-modules): Filter out pseudo
file systems from 'file-systems'.
* guix/scripts/system.scm (check-initrd-modules): Likewise.
2023-08-08 18:01:54 +02:00
Hilton Chain 8874f2da2c
scripts: system: Remove duplicated "--target=TRIPLET" in help messages.
It's already included in (show-cross-build-options-help).

* guix/scripts/system.scm (show-help): Remove "--target=TRIPLET".

Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
2023-07-28 21:52:18 +08:00
Ludovic Courtès ae587c2ef0
guix: Strip #:use-module lists.
This was obtained by setting up this environment:

  guix shell -D guix --with-input=guile@3.0.9=guile-next \
    --with-commit=guile-next=e2ed33ef0445c867fe56c247054aa67e834861f2
    -- make -j5

then adding 'unused-module' to (@@ (guix build compiler) %warnings),
building, and checking all the "unused module" warnings and removing
those that were definitely unused.
2023-03-13 15:08:33 +01:00
Ludovic Courtès 43c36c5c9f
ui: 'display-hint' quotes extra arguments for Texinfo.
Fixes <https://issues.guix.gnu.org/61201>.

Previously, common practice was to splice arbitrary strings (user names,
file names, etc.) into Texinfo snippets passed to 'display-hint'.  This
is unsafe in the general case because at signs and braces need to be
escaped to produced valid Texinfo.  This commit addresses that.

* guix/ui.scm (texinfo-quote): New procedure.
(display-hint): When ARGUMENTS is non-empty, pass it to 'texinfo-quote'
and call 'format'.
(report-unbound-variable-error, check-module-matches-file)
(display-collision-resolution-hint, run-guix-command): Remove explicit
'format' call; pass 'format' arguments as extra arguments to 'display-hint'.
* gnu/services/monitoring.scm (zabbix-front-end-config): Likewise.
* guix/scripts.scm (warn-about-disk-space): Likewise.
* guix/scripts/build.scm (%standard-cross-build-options)
(%standard-native-build-options): Likewise.
* guix/scripts/describe.scm (display-checkout-info): Likewise.
* guix/scripts/environment.scm (suggest-command-name): Likewise.
* guix/scripts/home.scm (process-command): Likewise.
* guix/scripts/home/edit.scm (service-type-not-found): Likewise.
* guix/scripts/import.scm (guix-import): Likewise.
* guix/scripts/package.scm (display-search-path-hint): Likewise.
* guix/scripts/pull.scm (build-and-install): Likewise.
* guix/scripts/shell.scm (auto-detect-manifest): Likewise.
* guix/scripts/system.scm (check-file-system-availability): Likewise.
(guix-system): Likewise.
* guix/scripts/system/edit.scm (service-type-not-found): Likewise.
* guix/status.scm (print-build-event): Likewise.
2023-02-27 23:40:43 +01:00
Maxim Cournoyer 30465558bd
guix system: Skip initrd modules check when using --target.
* guix/scripts/system.scm (perform-action): Do not call CHECK-INITRD-MODULES
when the %current-target-system parameter is set.
2022-12-21 14:22:13 -05:00
Ludovic Courtès a3619079f9
Remove now unnecessary uses of (guix grafts).
These modules would use (guix grafts) just to access '%graft?' and
related bindings, which are now in (guix store).

* gnu/ci.scm,
guix/gexp.scm,
guix/lint.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/deploy.scm,
guix/scripts/environment.scm,
guix/scripts/home.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/pull.scm,
guix/scripts/size.scm,
guix/scripts/system.scm,
guix/scripts/weather.scm,
tests/builders.scm,
tests/channels.scm,
tests/cpan.scm,
tests/derivations.scm,
tests/gexp.scm,
tests/graph.scm,
tests/guix-daemon.sh,
tests/monads.scm,
tests/pack.scm,
tests/packages.scm,
tests/profiles.scm,
tests/system.scm: Remove #:use-module (guix grafts).
2022-10-22 01:46:55 +02:00
Julien Lepiller 82b0f3755d
guix: Fix typos.
These typos were found and reported through weblate.

* gnu/packages/audio.scm (wildmidi)[description]: Fix typo.
* gnu/packages/games.scm (cgoban)[description]: Fix typo.
* gnu/services/version-control.scm (gitolite-service-type)[description]:
  Fix typo.
* gnu/installer/newt/substitutes.scm (run-substitutes-page): Remove full
  stop at end of title.
* gnu/machine/ssh.scm (machine-ssh-configuration-system): Move
  punctuation outside of quotes.
* guix/scripts/home.scm (process-action): Remove trailing space before
  newline.
* guix/scripts/system.scm (show-help): Fix typo.
* guix/scripts/environment.scm (with-store/maybe): Fix typo.
2022-10-17 07:29:09 +02:00
Ludovic Courtès 22b9734b67
Revert "guix system: Remove unused 'read-operating-system' procedure."
This reverts commit d11a432adf.

The 'read-operating-system' is used in Emacs-Guix.
2022-10-11 16:05:31 +02:00
Mathieu Othacehe 6454164412
scripts: system: Check the image operating-system.
* guix/scripts/system.scm (process-action): Check that the provided image has
a defined operating-system.
2022-08-30 19:29:58 +02:00
Thiago Jung Bauermann 65ce5fe2fb
guix system: Use standard cross and native build options.
This change prevents guix system from erroring out with an ugly backtrace
when it's passed an invalid value to the “--system” or “--target”
option. It also adds the “--list-systems” and “--list-targets” options.

The manual section about guix system doesn't mention the “--target” option,
so add it there.

* guix/scripts/system (show-help): Call show-cross-build-options-help and
show-native-build-options-help.
(%options): Remove own implementation of “system” and “target” options and
use the ones in %standard-cross-build-options and
%standard-native-build-options.
* doc/guix.texi (Invoking guix system): Document “--target” option.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2022-08-30 08:55:16 +02:00
Ludovic Courtès d11a432adf
guix system: Remove unused 'read-operating-system' procedure.
* guix/scripts/system.scm (read-operating-system): Remove.
* gnu/ci.scm: Remove unused (guix scripts system) import.
2022-08-05 15:28:05 +02:00
Antero Mejr 95acd67dd3
system: Add -I, --list-installed option.
* guix/scripts/system.scm (display-system-generation): Add
 #:list-installed-regex and honor it.
(list-generations): Likewise.
(show-help, %options): Add "--list-installed".
(process-command): For 'describe' and 'list-generation', honor the
'list-installed option.
* doc/guix.texi (Invoking Guix System): Add information for
--list-installed flag.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-07-19 18:54:42 +02:00
Christopher Baines 9d30cfa337
guix system: Inline menu-entries in to bootcfg in perform-action.
This avoids an exception when generating images, where the reading of boot
parameters fails.

* guix/scripts/system.scm (perform-action): Inline menu-entries in to bootcfg.
2022-06-23 12:50:48 +01:00
Tobias Geerinckx-Rice 91363452f2
guix system: Don't suggest reconfiguration during reconfiguration.
* guix/scripts/system.scm (process-action):
Add 'reconfigure to the warning's guard clause.

Reported by johnjaye on #guix.
2022-05-29 02:00:00 +02:00
Ludovic Courtès 3f83c0b7c7
guix system: Add 'edit' sub-command.
* guix/scripts/system/edit.scm: New file.
* Makefile.am (MODULES): Add it.
* guix/scripts/system.scm (show-help): Mention "edit".
(actions): Add it.
(process-command): Handle it.
* doc/guix.texi (Invoking guix system): Document it.
* po/guix/POTFILES.in: Add guix/scripts/system/edit.scm.
2022-06-04 12:04:24 +02:00
Josselin Poiret dab819d5c4
Move (gnu platform) and (gnu platforms ...) to guix/.
* gnu/platform.scm:
* gnu/platforms/arm.scm:
* gnu/platforms/hurd.scm:
* gnu/platforms/mips.scm:
* gnu/platforms/powerpc.scm:
* gnu/platforms/riscv.scm:
* gnu/platforms/s390.scm:
* gnu/platforms/x86.scm: Move to guix/.

* Makefile.am:
* doc/guix.texi (Porting to a New Platform):
* etc/release-manifest.scm:
* gnu/ci.scm:
* gnu/image.scm:
* gnu/local.mk:
* gnu/packages/bioinformatics.scm:
* gnu/packages/bootstrap.scm:
* gnu/packages/cross-base.scm:
* gnu/packages/instrumentation.scm:
* gnu/packages/linux.scm:
* gnu/system/image.scm:
* gnu/system/images/hurd.scm:
* gnu/system/images/novena.scm:
* gnu/system/images/pine64.scm:
* gnu/system/images/pinebook-pro.scm:
* gnu/system/images/rock64.scm:
* guix/scripts/build.scm:
* guix/scripts/system.scm:
* guix/self.scm: Update (gnu platform...) to (guix platform...).

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2022-05-25 09:27:25 +02:00
Ludovic Courtès d4e858763c
ui: Move hyperlink facilities to (guix colors).
* guix/ui.scm (supports-hyperlinks?, file-hyperlink, hyperlink): Move to...
* guix/colors.scm: ... here.
* guix/scripts/home.scm, guix/scripts/system.scm,
guix/scripts/system/search.scm: Adjust imports accordingly.
2022-04-08 23:59:48 +02:00
Ludovic Courtès 322707bc7f
guix system: Call 'export-graph' with the right port argument.
* guix/scripts/system.scm (export-extension-graph)
(export-shepherd-graph): Honor PORT.
2022-03-18 16:03:33 +01:00
Ludovic Courtès 25261cbf96
guix home: Implement the 'extension-graph' and 'shepherd-graph' actions.
Until now these two actions were silently ignored.

* guix/scripts/home.scm (show-help, %options): Add "--graph-backend".
(%default-options): Add 'graph-backend' key.
(export-extension-graph, export-shepherd-graph): New procedures.
(perform-action): Add #:graph-backend parameter.  Add cases for the
'extension-graph' and 'shepherd-graph' actions.
(process-action): Pass #:graph-backend to 'perform-action'.
* guix/scripts/system.scm (service-node-type)
(shepherd-service-node-type): Export
* tests/guix-home.sh: Add tests.
* doc/guix.texi (Invoking guix home): Document it.
2022-03-18 16:03:33 +01:00
Ludovic Courtès f5a94b3a9f
graph: Factorize 'lookup-backend'.
* guix/graph.scm (lookup-backend): New procedure.
* guix/scripts/graph.scm (lookup-backend): Remove.
* guix/scripts/system.scm (lookup-backend): Remove.
* po/guix/POTFILES.in: Add 'guix/graph.scm'.
2022-03-18 16:03:33 +01:00
Ludovic Courtès 791069737c
guix system: Fix 'describe' when booting the latest generation.
Fixes a regression introduced in
9679123ce0, whereby 'guix system describe'
would error out when /run/current-system points to /gnu/store/…-system,
which is the case when booting the latest generation or after
reconfigure.

* guix/scripts/system.scm (process-command): For 'describe'. Try
'generation-number' with and without the optional argument.
2022-02-15 17:24:08 +01:00
Ludovic Courtès 9679123ce0
guix system: 'describe' shows the running system, not the current one.
* guix/profiles.scm (generation-number): Add optional 'base-profile'
parameter and use it.
* guix/scripts/system.scm (process-command): Add "/run/current-system"
as first argument to 'generation-number'.
* doc/guix.texi (Invoking guix system): Clarify that 'guix system
describe' shows the running system.
2022-02-02 18:12:22 +01:00
Mathieu Othacehe 2d12ec724e
scripts: system: Rationalize persistency.
Make sure that the images are created with a non volatile root by default and
the vm are created with a volatile root by default. Break the --volatile
option into --volatile-image and --persistent-vm options.

* guix/scripts/system.scm (perform-action): Turn volatile? argument into
volatile-vm-root?.
(show-help): Introduce --volatile-image and --persistent-vm options instead of
--volatile.
(%default-options): Adapt it.
(%options): Handle those options.
(process-action): Honor them.
* doc/guix.texi (Invoking guix system): Adapt it accordingly.
2022-01-14 12:26:07 +01:00
Ludovic Courtès a9268216e4
guix home, system: Use 'leave' to report missing generations.
Fixes <https://issues.guix.gnu.org/50982>.
Reported by Xinglu Chen <public@yoctocell.xyz>.

Fixes a typo ('error' instead of 'leave') introduced in
158032bd7d and copied in
89e05a6955.

* guix/scripts/system.scm (process-command): Use 'leave', not 'error'.
* guix/scripts/home.scm (process-command): Likewise.
2022-01-06 16:27:30 +01:00
Mathieu Othacehe c717f27c5f
scripts: system: Add a missing module.
* guix/scripts/system.scm: Add a missing module.
2021-12-23 10:54:01 +01:00
Mathieu Othacehe bce55cec88
scripts: system: Use the disk-image size argument for VM generation.
* guix/scripts/system.scm (system-derivation-for-action): Use the given
image-size unconditionnaly when calling system-qemu-image/shared-store-script.
2021-12-23 10:54:00 +01:00
Mathieu Othacehe c37cd41764
scripts: system: Pass the volatile field to VM generation.
* guix/scripts/system.scm (system-derivation-for-action): Add new volatile?
argument and pass it to system-qemu-image/shared-store-script.
(perform-action): Add new volatile? argument and pass it to
system-derivation-for-action.
(process-action): Pass the volatile? argument to perform-action.
2021-12-23 10:54:00 +01:00
Mathieu Othacehe 3ed8ddd606
scripts: system: Deprecate the docker-image command.
* guix/scripts/system.scm (system-derivation-for-action): Use the image API to
generate the docker images and deprecate the docker-image command.
(process-action): Ditto.
* doc/guix.texi (Invoking guix system): Adapt it.
2021-12-23 10:54:00 +01:00
Attila Lendvai b42bfbdfe5
guix system vm: Add --no-graphic CLI argument.
It configures QEMU to use the tty it was started in for IO (as opposed to
opening a separate graphical window).  This enables copy-pasting and
scrollback.  Exit QEMU with C-a x.

* gnu/system/vm.scm (system-qemu-image/shared-store-script): Also add the
'-nographic' QEMU argument when called with #:graphic? #false.
* guix/scripts/system.scm (system-derivation-for-action): Propagate
the #:graphic? keyword arg.
(perform-action): Add and propagate the #:graphic? keyword arg.
(show-help): Add --no-graphic CLI arg.
(%options): Process the new --no-graphic CLI arg.
(process-action): Feed in the CLI arg through the #:graphic? keyword arg.
* doc/guix.texi (Invoking guix system): Add example to combine guix system and
invoking the vm start script into one command.  Split the description of the
various options into separate paragraphs.  Add a paragraph to describe
--no-graphic.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-12-03 14:18:32 +01:00
Mathieu Othacehe d5073fd113
gnu: Add platform support.
* gnu/platform.scm: New file.
* gnu/platforms/arm.scm: Ditto.
* gnu/platforms/hurd.scm: Ditto.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add them.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-10-11 12:05:39 +00:00
Ludovic Courtès 3f717a09e7
guix system: Adjust bootloader message to plural "targets".
This is a followup to 2ca982ff41.

* guix/scripts/system.scm (install): Adjust message to plural 'targets'.
2021-10-07 10:47:43 +02:00
zimoun b8b56badd3
system: Add hint for action typo.
* guix/scripts/system.scm (actions): New variable.
(define-command): Add hint for action typo.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-07 15:59:34 +02:00
Maxim Cournoyer 2ca982ff41
gnu: bootloader: Support multiple targets.
Fixes <https://issues.guix.gnu.org/40997>.

* gnu/bootloader.scm (<bootloader-configuration>): New 'targets' field.
(%bootloader-configuration-target): New procedure.
(bootloader-configuration-target): Add deprecation warning.
(bootloader-configuration-targets): New procedure.
* guix/scripts/system.scm (install): Access targets via
bootloader-configuration-targets.
(perform-action)[bootloader-target]: Remove unused argument and update doc.
Access targets via bootloader-configuration-targets and fix indentation.
(process-action): Access targets via bootloader-configuration-targets.
Do not provide the unused BOOTLOADER-TARGET argument when applying
`perform-action'.
* guix/scripts/system/reconfigure.scm (install-bootloader-program): Rename
DEVICE argument to DEVICES.  Adjust doc and comment.  Apply `installer' and
`disk-installer' for every DEVICES.
(install-bootloader): Access targets via bootloader-configuration-targets and
rename variable from DEVICE to DEVICES.
* gnu/tests/install.scm: Adjust accordingly.
* tests/guix-system.sh: Likewise.
* gnu/tests/reconfigure.scm (run-install-bootloader-test): Adjust the DEVICES
argument so that it is a list.
* doc/guix.texi: Update doc.
2021-08-29 01:05:26 -04:00
Roel Janssen ce3d05cc08
guix: scripts system: Increase the size for generating Docker container images.
* guix/scripts/system.scm: Override the default of 256.
2021-05-10 09:43:12 +02:00
Mark H Weaver e18e2e458f
scripts: system: Default to -v3 when building a system.
This is a followup to 8f9052d543.

* guix/scripts/system.scm (verbosity-level): Change the default
from 2 to 3 when building a system.
2021-04-11 22:13:17 -04:00
Brice Waegeneire 236a882942
scripts: system: Activate system when switching generations.
Fixes <https://bugs.gnu.org/38884>.

* guix/scripts/system.scm (switch-to-system-generation): Load the
activate script for that generation.

squash! scripts: system: Activate system when switching generations.
2021-03-09 06:56:17 +01:00
Mathieu Othacehe 6e8cdf1d26
scripts: system: Accept <image> records as input.
* guix/scripts/system.scm (system-derivation-for-action): Replace "os"
argument by "image". Remove "image-size", "image-type", "label" and
"volatile-root?"  arguments.
(perform-action): Ditto.
(process-action): Construct the <image> record and pass it to "perform-action"
procedure.
* tests/guix-system.sh: Adapt accordingly.
* gnu/system/images/hurd.scm: Return the default image.
* gnu/system/images/novena.scm: Ditto.
* gnu/system/images/pine64.scm: Ditto.
* gnu/system/images/pinebook-pro.scm Ditto.
2021-02-17 10:57:02 +01:00
Mathieu Othacehe ee2a5da80a
scripts: system: Remove 'vm-image' command.
Remove the 'vm-image' command that has been superseded by the 'image'
command.

* gnu/system/vm.scm (system-qemu-image): Remove it.
* guix/scripts/system.scm (system-derivation-for-action): Mark 'vm-image'
command as deprecated and use the image API to produce the VM image.
(perform-action, show-help): Adapt accordingly.
* tests/guix-system.sh: Ditto.
* doc/guix.texi (Invoking guix system,
Running Guix in a VM): Ditto.
* etc/completion/fish/guix.fish: Ditto.
* etc/completion/zsh/_guix: Ditto.
2021-02-17 10:52:28 +01:00
Maxime Devos 95f72dcd7a
services: shepherd: Allow custom 'shepherd' package.
* gnu/services/shepherd.scm (<shepherd-configuration>): New record.
(shepherd-boot-gexp, shepherd-root-service-type): Use it.
(scm->go, shepherd-configuration-file): Allow passing custom
shepherd package.
* gnu/system.scm (operating-system-shepherd-service-names): Use the new
record.
* guix/scripts/system.scm (export-shepherd-graph): Adjust accordingly.
* doc/guix.texi (Shepherd Services). Document it.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2021-01-30 15:36:57 +01:00
Mathieu Othacehe e74baa1245
system: Rename 'disk-image' command 'image'.
* guix/scripts/system.scm (system-derivation-for-action): Rename 'disk-image'
command 'image'. Warn when using the now deprecated 'disk-image' command.
(show-help): Adapt accordingly.
(guix-system): Ditto.
* tests/guix-system.sh: Ditto.
* gnu/system/examples/bare-hurd.tmpl: Ditto.
* doc/guix.texi (Building the Installation Image,
Building the Installation Image for ARM Boards,
Invoking guix pack,
Invoking guix system): Adapt documentation.
2021-01-19 17:16:56 +01:00
Mathieu Othacehe 2f497d94e7
image: Rename "raw" image-type to "efi-raw".
* gnu/system/image.scm (raw-image-type): Rename to "efi-raw-image-type".
* guix/scripts/system.scm (%default-options): Adapt accordingly.
* doc/guix.texi: Ditto.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-01-17 11:04:25 +01:00
Ludovic Courtès 6c3690fc57
guix system: Add '--graph-backend'.
* guix/scripts/system.scm (lookup-backend): New procedure.
(export-extension-graph, export-shepherd-graph): Add #:backend parameter
and honor it.
(show-help, %options): Add "--graph-backend".
(%default-options): Add 'graph-backend'.
(process-action): Pass #:backend to 'export-extension-graph' and
'export-shepherd-graph'.
* doc/guix.texi (Invoking guix system): Document '--graph-backend'.
2021-01-04 23:54:15 +01:00
Miguel Ángel Arruga Vivas f00e68ace0
system: Allow separated /boot and encrypted root.
* gnu/bootloader/grub.scm (grub-configuration-file): New parameter
store-crypto-devices.
[crypto-devices]: New helper function.
[builder]: Use crypto-devices.
* gnu/machine/ssh.scm (roll-back-managed-host): Use
boot-parameters-store-crypto-devices to provide its contents to the
bootloader configuration generation process.
* gnu/tests/install.scm (%encrypted-root-not-boot-os,
%encrypted-root-not-boot-os): New os declaration.
(%encrypted-root-not-boot-installation-script): New script, whose contents
were initially taken from %encrypted-root-installation-script.
(%test-encrypted-root-not-boot-os): New test.
* gnu/system.scm (define-module): Export
operating-system-bootoader-crypto-devices and
boot-parameters-store-crypto-devices.
(<boot-parameters>): Add field store-crypto-devices.
(read-boot-parameters): Parse store-crypto-devices field.
[uuid-sexp->uuid]: New helper function extracted from
device-sexp->device.
(operating-system-bootloader-crypto-devices): New function.
(operating-system-bootcfg): Use
operating-system-bootloader-crypto-devices to provide its contents to
the bootloader configuration generation process.
(operating-system-boot-parameters): Add store-crypto-devices to the
generated boot-parameters.
(operating-system-boot-parameters-file): Likewise to the file with
the serialized structure.
* guix/scripts/system.scm (reinstall-bootloader): Use
boot-parameters-store-crypto-devices to provide its contents to the
bootloader configuration generation process.
* tests/boot-parameters.scm (%default-store-crypto-devices): New
variable.
(%grub-boot-parameters, test-read-boot-parameters): Use
%default-store-crypto-devices.
(tests store-crypto-devices): New tests.
2020-12-21 18:41:11 +01:00
Ludovic Courtès 1574bd82bb
system: 'init' does not recompute the hash of each store item.
Fixes <https://bugs.gnu.org/44760>.

Previously, the 'register-path' call would re-traverse ITEM to compute
its nar hash, even though that hash is already known in the initial
store.  This patch also avoids repeated opening/closing of the
database.

* guix/store/database.scm (call-with-database): Export.
* guix/scripts/system.scm (copy-item): Add 'db' parameter.  Call
'sqlite-register' instead of 'register-path'.
(copy-closure): Remove redundant call to 'references*'.  Call
'call-with-database' and pass the database to 'copy-item'.
2020-12-15 17:32:11 +01:00
Ludovic Courtès 0682cc5936
database: Remove #:deduplicate? and #:reset-timestamps? from 'register-path'.
* guix/store/database.scm (register-path): Remove #:deduplicate?
and #:reset-timestamps?.
* guix/scripts/system.scm (copy-item): Adjust accordingly.
* tests/store-database.scm ("register-path")
("register-path, directory"): Call 'reset-timestamps'.
2020-12-15 17:32:11 +01:00
Ludovic Courtès cd6c5ddfc8
guix system: 'init' copies, resets timestamps, and deduplicates at once.
Partly fixes <https://bugs.gnu.org/44760>.

* guix/build/store-copy.scm (copy-store-item): New procedure.
(populate-store): Use it instead of the inline 'copy-recursively' call.
* guix/scripts/system.scm (copy-item): Likewise.
Pass #:reset-timestamps? and #:deduplicate? to 'register-path'.
2020-12-15 17:32:11 +01:00