* [Buildroot] Minor updates to Makefile.package.in
@ 2011-05-10 6:17 Allan W. Nielsen
2011-05-10 6:17 ` [Buildroot] [PATCH 1/3] Makefile.package.in: Makes it possible to override the default extract commands Allan W. Nielsen
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Allan W. Nielsen @ 2011-05-10 6:17 UTC (permalink / raw)
To: buildroot
Hi
I have send these patches some weeks ago but they was not accepted at
that time. I have now cleaned up, and splitted some of the patches and
therefor I will now try again.
I there are any comments I wiull be happy to correct them
--
Allan W. Nielsen
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 1/3] Makefile.package.in: Makes it possible to override the default extract commands
2011-05-10 6:17 [Buildroot] Minor updates to Makefile.package.in Allan W. Nielsen
@ 2011-05-10 6:17 ` Allan W. Nielsen
2011-05-10 7:08 ` Daniel Nyström
2011-05-10 7:16 ` Thomas Petazzoni
2011-05-10 6:17 ` [Buildroot] [PATCH 2/3] Makefile.package.in: Added LZMA as compression type Allan W. Nielsen
2011-05-10 6:17 ` [Buildroot] [PATCH 3/3] Makefile.package.in: Fixing git download method Allan W. Nielsen
2 siblings, 2 replies; 11+ messages in thread
From: Allan W. Nielsen @ 2011-05-10 6:17 UTC (permalink / raw)
To: buildroot
When using GENTARGETS (or macroes depending on it), there is no way of
specifying a custom extraction procedure. When using the patch one can
simply define $(PACKAGE_NAME)_EXTRACT_CMDS which will override the
default. If non is defined it will fall back to the default extract
procedure.
An example could look like this:
--- PACKAGE BEGIN ---
FGLRX_VERSION=11-3
FGLRX_SOURCE:=ati-driver-installer-$(FGLRX_VERSION)-x86.x86_64.run
FGLRX_SITE:=http://www2.ati.com/drivers/linux/
define FGLRX_EXTRACT_CMDS
sh $(DL_DIR)/$(FGLRX_SOURCE) --extract $(@D)
endef
$(eval $(call GENTARGETS,package,fglrx))
--- PACKAGE END ---
Signed-off-by: Allan W. Nielsen <a@awn.dk>
---
package/Makefile.package.in | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/package/Makefile.package.in b/package/Makefile.package.in
index bf4e1b4..e5dafd1 100644
--- a/package/Makefile.package.in
+++ b/package/Makefile.package.in
@@ -239,9 +239,17 @@ ifeq ($(DL_MODE),DOWNLOAD)
$(Q)touch $@
endif
-# Unpack the archive
+# Unpack the archive using custom commands
+$(BUILD_DIR)/%/.stamp_custom_extracted:
+ @$(call MESSAGE,"Extracting - custom")
+ $(Q)mkdir -p $(@D)
+ $($(PKG)_EXTRACT_CMDS)
+ $(foreach hook,$($(PKG)_POST_EXTRACT_HOOKS),$(call $(hook))$(sep))
+ $(Q)touch $@
+
+# Unpack the archive using default commands
$(BUILD_DIR)/%/.stamp_extracted:
- @$(call MESSAGE,"Extracting")
+ @$(call MESSAGE,"Extracting - default")
$(Q)mkdir -p $(@D)
$(Q)$(if $($(PKG)_SOURCE),$(INFLATE$(suffix $($(PKG)_SOURCE))) $(DL_DIR)/$($(PKG)_SOURCE) | \
$(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) -)
@@ -419,7 +427,13 @@ $(2)_TARGET_INSTALL_HOST = $$($(2)_DIR)/.stamp_host_installed
$(2)_TARGET_BUILD = $$($(2)_DIR)/.stamp_built
$(2)_TARGET_CONFIGURE = $$($(2)_DIR)/.stamp_configured
$(2)_TARGET_PATCH = $$($(2)_DIR)/.stamp_patched
+
+ifdef $(2)_EXTRACT_CMDS
+$(2)_TARGET_EXTRACT = $$($(2)_DIR)/.stamp_custom_extracted
+else
$(2)_TARGET_EXTRACT = $$($(2)_DIR)/.stamp_extracted
+endif
+
$(2)_TARGET_SOURCE = $$($(2)_DIR)/.stamp_downloaded
$(2)_TARGET_UNINSTALL = $$($(2)_DIR)/.stamp_uninstalled
$(2)_TARGET_CLEAN = $$($(2)_DIR)/.stamp_cleaned
--
1.7.3.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 2/3] Makefile.package.in: Added LZMA as compression type
2011-05-10 6:17 [Buildroot] Minor updates to Makefile.package.in Allan W. Nielsen
2011-05-10 6:17 ` [Buildroot] [PATCH 1/3] Makefile.package.in: Makes it possible to override the default extract commands Allan W. Nielsen
@ 2011-05-10 6:17 ` Allan W. Nielsen
2011-05-10 6:52 ` Thomas Petazzoni
2011-07-12 21:15 ` Peter Korsgaard
2011-05-10 6:17 ` [Buildroot] [PATCH 3/3] Makefile.package.in: Fixing git download method Allan W. Nielsen
2 siblings, 2 replies; 11+ messages in thread
From: Allan W. Nielsen @ 2011-05-10 6:17 UTC (permalink / raw)
To: buildroot
Signed-off-by: Allan W. Nielsen <a@awn.dk>
---
Config.in | 7 +++++++
Makefile | 1 +
package/Makefile.package.in | 1 +
3 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/Config.in b/Config.in
index a67c08d..2fce9d7 100644
--- a/Config.in
+++ b/Config.in
@@ -52,6 +52,13 @@ config BR2_BZCAT
Default is "bzcat"
Other possible values include "bunzip2 -c" or "bzip2 -d -c".
+config BR2_XZCAT
+ string "xzcat command"
+ default "xzcat"
+ help
+ Command to be used to extract a xz'ed file to stdout.
+ Default is "xzcat"
+
config BR2_TAR_OPTIONS
string "Tar options"
default ""
diff --git a/Makefile b/Makefile
index 5f61b93..0ac9f12 100644
--- a/Makefile
+++ b/Makefile
@@ -271,6 +271,7 @@ KERNEL_ARCH:=$(shell echo "$(ARCH)" | sed -e "s/-.*//" \
ZCAT:=$(call qstrip,$(BR2_ZCAT))
BZCAT:=$(call qstrip,$(BR2_BZCAT))
+XZCAT:=$(call qstrip,$(BR2_XZCAT))
TAR_OPTIONS=$(call qstrip,$(BR2_TAR_OPTIONS)) -xf
GNU_TARGET_SUFFIX:=-$(call qstrip,$(BR2_GNU_TARGET_SUFFIX))
diff --git a/package/Makefile.package.in b/package/Makefile.package.in
index e5dafd1..1e87256 100644
--- a/package/Makefile.package.in
+++ b/package/Makefile.package.in
@@ -61,6 +61,7 @@ INFLATE.gz = $(ZCAT)
INFLATE.tbz = $(BZCAT)
INFLATE.tbz2 = $(BZCAT)
INFLATE.tgz = $(ZCAT)
+INFLATE.xz = $(XZCAT)
INFLATE.tar = cat
# MESSAGE Macro -- display a message in bold type
--
1.7.3.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 3/3] Makefile.package.in: Fixing git download method
2011-05-10 6:17 [Buildroot] Minor updates to Makefile.package.in Allan W. Nielsen
2011-05-10 6:17 ` [Buildroot] [PATCH 1/3] Makefile.package.in: Makes it possible to override the default extract commands Allan W. Nielsen
2011-05-10 6:17 ` [Buildroot] [PATCH 2/3] Makefile.package.in: Added LZMA as compression type Allan W. Nielsen
@ 2011-05-10 6:17 ` Allan W. Nielsen
2011-05-10 6:53 ` Thomas Petazzoni
2 siblings, 1 reply; 11+ messages in thread
From: Allan W. Nielsen @ 2011-05-10 6:17 UTC (permalink / raw)
To: buildroot
Signed-off-by: Allan W. Nielsen <a@awn.dk>
---
package/Makefile.package.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/package/Makefile.package.in b/package/Makefile.package.in
index 1e87256..6038a09 100644
--- a/package/Makefile.package.in
+++ b/package/Makefile.package.in
@@ -109,7 +109,7 @@ define DOWNLOAD_GIT
$(GIT) clone --bare $($(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) && \
+ gzip -c > ../$($(PKG)_SOURCE) && \
popd > /dev/null && \
rm -rf $($(PKG)_DL_DIR) && \
popd > /dev/null)
--
1.7.3.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 2/3] Makefile.package.in: Added LZMA as compression type
2011-05-10 6:17 ` [Buildroot] [PATCH 2/3] Makefile.package.in: Added LZMA as compression type Allan W. Nielsen
@ 2011-05-10 6:52 ` Thomas Petazzoni
2011-07-12 21:15 ` Peter Korsgaard
1 sibling, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2011-05-10 6:52 UTC (permalink / raw)
To: buildroot
On Tue, 10 May 2011 08:17:05 +0200
"Allan W. Nielsen" <a@awn.dk> wrote:
> Signed-off-by: Allan W. Nielsen <a@awn.dk>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
--
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] 11+ messages in thread
* [Buildroot] [PATCH 3/3] Makefile.package.in: Fixing git download method
2011-05-10 6:17 ` [Buildroot] [PATCH 3/3] Makefile.package.in: Fixing git download method Allan W. Nielsen
@ 2011-05-10 6:53 ` Thomas Petazzoni
[not found] ` <BANLkTinQcHkTmHoq9ci_QYgaj8vAqZ07yQ@mail.gmail.com>
0 siblings, 1 reply; 11+ messages in thread
From: Thomas Petazzoni @ 2011-05-10 6:53 UTC (permalink / raw)
To: buildroot
Hello,
On Tue, 10 May 2011 08:17:06 +0200
"Allan W. Nielsen" <a@awn.dk> wrote:
> Signed-off-by: Allan W. Nielsen <a@awn.dk>
> ---
> package/Makefile.package.in | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/package/Makefile.package.in b/package/Makefile.package.in
> index 1e87256..6038a09 100644
> --- a/package/Makefile.package.in
> +++ b/package/Makefile.package.in
> @@ -109,7 +109,7 @@ define DOWNLOAD_GIT
> $(GIT) clone --bare $($(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) && \
> + gzip -c > ../$($(PKG)_SOURCE) && \
Could you provide a few details on how it "fixes" the Git download
method ? Actually, the existing implementation seems to do the right
thing: it stores the tarball into the $(DL_DIR) directory, which is
what we want. What problem did you encounter, and how does the ../
thing fixes it ?
Thanks!
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] 11+ messages in thread
* [Buildroot] [PATCH 1/3] Makefile.package.in: Makes it possible to override the default extract commands
2011-05-10 6:17 ` [Buildroot] [PATCH 1/3] Makefile.package.in: Makes it possible to override the default extract commands Allan W. Nielsen
@ 2011-05-10 7:08 ` Daniel Nyström
2011-05-10 7:16 ` Thomas Petazzoni
1 sibling, 0 replies; 11+ messages in thread
From: Daniel Nyström @ 2011-05-10 7:08 UTC (permalink / raw)
To: buildroot
2011/5/10 Allan W. Nielsen <a@awn.dk>:
> +# Unpack the archive using custom commands
> +$(BUILD_DIR)/%/.stamp_custom_extracted:
> + ? ? ? @$(call MESSAGE,"Extracting - custom")
> + ? ? ? $(Q)mkdir -p $(@D)
> + ? ? ? $($(PKG)_EXTRACT_CMDS)
> + ? ? ? $(foreach hook,$($(PKG)_POST_EXTRACT_HOOKS),$(call $(hook))$(sep))
> + ? ? ? $(Q)touch $@
> +
> +# Unpack the archive using default commands
> ?$(BUILD_DIR)/%/.stamp_extracted:
> - ? ? ? @$(call MESSAGE,"Extracting")
> + ? ? ? @$(call MESSAGE,"Extracting - default")
> ? ? ? ?$(Q)mkdir -p $(@D)
> ? ? ? ?$(Q)$(if $($(PKG)_SOURCE),$(INFLATE$(suffix $($(PKG)_SOURCE))) $(DL_DIR)/$($(PKG)_SOURCE) | \
> ? ? ? ?$(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) -)
What's the point of having a specific stamp target for custom
extration? Why not just merge them both under .stamp_extracted?
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 1/3] Makefile.package.in: Makes it possible to override the default extract commands
2011-05-10 6:17 ` [Buildroot] [PATCH 1/3] Makefile.package.in: Makes it possible to override the default extract commands Allan W. Nielsen
2011-05-10 7:08 ` Daniel Nyström
@ 2011-05-10 7:16 ` Thomas Petazzoni
[not found] ` <BANLkTi=HirqhyL4uuuBWnUoKu36xGE+V2g@mail.gmail.com>
1 sibling, 1 reply; 11+ messages in thread
From: Thomas Petazzoni @ 2011-05-10 7:16 UTC (permalink / raw)
To: buildroot
Hello Allan,
On Tue, 10 May 2011 08:17:04 +0200
"Allan W. Nielsen" <a@awn.dk> wrote:
> When using GENTARGETS (or macroes depending on it), there is no way of
> specifying a custom extraction procedure. When using the patch one can
> simply define $(PACKAGE_NAME)_EXTRACT_CMDS which will override the
> default. If non is defined it will fall back to the default extract
> procedure.
I like the feature added by this patch (it is needed for strange
packages), but I'm not sure about the implementation.
> -# Unpack the archive
> +# Unpack the archive using custom commands
> +$(BUILD_DIR)/%/.stamp_custom_extracted:
> + @$(call MESSAGE,"Extracting - custom")
> + $(Q)mkdir -p $(@D)
> + $($(PKG)_EXTRACT_CMDS)
> + $(foreach hook,$($(PKG)_POST_EXTRACT_HOOKS),$(call $(hook))$(sep))
> + $(Q)touch $@
> +
> +# Unpack the archive using default commands
> $(BUILD_DIR)/%/.stamp_extracted:
> - @$(call MESSAGE,"Extracting")
> + @$(call MESSAGE,"Extracting - default")
> $(Q)mkdir -p $(@D)
> $(Q)$(if $($(PKG)_SOURCE),$(INFLATE$(suffix $($(PKG)_SOURCE))) $(DL_DIR)/$($(PKG)_SOURCE) | \
> $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) -)
Instead of having two different stamp files, isn't possible to define
the extract step as follows :
> +$(BUILD_DIR)/%/.stamp_extracted:
> + @$(call MESSAGE,"Extracting")
> + $(Q)mkdir -p $(@D)
> + $($(PKG)_EXTRACT_CMDS)
> + $(foreach hook,$($(PKG)_POST_EXTRACT_HOOKS),$(call $(hook))$(sep))
> + $(Q)touch $@
And then have the $(PKG)_EXTRACT_CMDS variable be define to the default
value, unless it has already been defined ?
Note that I haven't looked closely whether it was possible or not. But
if it is, then I would prefer such an implementation.
Thanks for doing this work!
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] 11+ messages in thread
* [Buildroot] [PATCH 3/3] Makefile.package.in: Fixing git download method
[not found] ` <BANLkTinQcHkTmHoq9ci_QYgaj8vAqZ07yQ@mail.gmail.com>
@ 2011-05-10 7:36 ` Thomas Petazzoni
0 siblings, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2011-05-10 7:36 UTC (permalink / raw)
To: buildroot
On Tue, 10 May 2011 09:22:22 +0200
Allan Nielsen <a@awn.dk> wrote:
> When I run buildroot $(DL_DIR) is a relative path which says ./src and
> the current directory (at this point) is $(DL_DIR)/my-git-package/,
> and it will try to place the tar file in
> $(DL_DIR)/my-git-package/src/my-git-package.tar.gz which is the wrong
> place.
>
> The suggested change should work both when $(DL_DIR) is relative and absolute.
Ah, yes, got it.
> Alternative I could of cause just change my $(DL_DIR) variable to an
> absolute path.
Or, better, make sure that DL_DIR is an absolute path even if it was
defined as a relative path in the configuration. Something like
(untested):
DL_DIR=$(call qstrip,$(BR2_DL_DIR))
ifeq ($(DL_DIR),)
DL_DIR:=$(TOPDIR)/dl
endif
+ DL_DIR=$(shell readlink -f $(DL_DIR))
in package/Makefile.package.in
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] 11+ messages in thread
* [Buildroot] [PATCH 1/3] Makefile.package.in: Makes it possible to override the default extract commands
[not found] ` <BANLkTi=HirqhyL4uuuBWnUoKu36xGE+V2g@mail.gmail.com>
@ 2011-05-10 9:03 ` Thomas Petazzoni
0 siblings, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2011-05-10 9:03 UTC (permalink / raw)
To: buildroot
On Tue, 10 May 2011 10:59:26 +0200
Allan Nielsen <a@awn.dk> wrote:
> I have just tried it, and it seems to work fine.
>
> I agree with you that this is a much better solution, and I will post
> a patch based on the right away
Great, thanks!
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] 11+ messages in thread
* [Buildroot] [PATCH 2/3] Makefile.package.in: Added LZMA as compression type
2011-05-10 6:17 ` [Buildroot] [PATCH 2/3] Makefile.package.in: Added LZMA as compression type Allan W. Nielsen
2011-05-10 6:52 ` Thomas Petazzoni
@ 2011-07-12 21:15 ` Peter Korsgaard
1 sibling, 0 replies; 11+ messages in thread
From: Peter Korsgaard @ 2011-07-12 21:15 UTC (permalink / raw)
To: buildroot
>>>>> "Allan" == Allan W Nielsen <a@awn.dk> writes:
Allan> Signed-off-by: Allan W. Nielsen <a@awn.dk>
Committed, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2011-07-12 21:15 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-10 6:17 [Buildroot] Minor updates to Makefile.package.in Allan W. Nielsen
2011-05-10 6:17 ` [Buildroot] [PATCH 1/3] Makefile.package.in: Makes it possible to override the default extract commands Allan W. Nielsen
2011-05-10 7:08 ` Daniel Nyström
2011-05-10 7:16 ` Thomas Petazzoni
[not found] ` <BANLkTi=HirqhyL4uuuBWnUoKu36xGE+V2g@mail.gmail.com>
2011-05-10 9:03 ` Thomas Petazzoni
2011-05-10 6:17 ` [Buildroot] [PATCH 2/3] Makefile.package.in: Added LZMA as compression type Allan W. Nielsen
2011-05-10 6:52 ` Thomas Petazzoni
2011-07-12 21:15 ` Peter Korsgaard
2011-05-10 6:17 ` [Buildroot] [PATCH 3/3] Makefile.package.in: Fixing git download method Allan W. Nielsen
2011-05-10 6:53 ` Thomas Petazzoni
[not found] ` <BANLkTinQcHkTmHoq9ci_QYgaj8vAqZ07yQ@mail.gmail.com>
2011-05-10 7:36 ` Thomas Petazzoni
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.