Use makeWrapper to wrap lanzatool
This commit is contained in:
parent
7245142c55
commit
521bf343f5
18
flake.nix
18
flake.nix
|
@ -16,6 +16,8 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
lib = pkgs.lib;
|
||||||
|
|
||||||
rust-nightly = pkgs.rust-bin.fromRustupToolchainFile ./rust/lanzaboote/rust-toolchain.toml;
|
rust-nightly = pkgs.rust-bin.fromRustupToolchainFile ./rust/lanzaboote/rust-toolchain.toml;
|
||||||
|
|
||||||
naersk-nightly = pkgs.callPackage naersk {
|
naersk-nightly = pkgs.callPackage naersk {
|
||||||
|
@ -78,13 +80,17 @@
|
||||||
buildInputs = [ pkgs.binutils ];
|
buildInputs = [ pkgs.binutils ];
|
||||||
};
|
};
|
||||||
|
|
||||||
lanzatool = pkgs.writeShellScriptBin "lanzatool" ''
|
lanzatool = pkgs.runCommand "lanzatool" {
|
||||||
set -euo pipefail
|
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||||
|
} ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
|
||||||
export LANZABOOTE_STUB=${lanzaboote}/bin/lanzaboote.efi
|
# Clean PATH to only contain what we need to do objcopy. Also
|
||||||
export LANZABOOTE_INITRD_STUB=${initrd-stub}/bin/initrd-stub.efi
|
# tell lanzatool where to find our UEFI binaries.
|
||||||
|
makeWrapper ${lanzatoolBin}/bin/lanzatool $out/bin/lanzatool \
|
||||||
${lanzatoolBin}/bin/lanzatool "$@"
|
--set PATH ${lib.makeBinPath [ pkgs.binutils-unwrapped ]} \
|
||||||
|
--set LANZABOOTE_STUB ${lanzaboote}/bin/lanzaboote.efi \
|
||||||
|
--set LANZABOOTE_INITRD_STUB ${initrd-stub}/bin/initrd-stub.efi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# A script that takes an initrd and turns it into a PE image.
|
# A script that takes an initrd and turns it into a PE image.
|
||||||
|
|
Loading…
Reference in New Issue