2023-04-15 18:35:02 +02:00
|
|
|
{
|
|
|
|
stdenv
|
|
|
|
, fetchzip
|
|
|
|
, gdb
|
|
|
|
}:
|
|
|
|
let kernel = fetchzip {
|
|
|
|
name = "linux";
|
|
|
|
url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.71.tar.gz";
|
|
|
|
hash = "sha256-pq6QNa0PJVeheaZkuvAPD0rLuEeKrViKk65dz+y4kqo=";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "preinit";
|
|
|
|
src = ./.;
|
|
|
|
|
2023-06-19 00:02:08 +02:00
|
|
|
# NIX_DEBUG=2;
|
2023-04-15 18:35:02 +02:00
|
|
|
hardeningDisable = [ "all" ];
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
$STRIP --remove-section=.note --remove-section=.comment preinit
|
2023-06-19 00:02:08 +02:00
|
|
|
ls -l preinit
|
2023-04-15 18:35:02 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = ["preinit"];
|
|
|
|
stripAllList = ["bin"];
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp preinit $out/bin
|
|
|
|
'';
|
|
|
|
}
|