diff options
author | Koushik Dutta <koushd@gmail.com> | 2011-07-07 12:55:02 -0700 |
---|---|---|
committer | Koushik Dutta <koushd@gmail.com> | 2011-07-07 12:55:02 -0700 |
commit | a75c067df4a08df6e734aba607c941eef7f261e0 (patch) | |
tree | d3521d5bdd77d0ed479d9afb354c7806b5bb7e00 /flashutils | |
parent | 50732e3c67454e174f008ba5443b21070f360a56 (diff) | |
download | bootable_recovery-a75c067df4a08df6e734aba607c941eef7f261e0.zip bootable_recovery-a75c067df4a08df6e734aba607c941eef7f261e0.tar.gz bootable_recovery-a75c067df4a08df6e734aba607c941eef7f261e0.tar.bz2 |
Support overriding of the bml partition used for boot and recovery. This is not ideal, because that means that there are different flash_image binaries for different samsung phones. But as far as I know, there is no way to find out which bml device is boot or recovery.
Change-Id: I5e3b83dd9267a275def003182c1bd5d2cf585896
Diffstat (limited to 'flashutils')
-rw-r--r-- | flashutils/Android.mk | 9 | ||||
-rw-r--r-- | flashutils/flashutils.c | 10 |
2 files changed, 18 insertions, 1 deletions
diff --git a/flashutils/Android.mk b/flashutils/Android.mk index d513275..aa4c7d3 100644 --- a/flashutils/Android.mk +++ b/flashutils/Android.mk @@ -9,6 +9,15 @@ LOCAL_MODULE := libflashutils LOCAL_MODULE_TAGS := eng LOCAL_C_INCLUDES += bootable/recovery LOCAL_STATIC_LIBRARIES := libmmcutils libmtdutils libbmlutils libcrecovery + +BOARD_RECOVERY_DEFINES := BOARD_BML_BOOT BOARD_BML_RECOVERY + +$(foreach board_define,$(BOARD_RECOVERY_DEFINES), \ + $(if $($(board_define)), \ + $(eval LOCAL_CFLAGS += -D$(board_define)=\"$($(board_define))\") \ + ) \ + ) + include $(BUILD_STATIC_LIBRARY) include $(CLEAR_VARS) diff --git a/flashutils/flashutils.c b/flashutils/flashutils.c index 958476c..de45e87 100644 --- a/flashutils/flashutils.c +++ b/flashutils/flashutils.c @@ -6,12 +6,20 @@ #include "flashutils/flashutils.h" +#ifndef BOARD_BML_BOOT +#define BOARD_BML_BOOT "/dev/block/bml7" +#endif + +#ifndef BOARD_BML_RECOVERY +#define BOARD_BML_RECOVERY "/dev/block/bml8" +#endif + int the_flash_type = UNKNOWN; int device_flash_type() { if (the_flash_type == UNKNOWN) { - if (access("/dev/block/bml7", F_OK) == 0) { + if (access(BOARD_BML_BOOT, F_OK) == 0) { the_flash_type = BML; } else if (access("/proc/emmc", F_OK) == 0) { the_flash_type = MMC; |