All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/3] uboot: add support for patch files and URLs
@ 2015-04-18 20:27 Frank Hunleth
  2015-04-18 20:27 ` [Buildroot] [PATCH v2 2/3] uboot: deprecate BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR Frank Hunleth
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Frank Hunleth @ 2015-04-18 20:27 UTC (permalink / raw)
  To: buildroot

The existing u-boot patch option only allowed directories to be
specified. This adds support for URLs using similar code as found
in linux/linux.mk. Local files are also handled now.

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 <fhunleth@troodon-software.com>
---
Changes v1 -> v2:
  - Switch to linux.mk approach to patches (suggested by Thomas Petazzoni)

 boot/uboot/Config.in | 10 ++++++++++
 boot/uboot/uboot.mk  | 20 ++++++++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index 3f39ee8..768daa7 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -79,6 +79,16 @@ config BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR

 	  Most users may leave this empty

+config BR2_TARGET_UBOOT_PATCH
+	string "Custom U-Boot patches"
+	help
+	  A space-separated list of patches to apply to U-Boot.
+	  Each patch can be described as an URL, a local file path,
+	  or a directory. In the case of a directory, all files
+	  matching *.patch in the directory will be applied.
+
+	  Most users may leave this empty
+
 choice
 	prompt "U-Boot binary format"
 	default BR2_TARGET_UBOOT_FORMAT_BIN
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index 6b152ca..ca686ae 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -93,6 +93,8 @@ endef

 UBOOT_POST_EXTRACT_HOOKS += UBOOT_COPY_OLD_LICENSE_FILE

+# Prior to Buildroot 2015.05, only patch directories were supported. New
+# configurations use BR2_TARGET_UBOOT_PATCH instead.
 ifneq ($(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR)),)
 define UBOOT_APPLY_CUSTOM_PATCHES
 	$(APPLY_PATCHES) $(@D) $(BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR) \*.patch
@@ -101,6 +103,24 @@ endef
 UBOOT_POST_PATCH_HOOKS += UBOOT_APPLY_CUSTOM_PATCHES
 endif

+# Analogous code exists in linux/linux.mk. Basically, the generic
+# package infrastructure handles downloading and applying remote
+# patches. Local patches are handled depending on whether they are
+# directories or files.
+UBOOT_PATCHES = $(call qstrip,$(BR2_TARGET_UBOOT_PATCH))
+UBOOT_PATCH = $(filter ftp://% http://% https://%,$(UBOOT_PATCHES))
+
+define UBOOT_APPLY_LOCAL_PATCHES
+	for p in $(filter-out ftp://% http://% https://%,$(UBOOT_PATCHES)) ; do \
+		if test -d $$p ; then \
+			$(APPLY_PATCHES) $(@D) $$p \*.patch || exit 1 ; \
+		else \
+			$(APPLY_PATCHES) $(@D) `dirname $$p` `basename $$p` || exit 1; \
+		fi \
+	done
+endef
+UBOOT_POST_PATCH_HOOKS += UBOOT_APPLY_LOCAL_PATCHES
+
 define UBOOT_CONFIGURE_CMDS
 	$(TARGET_CONFIGURE_OPTS) 	\
 		$(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS)		\
--
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH v2 2/3] uboot: deprecate BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR
  2015-04-18 20:27 [Buildroot] [PATCH v2 1/3] uboot: add support for patch files and URLs Frank Hunleth
@ 2015-04-18 20:27 ` Frank Hunleth
  2015-04-18 20:27 ` [Buildroot] [PATCH v2 3/3] altera: update use of BR2_TARGET_UBOOT_PATCH_DIR Frank Hunleth
  2015-04-19  9:09 ` [Buildroot] [PATCH v2 1/3] uboot: add support for patch files and URLs Thomas Petazzoni
  2 siblings, 0 replies; 4+ messages in thread
