Commit graph

10 commits

Author SHA1 Message Date
Lilah Tascheter
e2e20d4002
gnu: tests: Update tests to new targets system.
* gnu/services/virtualization.scm
(%virtual-build-machine-operating-system): Remove bootloader.
(%hurd-vm-operating-system): Remove targets.
* gnu/system/hurd.scm (%hurd-default-operating-system): Remove targets.
* gnu/system/images/wsl2.scm (dummy-bootloader): Delete variable.
(wsl-os)[bootloader]: Don't provide field.
* gnu/system/vm.scm (virtualized-operating-system): Don't provide
bootloader.
* gnu/tests.scm (%simple-os), gnu/tests/ganeti.scm (%ganeti-os),
gnu/tests/image.scm (%simple-efi-os), gnu/tests/nfs.scm (%base-os),
gnu/tests/telephony.scm (make-jami-os), gnu/tests/vnc.scm (%xvnc-os):
Update bootloader targets.
* gnu/tests/install.scm (%minimal-os, %minimal-extlinux-os,
%minimal-os-on-vda, %separate-home-os, %separate-store-os,
%raid-root-os, %encrypted-root-os, %lvm-separate-home-os,
%encrypted-home-os, %encrypted-home-os-key-file,
%encrypted-root-not-boot-os, %btrfs-root-os-source,
%btrfs-raid-root-os-source, %btrfs-root-on-subvolume-os,
%btrfs-raid10-root-os, %jfs-root-os, %f2fs-root-os, %xfs-root-os):
Update bootloader targets.
(%btrfs-raid10-root-os): Use multiple bootloaders.

Change-Id: I3d66a839a9b2a73b8b65946950728b1e0155ca1e
2024-10-08 10:36:39 -04:00
Lilah Tascheter
9ba07f90f2
gnu: system: Remove useless boot parameters.
* gnu/system.scm (operating-system-boot-parameters,
operating-system-boot-parameters-file): Delete bootloader-menu-entries.
* gnu/system/boot.scm (boot-parameters)[bootloader-menu-entries]: Delete
field.
(read-boot-parameters): Don't read bootloader-menu-entries.
* tests/boot-parameters.scm (%grub-boot-parameters,
test-read-boot-parameters, test-read-boot-parameters): Don't include
bootloader-menu-entries.
("read, bootloader-menu-entries, default value"): Delete test.

Change-Id: I46d9cff4604dbfcf654b0820fdb77e72aecffbb4
2024-10-08 10:36:36 -04:00
Felix Lechner
b452d525d6
Move <boot-parameters> record to a separate file.
Required to avoid a missing dependency error on build-side.

* gnu/system.scm (<boot-parameters>): Move this record, and...
  (system-linux-image-file-name, %boot-parameters-version,
  bootable-kernel-arguments, ensure-not-/dev, read-boot-parameters,
  read-boot-parameters-file, boot-parameters->menu-entry):
  ...these procedures, to...

* gnu/system/boot.scm: ...this new file.

* gnu/machine/ssh.scm, gnu/system.scm, guix/scripts/system.scm,
  tests/boot-parameters.scm: Use new module above.

* gnu/local.mk (GNU_SYSTEM_MODULES): Add new module above.

* gnu/machine/ssh.scm (machine-boot-parameters): Don't private-import
  bootable-kernel-arguments.

