diff --git a/Android.mk b/Android.mk index ddb2012..d6bfb19 100644 --- a/Android.mk +++ b/Android.mk @@ -18,6 +18,10 @@ LOCAL_SRC_FILES := \ ui.c \ verifier.c +LOCAL_SRC_FILES += \ + reboot.c \ + setprop.c + ifndef BOARD_HAS_NO_MISC_PARTITION LOCAL_SRC_FILES += \ firmware.c \ @@ -36,7 +40,7 @@ LOCAL_MODULE := recovery LOCAL_FORCE_STATIC_EXECUTABLE := true -RECOVERY_VERSION := ClockworkMod Recovery v2.5.0.1 +RECOVERY_VERSION := ClockworkMod Recovery v2.5.0.4 LOCAL_CFLAGS += -DRECOVERY_VERSION="$(RECOVERY_VERSION)" RECOVERY_API_VERSION := 2 LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION) @@ -138,7 +142,7 @@ LOCAL_STATIC_LIBRARIES += libstdc++ libc include $(BUILD_EXECUTABLE) -RECOVERY_LINKS := amend busybox flash_image dump_image mkyaffs2image unyaffs erase_image nandroid +RECOVERY_LINKS := amend busybox flash_image dump_image mkyaffs2image unyaffs erase_image nandroid reboot # nc is provided by external/netcat SYMLINKS := $(addprefix $(TARGET_RECOVERY_ROOT_OUT)/sbin/,$(RECOVERY_LINKS)) diff --git a/killrecovery.sh b/killrecovery.sh index 90f43e6..4c15f0b 100755 --- a/killrecovery.sh +++ b/killrecovery.sh @@ -6,4 +6,11 @@ touch /tmp/.ignorebootmessage kill $(ps | grep /sbin/adbd) kill $(ps | grep /sbin/recovery) +# On the Galaxy S, the recovery comes test signed, but the +# recovery is not automatically restarted. +if [ -f /init.smdkc110.rc ] +then + /sbin/recovery & +fi + exit 1 \ No newline at end of file diff --git a/nandroid.c b/nandroid.c index e3a2bb4..35ad641 100644 --- a/nandroid.c +++ b/nandroid.c @@ -228,10 +228,12 @@ int nandroid_restore_partition_extended(const char* backup_path, const char* roo } ui_print("Restoring %s...\n", name); + /* if (0 != (ret = ensure_root_path_unmounted(root))) { ui_print("Can't unmount %s!\n", mount_point); return ret; } + */ if (0 != (ret = format_root_device(root))) { ui_print("Error while formatting %s!\n", root); return ret; diff --git a/recovery.c b/recovery.c index fea1e7d..ce4405b 100644 --- a/recovery.c +++ b/recovery.c @@ -536,6 +536,10 @@ main(int argc, char **argv) return amend_main(argc, argv); if (strstr(argv[0], "nandroid")) return nandroid_main(argc, argv); + if (strstr(argv[0], "reboot")) + return reboot_main(argc, argv); + if (strstr(argv[0], "setprop")) + return setprop_main(argc, argv); return busybox_driver(argc, argv); } __system("/sbin/postrecoveryboot.sh"); diff --git a/roots.c b/roots.c index df49cc3..474ea1d 100644 --- a/roots.c +++ b/roots.c @@ -345,7 +345,7 @@ format_root_device(const char *root) LOGW("format_root_device: can't resolve \"%s\"\n", root); return -1; } - if (info->mount_point != NULL) { + if (info->mount_point != NULL && info->device == g_mtd_device) { /* Don't try to format a mounted device. */ int ret = ensure_root_path_unmounted(root);