aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Strudel <tstrudel@google.com>2015-07-10 19:26:21 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-07-10 19:26:21 +0000
commit3a23373c3554b4b425339f1321e5235701a48b43 (patch)
treeb1ea57ae592a5de0b0f5a82669a6abb9df490961
parentce3a8d10e6b01f4b9fe619d62faa4db6a64e5417 (diff)
parent1a710ff698178fbf71251395c4c96e3e7e73e2ed (diff)
downloadsquashfs-tools-3a23373c3554b4b425339f1321e5235701a48b43.tar.gz
am 1a710ff6: fs_config: align with new explicit fs_config target_out parameter
* commit '1a710ff698178fbf71251395c4c96e3e7e73e2ed': fs_config: align with new explicit fs_config target_out parameter
-rw-r--r--squashfs-tools/android.c6
-rw-r--r--squashfs-tools/android.h2
-rw-r--r--squashfs-tools/mksquashfs.c19
3 files changed, 19 insertions, 8 deletions
diff --git a/squashfs-tools/android.c b/squashfs-tools/android.c
index 1dbee63..6abfb8d 100644
--- a/squashfs-tools/android.c
+++ b/squashfs-tools/android.c
@@ -42,10 +42,10 @@ void alloc_mounted_path(const char *mount_point, const char *subpath, char **mou
strcat(*mounted_path, subpath);
}
-void android_fs_config(const char *path, struct stat *stat) {
+void android_fs_config(const char *path, struct stat *stat, const char *target_out_path) {
unsigned long capabilities = 0;
- fs_config(path, S_ISDIR(stat->st_mode), &stat->st_uid, &stat->st_gid, &stat->st_mode,
- &capabilities);
+ fs_config(path, S_ISDIR(stat->st_mode), target_out_path,
+ &stat->st_uid, &stat->st_gid, &stat->st_mode, &capabilities);
}
diff --git a/squashfs-tools/android.h b/squashfs-tools/android.h
index b290b8e..c2e7018 100644
--- a/squashfs-tools/android.h
+++ b/squashfs-tools/android.h
@@ -18,7 +18,7 @@
#define _ANDROID_H_
void alloc_mounted_path(const char *mount_point, const char *subpath, char **mounted_path);
-void android_fs_config(const char *path, struct stat *stat);
+void android_fs_config(const char *path, struct stat *stat, const char *target_out_path);
struct selabel_handle *get_sehnd(const char *context_file);
char *set_selabel(const char *path, unsigned int mode, struct selabel_handle *sehnd);
diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
index 9e80d0a..67592b2 100644
--- a/squashfs-tools/mksquashfs.c
+++ b/squashfs-tools/mksquashfs.c
@@ -83,6 +83,7 @@
int android_config = FALSE;
char *context_file = NULL;
char *mount_point = NULL;
+char *target_out_path = NULL;
#endif
/* ANDROID CHANGES END */
@@ -3054,10 +3055,10 @@ inline void add_dir_entry(struct dir_ent *dir_ent, struct dir_info *sub_dir,
if (mount_point) {
char *mounted_path;
alloc_mounted_path(mount_point, subpathname(dir_ent), &mounted_path);
- android_fs_config(mounted_path, &inode_info->buf);
+ android_fs_config(mounted_path, &inode_info->buf, target_out_path);
free(mounted_path);
} else {
- android_fs_config(pathname(dir_ent), &inode_info->buf);
+ android_fs_config(pathname(dir_ent), &inode_info->buf, target_out_path);
}
}
#endif
@@ -3158,9 +3159,9 @@ void dir_scan(squashfs_inode *inode, char *pathname,
#ifdef ANDROID
if (android_config)
if (mount_point)
- android_fs_config(mount_point, &buf);
+ android_fs_config(mount_point, &buf, target_out_path);
else
- android_fs_config(pathname, &buf);
+ android_fs_config(pathname, &buf, target_out_path);
#endif
/* ANDROID CHANGES END */
dir_ent->inode = lookup_inode(&buf);
@@ -5603,6 +5604,14 @@ print_compressor_options:
}
mount_point = argv[i];
}
+ else if(strcmp(argv[i], "-product-out") == 0) {
+ if(++i == argc) {
+ ERROR("%s: -product-out: missing path name\n",
+ argv[0]);
+ exit(1);
+ }
+ target_out_path = argv[i];
+ }
#endif
/* ANDROID CHANGES END */
@@ -5673,6 +5682,8 @@ printOptions:
ERROR("-mount-point <name>\tNeed to be provided when "
"android-fs-config or context-file\n\t\t\tare "
"enabled and source directory is not mount point\n");
+ ERROR("-product-out <path>\tPRODUCT_OUT directory to "
+ "read device specific FS rules files from\n");
#endif
/* ANDROID CHANGES END */
ERROR("\nFilesystem filter options:\n");