Skip to contentSkip to conversation

strip path when untaring kernel for headers

PATCH New Paulius Zaleckas 2 participants 2 messages Dec 5, 2010 – Dec 13, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 strip path when untaring kernel for headers

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.

---

 .../kernel-headers/kernel-headers-new.makefile     |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
toolchain/kernel-headers/kernel-headers-new.makefile +3 -2
index 2237a0a..5682869 100644
@@ -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)
#1 lore raw

PATCH 1/1 strip path when untaring kernel for headers

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Paulius" == Paulius Zaleckas <[email protected]> writes:

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

Paulius> Signed-off-by: Paulius Zaleckas <[email protected]>

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard