From 018e75000a8e3d053548db1d7af33993c53740ed Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sat, 31 Dec 2022 13:56:57 -0800 Subject: [PATCH] optionally build nvramtool, put it and the .layout files in the initramfs --- src/platform/kgpe/default.nix | 7 +++++++ src/userspace/default.nix | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/platform/kgpe/default.nix b/src/platform/kgpe/default.nix index a7dcd91..31b27d6 100644 --- a/src/platform/kgpe/default.nix +++ b/src/platform/kgpe/default.nix @@ -18,6 +18,13 @@ in ''; }); + userspace = prev.userspace.overrideAttrs (a: { + postInstall = (a.postInstall or "") + '' + cp ${final.coreboot.src}/mainboard/asus/kgpe-d16/cmos.layout $out/etc/ + cp ${final.coreboot.src}/mainboard/asus/kgpe-d16/cmos.default $out/etc/ + ''; + }); + coreboot = let # does include spectre mitigations (performance hit) #linux-firmware = final.nixpkgsOnBuildForBuild.linux-firmware; diff --git a/src/userspace/default.nix b/src/userspace/default.nix index 48719cc..be5cdd4 100644 --- a/src/userspace/default.nix +++ b/src/userspace/default.nix @@ -15,11 +15,14 @@ , withLvm ? false , withCryptsetup ? false , withKexec ? false +, withNvramTool ? false # nixpkgsOnBuildForHost.stdenv.hostPlatform.isx86 }: let inherit (nixpkgsOnBuildForHost.pkgsStatic) stdenv busybox signify lvm2 cryptsetup kexec-tools findutils cpio; - + nvramtool = nixpkgsOnBuildForHost.pkgsStatic.nvramtool.overrideAttrs(a: { + NIX_CFLAGS_COMPILE = "-D__GLIBC__"; + }); in stdenv.mkDerivation { name = "ownerboot-initramfs-userspace"; dontUnpack = true; @@ -48,6 +51,8 @@ in stdenv.mkDerivation { cp ${cryptsetup}/bin/cryptsetup $out/bin/ '' + lib.optionalString withKexec '' cp ${kexec-tools}/bin/kexec $out/bin/ + '' + lib.optionalString withNvramTool '' + cp ${nvramtool}/bin/nvramtool $out/bin/ '' + '' runHook postInstall '';