add a utility erase_image. possible fix for d/s flashing bug from zinx
This commit is contained in:
parent
bca9243339
commit
2c3cc50356
@ -77,6 +77,16 @@ LOCAL_STATIC_LIBRARIES := libmtdutils libcutils libc
|
||||
LOCAL_FORCE_STATIC_EXECUTABLE := true
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_SRC_FILES := erase_image.c
|
||||
LOCAL_MODULE := utility_erase_image
|
||||
LOCAL_MODULE_CLASS := UTILITY_EXECUTABLES
|
||||
LOCAL_MODULE_PATH := $(PRODUCT_OUT)/utilities
|
||||
LOCAL_UNSTRIPPED_PATH := $(PRODUCT_OUT)/symbols/utilities
|
||||
LOCAL_MODULE_STEM := erase_image
|
||||
LOCAL_STATIC_LIBRARIES := libmtdutils libcutils libc
|
||||
LOCAL_FORCE_STATIC_EXECUTABLE := true
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
||||
endif # TARGET_ARCH == arm
|
||||
endif # !TARGET_SIMULATOR
|
||||
|
@ -121,6 +121,10 @@ int main(int argc, char **argv) {
|
||||
size_t block_size;
|
||||
if (mtd_partition_info(partition, NULL, &block_size, NULL))
|
||||
die("error getting %s block size", argv[1]);
|
||||
|
||||
// Zinx says this fixes noncongiuous memory allocation issues?
|
||||
if (block_size > 2048)
|
||||
block_size = 2048;
|
||||
|
||||
if (lseek(fd, headerlen, SEEK_SET) != headerlen)
|
||||
die("error rewinding %s", argv[2]);
|
||||
|
Loading…
Reference in New Issue
Block a user