Use unsquashfs specified by caller if possible am: f68e825640 am: 96522de5d4 am: f3a5ccd67c

Original change: https://android-review.googlesource.com/c/platform/system/update_engine/+/2624712

Change-Id: I993cef131d16fc23c48a53682fdc463a1ad90bdf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/payload_generator/squashfs_filesystem.cc b/payload_generator/squashfs_filesystem.cc
index 22b431d..4129349 100644
--- a/payload_generator/squashfs_filesystem.cc
+++ b/payload_generator/squashfs_filesystem.cc
@@ -72,7 +72,11 @@
   ScopedTempFile map_file("squashfs_file_map.XXXXXX");
   // Run unsquashfs to get the system file map.
   // unsquashfs -m <map-file> <squashfs-file>
-  vector<string> cmd = {"unsquashfs", "-m", map_file.path(), sqfs_path};
+  const char* unsquashfs = getenv("UNSQUASHFS");
+  if (unsquashfs == nullptr || unsquashfs[0] == '\0') {
+    unsquashfs = "unsquashfs";
+  }
+  vector<string> cmd = {unsquashfs, "-m", map_file.path(), sqfs_path};
   string stdout_str, stderr_str;
   int exit_code;
   if (!Subprocess::SynchronousExec(cmd, &exit_code, &stdout_str, &stderr_str) ||