diff options
-rw-r--r-- | meta-oe/recipes-devtools/android-tools/android-tools/preserve-ownership.patch | 71 | ||||
-rw-r--r-- | meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb | 2 |
2 files changed, 41 insertions, 32 deletions
diff --git a/meta-oe/recipes-devtools/android-tools/android-tools/preserve-ownership.patch b/meta-oe/recipes-devtools/android-tools/android-tools/preserve-ownership.patch index 85af81f0f9..5c90397194 100644 --- a/meta-oe/recipes-devtools/android-tools/android-tools/preserve-ownership.patch +++ b/meta-oe/recipes-devtools/android-tools/android-tools/preserve-ownership.patch | |||
@@ -1,19 +1,50 @@ | |||
1 | From aa669312a380611d280d126cb509fa282080707e Mon Sep 17 00:00:00 2001 | ||
2 | From: Markus Mayer <mmayer@mmayer.net> | ||
3 | Date: Wed, 7 Sep 2016 12:58:47 +0300 | ||
4 | Subject: [PATCH] android-tools: add recipe from AOSP tag android-5.1.1_r37 | ||
5 | |||
1 | Description: add -o argument to preserve ownership | 6 | Description: add -o argument to preserve ownership |
2 | Author: Markus Mayer <mmayer@mmayer.net> | ||
3 | 7 | ||
4 | See also https://android-review.googlesource.com/#/c/100312/ | 8 | See also https://android-review.googlesource.com/#/c/100312/ |
5 | 9 | ||
6 | Upstream-Status: Inappropriate | 10 | Upstream-Status: Inappropriate |
11 | |||
7 | --- | 12 | --- |
8 | system/extras/ext4_utils/make_ext4fs.c | 6 ++++++ | 13 | ext4_utils/make_ext4fs.c | 6 ++++++ |
9 | system/extras/ext4_utils/make_ext4fs_main.c | 10 ++++++++-- | 14 | ext4_utils/make_ext4fs_main.c | 10 ++++++++-- |
10 | 2 files changed, 14 insertions(+), 2 deletions(-) | 15 | 2 files changed, 14 insertions(+), 2 deletions(-) |
11 | 16 | ||
12 | --- a/system/extras/ext4_utils/make_ext4fs_main.c | 17 | diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c |
13 | +++ b/system/extras/ext4_utils/make_ext4fs_main.c | 18 | index 2f89ae8a..cc41d623 100644 |
14 | @@ -49,13 +49,15 @@ extern struct fs_info info; | 19 | --- a/ext4_utils/make_ext4fs.c |
20 | +++ b/ext4_utils/make_ext4fs.c | ||
21 | @@ -68,6 +68,8 @@ | ||
22 | |||
23 | #endif | ||
24 | |||
25 | +int preserve_owner = 0; | ||
26 | + | ||
27 | /* TODO: Not implemented: | ||
28 | Allocating blocks in the same block group as the file inode | ||
29 | Hash or binary tree directories | ||
30 | @@ -186,6 +188,10 @@ static u32 build_directory_structure(const char *full_path, const char *dir_path | ||
31 | } else { | ||
32 | dentries[i].mtime = fixed_time; | ||
33 | } | ||
34 | + if (preserve_owner) { | ||
35 | + dentries[i].uid = stat.st_uid; | ||
36 | + dentries[i].gid = stat.st_gid; | ||
37 | + } | ||
38 | uint64_t capabilities; | ||
39 | if (fs_config_func != NULL) { | ||
40 | #ifdef ANDROID | ||
41 | diff --git a/ext4_utils/make_ext4fs_main.c b/ext4_utils/make_ext4fs_main.c | ||
42 | index a6c5f616..7af0dddf 100644 | ||
43 | --- a/ext4_utils/make_ext4fs_main.c | ||
44 | +++ b/ext4_utils/make_ext4fs_main.c | ||
45 | @@ -48,13 +48,15 @@ struct selabel_handle; | ||
46 | extern struct fs_info info; | ||
15 | 47 | ||
16 | extern struct selabel_handle* selinux_android_file_context_handle(void); | ||
17 | 48 | ||
18 | +extern int preserve_owner; | 49 | +extern int preserve_owner; |
19 | + | 50 | + |
@@ -28,7 +59,7 @@ Upstream-Status: Inappropriate | |||
28 | fprintf(stderr, " <filename> [<directory>]\n"); | 59 | fprintf(stderr, " <filename> [<directory>]\n"); |
29 | } | 60 | } |
30 | 61 | ||
31 | @@ -81,7 +83,7 @@ int main(int argc, char **argv) | 62 | @@ -80,7 +82,7 @@ int main(int argc, char **argv) |
32 | struct selinux_opt seopts[] = { { SELABEL_OPT_PATH, "" } }; | 63 | struct selinux_opt seopts[] = { { SELABEL_OPT_PATH, "" } }; |
33 | #endif | 64 | #endif |
34 | 65 | ||
@@ -37,7 +68,7 @@ Upstream-Status: Inappropriate | |||
37 | switch (opt) { | 68 | switch (opt) { |
38 | case 'l': | 69 | case 'l': |
39 | info.len = parse_num(optarg); | 70 | info.len = parse_num(optarg); |
40 | @@ -144,6 +146,10 @@ int main(int argc, char **argv) | 71 | @@ -143,6 +145,10 @@ int main(int argc, char **argv) |
41 | } | 72 | } |
42 | #endif | 73 | #endif |
43 | break; | 74 | break; |
@@ -48,25 +79,3 @@ Upstream-Status: Inappropriate | |||
48 | case 'v': | 79 | case 'v': |
49 | verbose = 1; | 80 | verbose = 1; |
50 | break; | 81 | break; |
51 | --- a/system/extras/ext4_utils/make_ext4fs.c | ||
52 | +++ b/system/extras/ext4_utils/make_ext4fs.c | ||
53 | @@ -67,6 +67,8 @@ | ||
54 | |||
55 | #endif | ||
56 | |||
57 | +int preserve_owner = 0; | ||
58 | + | ||
59 | /* TODO: Not implemented: | ||
60 | Allocating blocks in the same block group as the file inode | ||
61 | Hash or binary tree directories | ||
62 | @@ -185,6 +187,10 @@ static u32 build_directory_structure(con | ||
63 | } else { | ||
64 | dentries[i].mtime = fixed_time; | ||
65 | } | ||
66 | + if (preserve_owner) { | ||
67 | + dentries[i].uid = stat.st_uid; | ||
68 | + dentries[i].gid = stat.st_gid; | ||
69 | + } | ||
70 | uint64_t capabilities; | ||
71 | if (fs_config_func != NULL) { | ||
72 | #ifdef ANDROID | ||
diff --git a/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb b/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb index d3ccd1d064..5d8f8a8435 100644 --- a/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb +++ b/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb | |||
@@ -26,7 +26,7 @@ SRC_URI = " \ | |||
26 | file://remove-selinux-android.patch \ | 26 | file://remove-selinux-android.patch \ |
27 | file://use-capability.patch \ | 27 | file://use-capability.patch \ |
28 | file://use-local-socket.patch \ | 28 | file://use-local-socket.patch \ |
29 | file://preserve-ownership.patch \ | 29 | file://preserve-ownership.patch;patchdir=system/extras \ |
30 | file://mkbootimg-Add-dt-parameter-to-specify-DT-image.patch \ | 30 | file://mkbootimg-Add-dt-parameter-to-specify-DT-image.patch \ |
31 | file://remove-bionic-android.patch \ | 31 | file://remove-bionic-android.patch \ |
32 | file://define-shell-command.patch \ | 32 | file://define-shell-command.patch \ |