From patchwork Wed Jun 29 05:06:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Bobroff X-Patchwork-Id: 641840 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rfW0N46vwz9ssM for ; Wed, 29 Jun 2016 15:08:20 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E84313341F; Wed, 29 Jun 2016 05:08:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OZMsywZ4AlkB; Wed, 29 Jun 2016 05:08:13 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 360F133401; Wed, 29 Jun 2016 05:07:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 01F4C1C0F5A for ; Wed, 29 Jun 2016 05:07:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id F29B38C284 for ; Wed, 29 Jun 2016 05:07:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id i-wRBODth1wj for ; Wed, 29 Jun 2016 05:07:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by whitealder.osuosl.org (Postfix) with ESMTPS id 69ACE8D344 for ; Wed, 29 Jun 2016 05:06:51 +0000 (UTC) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u5T4x1dw065733 for ; Wed, 29 Jun 2016 01:06:50 -0400 Received: from e23smtp03.au.ibm.com (e23smtp03.au.ibm.com [202.81.31.145]) by mx0a-001b2d01.pphosted.com with ESMTP id 23utc8m3a9-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 29 Jun 2016 01:06:50 -0400 Received: from localhost by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 29 Jun 2016 15:06:47 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp03.au.ibm.com (202.81.31.209) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 29 Jun 2016 15:06:46 +1000 X-IBM-Helo: d23dlp02.au.ibm.com X-IBM-MailFrom: sam.bobroff@au1.ibm.com X-IBM-RcptTo: buildroot@busybox.net Received: from d23relay10.au.ibm.com (d23relay10.au.ibm.com [9.190.26.77]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 965BF2BB0054 for ; Wed, 29 Jun 2016 15:06:45 +1000 (EST) Received: from d23av06.au.ibm.com (d23av06.au.ibm.com [9.190.235.151]) by d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u5T56jIK196920 for ; Wed, 29 Jun 2016 15:06:45 +1000 Received: from d23av06.au.ibm.com (localhost [127.0.0.1]) by d23av06.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u5T56jjv014699 for ; Wed, 29 Jun 2016 15:06:45 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av06.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u5T56juG014692; Wed, 29 Jun 2016 15:06:45 +1000 Received: from tungsten.au.ibm.com (unknown [9.192.196.106]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 8FDA5A0243; Wed, 29 Jun 2016 15:06:44 +1000 (AEST) From: Sam Bobroff To: buildroot@busybox.net Date: Wed, 29 Jun 2016 15:06:39 +1000 X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16062905-0008-0000-0000-0000009ED0C8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16062905-0009-0000-0000-0000078EDF2D Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-06-29_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606290047 Cc: patrick@stwcx.xyz, sam@mendozajonas.com, eliner@us.ibm.com Subject: [Buildroot] [PATCH v3 2/6] Add documentation for merged defconfigs 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" Signed-off-by: Sam Bobroff --- docs/manual/adding-board-support.txt | 3 ++ docs/manual/appendix.txt | 1 + docs/manual/merged-defconfigs.txt | 60 ++++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 docs/manual/merged-defconfigs.txt diff --git a/docs/manual/adding-board-support.txt b/docs/manual/adding-board-support.txt index f6d74ae..086a67e 100644 --- a/docs/manual/adding-board-support.txt +++ b/docs/manual/adding-board-support.txt @@ -24,6 +24,9 @@ savedefconfig+. This will generate a minimal +defconfig+ file at the root of the Buildroot source tree. Move this file into the +configs/+ directory, and rename it +_defconfig+. +It is also possible to create configurations by specifying differences from +an existing configuration. See xref:merged-defconfigs[]. + It is recommended to use as much as possible upstream versions of the Linux kernel and bootloaders, and to use as much as possible default kernel and bootloader configurations. If they are incorrect for your diff --git a/docs/manual/appendix.txt b/docs/manual/appendix.txt index 87a20bd..9abc37e 100644 --- a/docs/manual/appendix.txt +++ b/docs/manual/appendix.txt @@ -3,6 +3,7 @@ include::makedev-syntax.txt[] include::makeusers-syntax.txt[] +include::merged-defconfigs.txt[] // Automatically generated lists: diff --git a/docs/manual/merged-defconfigs.txt b/docs/manual/merged-defconfigs.txt new file mode 100644 index 0000000..e1f50fd --- /dev/null +++ b/docs/manual/merged-defconfigs.txt @@ -0,0 +1,60 @@ +// -*- mode:doc -*- ; +// vim: set syntax=asciidoc: + +[[merged-defconfigs]] +== Merged configurations + +Buildroot supports the use of the Linux kernel's +merge_config.sh+ script to +create configurations by merging a set of partial configurations (or overlays) +on top of a base configuration. This may be useful when there are several +configurations that are specializations of a single generic configuration. + +Files in the +configs/+ directory with the extension ++.mk+ will be read by the top level Makefile and the Make function ++merge_config+ can be used within them to define new merged configurations. + +The merge_config function takes three parameters: the first is the name of the +new configuration (which should end with +_defconfig+), the second is the name +of the base configuration file and the third is a space separated list of the +partial configuration files to merge from the +configs/+ directory. All files +should be specified relative to the +configs/+ directory and the name of the +Make fragment file should match the name of the configuration it creates. + +The new configuration can be selected as if it were a normal configuration, i.e. with ++make foo_defconfig+. + +Partial configurations have the same format as full configuration +files except that they contain only a subset of values. They can be created by +starting with a normal configuration file and deleting lines as appropriate. + +External configuration files from the +$(BR2_EXTERNAL)/configs+ directory are fully +supported, and merge configurations may freely refer to files from either +location. + +Example: + +If configs/foo_defconfig contains: +----- +BR2_TARGET_GENERIC_HOSTNAME="buildroot" +----- + +And configs/bar_defconfig.mk contains: +----- +$(eval $(call merge_config,bar_defconfig,foo_defconfig,b.config)) +----- + +And configs/b.config contains: +----- +BR2_TARGET_GENERIC_ISSUE="Welcome to BAR" +----- + +After running the command: +----- +make bar_defconfig +----- + +The resulting .config file would contain: +----- +BR2_TARGET_GENERIC_HOSTNAME="buildroot" +BR2_TARGET_GENERIC_ISSUE="Welcome to BAR" +-----