Merge pull request #287964 from linyinfeng/shim

shim-unsigned: build and install MOKManager and fallback

authored by Linus Heckemann and committed by GitHub 4635cbb9 6409be11

+13 -11
+13 -11
pkgs/tools/misc/shim/default.nix
··· 6 6 inherit (stdenv.hostPlatform) system; 7 7 throwSystem = throw "Unsupported system: ${system}"; 8 8 9 - target = { 10 - x86_64-linux = "shimx64.efi"; 11 - aarch64-linux = "shimaa64.efi"; 9 + archSuffix = { 10 + x86_64-linux = "x64"; 11 + aarch64-linux = "aa64"; 12 12 }.${system} or throwSystem; 13 13 in stdenv.mkDerivation rec { 14 14 pname = "shim"; ··· 28 28 29 29 makeFlags = 30 30 lib.optional (vendorCertFile != null) "VENDOR_CERT_FILE=${vendorCertFile}" 31 - ++ lib.optional (defaultLoader != null) "DEFAULT_LOADER=${defaultLoader}" 32 - ++ [ target ]; 31 + ++ lib.optional (defaultLoader != null) "DEFAULT_LOADER=${defaultLoader}"; 33 32 34 - installPhase = '' 35 - mkdir -p $out/share/shim 36 - install -m 644 ${target} $out/share/shim/ 37 - ''; 33 + installTargets = ["install-as-data"]; 34 + installFlags = [ 35 + "DATATARGETDIR=$(out)/share/shim" 36 + ]; 38 37 39 38 passthru = { 40 - # Expose the target file name so that consumers 39 + # Expose the arch suffix and target file names so that consumers 41 40 # (e.g. infrastructure for signing this shim) don't need to 42 41 # duplicate the logic from here 43 - inherit target; 42 + inherit archSuffix; 43 + target = "shim${archSuffix}.efi"; 44 + mokManagerTarget = "mm${archSuffix}.efi"; 45 + fallbackTarget = "fb${archSuffix}.efi"; 44 46 }; 45 47 46 48 meta = with lib; {