summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYifan Hong2017-08-01 18:33:11 -0500
committerYifan Hong2017-08-02 18:31:19 -0500
commit09c89672b6a5ed6e6b6fc3ad28ac309c7ff69170 (patch)
tree3837bd0ced3100188d70c0d037ebc5353800e5ea
parentb5c90e9d6b3218d80055dddf7b27cd1fa2a5c024 (diff)
downloadplatform-system-core-09c89672b6a5ed6e6b6fc3ad28ac309c7ff69170.tar.gz
platform-system-core-09c89672b6a5ed6e6b6fc3ad28ac309c7ff69170.tar.xz
platform-system-core-09c89672b6a5ed6e6b6fc3ad28ac309c7ff69170.zip
Move android_filesystem_config.h => fs_config.h
The non AID_ things in android_filesystem_config.h are moved to fs_config.h. For libcutils.vendor and libcutils_headers.vendor, fs_config.h is not exported. An empty system/core/include/private/fs_config.h is placed to appease the dependency from certain modules (logd, etc.) that includes system/core/include/private/android_filesystem_config.h directly. Test: m -j Test: BOARD_VNDK_VERSION=current m -j Bug: 63135587 Change-Id: I95dfb874a426941022b100c0ca26a0576b0f4aa3 Merged-In: I95dfb874a426941022b100c0ca26a0576b0f4aa3
-rw-r--r--include/private/fs_config.h4
-rw-r--r--libcutils/canned_fs_config.c1
l---------libcutils/include/cutils/android_filesystem_config.h1
-rw-r--r--libcutils/include/private/android_filesystem_config.h47
-rw-r--r--libcutils/include/private/fs_config.h43
l---------libcutils/include_vndk/cutils/android_filesystem_config.h1
6 files changed, 52 insertions, 45 deletions
diff --git a/include/private/fs_config.h b/include/private/fs_config.h
new file mode 100644
index 000000000..e9868a41f
--- /dev/null
+++ b/include/private/fs_config.h
@@ -0,0 +1,4 @@
1// TODO(b/63135587) remove this file after the transitive dependency
2// from private/android_filesystem_config.h is resolved. All files that use
3// libcutils/include/private/fs_config.h should include the file directly, not
4// indirectly via private/android_filesystem_config.h.
diff --git a/libcutils/canned_fs_config.c b/libcutils/canned_fs_config.c
index 96ca566cd..819a846a6 100644
--- a/libcutils/canned_fs_config.c
+++ b/libcutils/canned_fs_config.c
@@ -23,6 +23,7 @@
23#include <string.h> 23#include <string.h>
24 24
25#include <private/android_filesystem_config.h> 25#include <private/android_filesystem_config.h>
26#include <private/fs_config.h>
26#include <private/canned_fs_config.h> 27#include <private/canned_fs_config.h>
27 28
28typedef struct { 29typedef struct {
diff --git a/libcutils/include/cutils/android_filesystem_config.h b/libcutils/include/cutils/android_filesystem_config.h
new file mode 120000
index 000000000..d2a92fefa
--- /dev/null
+++ b/libcutils/include/cutils/android_filesystem_config.h
@@ -0,0 +1 @@
../private/android_filesystem_config.h \ No newline at end of file
diff --git a/libcutils/include/private/android_filesystem_config.h b/libcutils/include/private/android_filesystem_config.h
index 02141d687..d4ba01963 100644
--- a/libcutils/include/private/android_filesystem_config.h
+++ b/libcutils/include/private/android_filesystem_config.h
@@ -14,11 +14,6 @@
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 16
17/* This file is used to define the properties of the filesystem
18** images generated by build tools (mkbootfs and mkyaffs2image) and
19** by the device side of adb.
20*/
21
22/* 17/*
23 * This file is consumed by build/tools/fs_config and is used 18 * This file is consumed by build/tools/fs_config and is used
24 * for generating various files. Anything #define AID_<name> 19 * for generating various files. Anything #define AID_<name>
@@ -49,18 +44,12 @@
49#ifndef _ANDROID_FILESYSTEM_CONFIG_H_ 44#ifndef _ANDROID_FILESYSTEM_CONFIG_H_
50#define _ANDROID_FILESYSTEM_CONFIG_H_ 45#define _ANDROID_FILESYSTEM_CONFIG_H_
51 46
52#include <stdint.h>
53#include <sys/cdefs.h>
54#include <sys/types.h> 47#include <sys/types.h>
55 48
56#if defined(__BIONIC__) 49#if !defined(__ANDROID_VNDK__) && !defined(EXCLUDE_FS_CONFIG_STRUCTURES)
57#include <linux/capability.h> 50#include <private/fs_config.h>
58#else
59#include "android_filesystem_capability.h"
60#endif 51#endif
61 52
62#define CAP_MASK_LONG(cap_name) (1ULL << (cap_name))
63
64/* This is the master Users and Groups config for the platform. 53/* This is the master Users and Groups config for the platform.
65 * DO NOT EVER RENUMBER 54 * DO NOT EVER RENUMBER
66 */ 55 */
@@ -193,36 +182,4 @@
193 * Also see build/tools/fs_config for more details. 182 * Also see build/tools/fs_config for more details.
194 */ 183 */
195 184
196#if !defined(EXCLUDE_FS_CONFIG_STRUCTURES)
197
198struct fs_path_config {
199 unsigned mode;
200 unsigned uid;
201 unsigned gid;
202 uint64_t capabilities;
203 const char* prefix;
204};
205
206/* Rules for directories and files has moved to system/code/libcutils/fs_config.c */
207
208__BEGIN_DECLS
209
210/*
211 * Used in:
212 * build/tools/fs_config/fs_config.c
213 * build/tools/fs_get_stats/fs_get_stats.c
214 * system/extras/ext4_utils/make_ext4fs_main.c
215 * external/squashfs-tools/squashfs-tools/android.c
216 * system/core/cpio/mkbootfs.c
217 * system/core/adb/file_sync_service.cpp
218 * system/extras/ext4_utils/canned_fs_config.c
219 */
220void fs_config(const char* path, int dir, const char* target_out_path, unsigned* uid, unsigned* gid,
221 unsigned* mode, uint64_t* capabilities);
222
223ssize_t fs_config_generate(char* buffer, size_t length, const struct fs_path_config* pc);
224
225__END_DECLS
226
227#endif
228#endif 185#endif
diff --git a/libcutils/include/private/fs_config.h b/libcutils/include/private/fs_config.h
index 7dad668aa..aab504281 100644
--- a/libcutils/include/private/fs_config.h
+++ b/libcutils/include/private/fs_config.h
@@ -14,10 +14,24 @@
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 16
17/* This file is used to define the properties of the filesystem
18** images generated by build tools (mkbootfs and mkyaffs2image) and
19** by the device side of adb.
20*/
21
17#ifndef _LIBS_CUTILS_PRIVATE_FS_CONFIG_H 22#ifndef _LIBS_CUTILS_PRIVATE_FS_CONFIG_H
18#define _LIBS_CUTILS_PRIVATE_FS_CONFIG_H 23#define _LIBS_CUTILS_PRIVATE_FS_CONFIG_H
19 24
20#include <stdint.h> 25#include <stdint.h>
26#include <sys/cdefs.h>
27
28#if defined(__BIONIC__)
29#include <linux/capability.h>
30#else // defined(__BIONIC__)
31#include "android_filesystem_capability.h"
32#endif // defined(__BIONIC__)
33
34#define CAP_MASK_LONG(cap_name) (1ULL << (cap_name))
21 35
22/* 36/*
23 * binary format for the runtime <partition>/etc/fs_config_(dirs|files) 37 * binary format for the runtime <partition>/etc/fs_config_(dirs|files)
@@ -34,4 +48,33 @@ struct fs_path_config_from_file {
34 char prefix[]; 48 char prefix[];
35} __attribute__((__aligned__(sizeof(uint64_t)))); 49} __attribute__((__aligned__(sizeof(uint64_t))));
36 50
51struct fs_path_config {
52 unsigned mode;
53 unsigned uid;
54 unsigned gid;
55 uint64_t capabilities;
56 const char* prefix;
57};
58
59/* Rules for directories and files has moved to system/code/libcutils/fs_config.c */
60
61__BEGIN_DECLS
62
63/*
64 * Used in:
65 * build/tools/fs_config/fs_config.c
66 * build/tools/fs_get_stats/fs_get_stats.c
67 * system/extras/ext4_utils/make_ext4fs_main.c
68 * external/squashfs-tools/squashfs-tools/android.c
69 * system/core/cpio/mkbootfs.c
70 * system/core/adb/file_sync_service.cpp
71 * system/extras/ext4_utils/canned_fs_config.c
72 */
73void fs_config(const char* path, int dir, const char* target_out_path, unsigned* uid, unsigned* gid,
74 unsigned* mode, uint64_t* capabilities);
75
76ssize_t fs_config_generate(char* buffer, size_t length, const struct fs_path_config* pc);
77
78__END_DECLS
79
37#endif /* _LIBS_CUTILS_PRIVATE_FS_CONFIG_H */ 80#endif /* _LIBS_CUTILS_PRIVATE_FS_CONFIG_H */
diff --git a/libcutils/include_vndk/cutils/android_filesystem_config.h b/libcutils/include_vndk/cutils/android_filesystem_config.h
new file mode 120000
index 000000000..13a5a08ef
--- /dev/null
+++ b/libcutils/include_vndk/cutils/android_filesystem_config.h
@@ -0,0 +1 @@
../../include/private/android_filesystem_config.h \ No newline at end of file