]> git.sesse.net Git - bcachefs-tools-debian/commit
make: correct path to 'bcachefs' in mkfs/fsck scripts
authorAustin Seipp <aseipp@pobox.com>
Fri, 15 Dec 2017 23:39:12 +0000 (17:39 -0600)
committerAustin Seipp <aseipp@pobox.com>
Sun, 17 Dec 2017 18:46:45 +0000 (12:46 -0600)
commit8acc54456e11ee0ec80ed0c6abb6d68abae60592
tree61a74c8bd928fb425d90fe0c39b59598a03049fe
parent5053c6ed2521ec83bde641f6dba21d7efa4a81ec
make: correct path to 'bcachefs' in mkfs/fsck scripts

The fsck and bcachefs scripts simply worked by running 'exec bcachefs
...', but this executes whatever is out of `$PATH`, which is likely not
what a user expected when working inside the bcachefs-tools tree.

This replaces the local uses of 'exec bcachefs' to use bash's
readlink/dirname builtins in order to find the location of the currently
executing wrapper, and execute the 'bcachefs' tool from there.

This allows executing these wrappers from anywhere, provided 'bcachefs'
is just right next to them, with the correct semantics.

As a result, this also allows removing a tiny hack from the Nix
expressions, allowing the included default.nix to use completely
standard mkDerivation builders, with no extra patch/fixup phases.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
default.nix
fsck.bcachefs
mkfs.bcachefs