From 99fb6fef11db8172c7daa219f19161fd432f5c20 Mon Sep 17 00:00:00 2001 From: "Koushik K. Dutta" Date: Wed, 3 Mar 2010 00:42:58 -0800 Subject: [PATCH] merge busybox and other tools into recovery. --- Android.mk | 1 + extendedcommands.c | 3 ++- mtdutils/Android.mk | 22 ++++------------------ recovery.c | 12 ++++++++++++ 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Android.mk b/Android.mk index 93196f7..c92facd 100644 --- a/Android.mk +++ b/Android.mk @@ -41,6 +41,7 @@ ifeq ($(TARGET_RECOVERY_UI_LIB),) else LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UI_LIB) endif +LOCAL_STATIC_LIBRARIES += libbusybox libclearsilverregex libmkyaffs2image libunyaffs libdump_image libflash_image libmtdutils LOCAL_STATIC_LIBRARIES += libamend LOCAL_STATIC_LIBRARIES += libminzip libunz libmtdutils libmincrypt LOCAL_STATIC_LIBRARIES += libminui libpixelflinger_static libpng libcutils diff --git a/extendedcommands.c b/extendedcommands.c index 538cbb6..3f52947 100644 --- a/extendedcommands.c +++ b/extendedcommands.c @@ -52,6 +52,7 @@ void install_zip(const char* packagefilepath) ui_print("\n-- Installing: %s\n", packagefilepath); set_sdcard_update_bootloader_message(); int status = install_package(packagefilepath); + ui_reset_progress(); if (status != INSTALL_SUCCESS) { ui_set_background(BACKGROUND_ICON_ERROR); ui_print("Installation aborted.\n"); @@ -60,8 +61,8 @@ void install_zip(const char* packagefilepath) if (firmware_update_pending()) { ui_print("\nReboot via menu to complete\ninstallation.\n"); } - ui_print("\nInstall from sdcard complete.\n"); ui_set_background(BACKGROUND_ICON_NONE); + ui_print("\nInstall from sdcard complete.\n"); } char* INSTALL_MENU_ITEMS[] = { "apply sdcard:update.zip", diff --git a/mtdutils/Android.mk b/mtdutils/Android.mk index bbdc72f..790b8bd 100644 --- a/mtdutils/Android.mk +++ b/mtdutils/Android.mk @@ -30,28 +30,14 @@ include $(BUILD_EXECUTABLE) include $(CLEAR_VARS) LOCAL_SRC_FILES := flash_image.c -#LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES -LOCAL_MODULE := recovery_flash_image -#LOCAL_MODULE_TAGS := eng -#LOCAL_STATIC_LIBRARIES := libmtdutils libcutils libc -#LOCAL_MODULE_STEM := flash_image -#LOCAL_FORCE_STATIC_EXECUTABLE := true -#LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin +LOCAL_MODULE := libflash_image LOCAL_CFLAGS += -Dmain=flash_image_main -#ADDITIONAL_RECOVERY_EXECUTABLES += recovery_flash_image include $(BUILD_STATIC_LIBRARY) include $(CLEAR_VARS) LOCAL_SRC_FILES := dump_image.c -#LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES -LOCAL_MODULE := recovery_dump_image -#LOCAL_MODULE_TAGS := eng -#LOCAL_STATIC_LIBRARIES := libmtdutils libcutils libc -#LOCAL_MODULE_STEM := dump_image -#LOCAL_FORCE_STATIC_EXECUTABLE := true -#LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin +LOCAL_MODULE := libdump_image LOCAL_CFLAGS += -Dmain=dump_image_main -#ADDITIONAL_RECOVERY_EXECUTABLES += recovery_dump_image include $(BUILD_STATIC_LIBRARY) @@ -60,12 +46,12 @@ LOCAL_SRC_FILES := driver.c LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES LOCAL_MODULE := recovery_tools LOCAL_MODULE_TAGS := eng -LOCAL_STATIC_LIBRARIES := recovery_mkyaffs2image recovery_unyaffs recovery_dump_image recovery_flash_image libmtdutils libcutils libc +LOCAL_STATIC_LIBRARIES := libmkyaffs2image libunyaffs libdump_image libflash_image libmtdutils libcutils libc LOCAL_FORCE_STATIC_EXECUTABLE := true LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin LOCAL_UNSTRIPPED_PATH := $(TARGET_OUT_EXECUTABLES_UNSTRIPPED) ADDITIONAL_RECOVERY_EXECUTABLES += recovery_tools -include $(BUILD_EXECUTABLE) +#include $(BUILD_EXECUTABLE) endif # TARGET_ARCH == arm endif # !TARGET_SIMULATOR diff --git a/recovery.c b/recovery.c index 4dd8833..cc324cd 100644 --- a/recovery.c +++ b/recovery.c @@ -472,6 +472,18 @@ print_property(const char *key, const char *name, void *cookie) int main(int argc, char **argv) { + if (strstr(argv[0], "recovery") == NULL) + { + if (strstr(argv[0], "flash_image") != NULL) + return flash_image_main(argc, argv); + if (strstr(argv[0], "dump_image") != NULL) + return dump_image_main(argc, argv); + if (strstr(argv[0], "mkyaffs2image") != NULL) + return mkyaffs2image_main(argc, argv); + if (strstr(argv[0], "unyaffs") != NULL) + return unyaffs_main(argc, argv); + return busybox_driver(argc, argv); + } int is_user_initiated_recovery = 0; time_t start = time(NULL);