Skip to contentSkip to conversation

package/bootgen: add bootgen host package

PATCH In review Neal Frager via buildroot 2 participants 4 messages Oct 22, 2022 – Oct 25, 2022

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/bootgen: add bootgen host package

This patch adds Xilinx bootgen as a host package to buildroot. bootgen is a required utility for generating a boot.bin for Xilinx versal products.

In addition, for developers who wish to use secure boot with Xilinx SoC products such as zynq and zynqmp, bootgen has a more complete offering in secure boot features than the u-boot mkimage utility.

https://github.com/Xilinx/bootgen

---
V1->V2:
- improved build statement to support older hosts
- added bootgen.hash

---
 DEVELOPERS                     |  1 +
 package/Config.in.host         |  1 +
 package/bootgen/Config.in.host | 10 ++++++++++
 package/bootgen/bootgen.hash   |  3 +++
 package/bootgen/bootgen.mk     | 25 +++++++++++++++++++++++++
 5 files changed, 40 insertions(+)
 create mode 100644 package/bootgen/Config.in.host
 create mode 100644 package/bootgen/bootgen.hash
 create mode 100644 package/bootgen/bootgen.mk
DEVELOPERS +1 -0
index c0e6f8bbef..c8183b2290 100644
@@ -2175,6 +2175,7 @@ F:	configs/zynq_zc706_defconfig
 F:	configs/zynqmp_zcu102_defconfig
 F:	configs/zynqmp_zcu106_defconfig
 F:	configs/zynqmp_kria_kv260_defconfig
+F:	package/bootgen
 
 N:	Nicola Di Lieto <[email protected]>
 F:	package/uacme/
package/Config.in.host +1 -0
index d6b9ee0e2d..8ccbf40a84 100644
@@ -7,6 +7,7 @@ menu "Host utilities"
 	source "package/asn1c/Config.in.host"
 	source "package/babeltrace2/Config.in.host"
 	source "package/bmap-tools/Config.in.host"
+	source "package/bootgen/Config.in.host"
 	source "package/btrfs-progs/Config.in.host"
 	source "package/cbootimage/Config.in.host"
 	source "package/checkpolicy/Config.in.host"
package/bootgen/Config.in.host new file +10 -0
new file mode 100644
index 0000000000..0acb58dee0
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_HOST_BOOTGEN
+	bool "host bootgen"
+	help
+	  bootgen is a tool to generate a boot.bin firmware
+	  for Xilinx versal, zynqmp and zynq product families.
+
+	  Additional secure boot features are supported beyond
+	  what is included with u-boot mkimage.
+
+	  https://github.com/Xilinx/bootgen
package/bootgen/bootgen.hash new file +3 -0
new file mode 100644
index 0000000000..5d77c164f3
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  7e07c75aa3e3965c8e33faefde037877f78130451cebc2056b096db9c66acbb3  bootgen-xilinx_v2022.2.tar.gz
+sha256  4da5f5eff0592e5d275f1871faf9e9a4fc0f6346027bfb777fa59d0aa6a59aa3  LICENSE
package/bootgen/bootgen.mk new file +25 -0
new file mode 100644
index 0000000000..4589bf019f
@@ -0,0 +1,25 @@
+################################################################################
+#
+# bootgen
+#
+################################################################################
+
+BOOTGEN_VERSION = xilinx_v2022.2
+BOOTGEN_SITE = $(call github,Xilinx,bootgen,$(BOOTGEN_VERSION))
+HOST_BOOTGEN_DEPENDENCIES = host-openssl host-pkgconf
+BOOTGEN_LICENSE = Apache-2.0
+BOOTGEN_LICENSE_FILES = LICENSE
+
+define HOST_BOOTGEN_BUILD_CMDS
+	$(MAKE) $(HOST_CONFIGURE_OPTS) \
+		LIBS="`$(HOST_MAKE_ENV) $(PKG_CONFIG_HOST_BINARY) --libs libssl libcrypto`" \
+		INCLUDE_USER="`$(HOST_MAKE_ENV) $(PKG_CONFIG_HOST_BINARY) --cflags libssl libcrypto`" \
+		CXXFLAGS="$(HOST_CXXFLAGS) -std=c++0x" \
+		-C $(@D)
+endef
+
+define HOST_BOOTGEN_INSTALL_CMDS
+	$(INSTALL) -m 0755 -D $(@D)/bootgen $(HOST_DIR)/bin/bootgen
+endef
+
+$(eval $(host-generic-package))
Signature · 6 lines
2.17.1

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

"Neal" == Neal Frager <[email protected]> writes:

This patch adds Xilinx bootgen as a host package to buildroot. bootgen is a required utility for generating a boot.bin for Xilinx versal products.

In addition, for developers who wish to use secure boot with Xilinx SoC products such as zynq and zynqmp, bootgen has a more complete offering in secure boot features than the u-boot mkimage utility.

Quoted 7 lines

https://github.com/Xilinx/bootgen

---
V1-> V2:
- improved build statement to support older hosts
- added bootgen.hash

Committed, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
Quoted 12 lines
Quoted 11 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

"Peter" == Peter Korsgaard <[email protected]> writes:

"Neal" == Neal Frager <[email protected]> writes:

This patch adds Xilinx bootgen as a host package to buildroot. bootgen is a required utility for generating a boot.bin for Xilinx versal products.

In addition, for developers who wish to use secure boot with Xilinx SoC products such as zynq and zynqmp, bootgen has a more complete offering in secure boot features than the u-boot mkimage utility.

Quoted 4 lines
Quoted 4 lines

https://github.com/Xilinx/bootgen

---

V1-> V2:

Quoted 4 lines
Quoted 2 lines

- improved build statement to support older hosts
- added bootgen.hash

Committed, thanks.

As expected, this fails to build on setups with modern flex / configs where host-flex is built, so I've sent a patch with the fix from the PR:

https://github.com/Xilinx/bootgen/pull/20

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

Hi Peter,

Quoted 13 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

"Peter" == Peter Korsgaard <[email protected]> writes:

"Neal" == Neal Frager <[email protected]> writes:

This patch adds Xilinx bootgen as a host package to buildroot.
bootgen is a required utility for generating a boot.bin for >> Xilinx versal products.

Quoted 6 lines

In addition, for developers who wish to use secure boot with >> Xilinx SoC products such as zynq and zynqmp, bootgen has a >> more complete offering in secure boot features than the u-boot >> mkimage utility.

https://github.com/Xilinx/bootgen

- improved build statement to support older hosts >> - added bootgen.hash

Quoted 8 lines

Committed, thanks.

As expected, this fails to build on setups with modern flex / configs where host-flex is built, so I've sent a patch with the fix from the PR:

https://github.com/Xilinx/bootgen/pull/20

--
Bye, Peter Korsgaard

Thank you Peter. I will confirm once this is committed in the bootgen master branch.

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