Commit graph

143471 commits

Author SHA1 Message Date
Lilah Tascheter
33894a8d17
gnu: system: Fix bootloader crypto device recognition.
* gnu/system.scm (operating-system-bootloader-crypto-devices): Check for
luks-device-mapping-with-options in addition to luks-device-mapping.

Change-Id: Iafc9afe608640b97083c4d559c9240846330472a
2024-10-08 10:36:42 -04:00
Lilah Tascheter
bddc831845
gnu: packages: Add systemd-stub.
* gnu/packages/bootloaders.scm (systemd-stub): New variable.

Change-Id: I974bad9ff7a52f736286d05de53f7c5ccb60b9d6
2024-10-08 10:36:41 -04:00
Lilah Tascheter
a863f0b976
gnu: packages: Add ukify.
* gnu/packages/bootloaders.scm (%systemd-version, systemd-source,
ukify): New variables.

Change-Id: Icde59b7266529c8002331ff0375e0a35af3a2add
2024-10-08 10:36:41 -04:00
Lilah Tascheter
da153431f1
gnu: packages: Add pesign.
* gnu/packages/efi.scm (pesign): New variable.

Change-Id: I00fcc679d9514c85d508183b9ec7e121e0a814db
2024-10-08 10:36:41 -04:00
Herman Rimm
e1be617efe
Setup (gnu tests install) for build test.
Change-Id: I0b6adc4b6adee6b2dc92deb34b6cbca74cf8b3da
2024-10-08 10:36:41 -04:00
Herman Rimm
3bb77e73e1
gnu: Merge uuid and label into device.
Change-Id: If035bf0b1ee01bc93f638d04ed19df500ef4bc04
2024-10-08 10:36:41 -04:00
Herman Rimm
affda634d5
gnu: bootloader: Use define-configuration.
* gnu/bootloader.scm (bootloader-target): Use define-configuration.

Change-Id: I9c98da238bcb00639137349b2312a34336928aac
2024-10-08 10:36:41 -04:00
Herman Rimm
3f3ce48900
gnu: bootloader: Add find-mount procedure.
* gnu/bootloader.scm (find-mount, find-file-system, label->uuid,
uuid->file-system, mount-point->block-device): Add procedures.
2024-10-08 10:36:41 -04:00
Herman Rimm
5b7b514e4d
gnu: build: file-systems: Add find-uuid procedure.
* gnu/build/file-systems.scm (block-devices, uuids, find-uuid): Add
procedures.
* gnu/system/uuid.scm (file-system->uuid-type): Add procedure.

Change-Id: I8b4f3ad9fe5138d5c09ce24ded70fa53364550dc
2024-10-08 10:36:40 -04:00
Herman Rimm
92ecc0adfa
gnu: build: file-systems: Return uuid records.
* gnu/bootloader.scm (menu-entry->sexp, sexp->menu-entry): Swap order in
match subprocedures.
* gnu/build/file-systems.scm (ext2-superblock-uuid,
linux-swap-superblock-uuid, bcachefs-superblock-external-uuid,
btrfs-superblock-uuid, exfat-superblock-uuid, fat32-superblock-uuid,
fat16-superblock-uuid, iso9660-superblock-uuid, jfs-superblock-uuid,
f2fs-superblock-uuid, luks-header-uuid, ntfs-superblock-uuid,
xfs-superblock-uuid): Wrap bytevector in uuid record.
* gnu/build/image.scm (make-iso9660-image): Take uuid as string.
* gnu/installer/parted.scm (user-partition->file-system): Do not provide
uuid-type.
* gnu/system/image.scm (system-iso9660-image): Convert uuid to string.
* gnu/system/uuid.scm (dce-uuid->string, iso9660-uuid->string): Do not
export.

