summaryrefslogtreecommitdiffstats
path: root/adb/file_sync_service.c
diff options
context:
space:
mode:
authorDaniel Rosenberg <drosen@google.com>2014-06-30 20:29:40 -0700
committerDaniel Rosenberg <drosen@google.com>2014-07-02 20:00:49 +0000
commit686bce6390db802bfd2cb4e78f9270596b6decb2 (patch)
tree4e7fd4f587f4640858304d2e911b7d220920a197 /adb/file_sync_service.c
parent4a974df8adec7767bbd9be834008fd882bf33ffb (diff)
downloadsystem_core-686bce6390db802bfd2cb4e78f9270596b6decb2.zip
system_core-686bce6390db802bfd2cb4e78f9270596b6decb2.tar.gz
system_core-686bce6390db802bfd2cb4e78f9270596b6decb2.tar.bz2
Added support for vendor partition to adb
Remount will now remount the vendor partition as well, if it exists. Sync will also allow you to sync vendor, and will include it by default if it exists. Change-Id: Iea1e8212f445e96233438a8d8a9d3266bf3d6557 Signed-off-by: Daniel Rosenberg <drosen@google.com>
Diffstat (limited to 'adb/file_sync_service.c')
-rw-r--r--adb/file_sync_service.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/adb/file_sync_service.c b/adb/file_sync_service.c
index 1d80d26..e6f64bb 100644
--- a/adb/file_sync_service.c
+++ b/adb/file_sync_service.c
@@ -39,6 +39,11 @@ static bool is_on_system(const char *name) {
return (strncmp(SYSTEM, name, strlen(SYSTEM)) == 0);
}
+static bool is_on_vendor(const char *name) {
+ const char *VENDOR = "/vendor/";
+ return (strncmp(VENDOR, name, strlen(VENDOR)) == 0);
+}
+
static int mkdirs(char *name)
{
int ret;
@@ -54,7 +59,7 @@ static int mkdirs(char *name)
x = adb_dirstart(x);
if(x == 0) return 0;
*x = 0;
- if (is_on_system(name)) {
+ if (is_on_system(name) || is_on_vendor(name)) {
fs_config(name, 1, &uid, &gid, &mode, &cap);
}
ret = adb_mkdir(name, mode);
@@ -369,7 +374,7 @@ static int do_send(int s, char *path, char *buffer)
if(*tmp == '/') {
tmp++;
}
- if (is_on_system(path)) {
+ if (is_on_system(path) || is_on_vendor(path)) {
fs_config(tmp, 0, &uid, &gid, &mode, &cap);
}
ret = handle_send_file(s, path, uid, gid, mode, buffer, do_unlink);