Skip to contentSkip to conversation

uboot: add support for patch files and URLs

PATCH Superseded Frank Hunleth 3 participants 9 messages Apr 17, 2015 – Apr 18, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 uboot: add support for patch files and URLs

The existing u-boot patch option only allowed directories to be specified. As suggested by Arnout Vandecappelle, hooking into the generic patch framework enables files and URLs to be specified. The downside is that patch directories need to be converted to lists of files to use this approach.

This change is useful for Intel Edison support, so that Intel's u-boot patch can be downloaded rather than stored in the Buildroot source tree.

---
 boot/uboot/Config.in | 8 ++++++++
 boot/uboot/uboot.mk  | 2 ++
 2 files changed, 10 insertions(+)
boot/uboot/Config.in +8 -0
index 3f39ee8..32fcb21 100644
@@ -79,6 +79,14 @@ config BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR
 
 	  Most users may leave this empty
 
+config BR2_TARGET_UBOOT_PATCHES
+	string "custom patches"
+	help
+	  If your board requires custom patches, add a list of patches
+	  here.
+
+	  Most users may leave this empty
+
 choice
 	prompt "U-Boot binary format"
 	default BR2_TARGET_UBOOT_FORMAT_BIN
boot/uboot/uboot.mk +2 -0
index 6b152ca..e9f90a2 100644
@@ -101,6 +101,8 @@ endef
 UBOOT_POST_PATCH_HOOKS += UBOOT_APPLY_CUSTOM_PATCHES
 endif
 
+UBOOT_PATCH += $(call qstrip,$(BR2_TARGET_UBOOT_PATCHES))
+
 define UBOOT_CONFIGURE_CMDS
 	$(TARGET_CONFIGURE_OPTS) 	\
 		$(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS)		\
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/3 uboot: deprecate BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR

Users should use BR2_TARGET_UBOOT_PATCHES instead.

---
 boot/uboot/Config.in | 3 +++
 1 file changed, 3 insertions(+)
boot/uboot/Config.in +3 -0
index 32fcb21..6d42d49 100644
@@ -71,6 +71,7 @@ config BR2_TARGET_UBOOT_VERSION
 		if BR2_TARGET_UBOOT_CUSTOM_GIT || BR2_TARGET_UBOOT_CUSTOM_HG
 
 config BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR
+	depends on BR2_DEPRECATED_SINCE_2015_05
 	string "custom patch dir"
 	help
 	  If your board requires custom patches, add the path to the
@@ -79,6 +80,8 @@ config BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR
 
 	  Most users may leave this empty
 
+	  NOTE: Use BR2_TARGET_UBOOT_PATCHES instead.
+
 config BR2_TARGET_UBOOT_PATCHES
 	string "custom patches"
 	help
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/3 uboot: deprecate BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR

Dear Frank Hunleth,

Quoted 3 lines · Frank Hunleth

Users should use BR2_TARGET_UBOOT_PATCHES instead.

Except that your implementation of BR2_TARGET_UBOOT_PATCHES does not allow the same thing as BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR. BR2_TARGET_UBOOT_PATCHES, as per your current implementation, can only be used for remote patches: they will be downloaded from the given URL if a full URL is given, or from $(UBOOT_SITE) if just a file name is given.

See how things are done in linux/linux.mk for an example that allows both remote and local patches. Though I'm not necessarily too happy to see the linux/linux.mk being duplicated...

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 3/3 altera: update use of BR2_TARGET_UBOOT_PATCH_DIR

In reply to Frank Hunleth

Use BR2_TARGET_UBOOT_PATCHES now that BR2_TARGET_UBOOT_PATCH_DIR is deprecated.

---
 configs/altera_sockit_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configs/altera_sockit_defconfig +1 -1
index d27b96b..f9249ca 100644
@@ -31,7 +31,7 @@ BR2_TARGET_UBOOT_BOARDNAME="socfpga_cyclone5"
 BR2_TARGET_UBOOT_CUSTOM_GIT=y
 BR2_TARGET_UBOOT_CUSTOM_REPO_URL="git://git.rocketboards.org/u-boot-socfpga.git"
 BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="rel_acds13.0sp1"
-BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="board/altera/sockit"
+BR2_TARGET_UBOOT_CUSTOM_PATCHES="board/altera/sockit/uboot-sockit-preloader-sample-design.patch"
 BR2_TARGET_UBOOT_FORMAT_IMG=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="spl/u-boot-spl.bin"
Signature · 1 line
1.9.1
#4 lore raw

PATCH 3/3 altera: update use of BR2_TARGET_UBOOT_PATCH_DIR

Dear Frank Hunleth,

Quoted 13 lines · Frank Hunleth

Use BR2_TARGET_UBOOT_PATCHES now that BR2_TARGET_UBOOT_PATCH_DIR is deprecated.

---
 configs/altera_sockit_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configs/altera_sockit_defconfig +0 -0
index d27b96b..f9249ca 100644

configs/altera_sockit_defconfig BR2_TARGET_UBOOT_BOARDNAME="socfpga_cyclone5" · line 34

Quoted 5 lines
configs/altera_sockit_defconfig +1 -1
@@ -31,7 +31,7 @@ BR2_TARGET_UBOOT_BOARDNAME="socfpga_cyclone5"
 BR2_TARGET_UBOOT_CUSTOM_GIT=y
 BR2_TARGET_UBOOT_CUSTOM_REPO_URL="git://git.rocketboards.org/u-boot-socfpga.git"
 BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="rel_acds13.0sp1"
-BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="board/altera/sockit"
+BR2_TARGET_UBOOT_CUSTOM_PATCHES="board/altera/sockit/uboot-sockit-preloader-sample-design.patch"

Did you actually tested this? It will end up with:

UBOOT_PATCH = board/altera/sockit/uboot-sockit-preloader-sample-design.patch

which means that the package infra will try to download:

ftp://ftp.denx.de/pub/u-boot/board/altera/sockit/uboot-sockit-preloader-sample-design.patch

No?

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH 3/3 altera: update use of BR2_TARGET_UBOOT_PATCH_DIR

Quoted 24 lines · Thomas Petazzoni

Dear Frank Hunleth,

Quoted 13 lines · Frank Hunleth

Use BR2_TARGET_UBOOT_PATCHES now that BR2_TARGET_UBOOT_PATCH_DIR is deprecated.

---
 configs/altera_sockit_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configs/altera_sockit_defconfig +0 -0
index d27b96b..f9249ca 100644

configs/altera_sockit_defconfig BR2_TARGET_UBOOT_BOARDNAME="socfpga_cyclone5" · line 34

Quoted 5 lines
configs/altera_sockit_defconfig +1 -1
@@ -31,7 +31,7 @@ BR2_TARGET_UBOOT_BOARDNAME="socfpga_cyclone5"
 BR2_TARGET_UBOOT_CUSTOM_GIT=y
 BR2_TARGET_UBOOT_CUSTOM_REPO_URL="git://git.rocketboards.org/u-boot-socfpga.git"
 BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="rel_acds13.0sp1"
-BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="board/altera/sockit"
+BR2_TARGET_UBOOT_CUSTOM_PATCHES="board/altera/sockit/uboot-sockit-preloader-sample-design.patch"

Did you actually tested this? It will end up with:

Quoted 7 lines

UBOOT_PATCH = board/altera/sockit/uboot-sockit-preloader-sample-design.patch

which means that the package infra will try to download:

ftp://ftp.denx.de/pub/u-boot/board/altera/sockit/uboot-sockit-preloader-sample-design.patch

No?

Dohh! In my rush to leave yesterday, I had convinced myself that it would work without testing. You're totally right, though. I'll fix depending on how the first patch in the series works out.

Thanks,
Frank

Quoted 6 lines

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

#6 lore raw

PATCH 3/3 altera: update use of BR2_TARGET_UBOOT_PATCH_DIR

Dear Frank Hunleth,

Quoted 3 lines · Frank Hunleth

Dohh! In my rush to leave yesterday, I had convinced myself that it would work without testing. You're totally right, though. I'll fix depending on how the first patch in the series works out.

Well, I didn't test myself, so maybe I'm wrong. Make sure to verify what I said by testing for real.

Regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#7 lore raw

PATCH 1/3 uboot: add support for patch files and URLs

In reply to Frank Hunleth

Hi all,

Sorry for showing up a bit late on this thread.

Quoted 2 lines
boot/uboot/Config.in +2 -0
+config BR2_TARGET_UBOOT_PATCHES
+	string "custom patches"

[...]

boot/uboot/uboot.mk endef · line 106

Quoted 3 lines
boot/uboot/uboot.mk +2 -0
+UBOOT_PATCH += $(call qstrip,$(BR2_TARGET_UBOOT_PATCHES))
+
 define UBOOT_CONFIGURE_CMDS

While we are adding new U-Boot related symbols, I think it would be nice to respect the project naming convention, which is described in the "Names and Spelling" section [1] of the project README file.

So, I'd suggest these symbols to be named BR2_TARGET_U_BOOT_PATCHES and U_BOOT_PATCH in respect to the official project name.

[1] http://git.denx.de/?p=u-boot.git;a=blob;f=README;h=9b748ccc34120b3c10dd8c33d84269bff6853b1b;hb=HEAD#l93

Best Regards,
-v

#8 lore raw

PATCH 1/3 uboot: add support for patch files and URLs

In reply to Frank Hunleth

Dear Frank Hunleth,

Quoted 20 lines · Frank Hunleth

The existing u-boot patch option only allowed directories to be specified. As suggested by Arnout Vandecappelle, hooking into the generic patch framework enables files and URLs to be specified. The downside is that patch directories need to be converted to lists of files to use this approach.

This change is useful for Intel Edison support, so that Intel's u-boot patch can be downloaded rather than stored in the Buildroot source tree.

---
 boot/uboot/Config.in | 8 ++++++++
 boot/uboot/uboot.mk  | 2 ++
 2 files changed, 10 insertions(+)
boot/uboot/Config.in +0 -0
index 3f39ee8..32fcb21 100644

boot/uboot/Config.in config BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR · line 88

Quoted 10 lines
boot/uboot/Config.in +7 -0
@@ -79,6 +79,14 @@ config BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR
 
 	  Most users may leave this empty
 
+config BR2_TARGET_UBOOT_PATCHES
+	string "custom patches"
+	help
+	  If your board requires custom patches, add a list of patches
+	  here.
+
+	  Most users may leave this empty

What about doing like for the Linux kernel: a single option to list patches, which can be local patches, local directories, or remote patches to be downloaded?

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com