initial support for flashing samsung kernels via redbend_ua
Change-Id: I9033146899d596c6d0a4ba8a5fad080d799d96ae
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_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
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 @@
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 @@
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 @@
success ? "wrote" : "failed to write", partition, filename);
result = success ? partition : strdup("");
+#endif
done:
if (result != partition) free(partition);