diff options
Diffstat (limited to 'target/linux/ath79/image/lzma-loader/src')
-rw-r--r-- | target/linux/ath79/image/lzma-loader/src/Makefile | 5 | ||||
-rw-r--r-- | target/linux/ath79/image/lzma-loader/src/loader.c | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/target/linux/ath79/image/lzma-loader/src/Makefile b/target/linux/ath79/image/lzma-loader/src/Makefile index 7773f027a2..c7bb935a03 100644 --- a/target/linux/ath79/image/lzma-loader/src/Makefile +++ b/target/linux/ath79/image/lzma-loader/src/Makefile @@ -18,6 +18,7 @@ LOADADDR := LZMA_TEXT_START := 0x80a00000 LOADER_DATA := +KERNEL_MAGIC := BOARD := FLASH_OFFS := FLASH_MAX := @@ -54,6 +55,10 @@ OBJECTS += data.o CFLAGS += -DLZMA_WRAPPER=1 -DLOADADDR=$(LOADADDR) endif +ifneq ($(strip $(KERNEL_MAGIC)),) +CFLAGS += -DCONFIG_KERNEL_MAGIC=$(KERNEL_MAGIC) +endif + ifneq ($(strip $(KERNEL_CMDLINE)),) CFLAGS += -DCONFIG_KERNEL_CMDLINE='"$(KERNEL_CMDLINE)"' endif diff --git a/target/linux/ath79/image/lzma-loader/src/loader.c b/target/linux/ath79/image/lzma-loader/src/loader.c index 794c4b6285..0213e94574 100644 --- a/target/linux/ath79/image/lzma-loader/src/loader.c +++ b/target/linux/ath79/image/lzma-loader/src/loader.c @@ -189,7 +189,11 @@ static void lzma_init_data(void) p = flash_base + flash_ofs; magic = get_be32(p); +#ifdef CONFIG_KERNEL_MAGIC + if (magic == CONFIG_KERNEL_MAGIC) { +#else if (magic == IH_MAGIC_OKLI) { +#endif hdr = (struct image_header *) p; break; } |