mirror of
https://github.com/meizu-m86/twrp_multirom_m86
synced 2025-11-04 06:15:41 +08:00
Fix updater binary for 7.0
Note: updater is currently not backwards compatible with older trees. Maybe later... Change-Id: I3c2a5ef69cfa9005502408f7054e3096a64ba34b
This commit is contained in:
@@ -34,7 +34,7 @@ LOCAL_SRC_FILES := applypatch.cpp bspatch.cpp freecache.cpp imgpatch.cpp utils.c
|
||||
LOCAL_MODULE := libapplypatch
|
||||
LOCAL_MODULE_TAGS := eng
|
||||
LOCAL_C_INCLUDES += bootable/recovery
|
||||
LOCAL_STATIC_LIBRARIES += libbase libotafault libmtdutils libmincrypttwrp libbz libz
|
||||
LOCAL_STATIC_LIBRARIES += libbase libotafault libmtdutils libcrypto_static libbz libz
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ static int LoadPartitionContents(const char* filename, FileContents* file) {
|
||||
type = MTD;
|
||||
} else if (pieces[0] == "EMMC") {
|
||||
type = EMMC;
|
||||
} else if (strcmp(magic, "BML") == 0) {
|
||||
} else if (pieces[0] == "BML") {
|
||||
type = EMMC;
|
||||
} else {
|
||||
printf("LoadPartitionContents called with bad filename (%s)\n", filename);
|
||||
@@ -127,7 +127,7 @@ static int LoadPartitionContents(const char* filename, FileContents* file) {
|
||||
}
|
||||
const char* partition = pieces[1].c_str();
|
||||
|
||||
if (strcmp(magic, "BML") == 0) {
|
||||
if (pieces[0] == "BML") {
|
||||
if (strcmp(partition, "boot") == 0) {
|
||||
partition = BOARD_BML_BOOT;
|
||||
} else if (strcmp(partition, "recovery") == 0) {
|
||||
@@ -331,7 +331,7 @@ int WriteToPartition(const unsigned char* data, size_t len, const char* target)
|
||||
type = MTD;
|
||||
} else if (pieces[0] == "EMMC") {
|
||||
type = EMMC;
|
||||
} else if (strcmp(magic, "BML") == 0) {
|
||||
} else if (pieces[0] == "BML") {
|
||||
type = EMMC;
|
||||
} else {
|
||||
printf("WriteToPartition called with bad target (%s)\n", target);
|
||||
@@ -340,7 +340,7 @@ int WriteToPartition(const unsigned char* data, size_t len, const char* target)
|
||||
|
||||
const char* partition = pieces[1].c_str();
|
||||
|
||||
if (strcmp(magic, "BML") == 0) {
|
||||
if (pieces[0] == "BML") {
|
||||
if (strcmp(partition, "boot") == 0) {
|
||||
partition = BOARD_BML_BOOT;
|
||||
} else if (strcmp(partition, "recovery") == 0) {
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
#ifndef MTDUTILS_MOUNTS_H_
|
||||
#define MTDUTILS_MOUNTS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct MountedVolume MountedVolume;
|
||||
|
||||
int scan_mounted_volumes(void);
|
||||
@@ -30,4 +34,8 @@ int unmount_mounted_volume(const MountedVolume *volume);
|
||||
|
||||
int remount_read_only(const MountedVolume* volume);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // MTDUTILS_MOUNTS_H_
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
|
||||
#include <sys/types.h> // for size_t, etc.
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct MtdPartition MtdPartition;
|
||||
|
||||
int mtd_scan_partitions(void);
|
||||
@@ -58,4 +62,8 @@ struct MtdPartition {
|
||||
char *name;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // MTDUTILS_H_
|
||||
|
||||
@@ -33,27 +33,13 @@ LOCAL_CLANG := true
|
||||
|
||||
LOCAL_SRC_FILES := $(updater_src_files)
|
||||
|
||||
LOCAL_STATIC_LIBRARIES += libfec libfec_rs libext4_utils_static libsquashfs_utils libcrypto_static
|
||||
LOCAL_STATIC_LIBRARIES += libfec libfec_rs libsquashfs_utils libcrypto_static
|
||||
|
||||
ifeq ($(TARGET_USERIMAGES_USE_EXT4), true)
|
||||
LOCAL_CFLAGS += -DUSE_EXT4
|
||||
LOCAL_CFLAGS += -Wno-unused-parameter
|
||||
LOCAL_C_INCLUDES += system/extras/ext4_utils
|
||||
LOCAL_STATIC_LIBRARIES += \
|
||||
libext4_utils \
|
||||
libz
|
||||
ifneq ($(wildcard system/core/libmincrypt/rsa_e_3.c),)
|
||||
LOCAL_STATIC_LIBRARIES = \
|
||||
libext4_utils_static \
|
||||
libsparse_static \
|
||||
libz
|
||||
endif
|
||||
ifneq ($(wildcard system/core/include/mincrypt/sha256.h),)
|
||||
LOCAL_STATIC_LIBRARIES = \
|
||||
libext4_utils_static \
|
||||
libsparse_static \
|
||||
libz
|
||||
endif
|
||||
LOCAL_STATIC_LIBRARIES += libext4_utils_static libsparse_static
|
||||
ifneq ($(wildcard external/lz4/Android.mk),)
|
||||
LOCAL_STATIC_LIBRARIES += liblz4
|
||||
endif
|
||||
@@ -62,7 +48,7 @@ endif
|
||||
LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UPDATER_LIBS) $(TARGET_RECOVERY_UPDATER_EXTRA_LIBS)
|
||||
LOCAL_STATIC_LIBRARIES += libapplypatch libbase libotafault libedify libmtdutils libminzip libz
|
||||
LOCAL_STATIC_LIBRARIES += libflashutils libmmcutils libbmlutils
|
||||
LOCAL_STATIC_LIBRARIES += libmincrypttwrp libbz
|
||||
LOCAL_STATIC_LIBRARIES += libbz
|
||||
LOCAL_STATIC_LIBRARIES += libcutils liblog libc
|
||||
LOCAL_STATIC_LIBRARIES += libselinux
|
||||
|
||||
|
||||
Reference in New Issue
Block a user