Change-Id: I50cca8d2187879cd351b8e9332e1e114ca5096ae
2024-10-08 10:36:34 -04:00
Josselin Poiret
3294fa2ba4
tests: Add test for menu-entry roundtrips as sexps.
* tests/boot-parameters.scm (%uuid-menu-entry,
%file-system-label-menu-entry): New variables.
("menu-entry roundtrip, uuid", "menu-entry roundtrip,
file-system-label"): New tests.

Signed-off-by: Marius Bakke <marius@gnu.org>
2022-08-28 23:37:28 +02:00
Ludovic Courtès
47960b5526
system: Improve 'read-boot-parameters' incompatibility diagnostic.
Previously, when reading an incompatible "parameters" file, 'guix
system' would print a warning and then crash with a wrong-type-arg
backtrace because code expects 'read-boot-parameters' to always return a
<boot-parameters> record.

* gnu/system.scm (read-boot-parameters): Upon incompatibility, raise an
error instead of returning #f.  Also raise a '&fix-hint' condition.
* tests/boot-parameters.scm ("read, construction, mandatory fields"):
Define 'test-read-boot-parameters' as a macro; expect
'formatted-message?' exceptions rather than #f returns.
2022-03-16 15:48:52 +01:00
Maxim Cournoyer
4a3b8f4d59
system: Add a version field to the <boot-parameters> record.
This version field exposes the (already present) version information of a boot
parameters file.

* gnu/system.scm (%boot-parameters-version): New variable.
(<boot-parameters>)[version]: New field.
(read-boot-parameters): Use it.
(operating-system-boot-parameters-file): Likewise.
* tests/boot-parameters.scm (test-read-boot-parameters): Use
%boot-parameters-version as the default version value in the template.
2022-03-01 10:30:17 -05:00
Maxim Cournoyer
da4e409483
Migrate to the new 'targets' field of bootloader-configuration.
The old 'target' field is deprecated; adjust the sources to use the new
'targets' one instead.

* doc/guix-cookbook.texi<target>: Replace by 'targets'.
* gnu/bootloader/grub.scm: Likewise.
* gnu/installer/parted.scm: Likewise.
* gnu/machine/digital-ocean.scm: Likewise.
* gnu/system/examples/asus-c201.tmpl: Likewise
* gnu/system/examples/bare-bones.tmpl: Likewise
* gnu/system/examples/bare-hurd.tmpl: Likewise
* gnu/system/examples/beaglebone-black.tmpl: Likewise
* gnu/system/examples/desktop.tmpl: Likewise
* gnu/system/examples/docker-image.tmpl: Likewise
* gnu/system/examples/lightweight-desktop.tmpl: Likewise
* gnu/system/examples/vm-image.tmpl: Likewise
* gnu/system/examples/yggdrasil.tmpl: Likewise
* gnu/system/hurd.scm: Likewise
* gnu/system/images/hurd.scm: Likewise
* gnu/system/images/novena.scm: Likewise
* gnu/system/images/pine64.scm: Likewise
* gnu/system/images/pinebook-pro.scm: Likewise
* gnu/system/images/rock64.scm: Likewise
* gnu/system/install.scm: Likewise
* gnu/system/vm.scm: Likewise
* gnu/tests.scm: Likewise
* gnu/tests/ganeti.scm: Likewise
* gnu/tests/install.scm: Likewise
* gnu/tests/nfs.scm: Likewise
* gnu/tests/telephony.scm: Likewise
* tests/boot-parameters.scm: Likewise
* tests/system.scm: Likewise
2021-08-29 01:05:26 -04: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
Miguel Ángel Arruga Vivas
582cf9257c
system: Add store-directory-prefix to boot-parameters.
Fixes <http://issues.guix.gnu.org/44196>

* gnu/machine/ssh.scm (roll-back-managed-host): Use
boot-parameters-store-directory-prefix.
* gnu/system.scm (define-module): Export
boot-parameters-store-directory-prefix.
(<boot-parameters>)[store-directory-prefix]: New field. It is used to
generate the correct paths when /gnu/store is installed on a btrfs
subvolume whose name doesn't match the final runtime path, as the
bootloader doesn't have knowledge about the final mounting points.
[boot-parameters-store-directory-prefix]: New accessor.
(read-boot-parameters): Read directory-prefix from store field.
(operating-system-boot-parameters-file): Add directory-prefix to
store field.
* guix/scripts/system.scm (reinstall-bootloader): Use
boot-parameters-store-directory-prefix.
* test/boot-parameters.scm (%default-btrfs-subvolume,
%default-store-directory-prefix): New variables.
(%grub-boot-parameters): Use %default-store-directory-prefix.
(%default-operating-system): Use %default-btrfs-subvolume.
(test-boot-parameters): Add directory-prefix.
(test optional fields): Add test for directory-prefix.
(test os store-directory-prefix): New test.
2020-11-01 02:28:38 +01:00
Miguel Ángel Arruga Vivas
9d449b945b
system: Add locale to boot-parameters.
* gnu/system.scm (define-module)[export]: Add boot-parameters-locale.
(<boot-parameters>)[locale]: New field.
[boot-parameters-locale]: New accessor.
(read-boot-parameters): Read locale field.
(operating-system-boot-parameters): Provide operating-system locale to
boot-parameters record.
(opeating-system-boot-parameters-file): Likewise.
* Makefile.am (SCM_TESTS): Add tests/boot-parameters.scm.
* tests/boot-parameters.scm: New test file.
2020-10-18 15:32:54 +02:00