Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] buildroot:linux: Add options to checkout Linux kernel source from SVN or GIT repository.
  2010-12-14  5:29 [Buildroot] [PATCH] buildroot:download: Add option to download SVN or GIT repository with version control information Sonic Zhang
@ 2010-12-14  5:29 ` Sonic Zhang
  2010-12-14  9:12   ` Sonic Zhang
  0 siblings, 1 reply; 5+ messages in thread
From: Sonic Zhang @ 2010-12-14  5:29 UTC (permalink / raw)
  To: buildroot

From: Sonic Zhang <sonic.zhang@analog.com>

Current buildroot Config.in and linux.mk don't support kernel source in SVN
or GIT repository. A pre-checkouted local SVN or GIT kernel tree set in
KERNEL_CUSTOM_TREE is the only option. Because the local path can be anywhere,
no buildroot default config file can be defined in sub folder
target/device/company/boards to run quick building. It is inconvient to run
regression testing. Since buildroot has already support SVN and GIT repository
for application packages, it is reasonable to have it for linux kernel as well.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 linux/Config.in |   19 ++++++++++++++++++-
 linux/linux.mk  |   24 +++++++++++++++++++++++-
 2 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/linux/Config.in b/linux/Config.in
index 480adca..07b08e2 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -52,6 +52,10 @@ config BR2_LINUX_KERNEL_CUSTOM_TREE
 	help
 	  This option allows use of an already unpacked linux tree.
 
+config BR2_LINUX_KERNEL_CUSTOM_REPOSITORY
+	bool "Custom source repository"
+	help
+	  This option allows to specify the svn or git repository.
 endchoice
 
 config BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE
@@ -67,12 +71,25 @@ config BR2_LINUX_KERNEL_CUSTOM_PATH
 	string "PATH of custom kernel tree"
 	depends on BR2_LINUX_KERNEL_CUSTOM_TREE
 
+config BR2_LINUX_KERNEL_CUSTOM_REPOSITORY_LOCATION
+	string "URL of custom kernel repository"
+	depends on BR2_LINUX_KERNEL_CUSTOM_REPOSITORY
+	help
+	  This is either the clone URL of GIT or trunk/tag/branch URL of SVN. 
+
+config BR2_LINUX_KERNEL_CUSTOM_REPOSITORY_VERSION
+	string "revision(svn/git), tag(git) or branch(git) of custom kernel source"
+	depends on BR2_LINUX_KERNEL_CUSTOM_REPOSITORY
+	default "HEAD"
+	help
+	  Tag or branch of GIT repository should be filled in here.
+
 config BR2_LINUX_KERNEL_VERSION
 	string
 	default "2.6.36" if BR2_LINUX_KERNEL_2_6_36
 	default BR2_DEFAULT_KERNEL_HEADERS if BR2_LINUX_KERNEL_SAME_AS_HEADERS
 	default BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE if BR2_LINUX_KERNEL_CUSTOM_VERSION
-	default "custom" if BR2_LINUX_KERNEL_CUSTOM_TARBALL || BR2_LINUX_KERNEL_CUSTOM_TREE
+	default "custom" if BR2_LINUX_KERNEL_CUSTOM_TARBALL || BR2_LINUX_KERNEL_CUSTOM_TREE || BR2_LINUX_KERNEL_CUSTOM_REPOSITORY
 
 #
 # Patch selection