Change-Id: I35435de0d808e66e17fd9b54247a7a11a93ecd62
2024-10-08 10:36:40 -04:00
Herman Rimm
ecbf0794d7
Document grub-menu-entry.
Change-Id: Iccb7a563353fcfbe651693df22394538c4e819dc
2024-10-08 10:36:40 -04:00
Herman Rimm
38cb6dee66
gnu: bootloader: grub: Define grub-menu-entry configuration.
* gnu/bootloader/grub.scm (serialize-grub-theme, serialize-string,
normalize-file, serialize-file-like, string-list?, file-like-list?,
serialize-string-list, serialize-file-like-list, grub-device?,
serialize-grub-device, serialize-linux-directive,
serialize-multiboot-directive, directive-or-file-like?,
serialize-directive-or-file-like, menu-entry->grub-menu-entry,
serialize-grub-menu-entry): Add procedures.
(make-grub.cfg): Use really-mixed-text-file to reduce indentation.
(%boot): Add variable.  Define maybe-string.
(linux-directive, multiboot-directive, grub-menu-entry): Add records.

Change-Id: Ie1e56e04d5c8ae7ab07741ef7b6909f306398f28
2024-10-08 10:36:40 -04:00
Lilah Tascheter
fd4e074d61
doc: Update bootloader documentation.
* doc/guix.texi (Manual Installation)[Proceeding with the Installation]:
Offload target reference.

(System Installation)[Building the Installation Image]: Don't reference
deleted variables.

(System Configuration)[Using the Configuration System]: Update example.
[operating-system Reference]<bootloader>: Can use multiple bootloaders.
[Proceeding with the installation]: Refer to Bootloader Configuration.
[Building the Installation Image]: Update example.
[Bootloader Configuration]<bootloader>: Update documentation for all
bootloaders, and add new ones. Document new fields efi-removable?,
32bit?, and keypair.
<bootloader-target>: New record.
<menu-entry>: Remove now-unsupported GRUB specifics in linux.  Move
device documentation and add some for device-mount-point and
device-subvol.  Fix typo in multiboot-arguments.  Document chain-loader
for arbitrary bootloaders.
[Invoking guix system]<switch-generation>: Bootloaders are now
reinstalled.
<image> Other bootloaders may be used.
[Invoking guix deploy]: Update template.

Change-Id: I45ac9d5ad3cb491c693e9a4b2f0b44b527478ee7
2024-10-08 10:36:40 -04:00
Lilah Tascheter
40e19b3be0
gnu: system: Update examples.
* gnu/system/examples/asus-c201.tmpl (bootloader): Use new depthcharge
bootloader name scheme and update to new target system.
* gnu/system/examples/bare-bones.tmpl (bootloader),
gnu/system/examples/bare-hurd.tmpl (bootloader),
gnu/system/examples/beaglebone-black.tmpl (bootloader),
gnu/system/examples/desktop.tmpl (bootloader),
gnu/system/examples/lightweight-desktop.tmpl (bootloader),
gnu/system/examples/plasma.tmpl (bootloader): Use new target system.
* gnu/system/examples/docker-image.tmpl (bootloader): Delete.
* gnu/system/examples/vm-image.tmpl (bootloader): Use auto image target.

Change-Id: I3675f17ae9cd94cff99328762600fb4e491bc9f2
2024-10-08 10:36:39 -04:00
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
d43e1a34ad
gnu: bootloader: Add Raspberry Pi bootloader.
Less adding and more making it an actual bootloader rather than some
weirdly specified packages.  The GRUB EFI bootloader can be recreated by
combining a Raspberry Pi bootloader with grub-efi.

* gnu/bootloader.scm (efi-bootloader-profile, efi-bootloader-chain):
Delete procedures.
* gnu/bootloader/u-boot.scm (rpi-config, install-rpi,
make-u-boot-rpi-bootloader): New procedures.
(u-boot-rpi-2-bootloader, u-boot-rpi-3-bootloader,
u-boot-rpi-4-bootloader, u-boot-rpi-bootloader): New variables.
* gnu/packages/bootloaders.scm (make-u-boot-bin-package): Delete
procedure.
(%u-boot-rpi-efi-description, %u-boot-rpi-efi-description-32-bit,
u-boot-rpi-2-efi, u-boot-rpi-3-32b-efi, u-boot-rpi-4-32b-efi,
u-boot-rpi-arm64-efi, u-boot-rpi-2-bin, u-boot-rpi-3_32b-bin,
u-boot-rpi-4_32b-bin, u-boot-rpi-arm64-bin, u-boot-rpi-2-efi-bin,
u-boot-rpi-3-32b-efi-bin, u-boot-rpi-4-32b-efi-bin,
u-boot-rpi-arm64-efi-bin): Delete variables.
* gnu/packages/raspberry-pi.scm (grub-efi-bootloader-chain-raspi-64):
Delete procedure.
* gnu/system/examples/raspberry-pi-64-nfs-root.tmpl (bootloader),
gnu/system/examples/raspberry-pi-64.tmpl (bootloader): Use new target
system.

