aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Pässler <milan@petabyte.dev>2020-10-10 17:27:33 +0200
committerMilan Pässler <milan@petabyte.dev>2020-10-10 17:27:33 +0200
commit71f58551d83977397c3e6de795c31871c22d4d21 (patch)
tree98a136295bf343b6df654793f626faea12e3d313
parentbf204327ed2435251e99520a42854c42b03434ea (diff)
.
-rw-r--r--modules/coreboot/default.nix11
-rw-r--r--modules/grub2/default.nix5
-rw-r--r--pkgs/coreboot/default.nix2
3 files changed, 11 insertions, 7 deletions
diff --git a/modules/coreboot/default.nix b/modules/coreboot/default.nix
index 45706be546ea..a4ae0f675c3f 100644
--- a/modules/coreboot/default.nix
+++ b/modules/coreboot/default.nix
@@ -11,6 +11,7 @@ let
};
type = mkOption {
type = types.str;
+ default = "raw";
};
};
in {
@@ -34,13 +35,13 @@ in {
};
filteredFiles = filterAttrs (k: v: v != null) cfg.extraFiles;
- filesList = mapAttrsToList (k: v: v // { name = v; }) filteredFiles;
+ filesList = mapAttrsToList (k: v: v // { name = k; }) filteredFiles;
installCommands = concatMapStringsSep "\n" (file: ''
- cbfstool $out add \
- -f ${file.src} \
- -n ${file.name} \
- -t ${file.type}
+ cbfstool $out/coreboot.rom add \
+ -f "${file.src}" \
+ -n "${file.name}" \
+ -t "${file.type}"
'') filesList;
in pkgs.runCommand "coreboot-rom" {
diff --git a/modules/grub2/default.nix b/modules/grub2/default.nix
index 84aae528f828..c1993f2ea518 100644
--- a/modules/grub2/default.nix
+++ b/modules/grub2/default.nix
@@ -12,9 +12,12 @@ in {
config = lib.mkIf cfg.enable {
coreboot.extraFiles = {
"fallback/payload" = {
- type = "payload";
+ type = "simple elf";
src = "${pkgs.coreboot-payload-grub2}/default_payload.elf";
};
+ "grub.cfg" = {
+ src = ../../grub.cfg;
+ };
};
};
}
diff --git a/pkgs/coreboot/default.nix b/pkgs/coreboot/default.nix
index e4f932d1f81e..9e224c71a727 100644
--- a/pkgs/coreboot/default.nix
+++ b/pkgs/coreboot/default.nix
@@ -44,7 +44,7 @@ let
'';
};
- filteredConfig = lib.filterAttrs (n: v: v != null) (builtins.trace corebootConfig corebootConfig);
+ filteredConfig = lib.filterAttrs (n: v: v != null) corebootConfig;
lines = lib.mapAttrsToList (name: value: "${name}=${value}") filteredConfig;
configFile = writeText "config" (lib.concatStringsSep "\n" lines);
in stdenv.mkDerivation rec {