Commit Graph

434 Commits

Author SHA1 Message Date
stuebinm
6afb255d97 nixos: remove all uses of lib.mdDoc
these changes were generated with nixq 0.0.2, by running

  nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix

two mentions of the mdDoc function remain in nixos/, both of which
are inside of comments.

Since lib.mdDoc is already defined as just id, this commit is a no-op as
far as Nix (and the built manual) is concerned.
2024-04-13 10:07:35 -07:00
pennae
4e21f361d6
Merge pull request #154952 from colemickens/extlinux
extlinux-conf-builder: specialisations entries
2024-04-09 18:49:08 +02:00
r-vdp
a8ab8b59a7
systemd-boot: introduce options to set a sort-key for systemd-boot entries
Without sort-keys specified on entries, the entries are sorted only by
file name (in decreasing order, so starting at the end of the alphabet!),
without taking any other fields into account (see
[the boot loader specification reference][1]).
Moreover, entries without a sort-key are always ordered after all
entries with a sort-key, so by not adding a sort-key to the NixOS ones,
we cannot add a sort-key to any other entry while keeping it below the
NixOS entries.

So currently we have options to set the file names for additional entries like
memtest and netbootxyz.
However, as mentioned above, the sorting by file name is not very intuitive and
actually sorts in the opposite order of what is currently mentioned in the option
descriptions.

With this commit, we set a configurable sort-key on all NixOS entries,
and add options for setting the sort-keys for the memtest and netbootxyz
entries.
The sorting by sort-key is more intuitive (it starts at the start of the
alphabet) and also takes into account the machine-id and version for entries
with identical sort-keys.

We use a bootspec extension to store the sort keys, which allows us to
redefine the sort key for individual specialisations without needing any
special casing.

[1]: https://uapi-group.org/specifications/specs/boot_loader_specification/#sorting
2024-03-02 02:11:32 +01:00
Siddhartha
b470b4432d nixos/systemd-boot: Add support for an XBOOTLDR partition 2024-02-26 21:55:49 -05:00
Jared Baur
a786cc0227
nixos/systemd-boot: fix cross for lint check
Since we are not in a `callPackage` context, dependencies in
`nativeBuildInputs` don't get spliced to the buildPlatform, causing a
cross-compiled nixos system to fail at this step when running mypy built
for the hostPlatform.
2024-02-24 08:58:57 -06:00
Jörg Thalheim
202e697233 nixos/systemd-boot: fix editor option 2024-01-31 10:46:30 +07:00
Julien Malka
ceeddc5b15 nixos/systemd-boot: move builder script in bin folder 2024-01-27 01:29:40 +00:00
Niklas Hambüchen
aa6c8ae3a6
Merge pull request #253488 from nh2/install-grub-dont-stat-network-fs
install-grub.pl: Do stat() last to not hang on hanging network FS
2024-01-23 16:36:49 +01:00
Niklas Hambüchen
b9ba9df3e8 install-grub.pl: Do stat() last to not hang on hanging network FS 2024-01-23 15:34:40 +00:00
Julien Malka
42ad0d80ce
Merge pull request #281639 from Mic92/systemd-refactoring 2024-01-19 19:42:32 +01:00
Zolo
c9e7344950
Update systemd-boot.nix
Extending the systemd-boot information and where to find more information.
2024-01-19 14:01:26 +01:00
Jörg Thalheim
4a20af3932 nixos/systemd-boot: move all template variables in one place
This makes it easier to reason about what variables are inserted during packaging.
We also make sure that template file is also valid python syntax, which makes editor errors go away during development.
2024-01-17 22:53:17 +01:00
Ryan Lahfa
176e84d44f
Revert "nixos/systemd-boot: init boot counting" 2024-01-11 01:00:43 +01:00
Julien Malka
eb435897a6 nixos/systemd-boot: init boot counting 2024-01-07 11:34:09 +00:00
Raito Bezarius
b3d998e7ea boot/loader/systemd-boot: BootSpec makes initrdSecrets optional
A bootspec could remove the `initrdSecrets` attribute and is a perfectly valid bootspec, as can be seen
in the bootspec.cue.

This makes the builder not fail upon missing `initrdSecrets`.
2024-01-04 23:11:22 +01:00
Luflosi
c71cb77cd6
nixos/grub: use the correct ZFS version
When `config.boot.zfs.enableUnstable` is set to true, grub was built with the `zfs` package even though the rest of the system uses the `zfsUnstable` package.
The effect of this can only be seen when `zfs` and `zfsUnstable` actually differ (which is not currently the case), for example when overriding one of them locally.
2023-12-29 01:53:27 +01:00
Will Fancher
b606ebb355
Merge pull request #266990 from ElvishJerricco/systemd-boot-boot-pass-flags-to-update
nixos/systemd-boot: pass EFI variable flags during update too
2023-11-18 12:34:10 -05:00
Julien Malka
81e378618e
nixos/systemd-boot: allow for bootspec-less generations
Generation built with old versions of NixOS with no bootspec
support may still be present on the system and must be
accounted for.
2023-11-17 14:39:04 +01:00
Ryan Lahfa
75fbff2576
Merge pull request #263442 from JulienMalka/systemd-boot-bootspec 2023-11-15 08:40:19 +01:00
Julien Malka
372d07dc29 nixos/systemd-boot: conform backend to RFC-0125
Now the builder is using Bootspec documents.
2023-11-14 20:37:07 +01:00
Thomas Watson
ca84c463b9 nixos/systemd-boot: pass EFI variable flags during update too
8f2babd032 was partially reverted by mistake. Original message below

---

On some systems, EFI variables are not supported or otherwise wonky.
bootctl attempting to access them causes failures during bootloader
installations and updates. For such systems, NixOS provides the options
`boot.loader.efi.canTouchEfiVariables` and
`boot.loader.systemd-boot.graceful` which pass flags to bootctl that
change whether and how EFI variables are accessed.

Previously, these flags were only passed to bootctl during an install
operation. However, they also apply during an update operation, which
can cause the same sorts of errors. This change passes the flags during
update operations as well to prevent those errors.

Fixes https://github.com/NixOS/nixpkgs/issues/151336
2023-11-12 02:07:25 -05:00
Anthony Roussel
e30f48be94
treewide: fix redirected and broken URLs
Using the script in maintainers/scripts/update-redirected-urls.sh
2023-11-11 10:49:01 +01:00
Julien Malka
33df4d3447
nixos/systemd-boot: add julienmalka as maintainer 2023-11-04 02:38:11 +01:00
Martin Weinelt
0e4b63f713 Revert "nixos/systemd-boot: Avoid remote mypy executions"
This reverts commit ea0dcd0ae1.
2023-10-23 03:38:13 +02:00
Bjørn Forsman
142074c2a8 nixos: fix bad mkEnableOption descriptions
Fix descriptions that don't account for (1) the "Whether to enable"
prefix or (2) the automatically added trailing dot.
2023-10-20 16:22:40 +01:00
nicoo
ea0dcd0ae1 nixos/systemd-boot: Avoid remote mypy executions 2023-10-19 20:58:52 +01:00
Jörg Thalheim
b7057368c8 systemd-boot-builder: add missing fsync in atomic writes
write(2) and close(2) doesn't ensure the file content actually got synched, so let's also fsync before doing the rename
2023-10-10 14:49:51 +02:00
Jörg Thalheim
865a2cf8c1 Revert "nixos/systemd-boot: skip EFI update to 252"
This reverts commit 80665d606a.

Parsing the package version broke our systemd-boot builder test.

i.e. it won't be able to parse systemd-boot efi binaries coming from
ubuntu

