Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Paulius Zaleckas <paulius.zaleckas@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] strip path when untaring kernel for headers
Date: Sun, 05 Dec 2010 23:30:21 +0200	[thread overview]
Message-ID: <20101205213021.10524.40028.stgit@localhost.localdomain> (raw)

This is needed when custom/snapshot kernel headers are selected.
Buildroot expects to find dl/linux-2.6.tar.bz2 and also expects
it to extract to output/toolchain/linux-2.6, but if you tar
custom kernel sources directory can be anything, etc. linux-git.
In that case buildroot would extract it to output/toolchain/linux-git.
So fix this behaviour, by using tar strip-directory/component.

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
---

 .../kernel-headers/kernel-headers-new.makefile     |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/toolchain/kernel-headers/kernel-headers-new.makefile b/toolchain/kernel-headers/kernel-headers-new.makefile
index 2237a0a..5682869 100644
--- a/toolchain/kernel-headers/kernel-headers-new.makefile
+++ b/toolchain/kernel-headers/kernel-headers-new.makefile
@@ -28,8 +28,9 @@ LINUX_HEADERS_DEPENDS:=
 $(LINUX_HEADERS_UNPACK_DIR)/.unpacked: $(DL_DIR)/$(LINUX_HEADERS_SOURCE)
 	@echo "*** Using kernel-headers generated from kernel source"
 	rm -rf $(LINUX_HEADERS_DIR)
-	[ -d $(TOOLCHAIN_DIR) ] || $(INSTALL) -d $(TOOLCHAIN_DIR)
-	$(LINUX_HEADERS_CAT) $(DL_DIR)/$(LINUX_HEADERS_SOURCE) | tar -C $(TOOLCHAIN_DIR) $(TAR_OPTIONS) -
+	$(INSTALL) -d $(@D)
+	$(LINUX_HEADERS_CAT) $(DL_DIR)/$(LINUX_HEADERS_SOURCE) | \
+	tar $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) -
 	touch $@
 
 $(LINUX_HEADERS_UNPACK_DIR)/.patched: $(LINUX_HEADERS_UNPACK_DIR)/.unpacked $(LINUX_HEADERS_DEPENDS)

             reply	other threads:[~2010-12-05 21:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-05 21:30 Paulius Zaleckas [this message]
2010-12-13 16:19 ` [Buildroot] [PATCH] strip path when untaring kernel for headers Peter Korsgaard

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=20101205213021.10524.40028.stgit@localhost.localdomain \
    --to=paulius.zaleckas@gmail.com \
    --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