Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos: Formally deprecate boot.loader.raspberryPi #241534

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2311.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

## Backward Incompatibilities {#sec-release-23.11-incompatibilities}

- The `boot.loader.raspberryPi` options have been marked deprecated, with intent for removal for NixOS 24.11. They had a limited use-case, and do not work like people expect. They required either very old installs ([before mid-2019](https://github.com/NixOS/nixpkgs/pull/62462)) or customized builds out of scope of the standard and generic AArch64 support. That option set never supported the Raspberry Pi 4 family of devices.

- `python3.pkgs.sequoia` was removed in favor of `python3.pkgs.pysequoia`. The latter package is based on upstream's dedicated repository for sequoia's Python bindings, where the Python bindings from [gitlab:sequoia-pgp/sequoia](https://gitlab.com/sequoia-pgp/sequoia) were removed long ago.

- `writeTextFile` now requires `executable` to be boolean, values like `null` or `""` will now fail to evaluate.
Expand Down
64 changes: 55 additions & 9 deletions nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ in
Whether to create files with the system generations in
`/boot`.
`/boot/old` will hold files from old generations.

::: {.note}
These options are deprecated, unsupported, and may not work like expected.
:::
'';
};

Expand All @@ -67,6 +71,10 @@ in
type = types.bool;
description = lib.mdDoc ''
Enable using uboot as bootmanager for the raspberry pi.

::: {.note}
These options are deprecated, unsupported, and may not work like expected.
:::
'';
};

Expand All @@ -76,6 +84,10 @@ in
type = types.int;
description = lib.mdDoc ''
Maximum number of configurations in the boot menu.

::: {.note}
These options are deprecated, unsupported, and may not work like expected.
:::
'';
};

Expand All @@ -87,19 +99,53 @@ in
description = lib.mdDoc ''
Extra options that will be appended to `/boot/config.txt` file.
For possible values, see: https://www.raspberrypi.com/documentation/computers/config_txt.html

::: {.note}
These options are deprecated, unsupported, and may not work like expected.
:::
'';
};
};
};

config = mkIf cfg.enable {
assertions = singleton {
assertion = !pkgs.stdenv.hostPlatform.isAarch64 || cfg.version >= 3;
message = "Only Raspberry Pi >= 3 supports aarch64.";
};
config = mkMerge[
(mkIf cfg.uboot.enable {
warnings = [
''
The option set for `boot.loader.raspberrypi.uboot` has been recommended against
for years, and is now formally deprecated.

It is possible it already did not work like you expected.

It never worked on the Raspberry Pi 4 family.

These options will be removed by NixOS 24.11.
''
];
})
(mkIf cfg.enable {
warnings = [
''
The option set for `boot.loader.raspberrypi` has been recommended against
for years, and is now formally deprecated.

It is possible it already did not work like you expected.

It never worked on the Raspberry Pi 4 family.

These options will be removed by NixOS 24.11.
''
];
})
(mkIf cfg.enable {
assertions = singleton {
assertion = !pkgs.stdenv.hostPlatform.isAarch64 || cfg.version >= 3;
message = "Only Raspberry Pi >= 3 supports aarch64.";
};

system.build.installBootLoader = builder;
system.boot.loader.id = "raspberrypi";
system.boot.loader.kernelFile = pkgs.stdenv.hostPlatform.linux-kernel.target;
};
system.build.installBootLoader = builder;
system.boot.loader.id = "raspberrypi";
system.boot.loader.kernelFile = pkgs.stdenv.hostPlatform.linux-kernel.target;
})
];
}