optionally build nvramtool, put it and the .layout files in the initramfs

master
Adam Joseph 2 years ago
parent 7a93f3a128
commit 018e75000a

@ -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;

@ -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
'';

Loading…
Cancel
Save