Skip to contentSkip to conversation

u-boot: Add mkenvimage tool

PATCH Superseded Alexey Brodkin 7 participants 14 messages Nov 19, 2018 – Nov 20, 2018 Synopsys ARC architecture

v3 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 u-boot: Add mkenvimage tool

This utility is used for creation of images containing usable in run-time U-Boot environment.

As of today this utility is added per-board like here [1] for Intel Edison board.

[1] http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-edison/tree/meta-intel-edison-bsp/recipes-bsp/u-boot/u-boot-tools_2014.04.bb

Given there're quite some U-Boot tools that we may want to add later this recipe name switch from "u-boot-mkimage" to generic "u-boot-tools" still for compatibility we provide "u-boot-mkimage" with help of PROVIDES as well as proposed "u-boot-mkenvimage".

Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>
Cc Richard Purdie <richard.purdie at linuxfoundation.org>
Cc Otavio Salvador <otavio at ossystems.com.br>
Cc Martin Jansa <martin.jansa at gmail.com>
Cc Ross Burton <ross.burton at intel.com>
Cc Marek Vasut <marex at denx.de>

---

Changes v2 -> v3:
* Recipe renamed to "u-boot-tools" to better match its contents (especially in the future as we add more tools there)
* Existing "u-boot-mkimage" and newly introduced "u-boot-mkenvimage" made avaialble via PROVIDES

Changes v1 -> v2:
* Got rid of a separate recipe and instead added mkenvimage to u-boot mkimage recipy

 .../{u-boot-mkimage_2018.07.bb => u-boot-tools_2018.07.bb}       | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
 rename meta/recipes-bsp/u-boot/{u-boot-mkimage_2018.07.bb => u-boot-tools_2018.07.bb} (83%)
meta/recipes-bsp/u-boot/u-boot-tools_2018.07.bb renamed from meta/recipes-bsp/u-boot/u-boot-mkimage_2018.07.bb +8 -1
similarity index 83%
rename from meta/recipes-bsp/u-boot/u-boot-mkimage_2018.07.bb
rename to meta/recipes-bsp/u-boot/u-boot-tools_2018.07.bb
index 08bff1d161..140afa8dfe 100644
@@ -1,7 +1,8 @@
 require u-boot-common_${PV}.inc
 
-SUMMARY = "U-Boot bootloader image creation tool"
+SUMMARY = "U-Boot bootloader tools"
 DEPENDS += "openssl"
+PROVIDES = "u-boot-mkimage u-boot-mkenvimage"
 
 EXTRA_OEMAKE_class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
 EXTRA_OEMAKE_class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
