aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Frank Hunleth <fhunleth@troodon-software.com>2015-04-18 16:27:42 -0400
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-04-19 11:06:23 +0200
commit3e3fef39e71ed0426130b36aa00e4630ebb537ae (patch)
treed1c8df8d6b8fc6e022de4d25862355c5c101d4e0
parentdf484231d9f10842f984e571f6393570292b88ca (diff)
downloadbuildroot-3e3fef39e71ed0426130b36aa00e4630ebb537ae.tar.gz
buildroot-3e3fef39e71ed0426130b36aa00e4630ebb537ae.tar.bz2
uboot: add support for patch files and URLs
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> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r--boot/uboot/Config.in10
-rw-r--r--boot/uboot/uboot.mk20
2 files changed, 30 insertions, 0 deletions
diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index 23d9c80998..8769296470 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 0272d9ee2e..1526177b39 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -89,6 +89,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
@@ -97,6 +99,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) \