initial support for flashing samsung kernels via redbend_ua

Change-Id: I9033146899d596c6d0a4ba8a5fad080d799d96ae
This commit is contained in:
Koushik Dutta 2010-09-13 13:25:11 -07:00
parent 4233c7fb3c
commit e5678e9249
2 changed files with 15 additions and 1 deletions

View File

@ -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_<libname>()". Here we emit a little C function that
# gets #included by updater.c. It calls all those registration

View File

@ -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);