Change-Id: I5139a0b00ec89189e8e7c84e06a7a3b7240259cd
2024-10-08 10:36:39 -04:00
Lilah Tascheter
e12dd189e8
gnu: bootloader: u-boot: Rewrite completely.
* gnu/bootloader/u-boot.scm (u-boot-bootloader): Delete variable.
(make-install-u-boot): Add procedure.
(define-u-bootloader): Add macro.
(u-boot-*-bootloader): Use define-u-bootloader.
(install-*u-boot): Remove variables.
* gnu/system/install.scm (os-with-u-boot): Remove procedure.
* doc/guix.texi (System Installation)[Building the Installation Image]:
Use beaglebone as the example.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
2024-10-08 10:36:39 -04:00
Lilah Tascheter
a0a99c446b
gnu: bootloader: extlinux: Rewrite completely.
* gnu/bootloader/extlinux.scm (install-extlinux-config): Add procedure.
(extlinux-configuration-file): Delete procedure.
(install-extlinux): Use install-extlinux-config.
(install-extlinux-mbr, install-extlinux-gpt): Delete variables.
(extlinux-bootloader): Update to new bootloader record.
(extlinux-gpt-bootloader): Update extlinux-bootloader-gpt to this.
(extlinux-bootloader-gpt): Deprecate variable.
* gnu/tests/install.scm (%minimal-extlinux-os)[bootloader]: Use proper
extlinux variable.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
2024-10-08 10:36:39 -04:00
Lilah Tascheter
f171385ab4
gnu: bootloader: depthcharge: Rewrite completely.
* gnu/bootloader/depthcharge (install-depthcharge): Add procedure.
(signed-kernel, depthcharge-configuration-file): Remove procedures.
(depthcharge-veyron-speedy-bootloader): Update depthcharge-bootloader.
(depthcharge-bootloader): Deprecate variable.
* doc/guix.texi (Bootloader Configuration): Document bootloader.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
2024-10-08 10:36:39 -04:00
Herman Rimm
a95413d299
gnu: system: image: Reduce subprocedure indentation.
* gnu/system/image.scm (system-disk-image): Reduce indentation.

Change-Id: I9cf59d3a61d0c6e7e90009e62661f74f774f090a
2024-10-08 10:36:38 -04:00
Lilah Tascheter
689cca0c75
gnu: Core bootloader changes.
Sorry this is a massive commit.  It's kinda impossible to split it
without either completely breaking basic functionality or making a buggy
shim layer that's written just to be immediately removed.

But anyway, this is the real body of the bootloader subsystem update.
One of my favorite new things possible with this is easy generation of
disk images using arbitrary bootloaders, including ones that require one
or more data/install partitions, such as p-boot or depthcharge!

