mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 20:25:32 +03:00
nixos/systemd-boot: add test for devicetree
This commit is contained in:
parent
fca8ee915d
commit
22199c70d4
1 changed files with 18 additions and 1 deletions
|
@ -172,10 +172,23 @@ rec {
|
|||
imports = [ common ];
|
||||
specialisation.something.configuration = {
|
||||
boot.loader.systemd-boot.sortKey = "something";
|
||||
|
||||
# Since qemu will dynamically create a devicetree blob when starting
|
||||
# up, it is not straight forward to create an export of that devicetree
|
||||
# blob without knowing before-hand all the flags we would pass to qemu
|
||||
# (we would then be able to use `dumpdtb`). Thus, the following config
|
||||
# will not boot, but it does allow us to assert that the boot entry has
|
||||
# the correct contents.
|
||||
boot.loader.systemd-boot.installDeviceTree = pkgs.stdenv.hostPlatform.isAarch64;
|
||||
hardware.deviceTree.name = "dummy.dtb";
|
||||
hardware.deviceTree.package = lib.mkForce (pkgs.runCommand "dummy-devicetree-package" { } ''
|
||||
mkdir -p $out
|
||||
cp ${pkgs.emptyFile} $out/dummy.dtb
|
||||
'');
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
testScript = { nodes, ... }: ''
|
||||
machine.start()
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
|
||||
|
@ -188,6 +201,10 @@ rec {
|
|||
machine.succeed(
|
||||
"grep 'sort-key something' /boot/loader/entries/nixos-generation-1-specialisation-something.conf"
|
||||
)
|
||||
'' + pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isAarch64 ''
|
||||
machine.succeed(
|
||||
"grep 'devicetree .*dummy' /boot/loader/entries/nixos-generation-1-specialisation-something.conf"
|
||||
)
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue