tar nandroid and /data/media support.
Change-Id: I9405e701887fc83c422c63c1dbf5ff087fff880d
diff --git a/extendedcommands.c b/extendedcommands.c
index cb44cb1..5543e96 100644
--- a/extendedcommands.c
+++ b/extendedcommands.c
@@ -466,10 +466,16 @@
}
static char tmp[PATH_MAX];
- sprintf(tmp, "rm -rf %s/*", path);
- __system(tmp);
- sprintf(tmp, "rm -rf %s/.*", path);
- __system(tmp);
+ if (strcmp(path, "/data") == 0) {
+ sprintf(tmp, "cd /data ; for f in $(ls -a | grep -v ^media$); do rm -rf $f; done");
+ __system(tmp);
+ }
+ else {
+ sprintf(tmp, "rm -rf %s/*", path);
+ __system(tmp);
+ sprintf(tmp, "rm -rf %s/.*", path);
+ __system(tmp);
+ }
ensure_path_unmounted(path);
return 0;