diff mbox series

[LEDE-DEV,RFC] at91: fix build of legacy target

Message ID 20171015224444.8909-1-hauke@hauke-m.de
State Superseded
Delegated to: Hauke Mehrtens
Headers show
Series [LEDE-DEV,RFC] at91: fix build of legacy target | expand

Commit Message

Hauke Mehrtens Oct. 15, 2017, 10:44 p.m. UTC
Changing the order of the devices fixes the build problem seen by the
build bot. I do not understand why this is making any difference at all,
this is probably only hiding a different bug.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---

Without this patch I am getting the following error message:

cat /home/hauke/openwrt/lede/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_legacy/tmp/lede-at91-legacy-tny_a9260-squashfs-factory.bin.dtb >> /home/hauke/openwrt/lede/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_legacy/tmp/lede-at91-legacy-tny_a9260-squashfs-factory.bin
dd if=/home/hauke/openwrt/lede/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_legacy/tmp/lede-at91-legacy-tny_a9260-squashfs-factory.bin of=/home/hauke/openwrt/lede/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_legacy/tmp/lede-at91-legacy-tny_a9260-squashfs-factory.bin.new bs= conv=sync
dd: invalid number: ''
Makefile:74: recipe for target '/home/hauke/openwrt/lede/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_legacy/tmp/lede-at91-legacy-tny_a9260-squashfs-factory.bin' failed
make[5]: *** [/home/hauke/openwrt/lede/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_legacy/tmp/lede-at91-legacy-tny_a9260-squashfs-factory.bin] Error 1
make[5]: Leaving directory '/home/hauke/openwrt/lede/target/linux/at91/image'
Makefile:24: recipe for target 'install' failed


I am using this configuration:
$ ./scripts/diffconfig.sh 
CONFIG_TARGET_at91=y
CONFIG_TARGET_at91_legacy=y
CONFIG_TARGET_at91_legacy_DEVICE_tny_a9260=y

The build bots are also splotting this problem.


 target/linux/at91/image/legacy.mk | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

Comments

Mathias Kresin Oct. 16, 2017, 8:03 a.m. UTC | #1
16.10.2017 00:44, Hauke Mehrtens:
> Changing the order of the devices fixes the build problem seen by the
> build bot. I do not understand why this is making any difference at all,
> this is probably only hiding a different bug.
> 
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
> 
> Without this patch I am getting the following error message:
> 
> cat /home/hauke/openwrt/lede/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_legacy/tmp/lede-at91-legacy-tny_a9260-squashfs-factory.bin.dtb >> /home/hauke/openwrt/lede/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_legacy/tmp/lede-at91-legacy-tny_a9260-squashfs-factory.bin
> dd if=/home/hauke/openwrt/lede/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_legacy/tmp/lede-at91-legacy-tny_a9260-squashfs-factory.bin of=/home/hauke/openwrt/lede/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_legacy/tmp/lede-at91-legacy-tny_a9260-squashfs-factory.bin.new bs= conv=sync
> dd: invalid number: ''
> Makefile:74: recipe for target '/home/hauke/openwrt/lede/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_legacy/tmp/lede-at91-legacy-tny_a9260-squashfs-factory.bin' failed
> make[5]: *** [/home/hauke/openwrt/lede/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_legacy/tmp/lede-at91-legacy-tny_a9260-squashfs-factory.bin] Error 1
> make[5]: Leaving directory '/home/hauke/openwrt/lede/target/linux/at91/image'
> Makefile:24: recipe for target 'install' failed

Hey Hauke,

your issue is:

define Device/Default
   DTB_SIZE :=
endef

define Device/production-dtb
   $(Device/production)
   $(Device/dtb)
   DTB_SIZE := 128k
   IMAGE/factory.bin := append-dtb | pad-to $$$$(DTB_SIZE) \
	  | append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
endef

The pad-to $$$$(DTB_SIZE) references the DTB_SIZE variable from 
Device/Default instead of Device/production-dtb.

