Skip to contentSkip to conversation

boot/uboot/uboot.mk: add stripped u-boot.elf support

PATCH In review Neal Frager via buildroot 1 participant 5 messages Nov 8, 2022 – Nov 21, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 boot/uboot/uboot.mk: add stripped u-boot.elf support

If a user requests a u-boot binary in elf format, they may actually want the stripped u-boot.elf version. This patch provides the stripped u-boot.elf binary.

---
 boot/uboot/uboot.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
boot/uboot/uboot.mk +1 -1
index 0439ec5e4b..216efc5a13 100644
@@ -53,7 +53,7 @@ UBOOT_BINS += u-boot.dtb
 endif
 
 ifeq ($(BR2_TARGET_UBOOT_FORMAT_ELF),y)
-UBOOT_BINS += u-boot
+UBOOT_BINS += u-boot u-boot.elf
 # To make elf usable for debuging on ARC use special target
 ifeq ($(BR2_arc),y)
 UBOOT_MAKE_TARGET += mdbtrick
Signature · 6 lines
2.17.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hello everyone,

Just a friendly reminder regarding this patch. Any feedback?

If a user requests a u-boot binary in elf format, they may actually want the stripped u-boot.elf version. This patch provides the stripped u-boot.elf binary.

---
 boot/uboot/uboot.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
boot/uboot/uboot.mk +1 -2
@@ -53,7 +53,7 @@ UBOOT_BINS += u-boot.dtb  endif
 
 ifeq ($(BR2_TARGET_UBOOT_FORMAT_ELF),y)
-UBOOT_BINS += u-boot
+UBOOT_BINS += u-boot u-boot.elf
 # To make elf usable for debuging on ARC use special target  ifeq ($(BR2_arc),y)  UBOOT_MAKE_TARGET += mdbtrick
--

2.17.1

Best regards,
Neal Frager
AMD
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw

Hello Neal,

Quoted 16 lines · Neal

Hello everyone,

Just a friendly reminder regarding this patch. Any feedback?

If a user requests a u-boot binary in elf format, they may actually want the stripped u-boot.elf version. This patch provides the stripped u-boot.elf binary.

---
 boot/uboot/uboot.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

boot/uboot/uboot.mk UBOOT_BINS += u-boot.dtb endif · line 55

Quoted 4 lines
boot/uboot/uboot.mk +1 -1
@@ -53,7 +53,7 @@ UBOOT_BINS += u-boot.dtb  endif
 
 ifeq ($(BR2_TARGET_UBOOT_FORMAT_ELF),y)
-UBOOT_BINS += u-boot
+UBOOT_BINS += u-boot u-boot.elf

This assumes BR2_TARGET_UBOOT_FORMAT_ELF will always result in building u-boot.elf, but I don't think this is true for all platforms.

At a quick test with a RISC-V build and BR2_TARGET_UBOOT_FORMAT_ELF=y I got a failure with your patch applied because u-boot is produced but u-boot.elf isn't.

Signature · 7 lines
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

Hi Luca,

Quoted 24 lines

Hello everyone,

Just a friendly reminder regarding this patch. Any feedback?

If a user requests a u-boot binary in elf format, they may actually want the stripped u-boot.elf version. This patch provides the stripped u-boot.elf binary.

---
 boot/uboot/uboot.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
boot/uboot/uboot.mk index renamed from boot/uboot/uboot.mk +0 -0

0439ec5e4b..216efc5a13 100644

boot/uboot/uboot.mk +1 -1
@@ -53,7 +53,7 @@ UBOOT_BINS += u-boot.dtb  endif
 
 ifeq ($(BR2_TARGET_UBOOT_FORMAT_ELF),y)
-UBOOT_BINS += u-boot
+UBOOT_BINS += u-boot u-boot.elf
 

This assumes BR2_TARGET_UBOOT_FORMAT_ELF will always result in building u-boot.elf, but I don't think this is true for all platforms.

Quoted 1 line

At a quick test with a RISC-V build and BR2_TARGET_UBOOT_FORMAT_ELF=y I got a failure with your patch applied because u-boot is produced but u-boot.elf isn't.

Thank you for this feedback. I was not aware that some platforms generate a u-boot file, but not a u-boot.elf file.

I could just use the u-boot file with the versal builds, but I would prefer to use the u-boot.elf file, so that I fully match the way PetaLinux and Yocto work.

Do you have any suggestions for getting the u-boot.elf file, if it is not available for all platforms?

Would it be acceptable to add a define specific to this version of elf file such as BR2_TARGET_UBOOT_FORMAT_STRIPPED_ELF? This would still fail, of course, if built with a RISC-V configuration, so I am not sure what to do.

Best regards,
Neal Frager
AMD

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw
In reply to Luca Ceresoli via buildroot

Hi Luca,

Quoted 24 lines

Hello everyone,

Just a friendly reminder regarding this patch. Any feedback?

If a user requests a u-boot binary in elf format, they may actually want the stripped u-boot.elf version. This patch provides the stripped u-boot.elf binary.

---
 boot/uboot/uboot.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
boot/uboot/uboot.mk index renamed from boot/uboot/uboot.mk +0 -0

0439ec5e4b..216efc5a13 100644

boot/uboot/uboot.mk +1 -1
@@ -53,7 +53,7 @@ UBOOT_BINS += u-boot.dtb  endif
 
 ifeq ($(BR2_TARGET_UBOOT_FORMAT_ELF),y)
-UBOOT_BINS += u-boot
+UBOOT_BINS += u-boot u-boot.elf
 

This assumes BR2_TARGET_UBOOT_FORMAT_ELF will always result in building u-boot.elf, but I don't think this is true for all platforms.

Quoted 1 line

At a quick test with a RISC-V build and BR2_TARGET_UBOOT_FORMAT_ELF=y I got a failure with your patch applied because u-boot is produced but u-boot.elf isn't.

Do you know if all ARM 64-bit architectures generate a u-boot.elf by default?

We could do this then:

ifeq ($(BR2_TARGET_UBOOT_FORMAT_ELF),y)
UBOOT_BINS += u-boot
# To make elf usable for debuging on ARC use special target Ifeq ($(BR2_aarch64),y)
UBOOT_BINS += u-boot.elf
endif
ifeq ($(BR2_arc),y)
UBOOT_MAKE_TARGET += mdbtrick
endif
endif

What do you think?

Best regards,
Neal Frager
AMD

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot