Add initial support to build the barebox tools for the host and the
target.

Signed-off-by: Marco Felsch <m.fel...@pengutronix.de>
---
 .../barebox/barebox-tools_2023.01.0.bb        | 56 +++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 meta/recipes-bsp/barebox/barebox-tools_2023.01.0.bb

diff --git a/meta/recipes-bsp/barebox/barebox-tools_2023.01.0.bb 
b/meta/recipes-bsp/barebox/barebox-tools_2023.01.0.bb
new file mode 100644
index 0000000000..b1f7aa0b91
--- /dev/null
+++ b/meta/recipes-bsp/barebox/barebox-tools_2023.01.0.bb
@@ -0,0 +1,56 @@
+SUMMARY = "barebox bootloader tools"
+HOMEPAGE = "https://barebox.org/";
+
+LICENSE = "GPL-2.0-only"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f5125d13e000b9ca1f0d3364286c4192"
+
+DEPENDS = "libusb1 bison-native flex-native"
+
+SRC_URI = "https://barebox.org/download/barebox-${PV}.tar.bz2";
+SRC_URI[sha256sum] = 
"20532daff1720fbefa0e02dba0294e6817d29c155f49b9b549db9577435fc7b6"
+
+S = "${WORKDIR}/barebox-${PV}"
+B = "${WORKDIR}/build"
+
+inherit pkgconfig
+
+EXTRA_OEMAKE = " \
+  ARCH=sandbox \
+  CROSS_COMPILE=${TARGET_PREFIX} -C ${S} O=${B} \
+  CROSS_PKG_CONFIG=pkg-config \
+  "
+
+do_compile:class-target () {
+    export userccflags="${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
+    export userldflags="${TARGET_LDFLAGS}${TOOLCHAIN_OPTIONS}"
+    oe_runmake targettools_defconfig
+    oe_runmake scripts
+}
+
+do_compile:class-native () {
+    oe_runmake hosttools_defconfig
+    oe_runmake scripts
+}
+
+BAREBOX_TOOLS = " \
+         bareboxenv \
+         bareboxcrc32 \
+         kernel-install \
+         bareboximd \
+         omap3-usb-loader \
+         omap4_usbboot \
+         imx/imx-usb-loader \
+         "
+
+BAREBOX_TOOLS_SUFFIX = ""
+BAREBOX_TOOLS_SUFFIX:class-target = "-target"
+
+do_install () {
+       install -d ${D}${bindir}
+
+       for tool in ${BAREBOX_TOOLS}; do
+               install -m 0755 scripts/${tool}${BAREBOX_TOOLS_SUFFIX} 
${D}${bindir}/${tool##*/}
+       done
+}
+
+BBCLASSEXTEND = "native nativesdk"
-- 
2.30.2

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#176715): 
https://lists.openembedded.org/g/openembedded-core/message/176715
Mute This Topic: https://lists.openembedded.org/mt/96722578/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to