* gnu/build/image.scm (initialize-root-partition): Don't install
bootloader here.
(make-iso9660-image): Pull in grub.dir instead of a bootcfg.
* gnu/build/install.scm (install-boot-config): Delete procedure.
* gnu/machine/ssh.scm (deploy-managed-host, roll-back-managed-host): Use
new bootloader system.
(operating-system)[bootloader]: Use wrap-element sanitizer and support
multiple bootloaders.
(operating-system-bootcfg): Rename to...
(operating-system-bootmeta): ...this.  Rewrite to return relevant
information instead of calling the config procedure directly.
(operating-system-boot-parameters): Support multiple bootloaders.
* gnu/system/boot.scm (read-boot-parameters): Support multiple
bootloaders.
* gnu/system/image.scm (root-partition-index): Delete procedure.
(system-disk-image, system-iso9960-image): Support new bootloader system.
(system-disk-image)[targets]: New subprocedure.
* guix/scripts/system.scm (install, install-bootloader-from-provenance,
perform-action): Support multiple bootloaders and work with new
bootloader system instead of bootcfgs.
(display-system-generation): Support multiple bootloaders.
* guix/scripts/system/reconfigure.scm (install-bootloader-program):
Rewrite to simply insert each bootloader's installer in the gexp
directly, instead of copying bootcfgs.
(install-bootloader): Work with new bootloader system.  Just in case,
add install-bootloader.scm to the gc roots too.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
2024-10-08 10:36:38 -04:00
Lilah Tascheter
d09d96bccc
gnu: bootloader: Update bootloader-configuration targets field.
* gnu/bootloader.scm (warn-update-targets): New procedure.
(bootloader-configuration)[targets]: Use warn-update-targets sanitizer.
* gnu/installer/parted.scm (bootloader-configuration): Use new target
field format.
* gnu/system/images/hurd.scm (hurd-barebones-os)[bootloader],
gnu/system/images/novena.scm (novena-barebones-os)[bootloader],
gnu/system/images/orangepi-r1-plus-lts-rk3328.scm
(orangepi-r1-plus-lts-rk3328-barebones-os)[bootloader],
gnu/system/images/pine64.scm (pine64-barebones-os)[bootloader],
gnu/system/images/pinebook-pro.scm
(pinebook-pro-barebones-os)[bootloader],
gnu/system/images/rock64.scm (rock64-barebones-os)[bootloader],
gnu/system/images/unmatched.scm (unmatched-barebones-os)[bootloader],
gnu/system/images/visionfive2.scm
(visionfive2-barebones-os)[bootloader]: Use new target format.
* gnu/system/install.scm (installation-os)[bootloader]: Use new format.
(embedded-installation-os): Use new format and adjust description.
(beaglebone-black-installation-os, a20-olinuxino-lime-installation-os,
a20-olinuxino-lime2-emmc-installation-os,
a20-olinuxino-micro-installation-os, bananapi-m2-ultra-installation-os,
firefly-rk3399-installation-os, mx6cuboxi-installation-os,
novena-installation-os, nintendo-nes-classic-edition-installation-os,
orangepi-r1-plus-lts-rk3328-installation-os, pine64-plus-installation-os,
pinebook-installation-os, rock64-installation-os,
rockpro64-installation-os, rk3399-puma-installation-os,
wandboard-installation-os): Don't guess block device.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
2024-10-08 10:36:38 -04:00
Lilah Tascheter
5a6f0fbc58
gnu: bootloader: grub: Rewrite entirely.
* gnu/bootloader.scm (bootloader-configuration)[terminal-outputs,
terminal-inputs]: Don't assume grub.
[%bootloader-configuration-targets]: Rename to the below.
(bootloader-configuration-targets): Delete procedure.
* gnu/bootloader/grub.scm (normalize-file, bootloader-theme, image->png,
grub-background-image, grub-locale-directory, eye-candy,
keyboard-layout-file, grub-setup-io, grub-root-search,
make-grub-configuration, grub-configuration-file,
grub-efi-configuration-file, install-grub, install-grub-disk-image,
install-grub-efi, install-grub-efi-removable, install-grub-efi32,
make-grub-efi-netboot-installer, make-grub-efi-netboot-bootloader):
Remove procedures.
(grub-cfg, grub-mkrescue-bootloader): Remove variables.
(grub-efi-removable-bootloader, grub-efi32-bootloader,
grub-efi-netboot-bootloader, grub-efi-netboot-removable-bootloader):
Deprecate variables.
(grub-configuration): Remove macro.
(sanitize, search/target, search/menu-entry, when-list, grub-theme-png,
core.cfg->core.img, core.cfg, core.img, menu-entry->gexp, make-grub.cfg,
grub.cfg, grub.dir, install-grub.dir, install-grub-bios,
install-grub-efi, deprecated-installer): Add procedures.
(%grub-default-targets, %netboot-targets): Add variables.
(keyboard-layout-file): Return computed file.
* gnu/packages/bootloaders.scm (make-grub-efi-netboot): Delete
procedure.
* doc/guix.texi (system Configuration)[Bootloader Configuration]: Update
terminal-outputs and terminal-inputs to not be GRUB-specific.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
2024-10-08 10:36:38 -04:00
Lilah Tascheter
b658d324df
gnu: bootloader: Remove obsolete bootloader fields.
* gnu/bootloader.scm (bootloader)[package, disk-image-installer,
configuration-file, configuration-file-generator]: Remove fields.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
2024-10-08 10:36:38 -04:00
Lilah Tascheter
0c2cbd77b9
teams: Add bootloading team.
Might as well, to help ease the transition.

