Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 3/3] docs/manual: add explanations about BR2_EXTERNAL
Date: Thu, 12 Sep 2013 23:46:22 +0200	[thread overview]
Message-ID: <5232362E.60107@mind.be> (raw)
In-Reply-To: <1378646129-4167-4-git-send-email-thomas.petazzoni@free-electrons.com>

On 08/09/13 15:15, Thomas Petazzoni wrote:
> This commit updates the manual to add details on how to use the
> BR2_EXTERNAL feature.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>   docs/manual/customize-outside-br.txt | 110 +++++++++++++++++++++++++++++++++++
>   docs/manual/customize.txt            |   2 +
>   2 files changed, 112 insertions(+)
>   create mode 100644 docs/manual/customize-outside-br.txt
>
> diff --git a/docs/manual/customize-outside-br.txt b/docs/manual/customize-outside-br.txt
> new file mode 100644
> index 0000000..81a8911
> --- /dev/null
> +++ b/docs/manual/customize-outside-br.txt
> @@ -0,0 +1,110 @@
> +// -*- mode:doc -*- ;
> +
> +[[outside-br-custom]]
> +Keeping customization outside Buildroot
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +While the Buildroot community recommends and encourages upstreaming to
> +the official Buildroot version the packages and boards support that
> +are written by developers, it is sometimes not possible or desirable,
> +due to these packages or boards being highly specific or proprietary.
> +
> +In this case, Buildroot users are offered two choices:
> +
> + * They can add their packages, board support and configuration files
> +   directly within the Buildroot tree, and maintain them by using
> +   branches in a version control system.
> +
> + * They can use the +BR2_EXTERNAL+ mechanism, which allows to keep
> +   package recipes, board support and configuration files outside of
> +   the Buildroot tree, while still having them nicely integrated in
> +   the build logic. The following paragraphs give details on how to
> +   use +BR2_EXTERNAL+.
> +
> ++BR2_EXTERNAL+ is an environment variable that one can use to point to
> +a directory that contains Buildroot customizations. This environment
> +variable must be passed everytime a Buildroot +make+ command is
> +invoked, be it at configuration time (+make menuconfig+, +make
> +xconfig+, etc.), at build time (+make+) or any other Buildroot command
> +(+make source+, +make legal-info+, etc.).

  Hang on... It's stored in the .config, right? So no need to pass it 
every time?

  In fact, if the config option would get a prompt, you could even enter 
it through the config instead of through the environment. The only reason 
to pass it through the environment is to be able to list the available 
defconfigs.

  Or am I missing something?

> +
> +Examples:
> +
> +-----
> + buildroot/ $ make BR2_EXTERNAL=../company menuconfig
> + buildroot/ $ make BR2_EXTERNAL=../company
> +-----
> +
> +This +BR2_EXTERNAL+ then allows three different things:
> +
> + * One can store all the board-specific configuration files here, such
> +   as the kernel configuration, the root filesystem overlay, or any
> +   other configuration file for which Buildroot allows to set its
> +   location. The +BR2_EXTERNAL+ value is available within the
> +   Buildroot configuration using +$(BR2_EXTERNAL)+. As an example, one
> +   could set the +BR2_ROOTFS_OVERLAY+ Buildroot option to
> +   +$(BR2_EXTERNAL)/board/someboard/overlay/+ (to specify a root
> +   filesystem overlay), or the +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE+
> +   Buildroot option to +$(BR2_EXTERNAL)/board/someboard/kernel.config+
> +   (to specify the location of the kernel configuration file).
> ++
> +To achieve this, it is recommended but not mandatory, to store those
> +   details in directories called +board/<boardname>/+ under

  You use someboard instead of <boardname> earlier.

> +   +BR2_EXTERNAL+.
> +
> + * One can store package recipes (i.e +Config.in+ and
> +   +<packagename>.mk+), or even custom configuration options and make
> +   logic. Buildroot automatically includes +BR2_EXTERNAL/Config.in+ to
> +   make it appear in the top-level configuration menu, and includes
> +   +BR2_EXTERNAL/external.mk+ with the rest of the makefile logic.
> ++
> +The main usage of this would be to store package recipes. The
> +   recommended way to do this is to write a +BR2_EXTERNAL/Config.in+
> +   that looks like:
> ++
> +------
> +menu "<somecompany> packages"
> +
> +source "$BR2_EXTERNAL/package/package1/Config.in"
> +source "$BR2_EXTERNAL/package/package2/Config.in"

  Wow, does this work? Then actually, you don't need that generated 
