anchor.diff: -{ stdenv, lib, fetchgit, perl, cdrkit, syslinux, xz, openssl, gnu-efi
  +{ stdenv, lib, fetchgit, perl, cdrkit, syslinux, xz, openssl, gnu-efi, mtools
   , embedScript ? null
  +, additionalTargets ? {}
   }:
   
   let
     date = "20190318";
     rev = "ebf2eaf515e46abd43bc798e7e4ba77bfe529218";
  -  targets = (lib.optional stdenv.isx86_64 "bin-x86_64-efi/ipxe.efi") ++ [
  -    "bin/ipxe.dsk"
  -    "bin/ipxe.usb"
  -    "bin/ipxe.iso"
  -    "bin/ipxe.lkrn"
  -    "bin/undionly.kpxe"
  -  ];
  +  targets = additionalTargets // lib.optionalAttrs stdenv.isx86_64 {
  +    "bin-x86_64-efi/ipxe.efi" = null;
  +    "bin-x86_64-efi/ipxe.efirom" = null;
  +    "bin-x86_64-efi/ipxe.usb" = "ipxe-efi.usb";
  +  } // {
  +    "bin/ipxe.dsk" = null;
  +    "bin/ipxe.usb" = null;
  +    "bin/ipxe.iso" = null;
  +    "bin/ipxe.lkrn" = null;
  +    "bin/undionly.kpxe" = null;
  +  };
   in
   
   stdenv.mkDerivation {
     name = "ipxe-${date}-${builtins.substring 0 7 rev}";
   
  -  buildInputs = [ perl cdrkit syslinux xz openssl gnu-efi ];
  +  nativeBuildInputs = [ perl cdrkit syslinux xz openssl gnu-efi mtools ];
   
     src = fetchgit {
       url = https://git.ipxe.org/ipxe.git;
  
positive.code:       homepage = http://ipxe.org/;
        license = licenses.gpl2;
        maintainers = with maintainers; [ ehmry ];
        platforms = platforms.all;
      };
  }
  
negative.code: 
    preBuild = "cd src";
  
    buildFlags = lib.attrNames targets;
  
    installPhase = ''
      mkdir -p $out
      ${lib.concatStringsSep "\n" (lib.mapAttrsToList (from: to:
        if to == null
        then "cp -v ${from} $out"
        else "cp -v ${from} $out/${to}") targets)}
  
      # Some PXE constellations especially with dnsmasq are looking for the file with .0 ending
      # let's provide it as a symlink to be compatible in this case.
  