summaryrefslogtreecommitdiffstats
path: root/recovery.c
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2010-09-22 05:21:52 +0200
committerAndroid Git Automerger <android-git-automerger@android.com>2010-09-22 05:21:52 +0200
commit6b26c882a883b43d199bc2882cf574c651da0408 (patch)
tree6e6b656ff0777a0affec867cbc6956cd7fb7541d /recovery.c
parentam 8147ba85: (-s ours) am 93ca4fc6: use fs_type "emmc" instead of "block" for consistency (do not merge) (diff)
parentam 2c3c5c15: Merge "mount sdcard only on demand; fix sideload installs" into gingerbread (diff)
downloadandroid_bootable_recovery-6b26c882a883b43d199bc2882cf574c651da0408.tar
android_bootable_recovery-6b26c882a883b43d199bc2882cf574c651da0408.tar.gz
android_bootable_recovery-6b26c882a883b43d199bc2882cf574c651da0408.tar.bz2
android_bootable_recovery-6b26c882a883b43d199bc2882cf574c651da0408.tar.lz
android_bootable_recovery-6b26c882a883b43d199bc2882cf574c651da0408.tar.xz
android_bootable_recovery-6b26c882a883b43d199bc2882cf574c651da0408.tar.zst
android_bootable_recovery-6b26c882a883b43d199bc2882cf574c651da0408.zip
Diffstat (limited to 'recovery.c')
-rw-r--r--recovery.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/recovery.c b/recovery.c
index f5636d846..36da5f36a 100644
--- a/recovery.c
+++ b/recovery.c
@@ -456,6 +456,8 @@ static int compare_string(const void* a, const void* b) {
static int
sdcard_directory(const char* path) {
+ ensure_path_mounted(SDCARD_ROOT);
+
const char* MENU_HEADERS[] = { "Choose a package to install:",
path,
"",
@@ -465,6 +467,7 @@ sdcard_directory(const char* path) {
d = opendir(path);
if (d == NULL) {
LOGE("error opening %s: %s\n", path, strerror(errno));
+ ensure_path_unmounted(SDCARD_ROOT);
return 0;
}
@@ -546,11 +549,13 @@ sdcard_directory(const char* path) {
// the status to the caller.
char new_path[PATH_MAX];
strlcpy(new_path, path, PATH_MAX);
+ strlcat(new_path, "/", PATH_MAX);
strlcat(new_path, item, PATH_MAX);
ui_print("\n-- Install %s ...\n", path);
set_sdcard_update_bootloader_message();
char* copy = copy_sideloaded_package(new_path);
+ ensure_path_unmounted(SDCARD_ROOT);
if (copy) {
result = install_package(copy);
free(copy);
@@ -566,6 +571,7 @@ sdcard_directory(const char* path) {
free(zips);
free(headers);
+ ensure_path_unmounted(SDCARD_ROOT);
return result;
}
@@ -765,9 +771,6 @@ main(int argc, char **argv) {
if (status != INSTALL_SUCCESS) ui_set_background(BACKGROUND_ICON_ERROR);
if (status != INSTALL_SUCCESS || ui_text_visible()) {
- // Mount the sdcard when the menu is enabled so you can "adb
- // push" packages to the sdcard and immediately install them.
- ensure_path_mounted(SDCARD_ROOT);
prompt_and_wait();
}