We no longer use the faulty systemd-boot version so this code should no
longer be needed.
2023-10-10 14:49:51 +02:00
Jörg Thalheim
b7fbd1ffd4 systemd-boot-builder: use regex prefix string
otherwise there are warnings for \.
2023-10-10 14:49:51 +02:00
Jörg Thalheim
5ee9fdf929 systemd-boot-builder: use new builtin typing style 2023-10-10 14:49:51 +02:00
Jörg Thalheim
e20a886f87 systemd-boot-builder: drop unused import 2023-10-10 14:49:51 +02:00
Jörg Thalheim
a17f41ed0b systemd-boot-builder: replace mkdir_p function with stdlib equivalent 2023-10-10 14:49:51 +02:00
Jörg Thalheim
f4bf9702be systemd-boot-builder: always do syncfs, even after a failure 2023-10-10 14:49:51 +02:00
Jörg Thalheim
dbac7467ad systemd-boot-builder: drop semicolons
this is python, not C.
2023-10-10 14:49:51 +02:00
Jörg Thalheim
1f70361d08 systemd-boot-builder: resort imports according to isort
foo
2023-10-10 14:49:51 +02:00
Yureka
6500b4580c
Revert "nixos/boot/rasbperrypi: add support for boot.initrd.secret with uboot (#240358)" (#257251)
This reverts commit 94e939985b.
2023-09-25 14:22:51 +02:00
digital
94e939985b
nixos/boot/rasbperrypi: add support for boot.initrd.secret with uboot (#240358)
Co-authored-by: digital <didev@dinid.net>
2023-09-23 14:32:09 +02:00
Anders Kaseorg
191dee486f nixos/systemd-boot: Fix Memtest86+ name.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2023-09-10 18:44:20 -07:00
dev-null-undefined
a39526b3ef
nixos/grub: Add submenu for each generation with specialisation
Before this commit there was no way to access (boot into) specialisation of previous generations from grub,even tho they are there.

This commit will add grub submenu for each generation if the generation has any specialisation.
Which will allow you to boot into them.

Co-authored-by: Samuel Dionne-Riel <samuel@dionne-riel.com>
2023-08-21 21:44:42 +02:00
Maciej Krüger
56700d64b1
Merge pull request #226821 from enc0urage/memtest 2023-08-16 15:31:32 +02:00
enc0urage
00d7065913 nixos/systemd-boot: Replace proprietary memtest86 with free memtest86+ in UEFI 2023-08-14 03:05:24 +00:00
enc0urage
1488a2bc1a nixos/grub: Replace proprietary memtest86 with free memtest86+ in UEFI mode 2023-08-13 12:04:34 +00:00
Samuel Dionne-Riel
1d416595ad nixos/grub: Remove with with broad scopes.
There is only other `with` with a somewhat broad scope, `with pkgs`, but
it's used in a place where it would become awkward to change out. And
anyway its scope is rather limited still.
2023-08-01 19:18:48 -04:00
Samuel Dionne-Riel
c867c6d172 nixos/grub: Insert required image modules for themes
With a limited testing of all packaged GRUB 2 themes (pkgs.nixos-grub2-theme)
this is tested to work.

Without this change, the theme loading will error out (waiting for a key press).

With this change, the theme loads and works as expected.
2023-08-01 18:56:03 -04:00
Samuel Dionne-Riel
50063bf9d6 nixos/grub: Add support for timeoutStyle 2023-08-01 18:56:03 -04:00
Samuel Dionne-Riel
f12b216574 nixos/grub: Fix extraFiles in subdirectories
This directly copies the systemd-boot logic, which works.

`install` with `-D` will create all leading directory components.
2023-08-01 18:54:27 -04:00
Samuel Dionne-Riel
894d47f989 nixos/grub: Always install with bootloader id
The intent was to not pass the flag when installing as removable. In
reality there is a third case, where you may not want to touch EFI
variables, and not want to install as removable.

In that case, it would install to the generic \EFI\grub\grubx64.efi,
which is not a good choice in any cases. The operating system should
"own" their path under \EFI\ to be a good citizen [citation needed].

With this change, there can be only two paths GRUB can be installed to:

 - \EFI\NixOS-boot\grubx64.efi
 - \EFI\BOOT\bootx64.efi

This removes the surprising behaviour where GRUB may be installed to a
different location only because we configured NixOS not to touch EFI
variables.

It may be necessary under some configurations to install GRUB without
touching EFI variables, but to the NixOS-owned location.
2023-08-01 18:54:27 -04:00
Pol Dellaiera
fd304ecc8a
Merge pull request #236027 from iliana/grub-dont-die
nixos/grub: don't die on EFI-only systems if devices != ["nodev"]
2023-07-28 17:26:24 +02:00
Felix Bühler
0a2745684e
Merge pull request #239624 from Stunkymonkey/use-optionalString-then
treewide: use optionalString instead of 'then ""'
2023-07-22 13:02:47 +02:00
Samuel Dionne-Riel
a6e61a1ea9 nixos: Formally deprecate boot.loader.raspberryPi
The whole option set was recommended against since mid-2019, and never
worked with the Raspberry Pi 4 family of devices.

We should have deprecated it in early 2020 for removal by 2021. At the
time I did not feel confident in making such a decision, and never
ended-up getting around to it.

The ***only*** supported-by-NixOS boot methods for AArch64 are
standards-based boot methods, namely UEFI or the pragmatically
almost-standard extlinux-compatible for U-Boot.

You can quote me on that.
2023-07-04 13:42:57 -04:00