From patchwork Sat Apr 18 20:27:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Hunleth X-Patchwork-Id: 462427 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id DBB7914018C for ; Sun, 19 Apr 2015 06:28:21 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id BAB018D1DC; Sat, 18 Apr 2015 20:28:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 41f2C2AtikiN; Sat, 18 Apr 2015 20:28:19 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 97189909B6; Sat, 18 Apr 2015 20:28:19 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 0E3201C1F31 for ; Sat, 18 Apr 2015 20:28:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 09C118D1DC for ; Sat, 18 Apr 2015 20:28:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W0uD6HXAMIj5 for ; Sat, 18 Apr 2015 20:28:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qg0-f51.google.com (mail-qg0-f51.google.com [209.85.192.51]) by whitealder.osuosl.org (Postfix) with ESMTPS id AD9D99096F for ; Sat, 18 Apr 2015 20:28:16 +0000 (UTC) Received: by qgdy78 with SMTP id y78so36580767qgd.0 for ; Sat, 18 Apr 2015 13:28:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=fNPzVnYQCW+kKrmDE09QqW8r5LXQfU7APIhK8AZyBew=; b=cYLNxjxYS5Zuxgdd5V+i29DlMP+XQmI1VWLy+Jr9/Jcg5+f8fbFc28X3eJtaAjPej7 W056A88ySIHmq/hf2OIXm833ezkDOVqdxp0eNDGpl8MkobvMMFsszOYZeEoLchpXHAHv u5XoNfNz11gjb31xDiQi5vmQkbeINQK5Mr6lv7ySSERv71SbMFxcSEVSG0TYh219SrfV sqEdQPuDwGgnnkwTrMVx/CWWoRLbEW4dEXFgXUnt+/dwg3R1/6CPZnZOfzHZ5YxHg/6K b2OLJv7oM7N3DswiLtEUVWKZj009vp0OHCfY/BxH8D1TmfD7h5LqlCojVGCMSWBpDcvm SzdQ== X-Gm-Message-State: ALoCoQnC+if2dXxaHj91e8kH1H76geG/D2NAtGY6cKHr/qMrh3qY6AjUBcNRqGnkmPvCeciPCJAX X-Received: by 10.140.151.131 with SMTP id 125mr2891195qhx.41.1429388895865; Sat, 18 Apr 2015 13:28:15 -0700 (PDT) Received: from halfmarathon.home.hunleth.com (c-98-231-220-218.hsd1.md.comcast.net. [98.231.220.218]) by mx.google.com with ESMTPSA id k85sm10890946qkh.48.2015.04.18.13.28.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Apr 2015 13:28:15 -0700 (PDT) From: Frank Hunleth To: buildroot@buildroot.org Date: Sat, 18 Apr 2015 16:27:42 -0400 Message-Id: <1429388864-15377-1-git-send-email-fhunleth@troodon-software.com> X-Mailer: git-send-email 1.9.1 Subject: [Buildroot] [PATCH v2 1/3] uboot: add support for patch files and URLs X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "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 --- 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(+) -- 1.9.1 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) \