Merge pull request #169985 from trofi/fix-systemd-boot-on-aarch64

systemd: disable EFI stripping
This commit is contained in:
Bernardo Meurer 2022-04-26 18:35:00 -07:00 committed by GitHub
commit 786dfea2c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -666,6 +666,18 @@ stdenv.mkDerivation {
rm -rf $out/share/doc
'';
# Avoid *.EFI binary stripping. At least on aarch64-linux strip
# removes too much from PE32+ files:
# https://github.com/NixOS/nixpkgs/issues/169693
# The hack is to move EFI file out of lib/ before doStrip
# run and return it after doStrip run.
preFixup = lib.optionalString withEfi ''
mv $out/lib/systemd/boot/efi $out/dont-strip-me
'';
postFixup = lib.optionalString withEfi ''
mv $out/dont-strip-me $out/lib/systemd/boot/efi
'';
passthru = {
# The interface version prevents NixOS from switching to an
# incompatible systemd at runtime. (Switching across reboots is