Config.in at all... Instead, you can add

source "$BR2_EXTERNAL/package/Config.in"

to the top of package/Config.in. And set a non-empty default for 
BR2_EXTERNAL, e.g. $(TOPDIR)/support/dummy_external, which contains an 
empty package/Config.in.

  Regards,
  Arnout

> +
> +endmenu
> +------
> ++
> +Then, have a +BR2_EXTERNAL/external.mk' file that looks like:
> ++
> +------
> +include $(BR2_EXTERNAL)/package/*/*.mk
> +------
> ++
> +And then in +BR2_EXTERNAL/package/package1+ and
> +   +BR2_EXTERNAL/package/package2+ create normal Buildroot package
> +   recipes, as explained in xref:adding-packages[].
> +
> + * One can store Buildroot defconfigs in the +configs+ subdirectory of
> +   +BR2_EXTERNAL+. Buildroot will automatically show them in the
> +   output of +make help+ and allow them to be loaded with the normal
> +   +make <name>_defconfig+ command.
> +
> +In the end, a typical +BR2_EXTERNAL+ directory organization would
> +generally be:
> +
> +-----
> +??? Config.in
> +??? external.mk
> +??? board/
> +?   ??? <someboard>/
> +?       ??? overlay/
> +?           ??? etc/
> +?               ??? <some file>
> +??? configs/
> +?   ??? <some board>_defconfig
> +??? package/
> +    ??? Config.in
> +    ??? package1/
> +        ??? Config.in
> +        ??? package1.mk
> +    ??? package2/
> +        ??? Config.in
> +        ??? package2.mk
> +------
> diff --git a/docs/manual/customize.txt b/docs/manual/customize.txt
> index 0456ef1..7e46fd8 100644
> --- a/docs/manual/customize.txt
> +++ b/docs/manual/customize.txt
> @@ -17,3 +17,5 @@ include::customize-toolchain.txt[]
>   include::customize-store.txt[]
>
>   include::customize-packages.txt[]
> +
> +include::customize-outside-br.txt[]
>


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

  parent reply	other threads:[~2013-09-12 21:46 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-08 13:15 [Buildroot] [PATCH 0/3] Support for out-of-tree Buildroot customization Thomas Petazzoni
2013-09-08 13:15 ` [Buildroot] [PATCH 1/3] Makefile: factorize *config dependencies Thomas Petazzoni
2013-09-11  2:06   ` rjbarnet at rockwellcollins.com
2013-09-11 17:39   ` Yann E. MORIN
2013-09-08 13:15 ` [Buildroot] [PATCH 2/3] Add support for BR2_EXTERNAL Thomas Petazzoni
2013-09-11  2:03   ` rjbarnet at rockwellcollins.com
2013-09-11 17:03     ` Yann E. MORIN
2013-09-11 17:12       ` Ryan Barnett
2013-09-12 21:05     ` Arnout Vandecappelle
2013-09-12 21:30       ` Ryan Barnett
2013-09-12 21:41         ` Arnout Vandecappelle
2013-09-12 21:51           ` Ryan Barnett
2013-09-12 21:57             ` Arnout Vandecappelle
2013-09-12 22:11               ` Ryan Barnett
2013-09-13 20:56                 ` Arnout Vandecappelle
2013-09-14  5:29                   ` Thomas Petazzoni
2013-09-11  2:07   ` rjbarnet at rockwellcollins.com
2013-09-12 21:04   ` Arnout Vandecappelle
2013-09-13  3:48     ` Thomas Petazzoni
2013-09-13  6:43       ` Tzu-Jung Lee
2013-09-13  7:10         ` Thomas Petazzoni
2013-09-13  7:47           ` Tzu-Jung Lee
     [not found]   ` <CAC2S8kiHUwNFprvvYd85UEGjDJhEX0Jgtb4e7Pd1vwwFGF7m_w@mail.gmail.com>
2013-09-12 21:53     ` [Buildroot] Fwd: " Ryan Barnett
2013-09-08 13:15 ` [Buildroot] [PATCH 3/3] docs/manual: add explanations about BR2_EXTERNAL Thomas Petazzoni
2013-09-11  2:09   ` rjbarnet at rockwellcollins.com
2013-09-12 21:46   ` Arnout Vandecappelle [this message]
2013-09-13  6:53     ` Thomas Petazzoni
2013-09-11  1:32 ` [Buildroot] [PATCH 0/3] Support for out-of-tree Buildroot customization rjbarnet at rockwellcollins.com
2013-09-11  7:17   ` Thomas Petazzoni
2013-09-11 15:55     ` Ryan Barnett
2013-09-11 17:27       ` Yann E. MORIN
2013-09-12  7:54         ` Thomas De Schampheleire
2013-09-12 18:21           ` Thomas Petazzoni
2013-09-12 18:25             ` ANDY KENNEDY
2013-09-12 18:33               ` Thomas Petazzoni
2013-09-12 18:44                 ` ANDY KENNEDY
2013-09-12 22:04                 ` Arnout Vandecappelle
2013-09-12 22:12                   ` Yann E. MORIN
2013-09-13 21:50                     ` Arnout Vandecappelle
2013-09-14 22:16                       ` Yann E. MORIN
2013-09-16 15:43                         ` ANDY KENNEDY
2013-09-16 17:30                           ` Yann E. MORIN
2013-09-16 18:26                             ` Thomas Petazzoni
2013-09-16 18:58                               ` ANDY KENNEDY
2013-09-16 16:21                         ` [Buildroot] Is GPLv2 the right license for Buildroot? Thomas Petazzoni
2013-09-16 17:08                           ` Yann E. MORIN
2013-09-16 17:45                             ` ANDY KENNEDY
2013-09-16 18:01                               ` Thomas Petazzoni
2013-09-16 18:16                                 ` Yann E. MORIN
2013-09-16 21:17                                 ` Peter Korsgaard
2013-09-18  1:50                                 ` Jason Rennie
2013-09-18  7:22                                   ` Peter Korsgaard
2013-09-18 22:09                                   ` Yann E. MORIN
2013-09-19  0:25                                     ` Jason Rennie
2013-09-19 17:54                                       ` Yann E. MORIN
2013-09-16 17:58                             ` Thomas Petazzoni
2013-09-16 18:15                               ` Yann E. MORIN
2013-09-16 18:24                                 ` Thomas Petazzoni
2013-09-16 18:56                                   ` ANDY KENNEDY
2013-09-16 20:04                                   ` Yann E. MORIN
2013-09-17  4:17                                     ` Thomas Petazzoni
2013-09-16 19:50                             ` Grant Edwards
2013-09-16 20:15                               ` Yann E. MORIN
2013-09-18  1:52                               ` Jason Rennie
2013-09-16 19:53                             ` Arnout Vandecappelle
2013-09-16 21:13                             ` Peter Korsgaard
2013-09-16 21:12                           ` Peter Korsgaard
2013-09-17  4:44                             ` Thomas Petazzoni
2013-09-17 14:53                               ` Grant Edwards
2013-09-17 15:17                                 ` Jeremy Rosen
2013-09-17 15:22                                   ` Grant Edwards
2013-09-17 15:29                                 ` Peter Korsgaard
2013-09-16 18:56                         ` [Buildroot] [PATCH 0/3] Support for out-of-tree Buildroot customization Arnout Vandecappelle
2013-09-12 22:07                 ` Yann E. MORIN
2013-09-12 22:28                   ` ANDY KENNEDY
2013-09-12 22:47                     ` Yann E. MORIN
2013-09-15 13:18                       ` Thomas De Schampheleire
2013-09-12 21:51             ` Yann E. MORIN
2013-09-13  7:35             ` Thomas De Schampheleire
2013-09-13 15:55               ` Ryan Barnett
2013-09-12 21:50           ` Yann E. MORIN
2013-09-12 18:18         ` Thomas Petazzoni
2013-09-12 22:24           ` Yann E. MORIN
2013-09-11  5:00 ` Baruch Siach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5232362E.60107@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox