Support Nook Green Loader
This commit is contained in:
parent
f48e6c93b8
commit
28350e3ad9
@ -122,6 +122,11 @@ 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) {
|
||||||
|
boot->flags |= NOOK_FLAG;
|
||||||
|
fprintf(stderr, "NOOK_GREEN_LOADER\n");
|
||||||
|
head += NOOK_PRE_HEADER_SZ - 1;
|
||||||
|
continue;
|
||||||
} else {
|
} else {
|
||||||
boot->hdr = malloc(sizeof(boot_img_hdr));
|
boot->hdr = malloc(sizeof(boot_img_hdr));
|
||||||
memcpy(boot->hdr, head, sizeof(boot_img_hdr));
|
memcpy(boot->hdr, head, sizeof(boot_img_hdr));
|
||||||
@ -285,6 +290,8 @@ void repack(const char* orig_image, const char* out_image) {
|
|||||||
} else if (boot.flags & BLOB_FLAG) {
|
} else if (boot.flags & BLOB_FLAG) {
|
||||||
// Skip blob header
|
// Skip blob header
|
||||||
write_zero(fd, sizeof(blob_hdr));
|
write_zero(fd, sizeof(blob_hdr));
|
||||||
|
} else if (boot.flags & NOOK_FLAG) {
|
||||||
|
restore_buf(fd, boot.map_addr, NOOK_PRE_HEADER_SZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skip a page for header
|
// Skip a page for header
|
||||||
|
@ -130,6 +130,7 @@ typedef struct blob_hdr {
|
|||||||
#define LG_BUMP_FLAG 0x0040
|
#define LG_BUMP_FLAG 0x0040
|
||||||
#define SHA256_FLAG 0x0080
|
#define SHA256_FLAG 0x0080
|
||||||
#define BLOB_FLAG 0x0100
|
#define BLOB_FLAG 0x0100
|
||||||
|
#define NOOK_FLAG 0x0200
|
||||||
|
|
||||||
typedef struct boot_img {
|
typedef struct boot_img {
|
||||||
// Memory map of the whole image
|
// Memory map of the whole image
|
||||||
|
@ -38,6 +38,8 @@ typedef enum {
|
|||||||
#define DHTB_MAGIC "\x44\x48\x54\x42\x01\x00\x00\x00"
|
#define DHTB_MAGIC "\x44\x48\x54\x42\x01\x00\x00\x00"
|
||||||
#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_PRE_HEADER_SZ 1048575
|
||||||
|
|
||||||
#define SUP_LIST ((char *[]) { "gzip", "xz", "lzma", "bzip2", "lz4", "lz4_legacy", NULL })
|
#define SUP_LIST ((char *[]) { "gzip", "xz", "lzma", "bzip2", "lz4", "lz4_legacy", NULL })
|
||||||
#define SUP_EXT_LIST ((char *[]) { "gz", "xz", "lzma", "bz2", "lz4", "lz4", NULL })
|
#define SUP_EXT_LIST ((char *[]) { "gz", "xz", "lzma", "bz2", "lz4", "lz4", NULL })
|
||||||
|
Loading…
Reference in New Issue
Block a user