From e5678e9249795d26e97687e31ba279ef7127555e Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Mon, 13 Sep 2010 13:25:11 -0700 Subject: [PATCH] initial support for flashing samsung kernels via redbend_ua Change-Id: I9033146899d596c6d0a4ba8a5fad080d799d96ae --- updater/Android.mk | 7 ++++++- updater/install.c | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/updater/Android.mk b/updater/Android.mk index 319ebe2..f7c0502 100644 --- a/updater/Android.mk +++ b/updater/Android.mk @@ -18,12 +18,17 @@ LOCAL_MODULE_TAGS := eng LOCAL_SRC_FILES := $(updater_src_files) -LOCAL_STATIC_LIBRARIES := $(TARGET_RECOVERY_UPDATER_LIBS) $(TARGET_RECOVERY_UPDATER_EXTRA_LIBS) +LOCAL_STATIC_LIBRARIES += $(BOARD_UPDATER_LIBS) +LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UPDATER_LIBS) $(TARGET_RECOVERY_UPDATER_EXTRA_LIBS) LOCAL_STATIC_LIBRARIES += libapplypatch libedify libmtdutils libminzip libz LOCAL_STATIC_LIBRARIES += libmincrypt libbz LOCAL_STATIC_LIBRARIES += libcutils libstdc++ libc LOCAL_C_INCLUDES += $(LOCAL_PATH)/.. +ifdef BOARD_HAS_CUSTOM_WRITE_RAW_IMAGE + LOCAL_CFLAGS += -DBOARD_HAS_CUSTOM_WRITE_RAW_IMAGE +endif + # Each library in TARGET_RECOVERY_UPDATER_LIBS should have a function # named "Register_()". Here we emit a little C function that # gets #included by updater.c. It calls all those registration diff --git a/updater/install.c b/updater/install.c index e869134..759b688 100644 --- a/updater/install.c +++ b/updater/install.c @@ -628,6 +628,8 @@ static bool write_raw_image_cb(const unsigned char* data, return false; } +int write_raw_image(const char* partition, const char* filename); + // write_raw_image(file, partition) Value* WriteRawImageFn(const char* name, State* state, int argc, Expr* argv[]) { char* result = NULL; @@ -647,6 +649,12 @@ Value* WriteRawImageFn(const char* name, State* state, int argc, Expr* argv[]) { goto done; } +#ifdef BOARD_HAS_CUSTOM_WRITE_RAW_IMAGE + if (0 == write_raw_image(name, filename)) { + result = partition; + } + result = strdup("Failure"); +#else mtd_scan_partitions(); const MtdPartition* mtd = mtd_find_partition_by_name(partition); if (mtd == NULL) { @@ -698,6 +706,7 @@ Value* WriteRawImageFn(const char* name, State* state, int argc, Expr* argv[]) { success ? "wrote" : "failed to write", partition, filename); result = success ? partition : strdup(""); +#endif done: if (result != partition) free(partition);