Loading default_recovery_ui.c +2 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,8 @@ char* MENU_ITEMS[] = { "reboot system now", "install zip from sdcard", "backup", "restore", "mount sdcard", "mount /sdcard", "mount USB storage", NULL }; int device_toggle_display(volatile char* key_pressed, int key_code) { Loading extendedcommands.c +22 −0 Original line number Diff line number Diff line Loading @@ -359,3 +359,25 @@ void show_nandroid_restore_menu() } ui_print("Restore complete.\n"); } void do_mount_usb_storage() { system("echo /dev/block/mmcblk0 > /sys/devices/platform/usb_mass_storage/lun0/file"); static char* headers[] = { "USB Mass Storage device", "Leaving this menu unmount", "your SD card from your PC.", "", NULL }; static char* list[] = { "Unmount", NULL }; for (;;) { int chosen_item = get_menu_selection(headers, list, 0); if (chosen_item == GO_BACK || chosen_item == 0) break; } system("echo 0 > /sys/devices/platform/usb_mass_storage/lun0/enable"); } No newline at end of file extendedcommands.h +6 −3 Original line number Diff line number Diff line Loading @@ -13,11 +13,14 @@ show_choose_zip_menu(); int get_allow_toggle_display(); int ui_get_show_menu(); void ui_set_show_text(int value); void do_nandroid_backup(); void show_nandroid_restore_menu(); void do_mount_usb_storage(); No newline at end of file recovery.c +10 −1 Original line number Diff line number Diff line Loading @@ -456,6 +456,9 @@ prompt_and_wait() LOGE ("Can't mount /sdcard\n"); } break; case ITEM_MOUNT_USB: do_mount_usb_storage(); break; } } } Loading @@ -469,6 +472,7 @@ print_property(const char *key, const char *name, void *cookie) int main(int argc, char **argv) { int is_user_initiated_recovery = 0; time_t start = time(NULL); // If these fail, there's not really anywhere to complain... Loading Loading @@ -528,9 +532,14 @@ main(int argc, char **argv) if (status != INSTALL_SUCCESS) ui_print("Cache wipe failed.\n"); } else { status = INSTALL_ERROR; // No command specified // we are starting up in user initiated recovery here // let's set up some default options signature_check_enabled = 0; is_user_initiated_recovery = 1; ui_set_show_text(1); } if (status != INSTALL_SUCCESS) ui_set_background(BACKGROUND_ICON_ERROR); if (status != INSTALL_SUCCESS && !is_user_initiated_recovery) ui_set_background(BACKGROUND_ICON_ERROR); if (status != INSTALL_SUCCESS || ui_text_visible()) prompt_and_wait(); // If there is a radio image pending, reboot now to install it. Loading recovery_ui.h +1 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ int device_wipe_data(); #define ITEM_BACKUP 5 #define ITEM_RESTORE 6 #define ITEM_MOUNT_SDCARD 7 #define ITEM_MOUNT_USB 8 // Header text to display above the main menu. extern char* MENU_HEADERS[]; Loading Loading
default_recovery_ui.c +2 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,8 @@ char* MENU_ITEMS[] = { "reboot system now", "install zip from sdcard", "backup", "restore", "mount sdcard", "mount /sdcard", "mount USB storage", NULL }; int device_toggle_display(volatile char* key_pressed, int key_code) { Loading
extendedcommands.c +22 −0 Original line number Diff line number Diff line Loading @@ -359,3 +359,25 @@ void show_nandroid_restore_menu() } ui_print("Restore complete.\n"); } void do_mount_usb_storage() { system("echo /dev/block/mmcblk0 > /sys/devices/platform/usb_mass_storage/lun0/file"); static char* headers[] = { "USB Mass Storage device", "Leaving this menu unmount", "your SD card from your PC.", "", NULL }; static char* list[] = { "Unmount", NULL }; for (;;) { int chosen_item = get_menu_selection(headers, list, 0); if (chosen_item == GO_BACK || chosen_item == 0) break; } system("echo 0 > /sys/devices/platform/usb_mass_storage/lun0/enable"); } No newline at end of file
extendedcommands.h +6 −3 Original line number Diff line number Diff line Loading @@ -13,11 +13,14 @@ show_choose_zip_menu(); int get_allow_toggle_display(); int ui_get_show_menu(); void ui_set_show_text(int value); void do_nandroid_backup(); void show_nandroid_restore_menu(); void do_mount_usb_storage(); No newline at end of file
recovery.c +10 −1 Original line number Diff line number Diff line Loading @@ -456,6 +456,9 @@ prompt_and_wait() LOGE ("Can't mount /sdcard\n"); } break; case ITEM_MOUNT_USB: do_mount_usb_storage(); break; } } } Loading @@ -469,6 +472,7 @@ print_property(const char *key, const char *name, void *cookie) int main(int argc, char **argv) { int is_user_initiated_recovery = 0; time_t start = time(NULL); // If these fail, there's not really anywhere to complain... Loading Loading @@ -528,9 +532,14 @@ main(int argc, char **argv) if (status != INSTALL_SUCCESS) ui_print("Cache wipe failed.\n"); } else { status = INSTALL_ERROR; // No command specified // we are starting up in user initiated recovery here // let's set up some default options signature_check_enabled = 0; is_user_initiated_recovery = 1; ui_set_show_text(1); } if (status != INSTALL_SUCCESS) ui_set_background(BACKGROUND_ICON_ERROR); if (status != INSTALL_SUCCESS && !is_user_initiated_recovery) ui_set_background(BACKGROUND_ICON_ERROR); if (status != INSTALL_SUCCESS || ui_text_visible()) prompt_and_wait(); // If there is a radio image pending, reboot now to install it. Loading
recovery_ui.h +1 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ int device_wipe_data(); #define ITEM_BACKUP 5 #define ITEM_RESTORE 6 #define ITEM_MOUNT_SDCARD 7 #define ITEM_MOUNT_USB 8 // Header text to display above the main menu. extern char* MENU_HEADERS[]; Loading