* etc/teams.scm (bootloaders): New team.
(Lilah Tascheter): Create and add to above.

Change-Id: I63620f4e3151bb8e3d0bdf619fc70501af6397a0
2024-10-08 10:36:37 -04:00
Herman Rimm
10d2fc5890
gnu: bootloader: Match records outside the module.
* gnu/bootloader.scm (match-bootloader-configuration, match-menu-entry):
Add macros.

Change-Id: I42cb7541045314c37ffef98fe6efe7f46acd9d9b
2024-10-08 10:36:37 -04:00
Lilah Tascheter
79fe92ae16
gnu: bootloader: Install any bootloader to ESP.
* gnu/bootloader.scm (efi-arch, install-efi): New procedures.
(%efi-supported-systems, lazy-efibootmgr): New variables.
(bootloader-configuration)[efi-removable?, 32bit?]: New fields.
(match-bootloader-configuration, match-menu-entry): New macros.
* gnu/build/bootloader.scm (install-efi-loader): Delete procedure.
(install-efi): Rewrite to support installation of any efi bootloader.
* gnu/build/image.scm (initialize-efi32-partition): Deprecate.
(initialize-efi-partitition): Only create EFI directory.
* gnu/image.scm (partition)[target]: New field in order to support
dynamic provision of image partitions as bootloader targets.
* gnu/system/image.scm (root-partition, esp-partition): Use target
field.
* gnu/system/image.scm (esp32-partition, efi32-disk-partition,
efi32-raw-image-type): Deprecate.
* doc/guix.texi (Creating System Images)[image Reference]<partition
Reference>: Add target field.
[Instantiate an Image]: Update examples and update formatting.
<efi32-disk-image, efi32-raw-image-type>: Delete.
<pinebook-pro-image-type, rock64-image-type>: Reword slightly.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
2024-10-08 10:36:37 -04:00
Lilah Tascheter
35ac030f49
gnu: build: bootloader: Add efi-bootnums procedure.
* gnu/build/bootloader.scm (atomic-copy, efi-bootnums): Add procedures.
(in-temporary-directory): Add macro.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
2024-10-08 10:36:37 -04:00
Lilah Tascheter
b52e2a33f8
gnu: bootloader: Add device-subvol field to menu-entry record.
* gnu/bootloader.scm (menu-entry-device-subvol): Add and export field.
(normalize-file): Add procedure.
(device->sexp): Match device-subvol and include in S-expression.
(sexp->menu-entry): Try match device-subvol and include in menu-entry.
* gnu/system/boot.scm (boot-parameters->menu-entry): Add device-subvol
value to menu-entry.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
2024-10-08 10:36:37 -04:00
Lilah Tascheter
c2482d9e1d
gnu: bootloader: Add bootloader-configurations->gexp.
* gnu/bootloader.scm (bootloader)[default-targets]: Add field.
(target-overrides, normalize, bootloader-configuration->gexp,
bootloader-configurations->gexp): New procedures.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
2024-10-08 10:36:37 -04:00
Lilah Tascheter
3e536e9efd
gnu: bootloader: Add bootloader-target record and infastructure.
* gnu/bootloader.scm (bootloader-target): New record.
(&target-error): New condition.
(pathcat, get-target-of-type, parent-of, unfold-pathcat, target-base?,
type-major?, ensure, ensure-target-types, ensure-majors, gbegin): New
procedures.
(define-literal, with-targets, :path, :devpath, :device, :fs, :label,
:uuid): New macros.
* guix/ui.scm (call-with-error-handling)[target-error?]: Handle
target-errors.

