[OpenWrt-Devel,1/4] tools: build squashfs (v3) for ath79

Message ID 1528879913-25844-1-git-send-email-wigyori@uid0.hu
State Changes Requested
Delegated to: Felix Fietkau
Headers show
Series
  • [OpenWrt-Devel,1/4] tools: build squashfs (v3) for ath79
Related show

Commit Message

Zoltan HERPAI June 13, 2018, 8:51 a.m.
Certain Netgear devices use BE squashfs for the kernel image. As
squashfs4 only supports creating LE images, add squashfs (v3) into
the tools to be built for ath79.

Trying to use an LE squashfs (thus trying to use squashfs4 only for
building the image) for the kernel image results in the bootloader
barfing and stopping.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
---
 tools/Makefile | 1 +
 1 file changed, 1 insertion(+)

Comments

Mathias Kresin June 13, 2018, 6:01 p.m. | #1
13.06.2018 10:51, Zoltan HERPAI:
> Certain Netgear devices use BE squashfs for the kernel image. As
> squashfs4 only supports creating LE images, add squashfs (v3) into
> the tools to be built for ath79.
> 
> Trying to use an LE squashfs (thus trying to use squashfs4 only for
> building the image) for the kernel image results in the bootloader
> barfing and stopping.
> 
> Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
> ---
>   tools/Makefile | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/tools/Makefile b/tools/Makefile
> index d2b5daf..c8ef02c 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -31,6 +31,7 @@ tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2
>   tools-$(CONFIG_TARGET_x86) += qemu
>   tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
>   tools-$(CONFIG_TARGET_ar71xx) += lzma-old squashfs
> +tools-$(CONFIG_TARGET_ath79) += squashfs
>   tools-$(CONFIG_USES_MINOR) += kernel2minor
>   tools-y += lzma squashfs4
>   tools-$(BUILD_B43_TOOLS) += b43-tools
> 

Hey Zoltan,

I tried to do exactly the same at time I noticed the issue. If I apply 
your patch, the following (and even more related) new warnings are shown 
on my system:

tools/Makefile:153: warning: overriding recipe for target 
'tools/squashfs/clean'
tools/Makefile:153: warning: ignoring old recipe for target 
'tools/squashfs/clean'
tools/Makefile:153: warning: overriding recipe for target 
'tools/squashfs/download'
tools/Makefile:153: warning: ignoring old recipe for target 
'tools/squashfs/download'
tools/Makefile:153: warning: overriding recipe for target 
'tools/squashfs/prepare'
tools/Makefile:153: warning: ignoring old recipe for target 
'tools/squashfs/prepare'
tools/Makefile:153: warning: overriding recipe for target 
'tools/squashfs/compile'

