From 410bedeb394958d69cfff793ec46b20973bfbbc8 Mon Sep 17 00:00:00 2001 From: KSJ2000 Date: Tue, 15 Oct 2024 14:33:53 +0300 Subject: [PATCH] dumpifs: init at 0-unstable-2020-05-07 --- pkgs/by-name/du/dumpifs/package.nix | 51 +++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 pkgs/by-name/du/dumpifs/package.nix diff --git a/pkgs/by-name/du/dumpifs/package.nix b/pkgs/by-name/du/dumpifs/package.nix new file mode 100644 index 00000000000000..f63fca8c8ef501 --- /dev/null +++ b/pkgs/by-name/du/dumpifs/package.nix @@ -0,0 +1,51 @@ +{ + clang, + fetchFromGitHub, + lib, + lzo, + lz4, + stdenv, + ucl, + zlib, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "dumpifs"; + version = "0-unstable-2020-05-07"; + + src = fetchFromGitHub { + owner = "askac"; + repo = "dumpifs"; + rev = "b7bac90e8312eca2796f2003a52791899eb8dcd9"; + hash = "sha256-vFiMKcPfowLQQZXlXbq5ZR1X6zr7u3iQwz3o4A6aQMY="; + }; + + buildInputs = [ + clang + lzo + lz4 + ucl + zlib + ]; + + postUnpack = '' + rm source/{dumpifs,exMifsLzo,uuu,zzz} + ''; + + preBuild = '' + sed -i '10i #include ' fixdecifs.c + sed -i '6i #include ' fixencifs.c + sed -i '/error(1, "decompression init failure");/{N;s/error(1, "decompression init failure");\n[[:space:]]*return 0;/fprintf(stderr, "decompression init failure");\n\t\t\texit(1);/}' exMifsLzo.c + ''; + + installPhase = '' + install -D dumpifs exMifsLz4 exMifsLzo fixdecifs fixencifs uuu zzz -t $out/bin + ''; + + meta = with lib; { + description = "Tool for those who are interested in hacking MIB2 firmware"; + homepage = "https://github.com/askac/dumpifs"; + platforms = platforms.unix; + mainProgram = "dumpifs"; + }; +})