Merge pull request #287964 from linyinfeng/shim

shim-unsigned: build and install MOKManager and fallback
This commit is contained in:
Linus Heckemann 2024-03-28 08:43:14 +01:00 committed by GitHub
commit 4635cbb9df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 11 deletions

View File

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