From 9759ede7327d7d96a2839e52cda34d098667d299 Mon Sep 17 00:00:00 2001 From: atinm Date: Sat, 25 Jun 2011 18:36:53 -0400 Subject: [PATCH 1/2] Use the callback function in the call to mkyaffs2image() in _wrapper Change-Id: Iee385a602e33a44dfa0deee8af49133f16f09d2c --- nandroid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nandroid.c b/nandroid.c index ae10ca8..af97e86 100644 --- a/nandroid.c +++ b/nandroid.c @@ -101,7 +101,7 @@ typedef void (*file_event_callback)(const char* filename); typedef int (*nandroid_backup_handler)(const char* backup_path, const char* backup_file_image, int callback); static int mkyaffs2image_wrapper(const char* backup_path, const char* backup_file_image, int callback) { - return mkyaffs2image(backup_path, backup_file_image, 0, callback); + return mkyaffs2image(backup_path, backup_file_image, 0, callback ? yaffs_callback : NULL); } static int tar_compress_wrapper(const char* backup_path, const char* backup_file_image, int callback) { From a42d2b1e2466f69be6d802cd6511c076e0285ad9 Mon Sep 17 00:00:00 2001 From: atinm Date: Sat, 25 Jun 2011 18:41:05 -0400 Subject: [PATCH 2/2] Reverts: http://review.cyanogenmod.com/#change,6130 The system() call implemented in bionic/libc/unistd/system.c depends on paths.h which sets _PATH_BSHELL to "/system/bin/sh" which is incorrect for recovery - recovery cannot depend on /system being mounted or even sane because /system could be corrupt when recovery is used. We need _PATH_BSHELL to be pointing to /sbin/sh - and therefore bootable/recovery has its own __system() call implemented in bootable/recovery/libcrecovery that sets _PATH_BSHELL as well as makes sure environ is used in the call to execve. Change-Id: I2e5fd9c259e4fd0a9aad826a297fd3233a50a7c1 --- Android.mk | 2 +- extendedcommands.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Android.mk b/Android.mk index 9ec1301..34c092d 100644 --- a/Android.mk +++ b/Android.mk @@ -31,7 +31,7 @@ LOCAL_CFLAGS += -DRECOVERY_VERSION="$(RECOVERY_VERSION)" RECOVERY_API_VERSION := 2 LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION) -BOARD_RECOVERY_DEFINES := BOARD_HAS_NO_SELECT_BUTTON BOARD_HAS_SMALL_RECOVERY BOARD_LDPI_RECOVERY BOARD_UMS_LUNFILE +BOARD_RECOVERY_DEFINES := BOARD_HAS_NO_SELECT_BUTTON BOARD_HAS_SMALL_RECOVERY BOARD_LDPI_RECOVERY BOARD_UMS_LUNFILE TARGET_RECOVERY_PRE_COMMAND $(foreach board_define,$(BOARD_RECOVERY_DEFINES), \ $(if $($(board_define)), \ diff --git a/extendedcommands.c b/extendedcommands.c index c2a0e18..6725bef 100644 --- a/extendedcommands.c +++ b/extendedcommands.c @@ -894,7 +894,10 @@ void show_advanced_menu() switch (chosen_item) { case 0: - reboot_wrapper("recovery"); +#ifdef TARGET_RECOVERY_PRE_COMMAND + __system(TARGET_RECOVERY_PRE_COMMAND); +#endif + __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART2, "recovery"); break; case 1: {