nixos/limine: fix location for boot.loader.limine.additionalFiles (#539368)
This commit is contained in:
@@ -621,7 +621,7 @@ def install_bootloader() -> None:
|
||||
paths[config_file_path] = True
|
||||
|
||||
for dest_path, source_path in config("additionalFiles").items():
|
||||
dest_path = os.path.join(limine_install_dir, dest_path)
|
||||
dest_path = os.path.join(str(config("efiMountPoint")), dest_path)
|
||||
|
||||
copy_file(source_path, dest_path)
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
name = "additionalFiles";
|
||||
meta.maintainers = with lib.maintainers; [
|
||||
flokli
|
||||
];
|
||||
meta.platforms = [
|
||||
"x86_64-linux"
|
||||
];
|
||||
nodes.machine =
|
||||
{ ... }:
|
||||
{
|
||||
virtualisation.useBootLoader = true;
|
||||
virtualisation.useEFIBoot = true;
|
||||
boot.loader.limine.enable = true;
|
||||
boot.loader.limine.efiSupport = true;
|
||||
boot.loader.timeout = 0;
|
||||
|
||||
specialisation.withAdditionalFiles.configuration = { ... }: {
|
||||
boot.loader.limine.additionalFiles = {
|
||||
"efi/memtest86/memtest86.efi" = "${pkgs.memtest86-efi}/BOOTX64.efi";
|
||||
};
|
||||
};
|
||||
specialisation.withAdditionalFilesOther.configuration = { ... }: {
|
||||
boot.loader.limine.additionalFiles = {
|
||||
"efi/memtest86/memtest86.efi" = "${builtins.toFile "some-file" "some-content"}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
testScript =
|
||||
{ nodes, ... }:
|
||||
let
|
||||
withAdditionalFiles =
|
||||
nodes.machine.specialisation.withAdditionalFiles.configuration.system.build.toplevel;
|
||||
withAdditionalFilesOther =
|
||||
nodes.machine.specialisation.withAdditionalFilesOther.configuration.system.build.toplevel;
|
||||
in
|
||||
''
|
||||
machine.start()
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
|
||||
# switch to a generation with additional files and ensure they're present
|
||||
machine.succeed("${withAdditionalFiles}/bin/switch-to-configuration switch")
|
||||
machine.succeed("stat /boot/efi/memtest86/memtest86.efi")
|
||||
|
||||
# switch to the next generation with something else in there and ensure it got updated
|
||||
machine.succeed("${withAdditionalFilesOther}/bin/switch-to-configuration switch")
|
||||
assert machine.succeed("cat /boot/efi/memtest86/memtest86.efi").strip() == "some-content"
|
||||
'';
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
...
|
||||
}:
|
||||
{
|
||||
additionalFiles = runTest ./additional-files.nix;
|
||||
bios = runTest ./bios.nix;
|
||||
checksum = runTest ./checksum.nix;
|
||||
secureBoot = runTest ./secure-boot.nix;
|
||||
|
||||
Reference in New Issue
Block a user