The best would be to move DTB_SIZE := 128k to Device/Default (which is 
safe since we don't have different DTB_SIZE values). Another way to fix 
the issue is to change the pad-to parameter to pad-to $$(DTB_SIZE).

But I've to admit, I fail to see why it works as intended if you change 
the order of the build code and it's most likely the reason why I didn't 
noticed the issue at the time I merged 
c2f052acaeb480e89d3ce39c47f49ad16b3464ac.

Mathias
Hauke Mehrtens Oct. 16, 2017, 9:18 p.m. UTC | #2
On 10/16/2017 10:03 AM, Mathias Kresin wrote:
> 16.10.2017 00:44, Hauke Mehrtens:
>> Changing the order of the devices fixes the build problem seen by the
>> build bot. I do not understand why this is making any difference at all,
>> this is probably only hiding a different bug.
>>
>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>> ---
>>
>> Without this patch I am getting the following error message:
>>
>> cat
>> /home/hauke/openwrt/lede/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_legacy/tmp/lede-at91-legacy-tny_a9260-squashfs-factory.bin.dtb
>> >>
>> /home/hauke/openwrt/lede/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_legacy/tmp/lede-at91-legacy-tny_a9260-squashfs-factory.bin
>>
>> dd
>> if=/home/hauke/openwrt/lede/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_legacy/tmp/lede-at91-legacy-tny_a9260-squashfs-factory.bin
>> of=/home/hauke/openwrt/lede/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_legacy/tmp/lede-at91-legacy-tny_a9260-squashfs-factory.bin.new
>> bs= conv=sync
>> dd: invalid number: ''
>> Makefile:74: recipe for target
>> '/home/hauke/openwrt/lede/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_legacy/tmp/lede-at91-legacy-tny_a9260-squashfs-factory.bin'
>> failed
>> make[5]: ***
>> [/home/hauke/openwrt/lede/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_legacy/tmp/lede-at91-legacy-tny_a9260-squashfs-factory.bin]
>> Error 1
>> make[5]: Leaving directory
>> '/home/hauke/openwrt/lede/target/linux/at91/image'
>> Makefile:24: recipe for target 'install' failed
> 
> Hey Hauke,
> 
> your issue is:
> 
> define Device/Default
>   DTB_SIZE :=
> endef
> 
> define Device/production-dtb
>   $(Device/production)
>   $(Device/dtb)
>   DTB_SIZE := 128k
>   IMAGE/factory.bin := append-dtb | pad-to $$$$(DTB_SIZE) \
>       | append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
> endef
> 
> The pad-to $$$$(DTB_SIZE) references the DTB_SIZE variable from
> Device/Default instead of Device/production-dtb.
> 
> The best would be to move DTB_SIZE := 128k to Device/Default (which is
> safe since we don't have different DTB_SIZE values). Another way to fix
> the issue is to change the pad-to parameter to pad-to $$(DTB_SIZE).
> 
> But I've to admit, I fail to see why it works as intended if you change
> the order of the build code and it's most likely the reason why I didn't
> noticed the issue at the time I merged
> c2f052acaeb480e89d3ce39c47f49ad16b3464ac.
> 
> Mathias

Hi Mathias,

thanks for the help, I created a fix and pushed it with that fix it
builds at least for me, lest see if the build bot is fixed now too.

Probably this depends on the order these two variables have in some
internal representation and this gets affected by other things.

Hauke
diff mbox series

Patch

diff --git a/target/linux/at91/image/legacy.mk b/target/linux/at91/image/legacy.mk
index c6d9ed8108..7a8b4abef1 100644
--- a/target/linux/at91/image/legacy.mk
+++ b/target/linux/at91/image/legacy.mk
@@ -110,13 +110,6 @@  define Device/ethernut5
 endef
 TARGET_DEVICES += ethernut5
 
-define Device/at91-q5xr5
-  $(Device/production-dtb)
-  DEVICE_TITLE := Exegin Q5XR5
-  KERNEL_SIZE := 2048k
-endef
-TARGET_DEVICES += at91-q5xr5
-
 define Device/wb45n
   $(Device/evaluation-fit)
   DEVICE_TITLE := Laird WB45N
@@ -131,3 +124,9 @@  define Device/wb45n
 endef
 TARGET_DEVICES += wb45n
 
+define Device/at91-q5xr5
+  $(Device/production-dtb)
+  DEVICE_TITLE := Exegin Q5XR5
+  KERNEL_SIZE := 2048k
+endef
+TARGET_DEVICES += at91-q5xr5