From 24aacf38082fac4de98d4bc2275ae3db38d273aa Mon Sep 17 00:00:00 2001 From: "S. Nordin Abouzahra" Date: Sat, 20 Nov 2021 19:30:54 -0500 Subject: [PATCH] nilfs-utils: fix hardcoded paths /sbin/nilfs_cleanerd -> $out/bin/nilfs_cleanerd /sbin/badblocks -> ${e2fsprogs}/bin/badblocks The relevant binaries to test are mkfs.nilfs2 (calls badblocks), mount.nilfs2 and umount.nilfs2 (calls nilfs_cleanerd). --- pkgs/tools/filesystems/nilfs-utils/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/filesystems/nilfs-utils/default.nix b/pkgs/tools/filesystems/nilfs-utils/default.nix index 07c2c5292dcf..3c2dfaf2f1d3 100644 --- a/pkgs/tools/filesystems/nilfs-utils/default.nix +++ b/pkgs/tools/filesystems/nilfs-utils/default.nix @@ -1,4 +1,5 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, libuuid, libselinux }: +{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, libuuid, libselinux +, e2fsprogs }: stdenv.mkDerivation rec { pname = "nilfs-utils"; @@ -15,6 +16,12 @@ stdenv.mkDerivation rec { buildInputs = [ libuuid libselinux ]; + postPatch = '' + # Fix up hardcoded paths. + substituteInPlace lib/cleaner_exec.c --replace /sbin/ $out/bin/ + substituteInPlace sbin/mkfs/mkfs.c --replace /sbin/ ${lib.getBin e2fsprogs}/bin/ + ''; + # According to upstream, libmount should be detected automatically but the # build system fails to do this. This is likely a bug with their build system # hence it is explicitly enabled here.