From 54adff2f84da25bafbd6693fca4dd6cf6f870d6d Mon Sep 17 00:00:00 2001 From: Julian Stecklina Date: Tue, 17 Oct 2023 17:15:46 +0200 Subject: [PATCH] erofs-utils: fix filesystem corruption issues When packaging a Nix store, erofs hits a bug in version 1.7: [36640.475349] erofs: (device loop0): erofs_read_inode: bogus i_mode (0) @ nid 0 cannot access '.../-tzdata-2023c/share/zoneinfo/Brazil/Acre': Structure needs cleaning Backport the fix from erofs master. --- pkgs/tools/filesystems/erofs-utils/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/filesystems/erofs-utils/default.nix b/pkgs/tools/filesystems/erofs-utils/default.nix index 163439c903ed..68dd0b9fc26c 100644 --- a/pkgs/tools/filesystems/erofs-utils/default.nix +++ b/pkgs/tools/filesystems/erofs-utils/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, fuse, util-linux, lz4, zlib +{ lib, stdenv, fetchurl, fetchpatch, autoreconfHook, pkg-config, fuse, util-linux, lz4, zlib , fuseSupport ? stdenv.isLinux }: @@ -13,6 +13,14 @@ stdenv.mkDerivation rec { hash = "sha256-tutSm7Qj6y3XecnanCYyhVSItLkeI1U6Mc4j8Rycziw="; }; + patches = [ + # Fixes #261394. Can be dropped with the next erofs version. + (fetchpatch { + url = "https://github.com/erofs/erofs-utils/commit/8cbc205185a18b9510f4c1fbd54957354f696321.patch"; + hash = "sha256-CQ5hxav5+HGnBVJW66St9FaVgkuqhkv89rjC/4cmXLs="; + }) + ]; + nativeBuildInputs = [ autoreconfHook pkg-config ]; buildInputs = [ util-linux lz4 zlib ] ++ lib.optionals fuseSupport [ fuse ];