Skip to contentSkip to conversation

u-boot-fw-utils: Backport a patch for out-of-tree builds

PATCH Superseded Daisuke Yamane 3 participants 6 messages Dec 18, 2019

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 u-boot-fw-utils: Backport a patch for out-of-tree builds

This patch fixs the following error when ${S} != ${B}:
| cp: cannot create regular file 'tools/version.h': No such file or directory

---
 ...sure-tools-directory-exists-in-output-pri.patch | 34 ++++++++++++++++++++++
 meta/recipes-bsp/u-boot/u-boot-fw-utils_2020.01.bb |  5 +++-
 2 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-bsp/u-boot/files/0001-Makefile-Ensure-tools-directory-exists-in-output-pri.patch
meta/recipes-bsp/u-boot/files/0001-Makefile-Ensure-tools-directory-exists-in-output-pri.patch new file +34 -0
new file mode 100644
index 0000000..b4cadec
@@ -0,0 +1,34 @@
+From fb013eee68d08403572ef3c579f6688bbe33fd47 Mon Sep 17 00:00:00 2001
+From: Tom Rini <[email protected]>
+Date: Wed, 4 Dec 2019 18:54:30 -0500
+Subject: [PATCH] Makefile: Ensure tools directory exists in output prior to
+ use
+
+With the change to make tools/version.h a file we need to make sure that
+the output directory exists first otherwise we will get a build failure.
+
+Reported-by: Peter Robinson <[email protected]>
+Tested-by: Peter Robinson <[email protected]>
+Fixes: 4d90f6cd9813 ("tools: Avoid creating symbolic links for tools/version.h")
+Signed-off-by: Tom Rini <[email protected]>
+Reviewed-by: Bin Meng <[email protected]>
+Reviewed-by: Simon Glass <[email protected]>
+---
+ Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile b/Makefile
+index b6a091a..0766f78 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1889,6 +1889,7 @@ checkarmreloc: u-boot
+ 	fi
+ 
+ tools/version.h: include/version.h
++	$(Q)mkdir -p $(dir $@)
+ 	$(call if_changed,copy)
+ 
+ envtools: scripts_basic $(version_h) $(timestamp_h) tools/version.h
+-- 
+2.7.4
+
meta/recipes-bsp/u-boot/u-boot-fw-utils_2020.01.bb +4 -1
index 7de91ff..c30c490 100644
@@ -3,7 +3,10 @@ require u-boot-common.inc
 SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
 DEPENDS += "mtd-utils"
 
-SRC_URI += "file://0001-include-env.h-Ensure-ulong-is-defined.patch"
+SRC_URI += " \
+	file://0001-include-env.h-Ensure-ulong-is-defined.patch \
+	file://0001-Makefile-Ensure-tools-directory-exists-in-output-pri.patch \
+	"
 
 INSANE_SKIP_${PN} = "already-stripped"
 EXTRA_OEMAKE_class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" V=1'
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 2/3 u-boot-tools: Add capability of building from out-of-tree

This patch also helps to build with EXTERNALSRC.

---
 meta/recipes-bsp/u-boot/u-boot-tools_2020.01.bb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meta/recipes-bsp/u-boot/u-boot-tools_2020.01.bb +3 -3
