mkuserimg_mke2fs finds its sub tools in the same directory

So far, mkuserimg_mke2fs ran only in the Make world. Now, it will be
run in the Soong world via the new android_filesystem module.

But the problem is that, when running in Soong, the PATH environment
variable doesn't point to the host binary directory (e.g.
out/soong/host/linux-x86/bin). This is a problem for this script because
sub tools like mke2fs and e2fsdroid have been invoked just by their
names expecting that they will be under PATH.

To fix this problem, the tool now tries to find the sub tools in the
same directory as this script is located at, which would be the host
binary directory.

Bug: 172414391
Test: m
Change-Id: Ia42d0b2533357f20c4dcf1cb7d2587c35165b799
1 file changed