cgpt_wrapper: Resolve the path to "cgpt" command

Because we do not use "execvp", "cgpt.bin" is not resolved to the same
directory as "cgpt". So we need to resolve the original command to its
absolute path first, then append ".bin" to it.

BUG=None
BRANCH=None
TEST="cgpt" no longer fails.

Change-Id: Id22c2d97616867125e9744c00bbf527f8a176df4
Reviewed-on: https://chromium-review.googlesource.com/242294
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Nam Nguyen <namnguyen@chromium.org>
Commit-Queue: Nam Nguyen <namnguyen@google.com>
1 file changed