Change-Id: I3f07c9096dd8b91c04449b6360b3b7d21640da14
2024-10-08 10:36:36 -04:00
Herman Rimm
38ca46212c
guix: records: Add wrap-element procedure.
* guix/records.scm (wrap-element): Add procedure.

Change-Id: If121c5d856e815776830282a0701a73e5ae2a7e7
2024-10-08 10:36:36 -04:00
Herman Rimm
d0767b5a23
guix: utils: Add flatten and flat-map from haunt.
* guix/utils.scm (flatten, flat-map): Add procedures.

Change-Id: I1d7d49fd02115e3de09ed69bcf5f55a10423162e
2024-10-08 10:36:36 -04:00
Lilah Tascheter
b25d63e198
guix: scripts: Rewrite reinstall-bootloader to use provenance data.
Looking up bootloaders by name is broken because (extlinux) bootloaders
share a name.  Also, bootloader-configuration data is significant to
bootloader installation, so it shouldn't just use the default values.
Installation can rely on the provenance service instead, which should be
present for the vast majority of systems.

* gnu/bootloader.scm (%bootloaders): Delete variable.
(lookup-bootloader-by-name, bootloader-modules): Delete procedures.
* guix/scripts/system.scm (install-bootloader-from-os,
install-bootloader-from-provenance): Add procedures.
(reinstall-bootloader): Remove procedure.
(switch-to-system-generation, process-command): Use
install-bootloader-from-provenance.

Change-Id: I5713a43ad4f9f32a129d980db06d70de16b03f27
2024-10-08 10:36:36 -04:00
Lilah Tascheter
a9fb42b3fd
guix: scripts: Remove unused code.
* guix/scripts/system.scm (bootloader-installer-script): Delete.

Change-Id: Ic1e0a523c814e4f1bf44b2721f5658f00066b0ab
2024-10-08 10:36:36 -04:00
Lilah Tascheter
545815bcbd
gnu: tests: reconfigure: Remove bootloader install test.
* gnu/tests/reconfigure.scm (%test-install-bootloader): Delete variable.
(run-install-bootloader-test): Delete procedure.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
2024-10-08 10:36:36 -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
Lilah Tascheter
fa711c6979
gnu: bootloader: Remove deprecated bootloader-configuration field.
* gnu/bootloader.scm (warn-target-field-deprecation): Delete sanitizer.
(bootloader-configuration)[target]: Remove deprecated field.
(bootloader-configuration-target): Delete procedure.
(bootloader-configuration-targets): Do not use target field.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
2024-10-08 10:36:35 -04:00
Felix Lechner
a1de2abd8e
Encapsulate <boot-parameters> to retain generation, system-path and epoch.
* gnu/system/boot.scm (<boot-alternative>): New record.
  (boot-alternative->menu-entry): New procedure.

* gnu/machine/ssh.scm (machine->boot-alternatives): Return a
  boot-alternative encapsulating previous return value.
  (deploy-managed-host): Get menu-entries from boot-alternatives.
  (roll-back-managed-host): Get parameters from boot-alternatives.

* guix/scripts/system.scm (generation->boot-parameters): Rename to...
  (generation->boot-alternative): ...this.  Return a boot-alternative
  encapsulating previous return value.
  (profile->boot-alternatives): Rename uses as above.
  (reinstall-bootloader, perform-action): Get menu-entries from
  boot-alternatives.

Change-Id: Iaef0b0a3fa9240ca8315a9699bcf4a7bfe908e33
2024-10-08 10:36:35 -04:00
Felix Lechner
4b2cfd9794
Split system->boot-parameters out of profile->boot-alternatives.
* guix/scripts/system.scm
  (profile->boot-alternatives)[system->boot-parameters]: Rename, process
  system and epoch, and move to...
  (generation->boot-parameters): ...here.
  (reinstall-bootloader): Use procedure above.

Change-Id: If31eeb4cef4f5a107a0ee5ad3f117bf38629ac38
2024-10-08 10:36:35 -04:00
Felix Lechner
8356f8c2ba
Give a separate name to a commonly used expression.
* gnu/machine/ssh.scm (roll-back-managed-host): Factor out a
  subexpression into new variable parameters.

