* [Buildroot] [PATCH] barebox: add support for custom version, tarball, git and patch dir
@ 2011-09-17 20:23 Jean-Christophe PLAGNIOL-VILLARD
2011-09-18 20:06 ` Peter Korsgaard
2011-09-22 17:20 ` Arnout Vandecappelle
0 siblings, 2 replies; 9+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-09-17 20:23 UTC (permalink / raw)
To: buildroot
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
boot/barebox/Config.in | 53 +++++++++++++++++++++++++++++++++++++++++++++++
boot/barebox/barebox.mk | 23 +++++++++++++++++++-
2 files changed, 75 insertions(+), 1 deletions(-)
diff --git a/boot/barebox/Config.in b/boot/barebox/Config.in
index a821c45..c11c03d 100644
--- a/boot/barebox/Config.in
+++ b/boot/barebox/Config.in
@@ -6,6 +6,59 @@ menuconfig BR2_TARGET_BAREBOX
http://www.barebox.org
if BR2_TARGET_BAREBOX
+choice
+ prompt "Barebox Version"
+ default BR2_TARGET_BAREBOX_2011_09
+ help
+ Select the specific Barebox version you want to use
+
+config BR2_TARGET_BAREBOX_2011_08
+ bool "2011.08"
+
+config BR2_TARGET_BAREBOX_2011_09
+ bool "2011.09"
+
+config BR2_TARGET_BAREBOX_CUSTOM_TARBALL
+ bool "Custom tarball"
+
+config BR2_TARGET_BAREBOX_CUSTOM_GIT
+ bool "Custom Git repository"
+
+endchoice
+
+if BR2_TARGET_BAREBOX_CUSTOM_TARBALL
+
+config BR2_TARGET_BAREBOX_CUSTOM_TARBALL_LOCATION
+ string "URL of custom Barebox tarball"
+
+endif
+
+config BR2_TARGET_BAREBOX_VERSION
+ string
+ default "2011.08.0" if BR2_TARGET_BAREBOX_2011_08
+ default "2011.09.0" if BR2_TARGET_BAREBOX_2011_09
+ default "custom" if BR2_TARGET_BAREBOX_CUSTOM_TARBALL
+ default $BR2_TARGET_BAREBOX_CUSTOM_GIT_VERSION if BR2_TARGET_BAREBOX_CUSTOM_GIT
+
+config BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR
+ string "custom patch dir"
+ help
+ If your board requires custom patches, add the path to the
+ directory containing the patches here. The patches must be
+ named barebox-<version>-<something>.patch.
+
+ Most users may leave this empty
+
+if BR2_TARGET_BAREBOX_CUSTOM_GIT
+
+config BR2_TARGET_BAREBOX_CUSTOM_GIT_REPO_URL
+ string "URL of custom Git repository"
+
+config BR2_TARGET_BAREBOX_CUSTOM_GIT_VERSION
+ string "Custom Git version"
+
+endif
+
config BR2_TARGET_BAREBOX_BOARD_DEFCONFIG
string "board defconfig"
help
diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
index 0dfcff3..8826ef9 100644
--- a/boot/barebox/barebox.mk
+++ b/boot/barebox/barebox.mk
@@ -4,9 +4,30 @@
#
#############################################################
-BAREBOX_VERSION = 2011.09.0
+BAREBOX_VERSION = $(call qstrip,$(BR2_TARGET_BAREBOX_VERSION))
+
+ifeq ($(BAREBOX_VERSION),custom)
+# Handle custom Barebox tarballs as specified by the configuration
+BAREBOX_TARBALL = $(call qstrip,$(BR2_TARGET_BAREBOX_CUSTOM_TARBALL_LOCATION))
+BAREBOX_SITE = $(dir $(BAREBOX_TARBALL))
+BAREBOX_SOURCE = $(notdir $(BAREBOX_TARBALL))
+else ifeq ($(BR2_TARGET_BAREBOX_CUSTOM_GIT),y)
+BAREBOX_SITE = $(call qstrip,$(BR2_TARGET_BAREBOX_CUSTOM_GIT_REPO_URL))
+BAREBOX_SITE_METHOD = git
+else
+# Handle stable official Barebox versions
BAREBOX_SOURCE = barebox-$(BAREBOX_VERSION).tar.bz2
BAREBOX_SITE = http://www.barebox.org/download/
+endif
+
+ifneq ($(call qstrip,$(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR)),)
+define BAREBOX_APPLY_CUSTOM_PATCHES
+ toolchain/patch-kernel.sh $(@D) $(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR) \
+ barebox-$(BAREBOX_VERSION)-\*.patch
+endef
+
+BAREBOX_POST_PATCH_HOOKS += BAREBOX_APPLY_CUSTOM_PATCHES
+endif
BAREBOX_INSTALL_IMAGES = YES
ifneq ($(BR2_TARGET_BAREBOX_BAREBOXENV),y)
--
1.7.5.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH] barebox: add support for custom version, tarball, git and patch dir
2011-09-17 20:23 [Buildroot] [PATCH] barebox: add support for custom version, tarball, git and patch dir Jean-Christophe PLAGNIOL-VILLARD
@ 2011-09-18 20:06 ` Peter Korsgaard
2011-09-22 17:20 ` Arnout Vandecappelle
1 sibling, 0 replies; 9+ messages in thread
From: Peter Korsgaard @ 2011-09-18 20:06 UTC (permalink / raw)
To: buildroot
>>>>> "JC" == Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> writes:
JC> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Committed, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH] barebox: add support for custom version, tarball, git and patch dir
2011-09-17 20:23 [Buildroot] [PATCH] barebox: add support for custom version, tarball, git and patch dir Jean-Christophe PLAGNIOL-VILLARD
2011-09-18 20:06 ` Peter Korsgaard
@ 2011-09-22 17:20 ` Arnout Vandecappelle
2011-09-22 18:57 ` Thomas Petazzoni
2011-09-22 19:55 ` Peter Korsgaard
1 sibling, 2 replies; 9+ messages in thread
From: Arnout Vandecappelle @ 2011-09-22 17:20 UTC (permalink / raw)
To: buildroot
On Saturday 17 September 2011 22:23:08, Jean-Christophe PLAGNIOL-VILLARD
wrote:
> +config BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR
> + string "custom patch dir"
> + help
> + If your board requires custom patches, add the path to the
> + directory containing the patches here. The patches must be
> + named barebox-<version>-<something>.patch.
> +
> + Most users may leave this empty
Do people often use buildroot this way? I always make a project-specific
branch of the buildroot tree and drop any patches directly in there.
Not that it hurts to have the option of course :-)
But if many people use buildroot this way, it would make total sense to try
to implement overlays like openembedded does.
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286540
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: 31BB CF53 8660 6F88 345D 54CC A836 5879 20D7 CF43
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH] barebox: add support for custom version, tarball, git and patch dir
2011-09-22 17:20 ` Arnout Vandecappelle
@ 2011-09-22 18:57 ` Thomas Petazzoni
2011-09-22 19:45 ` Arnout Vandecappelle
2011-09-22 19:55 ` Peter Korsgaard
1 sibling, 1 reply; 9+ messages in thread
From: Thomas Petazzoni @ 2011-09-22 18:57 UTC (permalink / raw)
To: buildroot
Le Thu, 22 Sep 2011 19:20:36 +0200,
Arnout Vandecappelle <arnout@mind.be> a ?crit :
> Do people often use buildroot this way? I always make a
> project-specific branch of the buildroot tree and drop any patches
> directly in there.
I typically make a per-project branch as well, but for kernel/u-boot
patches, I typically like to store them into
board/<company>/<project>/linux-x.y.z-patches
board/<company>/<project>/uboot-x.y.z-patches
because those patches are typically board and project specific.
Where do you put them ? Directly in linux/ and boot/uboot/ ?
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH] barebox: add support for custom version, tarball, git and patch dir
2011-09-22 18:57 ` Thomas Petazzoni
@ 2011-09-22 19:45 ` Arnout Vandecappelle
2011-09-23 7:49 ` Thomas Petazzoni
0 siblings, 1 reply; 9+ messages in thread
From: Arnout Vandecappelle @ 2011-09-22 19:45 UTC (permalink / raw)
To: buildroot
On Thursday 22 September 2011 20:57:59, Thomas Petazzoni wrote:
> Le Thu, 22 Sep 2011 19:20:36 +0200,
>
> Arnout Vandecappelle <arnout@mind.be> a ?crit :
> > Do people often use buildroot this way? I always make a
> >
> > project-specific branch of the buildroot tree and drop any patches
> > directly in there.
>
> I typically make a per-project branch as well, but for kernel/u-boot
> patches, I typically like to store them into
>
> board/<company>/<project>/linux-x.y.z-patches
> board/<company>/<project>/uboot-x.y.z-patches
>
> because those patches are typically board and project specific.
>
> Where do you put them ? Directly in linux/ and boot/uboot/ ?
Since I have a separate branch or even repository per project, yes I put them
directly into the package directories. But I realize this is not necessarily
the best way to work.
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286540
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: 31BB CF53 8660 6F88 345D 54CC A836 5879 20D7 CF43
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH] barebox: add support for custom version, tarball, git and patch dir
2011-09-22 17:20 ` Arnout Vandecappelle
2011-09-22 18:57 ` Thomas Petazzoni
@ 2011-09-22 19:55 ` Peter Korsgaard
2011-09-23 6:27 ` Thomas De Schampheleire
1 sibling, 1 reply; 9+ messages in thread
From: Peter Korsgaard @ 2011-09-22 19:55 UTC (permalink / raw)
To: buildroot
>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:
Arnout> On Saturday 17 September 2011 22:23:08, Jean-Christophe PLAGNIOL-VILLARD
Arnout> wrote:
>> +config BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR
>> + string "custom patch dir"
>> + help
>> + If your board requires custom patches, add the path to the
>> + directory containing the patches here. The patches must be
>> + named barebox-<version>-<something>.patch.
>> +
>> + Most users may leave this empty
Arnout> Do people often use buildroot this way? I always make a
Arnout> project-specific branch of the buildroot tree and drop any
Arnout> patches directly in there.
I need to support a bunch of projects at work, so I keep them all in a
seperate repo (which gets synced with mainline buildroot ever so
often. Bootloader and kernel are likewise in (shared) local repos.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH] barebox: add support for custom version, tarball, git and patch dir
2011-09-22 19:55 ` Peter Korsgaard
@ 2011-09-23 6:27 ` Thomas De Schampheleire
2011-09-23 7:55 ` Thomas Petazzoni
0 siblings, 1 reply; 9+ messages in thread
From: Thomas De Schampheleire @ 2011-09-23 6:27 UTC (permalink / raw)
To: buildroot
On Thu, Sep 22, 2011 at 9:55 PM, Peter Korsgaard <jacmet@uclibc.org> wrote:
>>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:
>
> ?Arnout> On Saturday 17 September 2011 22:23:08, Jean-Christophe PLAGNIOL-VILLARD
> ?Arnout> wrote:
> ?>> +config BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR
> ?>> + ? ? ? string "custom patch dir"
> ?>> + ? ? ? help
> ?>> + ? ? ? ? If your board requires custom patches, add the path to the
> ?>> + ? ? ? ? directory containing the patches here. The patches must be
> ?>> + ? ? ? ? named barebox-<version>-<something>.patch.
> ?>> +
> ?>> + ? ? ? ? Most users may leave this empty
>
> ?Arnout> ?Do people often use buildroot this way? ?I always make a
> ?Arnout> project-specific branch of the buildroot tree and drop any
> ?Arnout> patches directly in there.
>
> I need to support a bunch of projects at work, so I keep them all in a
> seperate repo (which gets synced with mainline buildroot ever so
> often. Bootloader and kernel are likewise in (shared) local repos.
>
Of the approaches described above, I prefer Thomas' one: use the
board/<company>/<project>/ directory for such patches. But are these
patches automatically detected and applied by buildroot?
The advantage of this approach is that if you have multiple related
projects, you do not need two separate buildroot repos or branches.
For example, in my case, we could have two different boards with
different CPU architectures, both using a same buildroot platform (of
course with different configurations). Some of the patches may be the
same, but some will be different, and then the board/ directory would
be a logical place.
-Thomas
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH] barebox: add support for custom version, tarball, git and patch dir
2011-09-22 19:45 ` Arnout Vandecappelle
@ 2011-09-23 7:49 ` Thomas Petazzoni
0 siblings, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2011-09-23 7:49 UTC (permalink / raw)
To: buildroot
Le Thu, 22 Sep 2011 21:45:19 +0200,
Arnout Vandecappelle <arnout@mind.be> a ?crit :
> Since I have a separate branch or even repository per project, yes I put them
> directly into the package directories. But I realize this is not necessarily
> the best way to work.
I don't think there "a best way" to work, but I think that for highly
hardware-dependent packages such as bootloaders and kernel, it makes
sense to offer some options to apply additional patches.
Note that this option not only supports a local directory, but also the
URL of a patch, or the URL of a tarball containing patches. This can be
very useful for hardware manufacturers who want to ship a Buildroot
environment with a proper configuration. They can just do a config that
says:
* Use Linux 3.0
* Use Linux patches available at
http://foobar.com/linux-3.0-my-patches.tar.bz2
* Use U-Boot 2011.09
* Use U-Boot patches available at
http://foobar.com/u-boot-2001.09-my-patches.tar.bz2
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH] barebox: add support for custom version, tarball, git and patch dir
2011-09-23 6:27 ` Thomas De Schampheleire
@ 2011-09-23 7:55 ` Thomas Petazzoni
0 siblings, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2011-09-23 7:55 UTC (permalink / raw)
To: buildroot
Le Fri, 23 Sep 2011 08:27:24 +0200,
Thomas De Schampheleire <patrickdepinguin+buildroot@gmail.com> a ?crit :
> Of the approaches described above, I prefer Thomas' one: use the
> board/<company>/<project>/ directory for such patches. But are these
> patches automatically detected and applied by buildroot?
Depends on what you call automatically. As long as you tell the kernel
config, u-boot config or barebox config to apply those patches, then,
they will be applied.
Here is the config that I have for a project:
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARDNAME="myboard"
BR2_TARGET_UBOOT_1_3_4=y
BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="board/company/boardname/u-boot-1.3.4-patches/"
# BR2_TARGET_UBOOT_NETWORK is not set
BR2_TARGET_AT91BOOTSTRAP=y
BR2_TARGET_AT91BOOTSTRAP_BOARD="myboard"
BR2_TARGET_AT91BOOTSTRAP_CUSTOM_PATCH_DIR="board/company/boardname/at91bootstrap-1.16-patches/"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="2.6.39"
BR2_LINUX_KERNEL_PATCH="board/company/boardname/linux-2.6.39-patches/"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/company/boardname/linux-2.6.39.config"
This allows to build U-Boot 1.3.4 (old!) with patches, AT91Bootstrap
1.16 with patches, and Linux 2.6.39 with patches.
Regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2011-09-23 7:55 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-17 20:23 [Buildroot] [PATCH] barebox: add support for custom version, tarball, git and patch dir Jean-Christophe PLAGNIOL-VILLARD
2011-09-18 20:06 ` Peter Korsgaard
2011-09-22 17:20 ` Arnout Vandecappelle
2011-09-22 18:57 ` Thomas Petazzoni
2011-09-22 19:45 ` Arnout Vandecappelle
2011-09-23 7:49 ` Thomas Petazzoni
2011-09-22 19:55 ` Peter Korsgaard
2011-09-23 6:27 ` Thomas De Schampheleire
2011-09-23 7:55 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox