From patchwork Wed Dec 11 17:58:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Barnett X-Patchwork-Id: 300243 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 30C312C00B7 for ; Thu, 12 Dec 2013 04:58:19 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 858A88B658; Wed, 11 Dec 2013 17:58:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ijb3OfmOKIpm; Wed, 11 Dec 2013 17:58:17 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 68AFD8B210; Wed, 11 Dec 2013 17:58:17 +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 7EF7F1CE869 for ; Wed, 11 Dec 2013 17:58:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7C3F48AAA6 for ; Wed, 11 Dec 2013 17:58:16 +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 QuTGQCN8arm7 for ; Wed, 11 Dec 2013 17:58:15 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from secvs02.rockwellcollins.com (secvs02.rockwellcollins.com [205.175.225.241]) by whitealder.osuosl.org (Postfix) with ESMTPS id A9A8D88737 for ; Wed, 11 Dec 2013 17:58:15 +0000 (UTC) Received: from nosuchhost.198.131.in-addr.arpa (HELO collinscrsmtp02.rockwellcollins.com) ([131.198.63.133]) by mail-virt.rockwellcollins.com with ESMTP; 11 Dec 2013 11:58:14 -0600 Received: from nunkun.rockwellcollins.com ([131.198.63.11]) by collinscrsmtp02.rockwellcollins.com (Lotus Domino Release 8.5.2FP2 HF162) with ESMTP id 2013121111581380-1019311 ; Wed, 11 Dec 2013 11:58:13 -0600 From: Ryan Barnett To: buildroot@busybox.net Date: Wed, 11 Dec 2013 11:58:04 -0600 Message-Id: <1386784684-6546-2-git-send-email-rjbarnet@rockwellcollins.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1386784684-6546-1-git-send-email-rjbarnet@rockwellcollins.com> References: <1386784684-6546-1-git-send-email-rjbarnet@rockwellcollins.com> X-MIMETrack: Itemize by SMTP Server on CollinsCRSMTP02/CedarRapids/RockwellCollins(Release 8.5.2FP2 HF162|May 16, 2011) at 12/11/2013 11:58:13 AM, Serialize by Router on CollinsCRSMTP02/CedarRapids/RockwellCollins(Release 8.5.2FP2 HF162|May 16, 2011) at 12/11/2013 11:58:13 AM, Serialize complete at 12/11/2013 11:58:13 AM X-TNEFEvaluated: 1 Subject: [Buildroot] [PATCH 2/2] manual: update for multiple global patch dirs X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 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-bounces@busybox.net Updating the documentation to reflect that multiple directories can now be specified for BR2_GLOBAL_PATCH_DIR. Along with giving an example use case of how to use multiple global patch directories. --- docs/manual/customize-packages.txt | 69 +++++++++++++++++++++++++++++++----- docs/manual/patch-policy.txt | 13 ++++--- 2 files changed, 69 insertions(+), 13 deletions(-) diff --git a/docs/manual/customize-packages.txt b/docs/manual/customize-packages.txt index 1820c54..d3fb052 100644 --- a/docs/manual/customize-packages.txt +++ b/docs/manual/customize-packages.txt @@ -8,16 +8,67 @@ It is sometimes useful to apply 'extra' patches to packages - over and above those provided in Buildroot. This might be used to support custom features in a project, for example, or when working on a new architecture. -The +BR2_GLOBAL_PATCH_DIR+ configuration file option can be -used to specify a directory containing global package patches. +The +BR2_GLOBAL_PATCH_DIR+ configuration option can be used to specify +a space separated list of one or more directories containing global +package patches. By specifying multiple global patch directories, a +user could implement a layered approach to patches. This could be +useful when a user has multiple boards that share a common processor +architecture. It is often the case that a subset of patches for a +package that need to be shared between the different boards a user +has. However, each board may require specific patches for the package +that build on top of the common subset of patches. -For a specific version of a specific package , -patches are applied as follows. +For a specific version ++ of a specific package +++, patches are applied as follows: -First, the default Buildroot patch set for the package is applied. +. First, the default Buildroot patch set for the package is applied. -If the directory +$(BR2_GLOBAL_PATCH_DIR)//+ -exists, then all +*.patch+ files in the directory will be applied. +. Then for every directory - ++ - that exists in + +BR2_GLOBAL_PATCH_DIR+, the following will be done: ++ +* If the directory + +///+ exists, then + all *.patch files in this directory will be applied. ++ +* Otherwise, if the directory +/+ exists, + then all *.patch files in the directory will be applied. -Otherwise, if the directory +$(BR2_GLOBAL_PATCH_DIR)/+ -exists, then all +*.patch+ files in the directory will be applied. +The +BR2_GLOBAL_PATCH_DIR+ option is preferred method for specifying a +custom patch directory for packages. It should be used when patching +Linux, U-Boot, and other packages that already have custom patch +directories options available to them as configuration options. By +doing this, it will allow a user to manage their patches from one +top-level directory.` + +An example directory structure for where a user has multiple +directories specified for +BR2_GLOBAL_PATCH_DIR+ may look like this: + +----- +board/ ++-- common-fooarch +| +-- patches +| +-- linux +| | +-- linux-patch1.patch +| | +-- linux-patch2.patch +| +-- u-boot +| +-- foopkg ++-- fooarch-board + +-- patches + +-- linux + | +-- linux-patch3.patch + +-- u-boot + +-- foopkg +----- + +If the user to have +BR2_GLOBAL_PATCH_DIR+ configuration option set as +follows: + +----- +BR2_GLOBAL_PATCH_DIR="board/common-fooarch board/fooarch-board" +----- + +Then the patches would applied as follows for the Linux kernel: + +. board/common-fooarch/patches/linux/linux-patch1.patch +. board/common-fooarch/patches/linux/linux-patch2.patch +. board/fooarch-board/patches/linux/linux-patch1.patch diff --git a/docs/manual/patch-policy.txt b/docs/manual/patch-policy.txt index d9bc8ca..26586ad 100644 --- a/docs/manual/patch-policy.txt +++ b/docs/manual/patch-policy.txt @@ -50,8 +50,9 @@ Global patch directory ^^^^^^^^^^^^^^^^^^^^^^ The +BR2_GLOBAL_PATCH_DIR+ configuration file option can be -used to specify a directory containing global package patches. See -xref:packages-custom[] for details. +used to specify a space separated list of one or more directories +containing global package patches. See xref:packages-custom[] for +details. How patches are applied @@ -72,11 +73,15 @@ How patches are applied + * Otherwise, patch files matching +-*.patch+ are applied in alphabetical order. - So, to ensure they are applied in the right order, it is hightly - recommended to named the patch files like this: + So, to ensure they are applied in the right order, it is highly + recommended to name the patch files like this: +--.patch+, where ++ refers to the 'apply order'. +. If +BR2_GLOABL_PATCH_DIR+ is defined, the directories will be + enumerated in the order they are specified for patches. The patches + are applied as described in the previous step. + . Run the +_POST_PATCH_HOOKS+ commands if defined. If something goes wrong in the steps _3_ or _4_, then the build fails.