Change-Id: I8d70684142bea736042d6c9dc8276ea7bdb9c181
2024-10-08 10:36:35 -04:00
Felix Lechner
b13726dd98
Rename two remote variables confusingly named 'generations'.
Both refer to data sets returned from the remote expression, and one of them
shadowed an element of itself.

* gnu/machine/ssh.scm (machine->boot-alternatives): Rename generations
  to remote-results.

Change-Id: Ibd8a3036126d9da1215cfc191884c0f54df637df
2024-10-08 10:36:35 -04:00
Felix Lechner
02b0324822
Rename boot-parameters to boot-alternatives when appropriate.
Throughout the code base, the token 'boot-parameters' refers to collection of
data that is stored on disk for each system generation. It was confusing to
use it for a list of such records. This comment imposes an alternative name.

* gnu/machine/ssh.scm (machine-boot-parameters): Rename to
  machine->boot-alternatives.
  (machine->boot-alternatives, roll-back-managed-host): Use
  boot-alternatives instead of boot-parameters as appropriate.
* guix/scripts/system.scm (profile-boot-parameters): Rename to
  profile->boot-alternatives.
  (reinstall-bootloader, perform-action): Use boot-alternatives instead
  of boot-parameters as appropriate.

Change-Id: Iabb04dbb39f42f989692bede7304f20a69bef9fb
2024-10-08 10:36:35 -04:00
Felix Lechner
5ec2223c71
Offer a uniform decorated-boot-label and use it.
* gnu/system/boot.scm (decorated-boot-label): New procedure.
* gnu/machine/ssh.scm (machine-boot-parameters): Use
  decorated-boot-label.
* guix/scripts/system.scm
  (profile-boot-parameters)[system->boot-parameters]: Use
  decorated-boot-label.

Change-Id: Id348c3047df2353f76b1bad0eb2a3e0fa17e474c
2024-10-08 10:36:35 -04:00
Felix Lechner
42d65fe2eb
Move epoch->date-string to gnu/system/boot.scm and use it elsewhere.
* guix/scripts/system.scm (profile-boot-parameters): Rename time to
  epoch to fit new procedure name.
  (epoch->date-string): Move to...
* gnu/system/boot.scm (epoch->date-string): ...here.
* gnu/machine/ssh.scm (machine-boot-parameters): Rename time to epoch.
  (machine-boot-parameters)[boot-parameters]: Use epoch->date-string.

Change-Id: I6a5f793567221f81edd7b2d8d9f0f3e801d1b113
2024-10-08 10:36:34 -04:00
Felix Lechner
cb491fdcba
Rename seconds->string procedure to epoch->date-string.
* guix/scripts/system.scm (seconds->string): Rename to
  epoch->date-string.
  (profile-boot-parameters)[boot-parameters]: Update as above.

Change-Id: I2b9aaa816b3ca84c32f7d6fa690245b149228310
2024-10-08 10:36:34 -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
Felix Lechner
8db7a8f1e2
Fix bug where the extra menu entries for a bootloader were shown twice.
The extra menu entries are already being added in each bootloaders, as
applicable.

* guix/scripts/system.scm (reinstall-bootloader)[entries]: Don't
  extraneously include bootloader-configuration-menu-entries here.

Change-Id: I8a600f2a5836ab4f7db5e27e25b0b8f432c3e1e0
2024-10-08 10:36:34 -04:00
Herman Rimm
f321a5022d
gnu: bootloader: Add orangepi-zero2w bootloader.
* gnu/bootloader/u-boot.scm (u-boot-orangepi-zero2w-bootloader): Add
variable.
* gnu/packages/bootloaders.scm (u-boot-orangepi-zero2w): Add variable.
* gnu/packages/firmware.scm (arm-trusted-firmware-sun50i-h616): Add
variable.

Change-Id: Idb43fdabac51b3301f3bea24fec72bfa29636489
2024-10-08 10:36:34 -04:00
Herman Rimm
0b06788009
gnu: u-boot-sandbox: Unconfigure CONFIG_RSA and CONFIG_TOOLS_LIBCRYPTO.
* gnu/packages/bootloaders.scm (u-boot-sandbox): Remove CONFIG_RSA and
CONFIG_TOOLS_LIBCRYPTO.
2024-10-08 10:36:34 -04:00