aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Strudel <tstrudel@google.com>2015-07-09 16:34:38 -0700
committerThierry Strudel <tstrudel@google.com>2015-07-09 21:49:39 -0700
commit1a710ff698178fbf71251395c4c96e3e7e73e2ed (patch)
tree0cd82a70bcabce2f8ee7ed11f170731fb5bc5b46
parentefa2a473ce8915ca9332c621479b79d26cdc1cf7 (diff)
downloadsquashfs-tools-marshmallow-mr1-dev.tar.gz
fs_config: align with new explicit fs_config target_out parameterandroid-cts-6.0_r9android-cts-6.0_r8android-cts-6.0_r7android-cts-6.0_r6android-cts-6.0_r5android-cts-6.0_r4android-cts-6.0_r32android-cts-6.0_r31android-cts-6.0_r30android-cts-6.0_r3android-cts-6.0_r29android-cts-6.0_r28android-cts-6.0_r27android-cts-6.0_r26android-cts-6.0_r25android-cts-6.0_r24android-cts-6.0_r23android-cts-6.0_r22android-cts-6.0_r21android-cts-6.0_r20android-cts-6.0_r2android-cts-6.0_r19android-cts-6.0_r18android-cts-6.0_r17android-cts-6.0_r16android-cts-6.0_r15android-cts-6.0_r14android-cts-6.0_r13android-cts-6.0_r12android-cts-6.0_r1android-6.0.1_r9android-6.0.1_r81android-6.0.1_r80android-6.0.1_r8android-6.0.1_r79android-6.0.1_r78android-6.0.1_r77android-6.0.1_r74android-6.0.1_r73android-6.0.1_r72android-6.0.1_r70android-6.0.1_r7android-6.0.1_r69android-6.0.1_r68android-6.0.1_r67android-6.0.1_r66android-6.0.1_r65android-6.0.1_r63android-6.0.1_r62android-6.0.1_r61android-6.0.1_r60android-6.0.1_r59android-6.0.1_r58android-6.0.1_r57android-6.0.1_r56android-6.0.1_r55android-6.0.1_r54android-6.0.1_r53android-6.0.1_r52android-6.0.1_r51android-6.0.1_r50android-6.0.1_r5android-6.0.1_r49android-6.0.1_r48android-6.0.1_r47android-6.0.1_r46android-6.0.1_r45android-6.0.1_r43android-6.0.1_r42android-6.0.1_r41android-6.0.1_r40android-6.0.1_r4android-6.0.1_r33android-6.0.1_r32android-6.0.1_r31android-6.0.1_r30android-6.0.1_r3android-6.0.1_r28android-6.0.1_r27android-6.0.1_r26android-6.0.1_r25android-6.0.1_r24android-6.0.1_r22android-6.0.1_r21android-6.0.1_r20android-6.0.1_r18android-6.0.1_r17android-6.0.1_r16android-6.0.1_r13android-6.0.1_r12android-6.0.1_r11android-6.0.1_r10android-6.0.1_r1android-6.0.0_r7android-6.0.0_r6android-6.0.0_r5android-6.0.0_r41android-6.0.0_r4android-6.0.0_r3android-6.0.0_r26android-6.0.0_r25android-6.0.0_r24android-6.0.0_r23android-6.0.0_r2android-6.0.0_r13android-6.0.0_r12android-6.0.0_r11android-6.0.0_r1marshmallow-releasemarshmallow-mr3-releasemarshmallow-mr2-releasemarshmallow-mr1-releasemarshmallow-mr1-devmarshmallow-dr1.6-releasemarshmallow-dr1.5-releasemarshmallow-dr1.5-devmarshmallow-dr-releasemarshmallow-dr-dragon-releasemarshmallow-dr-devmarshmallow-devmarshmallow-cts-release
Bug: 21989305 Bug: 22048934 Change-Id: I5b49d521562245cae00fa9701c92dc0a1fa3dd80 Signed-off-by: Thierry Strudel <tstrudel@google.com>
-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 aaf91b5..4881d50 100644
--- a/squashfs-tools/android.c
+++ b/squashfs-tools/android.c
@@ -43,10 +43,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");