mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-20 04:19:00 +02:00
shim-unsigned: install all targets as data
This commit is contained in:
parent
bb2b73df7b
commit
19280a7ce4
|
@ -6,9 +6,9 @@ let
|
|||
inherit (stdenv.hostPlatform) system;
|
||||
throwSystem = throw "Unsupported system: ${system}";
|
||||
|
||||
target = {
|
||||
x86_64-linux = "shimx64.efi";
|
||||
aarch64-linux = "shimaa64.efi";
|
||||
archSuffix = {
|
||||
x86_64-linux = "x64";
|
||||
aarch64-linux = "aa64";
|
||||
}.${system} or throwSystem;
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "shim";
|
||||
|
@ -28,19 +28,21 @@ in stdenv.mkDerivation rec {
|
|||
|
||||
makeFlags =
|
||||
lib.optional (vendorCertFile != null) "VENDOR_CERT_FILE=${vendorCertFile}"
|
||||
++ lib.optional (defaultLoader != null) "DEFAULT_LOADER=${defaultLoader}"
|
||||
++ [ target ];
|
||||
++ lib.optional (defaultLoader != null) "DEFAULT_LOADER=${defaultLoader}";
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/shim
|
||||
install -m 644 ${target} $out/share/shim/
|
||||
'';
|
||||
installTargets = ["install-as-data"];
|
||||
installFlags = [
|
||||
"DATATARGETDIR=$(out)/share/shim"
|
||||
];
|
||||
|
||||
passthru = {
|
||||
# Expose the target file name so that consumers
|
||||
# Expose the arch suffix and target file names so that consumers
|
||||
# (e.g. infrastructure for signing this shim) don't need to
|
||||
# duplicate the logic from here
|
||||
inherit target;
|
||||
inherit archSuffix;
|
||||
target = "shim${archSuffix}.efi";
|
||||
mokManagerTarget = "mm${archSuffix}.efi";
|
||||
fallbackTarget = "fb${archSuffix}.efi";
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
|
|
Loading…
Reference in a new issue