@@ -20,8 +21,14 @@ do_compile () {
 
 do_install () {
 	install -d ${D}${bindir}
+
+	# mkimage
 	install -m 0755 tools/mkimage ${D}${bindir}/uboot-mkimage
 	ln -sf uboot-mkimage ${D}${bindir}/mkimage
+
+	# mkenvimage
+	install -m 0755 tools/mkenvimage ${D}${bindir}/uboot-mkenvimage
+	ln -sf uboot-mkenvimage ${D}${bindir}/mkenvimage
 }
 
 RDEPENDS_${PN} += "dtc"
Signature · 1 line
2.16.2
#1 lore raw

PATCH v3 1/1 u-boot: Add mkenvimage tool

Quoted 13 lines · Alexey Brodkin

This utility is used for creation of images containing usable in run-time U-Boot environment.

As of today this utility is added per-board like here [1] for Intel Edison board.

[1] http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-edison/tree/meta-intel-edison-bsp/recipes-bsp/u-boot/u-boot-tools_2014.04.bb

Given there're quite some U-Boot tools that we may want to add later this recipe name switch from "u-boot-mkimage" to generic "u-boot-tools" still for compatibility we provide "u-boot-mkimage" with help of PROVIDES as well as proposed "u-boot-mkenvimage".

Quoted 6 lines
Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>
Cc Richard Purdie <richard.purdie at linuxfoundation.org>
Cc Otavio Salvador <otavio at ossystems.com.br>
Cc Martin Jansa <martin.jansa at gmail.com>
Cc Ross Burton <ross.burton at intel.com>
Cc Marek Vasut <marex at denx.de>

Do we want to generate one package per tool or not ?

Quoted 49 lines

---

Changes v2 -> v3:
* Recipe renamed to "u-boot-tools" to better match its contents (especially in the future as we add more tools there)
* Existing "u-boot-mkimage" and newly introduced "u-boot-mkenvimage" made avaialble via PROVIDES

Changes v1 -> v2:
* Got rid of a separate recipe and instead added mkenvimage to u-boot mkimage recipy

 .../{u-boot-mkimage_2018.07.bb => u-boot-tools_2018.07.bb}       | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
 rename meta/recipes-bsp/u-boot/{u-boot-mkimage_2018.07.bb => u-boot-tools_2018.07.bb} (83%)
meta/recipes-bsp/u-boot/u-boot-tools_2018.07.bb renamed from meta/recipes-bsp/u-boot/u-boot-mkimage_2018.07.bb +8 -1
similarity index 83%
rename from meta/recipes-bsp/u-boot/u-boot-mkimage_2018.07.bb
rename to meta/recipes-bsp/u-boot/u-boot-tools_2018.07.bb
index 08bff1d161..140afa8dfe 100644
@@ -1,7 +1,8 @@
 require u-boot-common_${PV}.inc
 
-SUMMARY = "U-Boot bootloader image creation tool"
+SUMMARY = "U-Boot bootloader tools"
 DEPENDS += "openssl"
+PROVIDES = "u-boot-mkimage u-boot-mkenvimage"
 
 EXTRA_OEMAKE_class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
 EXTRA_OEMAKE_class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
@@ -20,8 +21,14 @@ do_compile () {
 
 do_install () {
 	install -d ${D}${bindir}
+
+	# mkimage
 	install -m 0755 tools/mkimage ${D}${bindir}/uboot-mkimage
 	ln -sf uboot-mkimage ${D}${bindir}/mkimage
+
+	# mkenvimage
+	install -m 0755 tools/mkenvimage ${D}${bindir}/uboot-mkenvimage
+	ln -sf uboot-mkenvimage ${D}${bindir}/mkenvimage
 }
 
 RDEPENDS_${PN} += "dtc"
Signature · 2 lines
Best regards,
Marek Vasut
#2 lore raw

PATCH v3 1/1 u-boot: Add mkenvimage tool

Quoted 14 lines · Marek Vasut
Quoted 13 lines · Alexey Brodkin

This utility is used for creation of images containing usable in run-time U-Boot environment.

As of today this utility is added per-board like here [1] for Intel Edison board.

[1] http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-edison/tree/meta-intel-edison-bsp/recipes-bsp/u-boot/u-boot-tools_2014.04.bb

Given there're quite some U-Boot tools that we may want to add later this recipe name switch from "u-boot-mkimage" to generic "u-boot-tools" still for compatibility we provide "u-boot-mkimage" with help of PROVIDES as well as proposed "u-boot-mkenvimage".

Quoted 8 lines
Quoted 6 lines
Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>
Cc Richard Purdie <richard.purdie at linuxfoundation.org>
Cc Otavio Salvador <otavio at ossystems.com.br>
Cc Martin Jansa <martin.jansa at gmail.com>
Cc Ross Burton <ross.burton at intel.com>
Cc Marek Vasut <marex at denx.de>

Do we want to generate one package per tool or not ?

I think so, yes. Not all places will want all tools.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-snps-arc/attachments/20181119/9af71c05/attachment-0001.sig>
#3 lore raw

PATCH v3 1/1 u-boot: Add mkenvimage tool

Quoted 23 lines · Tom Rini
Quoted 21 lines · Marek Vasut
Quoted 19 lines · Alexey Brodkin

This utility is used for creation of images containing usable in run-time U-Boot environment.

As of today this utility is added per-board like here [1] for Intel Edison board.

[1] http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-edison/tree/meta-intel-edison-bsp/recipes-bsp/u-boot/u-boot-tools_2014.04.bb

Given there're quite some U-Boot tools that we may want to add later this recipe name switch from "u-boot-mkimage" to generic "u-boot-tools" still for compatibility we provide "u-boot-mkimage" with help of PROVIDES as well as proposed "u-boot-mkenvimage".

Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>
Cc Richard Purdie <richard.purdie at linuxfoundation.org>
Cc Otavio Salvador <otavio at ossystems.com.br>
Cc Martin Jansa <martin.jansa at gmail.com>
Cc Ross Burton <ross.burton at intel.com>
Cc Marek Vasut <marex at denx.de>
Quoted 3 lines
Quoted 1 line

Do we want to generate one package per tool or not ?

I think so, yes. Not all places will want all tools.

And a bonus to add a u-boot-tools-meta which rdepends on all. You can copy code to do that from gstreamer-plugins packages.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750
#4 lore raw

PATCH v3 1/1 u-boot: Add mkenvimage tool

Hi Otavio, Tom, all,

Quoted 24 lines · Otavio Salvador
Quoted 23 lines · Tom Rini
Quoted 22 lines · Marek Vasut
Quoted 20 lines · Alexey Brodkin

This utility is used for creation of images containing usable in run-time U-Boot environment.

As of today this utility is added per-board like here [1] for Intel Edison board.

[1]
https://urldefense.proofpoint.com/v2/url?u=http-3A__git.yoctoproject.org_cgit_cgit.cgi_meta-2Dintel-2Dedison_tree_meta-2Dintel-2Dedison-2Dbsp_recipes-2Dbsp_u-2Dboot_u-2Dboot-2Dtools-5F2014.04.bb&d=DwIBaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=lqdeeSSEes0GFDDl656eViXO7breS55ytWkhpk5R81I&m=sQnruA_KoGH_aC_YyN_lCddYmWBmcOpMVXzZtSwSbWo&s=pXmv0aNPFSCoj8CwGvwcZj-4bN_Sdjob3YwHYTzxDlw&e=

Given there're quite some U-Boot tools that we may want to add later this recipe name switch from "u-boot-mkimage" to generic "u-boot-tools" still for compatibility we provide "u-boot-mkimage" with help of PROVIDES as well as proposed "u-boot-mkenvimage".

Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>
Cc Richard Purdie <richard.purdie at linuxfoundation.org>
Cc Otavio Salvador <otavio at ossystems.com.br>
Cc Martin Jansa <martin.jansa at gmail.com>
Cc Ross Burton <ross.burton at intel.com>
Cc Marek Vasut <marex at denx.de>
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Do we want to generate one package per tool or not ?

I think so, yes. Not all places will want all tools.

And a bonus to add a u-boot-tools-meta which rdepends on all. You can copy code to do that from gstreamer-plugins packages.

That's how we start from simple enhancement one-liner and end-up with rework of a different scale :)

I'm still ramping-up with OE but hopefully will be able to implement proposed tool-per-package feature sometime soon.

-Alexey

#5 lore raw

PATCH v3 1/1 u-boot: Add mkenvimage tool

In reply to Otavio Salvador
Quoted 39 lines

-----Original Message-----
From: openembedded-core-bounces at lists.openembedded.org <openembedded- core-bounces at lists.openembedded.org> On Behalf Of Otavio Salvador
Sent: den 19 november 2018 20:22
To: Tom Rini <trini at konsulko.com>
Cc: Marek Vasut <marex at denx.de>; linux-snps-arc at lists.infradead.org; Alexey Brodkin <alexey.brodkin at synopsys.com>; Otavio Salvador <otavio at ossystems.com.br>; Patches and discussions about the oe-core layer <openembedded-core at lists.openembedded.org>
Subject: Re: [OE-core] [PATCH v3] u-boot: Add mkenvimage tool

Quoted 10 lines · Tom Rini
Quoted 8 lines · Marek Vasut
Quoted 7 lines · Alexey Brodkin

This utility is used for creation of images containing usable in run-time U-Boot environment.

As of today this utility is added per-board like here [1] for Intel Edison board.

[1] http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-

edison/tree/meta-intel-edison-bsp/recipes-bsp/u-boot/u-boot- tools_2014.04.bb

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Given there're quite some U-Boot tools that we may want to add

later

Quoted 1 line
Quoted 1 line
Quoted 1 line

this recipe name switch from "u-boot-mkimage" to generic "u-boot-

tools"

Quoted 10 lines
Quoted 10 lines
Quoted 9 lines

still for compatibility we provide "u-boot-mkimage" with help of PROVIDES as well as proposed "u-boot-mkenvimage".

Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>
Cc Richard Purdie <richard.purdie at linuxfoundation.org>
Cc Otavio Salvador <otavio at ossystems.com.br>
Cc Martin Jansa <martin.jansa at gmail.com>
Cc Ross Burton <ross.burton at intel.com>
Cc Marek Vasut <marex at denx.de>
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Do we want to generate one package per tool or not ?

I think so, yes. Not all places will want all tools.

And a bonus to add a u-boot-tools-meta which rdepends on all. You can copy code to do that from gstreamer-plugins packages.

Actually, why mess with an unnecessary meta package. Just use the empty ${PN} package for that. That works for the GStreamer packages as well these days (since commit 8e1009a3), even though they do it by depending on the meta packages for backwards compatibility.

//Peter

Quoted 4 lines

--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854 Mobile: +1 (347) 903-9750

#6 lore raw

PATCH v3 1/1 u-boot: Add mkenvimage tool

Quoted 4 lines · Peter Kjellerstedt

Actually, why mess with an unnecessary meta package. Just use the empty ${PN} package for that. That works for the GStreamer packages as well these days (since commit 8e1009a3), even though they do it by depending on the meta packages for backwards compatibility.

Yes, please.

Having a u-boot-tools-meta will mean we're constantly explaining why installing u-boot-tools either doesn't install anything, or produces an error.

Ross

#7 lore raw

PATCH v3 1/1 u-boot: Add mkenvimage tool

(hit sent too early)

Of course how big are these tools, and is it really useful splitting them up? If we're talking a 10k binary, is putting them in separate packages worth the complication?

Ross

#8 lore raw

PATCH v3 1/1 u-boot: Add mkenvimage tool

Quoted 6 lines · Ross

(hit sent too early)

Of course how big are these tools, and is it really useful splitting them up? If we're talking a 10k binary, is putting them in separate packages worth the complication?

I think it makes sense to split; we are building an embedded system build system and granular installation is a must have. Using PN to install all tools is a win win combination.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750
#9 lore raw

PATCH v3 1/1 u-boot: Add mkenvimage tool

Hi Otavio,

Quoted 13 lines

-----Original Message-----
From: Otavio Salvador [mailto:otavio.salvador at ossystems.com.br]
Sent: Tuesday, November 20, 2018 6:49 PM
To: Burton, Ross <ross.burton at intel.com>
Cc: Peter Kjellerstedt <peter.kjellerstedt at axis.com>; Marek Vasut <marex at denx.de>; Tom Rini <trini at konsulko.com>; Otavio Salvador <otavio at ossystems.com.br>; Alexey Brodkin <alexey.brodkin at synopsys.com>; Patches and discussions about the oe-core layer <openembedded-core at lists.openembedded.org>; linux-snps-arc at lists.infradead.org
Subject: Re: [OE-core] [PATCH v3] u-boot: Add mkenvimage tool

Quoted 3 lines · Ross

(hit sent too early)

Quoted 7 lines
Quoted 3 lines

Of course how big are these tools, and is it really useful splitting them up? If we're talking a 10k binary, is putting them in separate packages worth the complication?

I think it makes sense to split; we are building an embedded system build system and granular installation is a must have. Using PN to install all tools is a win win combination.

Please note we're discussing _host_ tools here!
So do we really care if there's one more utility installed on development host?

And if someone installs those U-Boot host utilities on the target then most probably this target is not super embedded any longer.

-Alexey

#10 lore raw

PATCH v3 1/1 u-boot: Add mkenvimage tool

Quoted 23 lines · Alexey Brodkin

Hi Otavio,

Quoted 13 lines

-----Original Message-----
From: Otavio Salvador [mailto:otavio.salvador at ossystems.com.br]
Sent: Tuesday, November 20, 2018 6:49 PM
To: Burton, Ross <ross.burton at intel.com>
Cc: Peter Kjellerstedt <peter.kjellerstedt at axis.com>; Marek Vasut <marex at denx.de>; Tom Rini <trini at konsulko.com>; Otavio Salvador <otavio at ossystems.com.br>; Alexey Brodkin <alexey.brodkin at synopsys.com>; Patches and discussions about the oe-core layer <openembedded-core at lists.openembedded.org>; linux-snps-arc at lists.infradead.org
Subject: Re: [OE-core] [PATCH v3] u-boot: Add mkenvimage tool

Quoted 3 lines · Ross

(hit sent too early)

Quoted 7 lines
Quoted 3 lines

Of course how big are these tools, and is it really useful splitting them up? If we're talking a 10k binary, is putting them in separate packages worth the complication?

I think it makes sense to split; we are building an embedded system build system and granular installation is a must have. Using PN to install all tools is a win win combination.

Quoted 5 lines

Please note we're discussing _host_ tools here!
So do we really care if there's one more utility installed on development host?

And if someone installs those U-Boot host utilities on the target then most probably this target is not super embedded any longer.

You can use mkenvimage on target, I had to do that a few times.

Signature · 2 lines
Best regards,
Marek Vasut
#11 lore raw

PATCH v3 1/1 u-boot: Add mkenvimage tool

In reply to Alexey Brodkin
Quoted 21 lines · Alexey Brodkin
Quoted 13 lines

-----Original Message-----
From: Otavio Salvador [mailto:otavio.salvador at ossystems.com.br]
Sent: Tuesday, November 20, 2018 6:49 PM
To: Burton, Ross <ross.burton at intel.com>
Cc: Peter Kjellerstedt <peter.kjellerstedt at axis.com>; Marek Vasut <marex at denx.de>; Tom Rini <trini at konsulko.com>; Otavio Salvador <otavio at ossystems.com.br>; Alexey Brodkin <alexey.brodkin at synopsys.com>; Patches and discussions about the oe-core layer <openembedded-core at lists.openembedded.org>; linux-snps-arc at lists.infradead.org
Subject: Re: [OE-core] [PATCH v3] u-boot: Add mkenvimage tool

Quoted 3 lines · Ross

(hit sent too early)

Quoted 7 lines
Quoted 3 lines

Of course how big are these tools, and is it really useful splitting them up? If we're talking a 10k binary, is putting them in separate packages worth the complication?

I think it makes sense to split; we are building an embedded system build system and granular installation is a must have. Using PN to install all tools is a win win combination.

Quoted 5 lines

Please note we're discussing _host_ tools here!
So do we really care if there's one more utility installed on development host?

And if someone installs those U-Boot host utilities on the target then most probably this target is not super embedded any longer.

The tools are commonly used on host but this is not a limitation and there are use cases where we may want to include it on target. Also, it can be installed on SDK (nativesdk packages) and being able to install what will be used is a must for me.

I am not concerned about the space used by it but for the choice of me pick the right pieces I need, and not putting it all together.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750
#12 lore raw

PATCH v3 1/1 u-boot: Add mkenvimage tool

In reply to Otavio Salvador
Quoted 11 lines · Otavio Salvador
Quoted 6 lines · Ross

(hit sent too early)

Of course how big are these tools, and is it really useful splitting them up? If we're talking a 10k binary, is putting them in separate packages worth the complication?

I think it makes sense to split; we are building an embedded system build system and granular installation is a must have. Using PN to install all tools is a win win combination.

Agreed. The common use cases won't need all of the possible tools so lets not grow sizes we don't need to grow.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-snps-arc/attachments/20181120/5e8f3cba/attachment-0001.sig>
#13 lore raw

PATCH v3 1/1 u-boot: Add mkenvimage tool

In reply to Alexey Brodkin
Quoted 15 lines · Alexey Brodkin

This utility is used for creation of images containing usable in run-time U-Boot environment.

As of today this utility is added per-board like here [1] for Intel Edison board.

[1]
http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-edison/tree/meta-intel-edison-bsp/recipes-bsp/u-boot/u-boot-tools_2014.04.bb

Given there're quite some U-Boot tools that we may want to add later this recipe name switch from "u-boot-mkimage" to generic "u-boot- tools"
still for compatibility we provide "u-boot-mkimage" with help of PROVIDES as well as proposed "u-boot-mkenvimage".

Quoted 7 lines
Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>
Cc Richard Purdie <richard.purdie at linuxfoundation.org>
Cc Otavio Salvador <otavio at ossystems.com.br>
Cc Martin Jansa <martin.jansa at gmail.com>
Cc Ross Burton <ross.burton at intel.com>
Cc Marek Vasut <marex at denx.de>

---

I know others are talking about splitting the packaging and I'm ok with deferring that to a separate patch.

This patch did break the build in oe-selftest as you renamed a recipe and didn't update conf/distro/include/maintainers.inc.

Could you send a new version with that tweak please?

(grep
https://autobuilder.yoctoproject.org/typhoon/#/builders/28/builds/242/steps/7/logs/step2d
for the recipe name to see the test that failed)

Cheers,

Richard