fix device specific fs_config on build server

fs_config function from libcutils, in order to properly set the xattr FS
used to define device specific uid, gid, permissions and capabilities,
now needs TARGET_OUT make variable to be passed explicitly to all tools
using it:
  fs_config
  fs_get_stats used by mktarball.sh
  make_ext4fs used by mkuserimg.sh
  mksquashfs used by mksquashfsimage.sh

Bug: 21989305
Bug: 22048934
Change-Id: I6caf9cf870882fce2ead93027767092c29b75ded
Signed-off-by: Thierry Strudel <tstrudel@google.com>
diff --git a/tools/fs_get_stats/fs_get_stats.c b/tools/fs_get_stats/fs_get_stats.c
index a9814b9..159e2aa 100644
--- a/tools/fs_get_stats/fs_get_stats.c
+++ b/tools/fs_get_stats/fs_get_stats.c
@@ -25,11 +25,12 @@
 {
 	fprintf(stderr, "fs_get_stats: retrieve the target file stats "
 	        "for the specified file\n");
-	fprintf(stderr, "usage: fs_get_stats cur_perms is_dir filename\n");
+	fprintf(stderr, "usage: fs_get_stats cur_perms is_dir filename targetout\n");
 	fprintf(stderr, "\tcur_perms - The current permissions of "
 	        "the file\n");
 	fprintf(stderr, "\tis_dir    - Is filename is a dir, 1. Otherwise, 0.\n");
 	fprintf(stderr, "\tfilename  - The filename to lookup\n");
+	fprintf(stderr, "\ttargetout - The target out path to query device specific FS configs\n");
 	fprintf(stderr, "\n");
 }
 
@@ -42,7 +43,7 @@
 	unsigned uid = (unsigned)-1;
 	unsigned gid = (unsigned)-1;
 
-	if (argc < 4) {
+	if (argc < 5) {
 		ERROR("Invalid arguments\n");
 		print_help();
 		exit(-1);
@@ -58,7 +59,7 @@
 		is_dir = 1;
 
 	uint64_t capabilities;
-	fs_config(argv[3], is_dir, &uid, &gid, &perms, &capabilities);
+	fs_config(argv[3], is_dir, argv[4], &uid, &gid, &perms, &capabilities);
 	fprintf(stdout, "%d %d 0%o\n", uid, gid, perms);
 
 	return 0;