From: Frank Hunleth @ 2015-04-18 20:27 UTC (permalink / raw)
  To: buildroot

Users should use BR2_TARGET_UBOOT_PATCH instead.

Signed-off-by: Frank Hunleth <fhunleth@troodon-software.com>
---
Changes v1 -> v2:
  - Made BR2_TARGET_UBOOT_PATCH naming consistent with kernel
    naming, since using linux.mk patch strategy now

 boot/uboot/Config.in | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index 768daa7..a2e8e94 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -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_PATCH instead.
+
 config BR2_TARGET_UBOOT_PATCH
 	string "Custom U-Boot patches"
 	help
--
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH v2 3/3] altera: update use of BR2_TARGET_UBOOT_PATCH_DIR
  2015-04-18 20:27 [Buildroot] [PATCH v2 1/3] uboot: add support for patch files and URLs Frank Hunleth
  2015-04-18 20:27 ` [Buildroot] [PATCH v2 2/3] uboot: deprecate BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR Frank Hunleth
@ 2015-04-18 20:27 ` Frank Hunleth
  2015-04-19  9:09 ` [Buildroot] [PATCH v2 1/3] uboot: add support for patch files and URLs Thomas Petazzoni
  2 siblings, 0 replies; 4+ messages in thread
From: Frank Hunleth @ 2015-04-18 20:27 UTC (permalink / raw)
  To: buildroot

Use BR2_TARGET_UBOOT_PATCH now that BR2_TARGET_UBOOT_PATCH_DIR is
deprecated.

Signed-off-by: Frank Hunleth <fhunleth@troodon-software.com>
---
Changes v1 -> v2:
  - After switch to linux.mk style, patch directories are supported
    again
  - Actually tested this patch this time. It works - at least the
    patch applies and the altera_sockit configuration builds.

 configs/altera_sockit_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configs/altera_sockit_defconfig b/configs/altera_sockit_defconfig
index d27b96b..888fccf 100644
--- a/configs/altera_sockit_defconfig
+++ b/configs/altera_sockit_defconfig
@@ -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_PATCH="board/altera/sockit"
 BR2_TARGET_UBOOT_FORMAT_IMG=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="spl/u-boot-spl.bin"
--
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH v2 1/3] uboot: add support for patch files and URLs
  2015-04-18 20:27 [Buildroot] [PATCH v2 1/3] uboot: add support for patch files and URLs Frank Hunleth
  2015-04-18 20:27 ` [Buildroot] [PATCH v2 2/3] uboot: deprecate BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR Frank Hunleth
  2015-04-18 20:27 ` [Buildroot] [PATCH v2 3/3] altera: update use of BR2_TARGET_UBOOT_PATCH_DIR Frank Hunleth
@ 2015-04-19  9:09 ` Thomas Petazzoni
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2015-04-19  9:09 UTC (permalink / raw)
  To: buildroot

Dear Frank Hunleth,

On Sat, 18 Apr 2015 16:27:42 -0400, Frank Hunleth wrote:
> The existing u-boot patch option only allowed directories to be
> specified. This adds support for URLs using similar code as found
> in linux/linux.mk. Local files are also handled now.
> 
> 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 <fhunleth@troodon-software.com>
> ---
> Changes v1 -> v2:
>   - Switch to linux.mk approach to patches (suggested by Thomas Petazzoni)

All three patches applied, thanks.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-19  9:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-18 20:27 [Buildroot] [PATCH v2 1/3] uboot: add support for patch files and URLs Frank Hunleth
2015-04-18 20:27 ` [Buildroot] [PATCH v2 2/3] uboot: deprecate BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR Frank Hunleth
2015-04-18 20:27 ` [Buildroot] [PATCH v2 3/3] altera: update use of BR2_TARGET_UBOOT_PATCH_DIR Frank Hunleth
2015-04-19  9:09 ` [Buildroot] [PATCH v2 1/3] uboot: add support for patch files and URLs Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.