From 357a2f51097cef529ae53d5609aebfbbe3d0c1b3 Mon Sep 17 00:00:00 2001 From: Prashant Somashekar Date: Sat, 26 Nov 2011 09:53:41 -0500 Subject: [PATCH] extendedcommands/nandroid: remove internal options if no sdcard and is_data_media -force /data as backup_path if volume for /sdcard is null and the same is true Change-Id: I927b723cde5b519d81402c6d841f2424627253e8 Conflicts: nandroid.c --- extendedcommands.c | 2 +- nandroid.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/extendedcommands.c b/extendedcommands.c index e6d87e9..44e7117 100644 --- a/extendedcommands.c +++ b/extendedcommands.c @@ -825,7 +825,7 @@ void show_nandroid_menu() NULL }; - if (volume_for_path("/emmc") == NULL) + if (volume_for_path("/emmc") == NULL || volume_for_path("/sdcard") == NULL && is_data_media()) list[3] = NULL; int chosen_item = get_menu_selection(headers, list, 0, 0); diff --git a/nandroid.c b/nandroid.c index 56c633d..ad44ae6 100644 --- a/nandroid.c +++ b/nandroid.c @@ -233,6 +233,12 @@ int nandroid_backup(const char* backup_path) } Volume* volume = volume_for_path(backup_path); + if (NULL == volume) { + if (strstr(backup_path, "/sdcard") == backup_path && is_data_media()) + volume = volume_for_path("/data"); + else + return print_and_error("Unable to find volume for backup path.\n"); + } int ret; struct statfs s; if (NULL != volume) {