I've no idea what is going wrong. Instead I've the following change in 
my local tree since a few days (but didn't managed to send it yet):

diff --git a/tools/Makefile b/tools/Makefile
index d2b5daf..b546c64 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -30,7 +30,10 @@ tools-y += mtools dosfstools libressl
  tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2
  tools-$(CONFIG_TARGET_x86) += qemu
  tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
-tools-$(CONFIG_TARGET_ar71xx) += lzma-old squashfs
+tools-$(CONFIG_TARGET_ar71xx) += lzma-old
+ifeq ($(CONFIG_TARGET_ar71xx)$(CONFIG_TARGET_ath79),y)
+  tools-y += squashfs
+endif
  tools-$(CONFIG_USES_MINOR) += kernel2minor
  tools-y += lzma squashfs4
  tools-$(BUILD_B43_TOOLS) += b43-tools

Using this approach the squashfs3 binary is build for ar71xx and ath79 
without these warning.

Mathias
Felix Fietkau June 14, 2018, 8:39 a.m. | #2
On 2018-06-13 20:01, Mathias Kresin wrote:
> 13.06.2018 10:51, Zoltan HERPAI:
>> Certain Netgear devices use BE squashfs for the kernel image. As
>> squashfs4 only supports creating LE images, add squashfs (v3) into
>> the tools to be built for ath79.
>> 
>> Trying to use an LE squashfs (thus trying to use squashfs4 only for
>> building the image) for the kernel image results in the bootloader
>> barfing and stopping.
>> 
>> Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
>> ---
>>   tools/Makefile | 1 +
>>   1 file changed, 1 insertion(+)
>> 
>> diff --git a/tools/Makefile b/tools/Makefile
>> index d2b5daf..c8ef02c 100644
>> --- a/tools/Makefile
>> +++ b/tools/Makefile
>> @@ -31,6 +31,7 @@ tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2
>>   tools-$(CONFIG_TARGET_x86) += qemu
>>   tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
>>   tools-$(CONFIG_TARGET_ar71xx) += lzma-old squashfs
>> +tools-$(CONFIG_TARGET_ath79) += squashfs
>>   tools-$(CONFIG_USES_MINOR) += kernel2minor
>>   tools-y += lzma squashfs4
>>   tools-$(BUILD_B43_TOOLS) += b43-tools
>> 
> 
> Hey Zoltan,
> 
> I tried to do exactly the same at time I noticed the issue. If I apply 
> your patch, the following (and even more related) new warnings are shown 
> on my system:
> 
> tools/Makefile:153: warning: overriding recipe for target 
> 'tools/squashfs/clean'
> tools/Makefile:153: warning: ignoring old recipe for target 
> 'tools/squashfs/clean'
> tools/Makefile:153: warning: overriding recipe for target 
> 'tools/squashfs/download'
> tools/Makefile:153: warning: ignoring old recipe for target 
> 'tools/squashfs/download'
> tools/Makefile:153: warning: overriding recipe for target 
> 'tools/squashfs/prepare'
> tools/Makefile:153: warning: ignoring old recipe for target 
> 'tools/squashfs/prepare'
> tools/Makefile:153: warning: overriding recipe for target 
> 'tools/squashfs/compile'
> 
> I've no idea what is going wrong. Instead I've the following change in 
> my local tree since a few days (but didn't managed to send it yet):
> 
> diff --git a/tools/Makefile b/tools/Makefile
> index d2b5daf..b546c64 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -30,7 +30,10 @@ tools-y += mtools dosfstools libressl
>   tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2
>   tools-$(CONFIG_TARGET_x86) += qemu
>   tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
> -tools-$(CONFIG_TARGET_ar71xx) += lzma-old squashfs
> +tools-$(CONFIG_TARGET_ar71xx) += lzma-old
> +ifeq ($(CONFIG_TARGET_ar71xx)$(CONFIG_TARGET_ath79),y)
> +  tools-y += squashfs
> +endif
How about this instead:
tools-$(CONFIG_TARGET_ar71xx)$(CONFIG_TARGET_ath79) += squashfs

- Felix
Zoltan HERPAI June 14, 2018, 8:38 p.m. | #3
Felix Fietkau wrote:
> On 2018-06-13 20:01, Mathias Kresin wrote:
>   
>> 13.06.2018 10:51, Zoltan HERPAI:
>>     
>>> Certain Netgear devices use BE squashfs for the kernel image. As
>>> squashfs4 only supports creating LE images, add squashfs (v3) into
>>> the tools to be built for ath79.
>>>
>>> Trying to use an LE squashfs (thus trying to use squashfs4 only for
>>> building the image) for the kernel image results in the bootloader
>>> barfing and stopping.
>>>
>>> Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
>>> ---
>>>   tools/Makefile | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/tools/Makefile b/tools/Makefile
>>> index d2b5daf..c8ef02c 100644
>>> --- a/tools/Makefile
>>> +++ b/tools/Makefile
>>> @@ -31,6 +31,7 @@ tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2
>>>   tools-$(CONFIG_TARGET_x86) += qemu
>>>   tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
>>>   tools-$(CONFIG_TARGET_ar71xx) += lzma-old squashfs
>>> +tools-$(CONFIG_TARGET_ath79) += squashfs
>>>   tools-$(CONFIG_USES_MINOR) += kernel2minor
>>>   tools-y += lzma squashfs4
>>>   tools-$(BUILD_B43_TOOLS) += b43-tools
>>>
>>>       
>> Hey Zoltan,
>>
>> I tried to do exactly the same at time I noticed the issue. If I apply 
>> your patch, the following (and even more related) new warnings are shown 
>> on my system:
>>
>> tools/Makefile:153: warning: overriding recipe for target 
>> 'tools/squashfs/clean'
>> tools/Makefile:153: warning: ignoring old recipe for target 
>> 'tools/squashfs/clean'
>> tools/Makefile:153: warning: overriding recipe for target 
>> 'tools/squashfs/download'
>> tools/Makefile:153: warning: ignoring old recipe for target 
>> 'tools/squashfs/download'
>> tools/Makefile:153: warning: overriding recipe for target 
>> 'tools/squashfs/prepare'
>> tools/Makefile:153: warning: ignoring old recipe for target 
>> 'tools/squashfs/prepare'
>> tools/Makefile:153: warning: overriding recipe for target 
>> 'tools/squashfs/compile'
>>
>> I've no idea what is going wrong. Instead I've the following change in 
>> my local tree since a few days (but didn't managed to send it yet):
>>
>> diff --git a/tools/Makefile b/tools/Makefile
>> index d2b5daf..b546c64 100644
>> --- a/tools/Makefile
>> +++ b/tools/Makefile
>> @@ -30,7 +30,10 @@ tools-y += mtools dosfstools libressl
>>   tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2
>>   tools-$(CONFIG_TARGET_x86) += qemu
>>   tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
>> -tools-$(CONFIG_TARGET_ar71xx) += lzma-old squashfs
>> +tools-$(CONFIG_TARGET_ar71xx) += lzma-old
>> +ifeq ($(CONFIG_TARGET_ar71xx)$(CONFIG_TARGET_ath79),y)
>> +  tools-y += squashfs
>> +endif
>>     
> How about this instead:
> tools-$(CONFIG_TARGET_ar71xx)$(CONFIG_TARGET_ath79) += squashfs
>
> - Felix
>   
I'm happy with either, whichever you guys fancy.

Thanks,
-w-
Mathias Kresin June 16, 2018, 8:16 a.m. | #4
14.06.2018 22:38, Zoltan HERPAI:
> Felix Fietkau wrote:
>> How about this instead:
>> tools-$(CONFIG_TARGET_ar71xx)$(CONFIG_TARGET_ath79) += squashfs
>>
>> - Felix
> I'm happy with either, whichever you guys fancy.
> 
> Thanks,
> -w-

I like felix proposed solution more than what I had and committed it 
instead.

Mathias

Patch

diff --git a/tools/Makefile b/tools/Makefile
index d2b5daf..c8ef02c 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -31,6 +31,7 @@  tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2
 tools-$(CONFIG_TARGET_x86) += qemu
 tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
 tools-$(CONFIG_TARGET_ar71xx) += lzma-old squashfs
+tools-$(CONFIG_TARGET_ath79) += squashfs
 tools-$(CONFIG_USES_MINOR) += kernel2minor
 tools-y += lzma squashfs4
 tools-$(BUILD_B43_TOOLS) += b43-tools