uboot: add support for patch files and URLs
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
@@ -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
@@ -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
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
@@ -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
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_PATCHESinstead.Signed-off-by Frank Hunleth <[email protected]>
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
PATCH 3/3 altera: update use of BR2_TARGET_UBOOT_PATCH_DIR
In reply to Frank HunlethUse 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
@@ -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
PATCH 3/3 altera: update use of BR2_TARGET_UBOOT_PATCH_DIR
Dear Frank Hunleth,
Quoted 13 lines · Frank Hunleth
Use
BR2_TARGET_UBOOT_PATCHESnow thatBR2_TARGET_UBOOT_PATCH_DIRis deprecated.Signed-off-by Frank Hunleth <[email protected]>--- configs/altera_sockit_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)configs/altera_sockit_defconfig +0
-0
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
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_PATCHESnow thatBR2_TARGET_UBOOT_PATCH_DIRis deprecated.Signed-off-by Frank Hunleth <[email protected]>--- configs/altera_sockit_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)configs/altera_sockit_defconfig +0
-0configs/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.patchwhich 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
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
PATCH 1/3 uboot: add support for patch files and URLs
In reply to Frank HunlethHi 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.
Best Regards,
-v
PATCH 1/3 uboot: add support for patch files and URLs
In reply to Frank HunlethDear 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.
Signed-off-by Frank Hunleth <[email protected]>--- boot/uboot/Config.in | 8 ++++++++ boot/uboot/uboot.mk | 2 ++ 2 files changed, 10 insertions(+)boot/uboot/Config.in +0
-0
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