diff --git a/linux/linux.mk b/linux/linux.mk
index 4b680fd..55fddfa 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -7,11 +7,33 @@ LINUX26_VERSION=$(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
 
 # Compute LINUX26_SOURCE and LINUX26_SITE from the configuration
 ifeq ($(LINUX26_VERSION),custom)
+
+ifeq ($(BR2_LINUX_KERNEL_CUSTOM_REPOSITORY),y)
+PKG:=LINUX26
+LINUX26_SITE:=$(call qstrip, $(BR2_LINUX_KERNEL_CUSTOM_REPOSITORY_LOCATION))
+LINUX26_DL_VERSION:=$(call qstrip, $(BR2_LINUX_KERNEL_CUSTOM_REPOSITORY_VERSION))
+
+ifeq ($(findstring svn://,$(LINUX26_SITE)),svn://)
+LINUX26_SITE_METHOD:=svn
+LINUX26_DL_DIR:=linux-$(notdir $(LINUX26_SITE))
+else
+LINUX26_SITE_METHOD:=git
+LINUX26_DL_DIR:=linux-$(call qstrip, $(BR2_LINUX_KERNEL_CUSTOM_REPOSITORY_VERSION))
+LINUX26_BRANCH:=$(LINUX26_DL_VERSION)
+endif
+
+LINUX26_BASE_NAME:=$(LINUX26_DL_DIR)
+LINUX26_SOURCE:=$(LINUX26_DL_DIR).tar.gz
+else
+
 ifneq ($(BR2_LINUX_KERNEL_CUSTOM_TREE),y)
 LINUX26_TARBALL:=$(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION))
 LINUX26_SITE:=$(dir $(LINUX26_TARBALL))
-LINUX26_SOURCE:=$(notdir $(LINUX26_TARBALL))
+LINUX26_SOURCE:=linux-$(notdir $(LINUX26_TARBALL))
 endif
+
+endif
+
 else
 LINUX26_SOURCE:=linux-$(LINUX26_VERSION).tar.bz2
 LINUX26_SITE:=$(BR2_KERNEL_MIRROR)/linux/kernel/v2.6/
-- 
1.6.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] buildroot:linux: Add options to checkout Linux kernel source from SVN or GIT repository.
  2010-12-14  5:29 ` [Buildroot] [PATCH] buildroot:linux: Add options to checkout Linux kernel source from SVN or GIT repository Sonic Zhang
@ 2010-12-14  9:12   ` Sonic Zhang
  2010-12-14 19:33     ` Maxime Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Sonic Zhang @ 2010-12-14  9:12 UTC (permalink / raw)
  To: buildroot

Please ignore this patch. I will send out a new version.


Sonic Zhang

On Tue, Dec 14, 2010 at 1:29 PM, Sonic Zhang <sonic.adi@gmail.com> wrote:
> From: Sonic Zhang <sonic.zhang@analog.com>
>
> Current buildroot Config.in and linux.mk don't support kernel source in SVN
> or GIT repository. A pre-checkouted local SVN or GIT kernel tree set in
> KERNEL_CUSTOM_TREE is the only option. Because the local path can be anywhere,
> no buildroot default config file can be defined in sub folder
> target/device/company/boards to run quick building. It is inconvient to run
> regression testing. Since buildroot has already support SVN and GIT repository
> for application packages, it is reasonable to have it for linux kernel as well.
>
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
> ---
> ?linux/Config.in | ? 19 ++++++++++++++++++-
> ?linux/linux.mk ?| ? 24 +++++++++++++++++++++++-
> ?2 files changed, 41 insertions(+), 2 deletions(-)
>
> diff --git a/linux/Config.in b/linux/Config.in
> index 480adca..07b08e2 100644
> --- a/linux/Config.in
> +++ b/linux/Config.in
> @@ -52,6 +52,10 @@ config BR2_LINUX_KERNEL_CUSTOM_TREE
> ? ? ? ?help
> ? ? ? ? ?This option allows use of an already unpacked linux tree.
>
> +config BR2_LINUX_KERNEL_CUSTOM_REPOSITORY
> + ? ? ? bool "Custom source repository"
> + ? ? ? help
> + ? ? ? ? This option allows to specify the svn or git repository.
> ?endchoice
>
> ?config BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE
> @@ -67,12 +71,25 @@ config BR2_LINUX_KERNEL_CUSTOM_PATH
> ? ? ? ?string "PATH of custom kernel tree"
> ? ? ? ?depends on BR2_LINUX_KERNEL_CUSTOM_TREE
>
> +config BR2_LINUX_KERNEL_CUSTOM_REPOSITORY_LOCATION
> + ? ? ? string "URL of custom kernel repository"
> + ? ? ? depends on BR2_LINUX_KERNEL_CUSTOM_REPOSITORY
> + ? ? ? help
> + ? ? ? ? This is either the clone URL of GIT or trunk/tag/branch URL of SVN.
> +
> +config BR2_LINUX_KERNEL_CUSTOM_REPOSITORY_VERSION
> + ? ? ? string "revision(svn/git), tag(git) or branch(git) of custom kernel source"
> + ? ? ? depends on BR2_LINUX_KERNEL_CUSTOM_REPOSITORY
> + ? ? ? default "HEAD"
> + ? ? ? help
> + ? ? ? ? Tag or branch of GIT repository should be filled in here.
> +
> ?config BR2_LINUX_KERNEL_VERSION
> ? ? ? ?string
> ? ? ? ?default "2.6.36" if BR2_LINUX_KERNEL_2_6_36
> ? ? ? ?default BR2_DEFAULT_KERNEL_HEADERS if BR2_LINUX_KERNEL_SAME_AS_HEADERS
> ? ? ? ?default BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE if BR2_LINUX_KERNEL_CUSTOM_VERSION
> - ? ? ? default "custom" if BR2_LINUX_KERNEL_CUSTOM_TARBALL || BR2_LINUX_KERNEL_CUSTOM_TREE
> + ? ? ? default "custom" if BR2_LINUX_KERNEL_CUSTOM_TARBALL || BR2_LINUX_KERNEL_CUSTOM_TREE || BR2_LINUX_KERNEL_CUSTOM_REPOSITORY
>
> ?#
> ?# Patch selection
> diff --git a/linux/linux.mk b/linux/linux.mk
> index 4b680fd..55fddfa 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -7,11 +7,33 @@ LINUX26_VERSION=$(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
>
> ?# Compute LINUX26_SOURCE and LINUX26_SITE from the configuration
> ?ifeq ($(LINUX26_VERSION),custom)
> +
> +ifeq ($(BR2_LINUX_KERNEL_CUSTOM_REPOSITORY),y)
> +PKG:=LINUX26
> +LINUX26_SITE:=$(call qstrip, $(BR2_LINUX_KERNEL_CUSTOM_REPOSITORY_LOCATION))
> +LINUX26_DL_VERSION:=$(call qstrip, $(BR2_LINUX_KERNEL_CUSTOM_REPOSITORY_VERSION))
> +
> +ifeq ($(findstring svn://,$(LINUX26_SITE)),svn://)
> +LINUX26_SITE_METHOD:=svn
> +LINUX26_DL_DIR:=linux-$(notdir $(LINUX26_SITE))
> +else
> +LINUX26_SITE_METHOD:=git
> +LINUX26_DL_DIR:=linux-$(call qstrip, $(BR2_LINUX_KERNEL_CUSTOM_REPOSITORY_VERSION))
> +LINUX26_BRANCH:=$(LINUX26_DL_VERSION)
> +endif
> +
> +LINUX26_BASE_NAME:=$(LINUX26_DL_DIR)
> +LINUX26_SOURCE:=$(LINUX26_DL_DIR).tar.gz
> +else
> +
> ?ifneq ($(BR2_LINUX_KERNEL_CUSTOM_TREE),y)
> ?LINUX26_TARBALL:=$(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION))
> ?LINUX26_SITE:=$(dir $(LINUX26_TARBALL))
> -LINUX26_SOURCE:=$(notdir $(LINUX26_TARBALL))
> +LINUX26_SOURCE:=linux-$(notdir $(LINUX26_TARBALL))
> ?endif
> +
> +endif
> +
> ?else
> ?LINUX26_SOURCE:=linux-$(LINUX26_VERSION).tar.bz2
> ?LINUX26_SITE:=$(BR2_KERNEL_MIRROR)/linux/kernel/v2.6/
> --
> 1.6.0
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] buildroot:linux: Add options to checkout Linux kernel source from SVN or GIT repository.
  2010-12-14  9:12   ` Sonic Zhang
@ 2010-12-14 19:33     ` Maxime Petazzoni
  0 siblings, 0 replies; 5+ messages in thread
From: Maxime Petazzoni @ 2010-12-14 19:33 UTC (permalink / raw)
  To: buildroot

Hi,

* Sonic Zhang <sonic.adi@gmail.com> [2010-12-14 17:12:01]:

> Please ignore this patch. I will send out a new version.

Ok, I'm looking forward to it (and to the other one). The download
mechanism still has some shortcomings.

For keeping the version control information, this folds in the "doing
application development with Buildroot" process discussion, which we
should really get going to discuss this and come up with a reasonable
solution (Thomas? Peter? do you have any input on this?).

As for the Linux kernel, I am running into the same problem as well (not
only for the kernel, but for any non-package software like bootloaders),
so we need to find a common way of downloading sources from the web,
Svn, Git or whatever, being in the GENTARGETS infrastructure or not.
Here again, any input is most welcome so we can design the appropriate
solution (see my email on X-Loader support for a few more insights on
this).

- Maxime

> 
> 
> Sonic Zhang
> 
> On Tue, Dec 14, 2010 at 1:29 PM, Sonic Zhang <sonic.adi@gmail.com> wrote:
> > From: Sonic Zhang <sonic.zhang@analog.com>
> >
> > Current buildroot Config.in and linux.mk don't support kernel source in SVN
> > or GIT repository. A pre-checkouted local SVN or GIT kernel tree set in
> > KERNEL_CUSTOM_TREE is the only option. Because the local path can be anywhere,
> > no buildroot default config file can be defined in sub folder
> > target/device/company/boards to run quick building. It is inconvient to run
> > regression testing. Since buildroot has already support SVN and GIT repository
> > for application packages, it is reasonable to have it for linux kernel as well.
> >
> > Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
> > ---
> > ?linux/Config.in | ? 19 ++++++++++++++++++-
> > ?linux/linux.mk ?| ? 24 +++++++++++++++++++++++-
> > ?2 files changed, 41 insertions(+), 2 deletions(-)
> >
> > diff --git a/linux/Config.in b/linux/Config.in
> > index 480adca..07b08e2 100644
> > --- a/linux/Config.in
> > +++ b/linux/Config.in
> > @@ -52,6 +52,10 @@ config BR2_LINUX_KERNEL_CUSTOM_TREE
> > ? ? ? ?help
> > ? ? ? ? ?This option allows use of an already unpacked linux tree.
> >
> > +config BR2_LINUX_KERNEL_CUSTOM_REPOSITORY
> > + ? ? ? bool "Custom source repository"
> > + ? ? ? help
> > + ? ? ? ? This option allows to specify the svn or git repository.
> > ?endchoice
> >
> > ?config BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE
> > @@ -67,12 +71,25 @@ config BR2_LINUX_KERNEL_CUSTOM_PATH
> > ? ? ? ?string "PATH of custom kernel tree"
> > ? ? ? ?depends on BR2_LINUX_KERNEL_CUSTOM_TREE
> >
> > +config BR2_LINUX_KERNEL_CUSTOM_REPOSITORY_LOCATION
> > + ? ? ? string "URL of custom kernel repository"
> > + ? ? ? depends on BR2_LINUX_KERNEL_CUSTOM_REPOSITORY
> > + ? ? ? help
> > + ? ? ? ? This is either the clone URL of GIT or trunk/tag/branch URL of SVN.
> > +
> > +config BR2_LINUX_KERNEL_CUSTOM_REPOSITORY_VERSION
> > + ? ? ? string "revision(svn/git), tag(git) or branch(git) of custom kernel source"
> > + ? ? ? depends on BR2_LINUX_KERNEL_CUSTOM_REPOSITORY
> > + ? ? ? default "HEAD"
> > + ? ? ? help
> > + ? ? ? ? Tag or branch of GIT repository should be filled in here.
> > +
> > ?config BR2_LINUX_KERNEL_VERSION
> > ? ? ? ?string
> > ? ? ? ?default "2.6.36" if BR2_LINUX_KERNEL_2_6_36
> > ? ? ? ?default BR2_DEFAULT_KERNEL_HEADERS if BR2_LINUX_KERNEL_SAME_AS_HEADERS
> > ? ? ? ?default BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE if BR2_LINUX_KERNEL_CUSTOM_VERSION
> > - ? ? ? default "custom" if BR2_LINUX_KERNEL_CUSTOM_TARBALL || BR2_LINUX_KERNEL_CUSTOM_TREE
> > + ? ? ? default "custom" if BR2_LINUX_KERNEL_CUSTOM_TARBALL || BR2_LINUX_KERNEL_CUSTOM_TREE || BR2_LINUX_KERNEL_CUSTOM_REPOSITORY
> >
> > ?#
> > ?# Patch selection
> > diff --git a/linux/linux.mk b/linux/linux.mk
> > index 4b680fd..55fddfa 100644
> > --- a/linux/linux.mk
> > +++ b/linux/linux.mk
> > @@ -7,11 +7,33 @@ LINUX26_VERSION=$(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
> >
> > ?# Compute LINUX26_SOURCE and LINUX26_SITE from the configuration
> > ?ifeq ($(LINUX26_VERSION),custom)
> > +
> > +ifeq ($(BR2_LINUX_KERNEL_CUSTOM_REPOSITORY),y)
> > +PKG:=LINUX26
> > +LINUX26_SITE:=$(call qstrip, $(BR2_LINUX_KERNEL_CUSTOM_REPOSITORY_LOCATION))
> > +LINUX26_DL_VERSION:=$(call qstrip, $(BR2_LINUX_KERNEL_CUSTOM_REPOSITORY_VERSION))
> > +
> > +ifeq ($(findstring svn://,$(LINUX26_SITE)),svn://)
> > +LINUX26_SITE_METHOD:=svn
> > +LINUX26_DL_DIR:=linux-$(notdir $(LINUX26_SITE))
> > +else
> > +LINUX26_SITE_METHOD:=git
> > +LINUX26_DL_DIR:=linux-$(call qstrip, $(BR2_LINUX_KERNEL_CUSTOM_REPOSITORY_VERSION))
> > +LINUX26_BRANCH:=$(LINUX26_DL_VERSION)
> > +endif
> > +
> > +LINUX26_BASE_NAME:=$(LINUX26_DL_DIR)
> > +LINUX26_SOURCE:=$(LINUX26_DL_DIR).tar.gz
> > +else
> > +
> > ?ifneq ($(BR2_LINUX_KERNEL_CUSTOM_TREE),y)
> > ?LINUX26_TARBALL:=$(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION))
> > ?LINUX26_SITE:=$(dir $(LINUX26_TARBALL))
> > -LINUX26_SOURCE:=$(notdir $(LINUX26_TARBALL))
> > +LINUX26_SOURCE:=linux-$(notdir $(LINUX26_TARBALL))
> > ?endif
> > +
> > +endif
> > +
> > ?else
> > ?LINUX26_SOURCE:=linux-$(LINUX26_VERSION).tar.bz2
> > ?LINUX26_SITE:=$(BR2_KERNEL_MIRROR)/linux/kernel/v2.6/
> > --
> > 1.6.0
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
> >
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
> 

-- 
Maxime Petazzoni <http://www.bulix.org>
 ``One by one, the penguins took away my sanity.''
Writing software in California
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20101214/cebdf594/attachment.pgp>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] buildroot:download: Add option to download SVN or GIT repository with version control information.
@ 2010-12-16  9:46 Sonic Zhang
  2010-12-16  9:46 ` [Buildroot] [PATCH] buildroot:linux: Add options to checkout Linux kernel source from SVN or GIT repository Sonic Zhang
  0 siblings, 1 reply; 5+ messages in thread
From: Sonic Zhang @ 2010-12-16  9:46 UTC (permalink / raw)
  To: buildroot

Current DOWNLOAD_SVN and DOWNLOAD_GIT scripts only retrieve source code of a
given version from the repository. It is more complicated to generate patches
against the source after fixing bugs and developing in buildroot directly.
This patch adds an option BR2_CHECKOUT_SOURCE_FOR_DEVELOPMENT to checkout the
source with version control information. This option is disabled by default.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 Config.in                   |    7 +++++++
 package/Makefile.package.in |   20 ++++++++++++++++----
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/Config.in b/Config.in
index c90de77..7fa2aba 100644
--- a/Config.in
+++ b/Config.in
@@ -154,6 +154,13 @@ config BR2_DEBUG_MUDFLAP
 	  Your GCC must be new enough to support this option.
 endif
 
+config BR2_CHECKOUT_SOURCE_FOR_DEVELOPMENT
+	bool "check out source with git or svn revision information"
+	default n
+	help
+	  If y, check out the source from git or svn repository with
+	  revision information and store in the source tar ball.
+
 choice
 	prompt "strip"
 	default BR2_STRIP_strip
diff --git a/package/Makefile.package.in b/package/Makefile.package.in
index 9f876b9..78b2cda 100644
--- a/package/Makefile.package.in
+++ b/package/Makefile.package.in
@@ -100,15 +100,22 @@ endif
 # source repositories, producing a list of all the "external dependencies" of
 # a given build configuration.
 ################################################################################
-
 define DOWNLOAD_GIT
+	if [ "$(BR2_CHECKOUT_SOURCE_FOR_DEVELOPMENT)" = "y" ] ; then \
+		GITCMD="$(GIT) checkout -b $($(PKG)_BRANCH) $($(PKG)_DL_VERSION)" ; \
+		TARCMD="$(TAR) czf $($(PKG)_SOURCE) $($(PKG)_BASE_NAME)/" ; \
+	else \
+		GITCMD="$(GIT) archive --format=tar --prefix=$($(PKG)_BASE_NAME)/ $($(PKG)_DL_VERSION) | \
+			gzip -c > $(DL_DIR)/$($(PKG)_SOURCE)" ; \
+		TARCMD=test ; \
+	fi ; \
 	test -e $(DL_DIR)/$($(PKG)_SOURCE) || \
 	(pushd $(DL_DIR) > /dev/null && \
 	$(GIT) clone $($(PKG)_SITE) $($(PKG)_BASE_NAME) && \
 	pushd $($(PKG)_BASE_NAME) > /dev/null && \
-	$(GIT) archive --format=tar --prefix=$($(PKG)_BASE_NAME)/ $($(PKG)_DL_VERSION) | \
-		gzip -c > $(DL_DIR)/$($(PKG)_SOURCE) && \
+	eval $$GITCMD && \
 	popd > /dev/null && \
+	eval $$TARCMD && \
 	rm -rf $($(PKG)_DL_DIR) && \
 	popd > /dev/null)
 endef
@@ -125,9 +132,14 @@ endef
 
 
 define DOWNLOAD_SVN
+	if [ "$(BR2_CHECKOUT_SOURCE_FOR_DEVELOPMENT)" = "y" ] ; then \
+		SVNCMD=checkout ; \
+	else \
+		SVNCMD=export ; \
+	fi ; \
 	test -e $(DL_DIR)/$($(PKG)_SOURCE) || \
 	(pushd $(DL_DIR) > /dev/null && \
-	$(SVN) export -r $($(PKG)_DL_VERSION) $($(PKG)_SITE) $($(PKG)_DL_DIR) && \
+	$(SVN) $$SVNCMD -r $($(PKG)_DL_VERSION) $($(PKG)_SITE) $($(PKG)_DL_DIR) && \
 	$(TAR) czf $($(PKG)_SOURCE) $($(PKG)_BASE_NAME)/ && \
 	rm -rf $($(PKG)_DL_DIR) && \
 	popd > /dev/null)
-- 
1.6.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] buildroot:linux: Add options to checkout Linux kernel source from SVN or GIT repository.
  2010-12-16  9:46 [Buildroot] [PATCH] buildroot:download: Add option to download SVN or GIT repository with version control information Sonic Zhang
@ 2010-12-16  9:46 ` Sonic Zhang
  0 siblings, 0 replies; 5+ messages in thread
From: Sonic Zhang @ 2010-12-16  9:46 UTC (permalink / raw)
  To: buildroot

Current buildroot Config.in and linux.mk don't support kernel source in SVN
or GIT repository. A pre-checkouted local SVN or GIT kernel tree set in
KERNEL_CUSTOM_TREE is the only option. Because the local path can be anywhere,
no buildroot default config file can be defined in sub folder
target/device/company/boards to run quick building. It is inconvient to run
regression testing. Since buildroot has already support SVN and GIT repository
for application packages, it is reasonable to have it for linux kernel as well.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 linux/Config.in |   19 ++++++++++++++++++-
 linux/linux.mk  |   31 ++++++++++++++++++++++++++++++-
 2 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/linux/Config.in b/linux/Config.in
index 480adca..07b08e2 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -52,6 +52,10 @@ config BR2_LINUX_KERNEL_CUSTOM_TREE
 	help
 	  This option allows use of an already unpacked linux tree.
 
+config BR2_LINUX_KERNEL_CUSTOM_REPOSITORY
+	bool "Custom source repository"
+	help
+	  This option allows to specify the svn or git repository.
 endchoice
 
 config BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE
@@ -67,12 +71,25 @@ config BR2_LINUX_KERNEL_CUSTOM_PATH
 	string "PATH of custom kernel tree"
 	depends on BR2_LINUX_KERNEL_CUSTOM_TREE
 
+config BR2_LINUX_KERNEL_CUSTOM_REPOSITORY_LOCATION
+	string "URL of custom kernel repository"
+	depends on BR2_LINUX_KERNEL_CUSTOM_REPOSITORY
+	help
+	  This is either the clone URL of GIT or trunk/tag/branch URL of SVN. 
+
+config BR2_LINUX_KERNEL_CUSTOM_REPOSITORY_VERSION
+	string "revision(svn/git), tag(git) or branch(git) of custom kernel source"
+	depends on BR2_LINUX_KERNEL_CUSTOM_REPOSITORY
+	default "HEAD"
+	help
+	  Tag or branch of GIT repository should be filled in here.
+
 config BR2_LINUX_KERNEL_VERSION
 	string
 	default "2.6.36" if BR2_LINUX_KERNEL_2_6_36
 	default BR2_DEFAULT_KERNEL_HEADERS if BR2_LINUX_KERNEL_SAME_AS_HEADERS
 	default BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE if BR2_LINUX_KERNEL_CUSTOM_VERSION
-	default "custom" if BR2_LINUX_KERNEL_CUSTOM_TARBALL || BR2_LINUX_KERNEL_CUSTOM_TREE
+	default "custom" if BR2_LINUX_KERNEL_CUSTOM_TARBALL || BR2_LINUX_KERNEL_CUSTOM_TREE || BR2_LINUX_KERNEL_CUSTOM_REPOSITORY
 
 #
 # Patch selection
diff --git a/linux/linux.mk b/linux/linux.mk
index 4b680fd..a6306c9 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -7,11 +7,32 @@ LINUX26_VERSION=$(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
 
 # Compute LINUX26_SOURCE and LINUX26_SITE from the configuration
 ifeq ($(LINUX26_VERSION),custom)
+
+ifeq ($(BR2_LINUX_KERNEL_CUSTOM_REPOSITORY),y)
+LINUX26_SITE:=$(call qstrip, $(BR2_LINUX_KERNEL_CUSTOM_REPOSITORY_LOCATION))
+LINUX26_DL_VERSION:=$(call qstrip, $(BR2_LINUX_KERNEL_CUSTOM_REPOSITORY_VERSION))
+
+ifeq ($(findstring svn://,$(LINUX26_SITE)),svn://)
+LINUX26_SITE_METHOD:=svn
+LINUX26_DL_DIR:=linux-$(notdir $(LINUX26_SITE))
+else
+LINUX26_SITE_METHOD:=git
+LINUX26_DL_DIR:=linux-$(call qstrip, $(BR2_LINUX_KERNEL_CUSTOM_REPOSITORY_VERSION))
+LINUX26_BRANCH:=$(LINUX26_DL_VERSION)
+endif
+
+LINUX26_BASE_NAME:=$(LINUX26_DL_DIR)
+LINUX26_SOURCE:=$(LINUX26_DL_DIR).tar.gz
+else
+
 ifneq ($(BR2_LINUX_KERNEL_CUSTOM_TREE),y)
 LINUX26_TARBALL:=$(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION))
 LINUX26_SITE:=$(dir $(LINUX26_TARBALL))
-LINUX26_SOURCE:=$(notdir $(LINUX26_TARBALL))
+LINUX26_SOURCE:=linux-$(notdir $(LINUX26_TARBALL))
+endif
+
 endif
+
 else
 LINUX26_SOURCE:=linux-$(LINUX26_VERSION).tar.bz2
 LINUX26_SITE:=$(BR2_KERNEL_MIRROR)/linux/kernel/v2.6/
@@ -155,6 +176,14 @@ $(LINUX26_BUILD_DIR)/.stamp_installed: $(LINUX26_BUILD_DIR)/.stamp_compiled
 	fi
 	$(Q)touch $@
 
+
+$(LINUX26_BUILD_DIR)/.stamp_downloaded: PKG=LINUX26
+$(LINUX26_BUILD_DIR)/.stamp_extracted: PKG=LINUX26
+$(LINUX26_BUILD_DIR)/.stamp_patched: PKG=LINUX26
+$(LINUX26_BUILD_DIR)/.stamp_configured: PKG=LINUX26
+$(LINUX26_BUILD_DIR)/.stamp_compiled: PKG=LINUX26
+$(LINUX26_BUILD_DIR)/.stamp_installed: PKG=LINUX26
+
 linux26: host-module-init-tools $(LINUX26_DEPENDENCIES) $(LINUX26_BUILD_DIR)/.stamp_installed
 
 linux26-menuconfig linux26-xconfig linux26-gconfig: dirs $(LINUX26_BUILD_DIR)/.stamp_configured
-- 
1.6.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-12-16  9:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-16  9:46 [Buildroot] [PATCH] buildroot:download: Add option to download SVN or GIT repository with version control information Sonic Zhang
2010-12-16  9:46 ` [Buildroot] [PATCH] buildroot:linux: Add options to checkout Linux kernel source from SVN or GIT repository Sonic Zhang
  -- strict thread matches above, loose matches on Subject: below --
2010-12-14  5:29 [Buildroot] [PATCH] buildroot:download: Add option to download SVN or GIT repository with version control information Sonic Zhang
2010-12-14  5:29 ` [Buildroot] [PATCH] buildroot:linux: Add options to checkout Linux kernel source from SVN or GIT repository Sonic Zhang
2010-12-14  9:12   ` Sonic Zhang
2010-12-14 19:33     ` Maxime Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox