From 20328bee63ab9c4ad5505e59744bedc75ef3d036 Mon Sep 17 00:00:00 2001 From: Jared Baur Date: Thu, 12 Dec 2024 12:37:24 -0800 Subject: [PATCH] flash-tools: add back missing lz4c program Since https://github.com/lz4/lz4/commit/65998fecaffe7828df7b2bd9c04e9392e9704a0b, the lz4c symlink no longer exists, but is wanted by `flash.sh`. The `lz4` program adds a set of legacy cmdline flags when `argv[0]` is `lz4c` (see https://github.com/lz4/lz4/blob/6cf42afbea04c9ea6a704523aead273715001330/programs/lz4cli.c#L444), however NVIDIA doesn't use any of these legacy flags in `flash.sh`, they only require the `lz4c` program to be in PATH. --- pkgs/flash-tools/default.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pkgs/flash-tools/default.nix b/pkgs/flash-tools/default.nix index 6c84f4e..8a3b14f 100644 --- a/pkgs/flash-tools/default.nix +++ b/pkgs/flash-tools/default.nix @@ -29,7 +29,7 @@ , openssl , bspSrc , l4tVersion -, +, symlinkJoin }: let @@ -121,13 +121,22 @@ let python3 util-linux dosfstools - lz4 bc openssl # Needed by bootloader/tegraflash_impl_t234.py gcc dtc + + # flash.sh wants lz4c, which used to be a symlink to lz4, but does not + # exist in more recent nixpkgs. + (symlinkJoin { + inherit (lz4) name; + paths = [ (lib.getBin lz4) ]; + postBuild = '' + ln -sf $out/bin/lz4{,c} + ''; + }) ]; };