index bede984..414ee33 100644
@@ -25,14 +25,14 @@ SED_CONFIG_EFI_armeb = ''
 SED_CONFIG_EFI_aarch64 = ''
 
 do_compile () {
-	oe_runmake sandbox_defconfig
+	oe_runmake -C ${S} sandbox_defconfig O=${B}
 
 	# Disable CONFIG_CMD_LICENSE, license.h is not used by tools and
 	# generating it requires bin2header tool, which for target build
 	# is built with target tools and thus cannot be executed on host.
-	sed -i -e "s/CONFIG_CMD_LICENSE=.*/# CONFIG_CMD_LICENSE is not set/" ${SED_CONFIG_EFI} .config
+	sed -i -e "s/CONFIG_CMD_LICENSE=.*/# CONFIG_CMD_LICENSE is not set/" ${SED_CONFIG_EFI} ${B}/.config
 
-	oe_runmake cross_tools NO_SDL=1
+	oe_runmake -C ${S} cross_tools NO_SDL=1 O=${B}
 }
 
 do_install () {
Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 3/3 u-boot: Move B from u-boot.inc to u-boot-common.inc

In reply to Daisuke Yamane

Use the same value of B between u-boot, u-boot-fw-utils and u-boot-tools. This patch also enable the out-of-tree builds of u-boot-fw-utils and u-boot-tools actually.

---
 meta/recipes-bsp/u-boot/u-boot-common.inc | 1 +
 meta/recipes-bsp/u-boot/u-boot.inc        | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)
meta/recipes-bsp/u-boot/u-boot-common.inc +1 -0
index a0f9c41..48402e4 100644
@@ -21,3 +21,4 @@ SRC_URI = "git://git.denx.de/u-boot.git \
           "
 
 S = "${WORKDIR}/git"
+B = "${WORKDIR}/build"
meta/recipes-bsp/u-boot/u-boot.inc +0 -2
index 55d8b47..ec77762 100644
@@ -1,8 +1,6 @@
 SUMMARY = "Universal Boot Loader for embedded devices"
 PROVIDES = "virtual/bootloader"
 
-B = "${WORKDIR}/build"
-
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
 DEPENDS += "kern-tools-native"
Signature · 1 line
2.7.4
#3 lore raw

✗ patchtest: failure for "[v2] u-boot-fw-utils: Backport..." and 2 more

In reply to Daisuke Yamane

== Series Details ==

Series: "[v2] u-boot-fw-utils: Backport..." and 2 more
Revision: 1
URL : https://patchwork.openembedded.org/series/21666/
State : failure

== Summary ==

Thank you for submitting this patch series to OpenEmbedded Core. This is an automated response. Several tests have been executed on the proposed series by patchtest resulting in the following failures:

* Issue Added patch file is missing Upstream-Status in the header [test_upstream_status_presence_format]

  Suggested fix    Add Upstream-Status: <Valid status> to the header of meta/recipes-bsp/u-boot/files/0001-Makefile-Ensure-tools-directory-exists-in-output-pri.patch
  Standard format  Upstream-Status: <Valid status>
  Valid status     Pending, Accepted, Backport, Denied, Inappropriate [reason], Submitted [where]

If you believe any of these test results are incorrect, please reply to the mailing list ([email protected]) raising your concerns. Otherwise we would appreciate you correcting the issues and submitting a new version of the patchset if applicable. Please ensure you add/increment the version number when sending the new version (i.e. [PATCH] -> [PATCH v2] -> [PATCH v3] -> ...).

---

Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe
#4 lore raw
In reply to Daisuke Yamane
Quoted 5 lines · Daisuke Yamane

This patch fixs the following error when ${S} != ${B}:
| cp: cannot create regular file 'tools/version.h': No such file or directory

I don't think backporting this makes sense as we'll only be dropping it in January when 2020.01 gets released. I'd just move to the -rc5 tag which includes this upstream change and then apply your other out of tree fixes on top of it.

--
Alex Kiernan

#5 lore raw

2019年12月18日(水) 18:56 Alex Kiernan <[email protected]>:

Quoted 6 lines · Daisuke Yamane
Quoted 4 lines

This patch fixs the following error when ${S} != ${B}:
| cp: cannot create regular file 'tools/version.h': No such file or directory

Quoted 6 lines
Quoted 1 line

I don't think backporting this makes sense as we'll only be dropping it in January when 2020.01 gets released. I'd just move to the -rc5 tag which includes this upstream change and then apply your other out of tree fixes on top of it.

Right.
I'll resend patches after updating u-boot, so please discard my patch-set of v3 as I only fixed header of backporting patch according to patch test.