diff mbox

[OpenWrt-Devel,v2,1/3] ar71xx/image: introduce LOADER_TYPE to support elf loaders

Message ID 1457393875-13132-2-git-send-email-lynxis@fe80.eu
State Accepted
Headers show

Commit Message

Alexander 'lynxis' Couzens March 7, 2016, 11:37 p.m. UTC
The loader decompress a lzma compressed kernel. Some bootloaders
only support elf files like the tplink cpe510

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
---
 target/linux/ar71xx/image/Makefile | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

John Crispin March 8, 2016, 6:21 a.m. UTC | #1
On 08/03/2016 00:37, Alexander Couzens wrote:
> The loader decompress a lzma compressed kernel. Some bootloaders
> only support elf files like the tplink cpe510
> 
> Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
> ---
>  target/linux/ar71xx/image/Makefile | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
> index cb11104..068d293 100644
> --- a/target/linux/ar71xx/image/Makefile
> +++ b/target/linux/ar71xx/image/Makefile
> @@ -14,7 +14,7 @@ IMAGE_PROFILE:=$(if $(PROFILE),$(PROFILE),Default)
>  
>  KERNEL_LOADADDR = 0x80060000
>  
> -DEVICE_VARS += NETGEAR_KERNEL_MAGIC NETGEAR_BOARD_ID NETGEAR_HW_ID CMDLINE CONSOLE IMAGE_SIZE BOARDNAME LOADER_FLASH_OFFS
> +DEVICE_VARS += NETGEAR_KERNEL_MAGIC NETGEAR_BOARD_ID NETGEAR_HW_ID CMDLINE CONSOLE IMAGE_SIZE BOARDNAME LOADER_FLASH_OFFS LOADER_TYPE
>  
>  define Build/netgear-squashfs
>  	rm -rf $@.fs $@.squashfs
> @@ -80,8 +80,8 @@ define Build/loader-common
>  		TARGET_DIR="$(dir $@)" LOADER_NAME="$(notdir $@)" \
>  		KERNEL_CMDLINE="$(CMDLINE)" BOARD="$(BOARDNAME)" \
>  		LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
> -		$(1) compile loader.gz
> -	mv "$@.gz" "$@"
> +		$(1) compile loader.$(LOADER_TYPE)
> +	mv "$@.$(LOADER_TYPE)" "$@"

does this not need some defaults for when loader_type is not set ?



>  	rm -rf $@.src
>  endef
>  
> @@ -264,6 +264,7 @@ TARGET_DEVICES += wndr3700 wndr3700v2 wndr3800 wndr3800ch wndrmac wndrmacv2
>  define Device/tplink
>    TPLINK_HWREV := 0x1
>    TPLINK_HEADER_VERSION := 1
> +  LOADER_TYPE := gz
>    KERNEL := kernel-bin | patch-cmdline | lzma
>    KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | mktplinkfw-initramfs
>    IMAGES := sysupgrade.bin factory.bin
>
Alexander 'lynxis' Couzens March 8, 2016, 3:12 p.m. UTC | #2
On Tue, 8 Mar 2016 07:21:26 +0100
John Crispin <blogic@openwrt.org> wrote:

> does this not need some defaults for when loader_type is not set ?
right. it must set. Should I set gz as default?
John Crispin March 8, 2016, 3:36 p.m. UTC | #3
On 08/03/2016 16:12, Alexander Couzens wrote:
> On Tue, 8 Mar 2016 07:21:26 +0100
> John Crispin <blogic@openwrt.org> wrote:
> 
>> does this not need some defaults for when loader_type is not set ?
> right. it must set. Should I set gz as default?
> 

you tell me, what was the default before your patch ?



> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
Alexander 'lynxis' Couzens March 10, 2016, 7:56 p.m. UTC | #4
On Tue, 8 Mar 2016 16:36:41 +0100
John Crispin <blogic@openwrt.org> wrote:

> >> does this not need some defaults for when loader_type is not
> >> set ?  
> > right. it must set. Should I set gz as default?
> >   
> 
> you tell me, what was the default before your patch ?
There wasn't a real default before, but the loader built gz before.
I set it for all device which uses the Loader in the Device/tplink
Template to := gz.

Ok, I could setting it under Device/Default. But wouldn't that overflow
that Default/Device? Like LOADER_FLASH_OFFSET isn't set either. It's
only set for these device which uses the LOADER.

Best,
lynxis
diff mbox

Patch

diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index cb11104..068d293 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -14,7 +14,7 @@  IMAGE_PROFILE:=$(if $(PROFILE),$(PROFILE),Default)
 
 KERNEL_LOADADDR = 0x80060000
 
-DEVICE_VARS += NETGEAR_KERNEL_MAGIC NETGEAR_BOARD_ID NETGEAR_HW_ID CMDLINE CONSOLE IMAGE_SIZE BOARDNAME LOADER_FLASH_OFFS
+DEVICE_VARS += NETGEAR_KERNEL_MAGIC NETGEAR_BOARD_ID NETGEAR_HW_ID CMDLINE CONSOLE IMAGE_SIZE BOARDNAME LOADER_FLASH_OFFS LOADER_TYPE
 
 define Build/netgear-squashfs
 	rm -rf $@.fs $@.squashfs
@@ -80,8 +80,8 @@  define Build/loader-common
 		TARGET_DIR="$(dir $@)" LOADER_NAME="$(notdir $@)" \
 		KERNEL_CMDLINE="$(CMDLINE)" BOARD="$(BOARDNAME)" \
 		LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
-		$(1) compile loader.gz
-	mv "$@.gz" "$@"
+		$(1) compile loader.$(LOADER_TYPE)
+	mv "$@.$(LOADER_TYPE)" "$@"
 	rm -rf $@.src
 endef
 
@@ -264,6 +264,7 @@  TARGET_DEVICES += wndr3700 wndr3700v2 wndr3800 wndr3800ch wndrmac wndrmacv2
 define Device/tplink
   TPLINK_HWREV := 0x1
   TPLINK_HEADER_VERSION := 1
+  LOADER_TYPE := gz
   KERNEL := kernel-bin | patch-cmdline | lzma
   KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | mktplinkfw-initramfs
   IMAGES := sysupgrade.bin factory.bin