Add support for the new NOOK_MAGIC

The new cmdline value that's been in use since Marshmallow
This commit is contained in:
worstperson 2018-02-22 05:17:22 -06:00 committed by John Wu
parent 31360c34ed
commit 3e48427eaf
2 changed files with 3 additions and 1 deletions

View File

@ -124,7 +124,8 @@ int parse_img(const char *image, boot_img *boot) {
fprintf(stderr, "PXA_BOOT_HDR\n"); fprintf(stderr, "PXA_BOOT_HDR\n");
boot->hdr = malloc(sizeof(pxa_boot_img_hdr)); boot->hdr = malloc(sizeof(pxa_boot_img_hdr));
memcpy(boot->hdr, head, sizeof(pxa_boot_img_hdr)); memcpy(boot->hdr, head, sizeof(pxa_boot_img_hdr));
} else if (memcmp(((boot_img_hdr*) head)->cmdline, NOOK_MAGIC, 12) == 0) { } else if (memcmp(((boot_img_hdr*) head)->cmdline, NOOK_MAGIC, 12) == 0
|| memcmp(((boot_img_hdr*) head)->cmdline, NOOK_NEW_MAGIC, 26) == 0) {
boot->flags |= NOOK_FLAG; boot->flags |= NOOK_FLAG;
fprintf(stderr, "NOOK_GREEN_LOADER\n"); fprintf(stderr, "NOOK_GREEN_LOADER\n");
head += NOOK_PRE_HEADER_SZ - 1; head += NOOK_PRE_HEADER_SZ - 1;

View File

@ -39,6 +39,7 @@ typedef enum {
#define SEANDROID_MAGIC "SEANDROIDENFORCE" #define SEANDROID_MAGIC "SEANDROIDENFORCE"
#define TEGRABLOB_MAGIC "-SIGNED-BY-SIGNBLOB-" #define TEGRABLOB_MAGIC "-SIGNED-BY-SIGNBLOB-"
#define NOOK_MAGIC "Green Loader" #define NOOK_MAGIC "Green Loader"
#define NOOK_NEW_MAGIC "eMMC boot.img+secondloader"
#define NOOK_PRE_HEADER_SZ 1048576 #define NOOK_PRE_HEADER_SZ 1048576
#define SUP_LIST ((char *[]) { "gzip", "xz", "lzma", "bzip2", "lz4", "lz4_legacy", NULL }) #define SUP_LIST ((char *[]) { "gzip", "xz", "lzma", "bzip2", "lz4", "lz4_legacy", NULL })