From: sinseman44 <sinseman44@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] correction : use same kernel in buildroot and in crosstool-ng
Date: Thu, 22 Sep 2011 15:33:28 +0200 [thread overview]
Message-ID: <1316698408-30902-1-git-send-email-sinseman44@gmail.com> (raw)
---
Makefile | 4 +-
...-ng-001-makefile-buildroot-kernel-version.patch | 41 ++++++++++++++++++++
...ol-ng-002-config-buildroot-kernel-version.patch | 24 +++++++++++
package/crosstool-ng/crosstool-ng.mk | 6 ++-
toolchain/toolchain-crosstool-ng/Config.in | 6 +++
toolchain/toolchain-crosstool-ng/crosstool-ng.mk | 5 ++
6 files changed, 84 insertions(+), 2 deletions(-)
create mode 100644 package/crosstool-ng/crosstool-ng-001-makefile-buildroot-kernel-version.patch
create mode 100644 package/crosstool-ng/crosstool-ng-002-config-buildroot-kernel-version.patch
diff --git a/Makefile b/Makefile
index a20d3e2..59eb941 100644
--- a/Makefile
+++ b/Makefile
@@ -301,6 +301,8 @@ all: world
# We also need the various per-package makefiles, which also add
# each selected package to TARGETS if that package was selected
# in the .config file.
+include linux/linux.mk
+
ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
include toolchain/toolchain-buildroot.mk
else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
@@ -313,7 +315,7 @@ include package/*/*.mk
include boot/common.mk
include target/Makefile.in
-include linux/linux.mk
+
TARGETS+=target-finalize
diff --git a/package/crosstool-ng/crosstool-ng-001-makefile-buildroot-kernel-version.patch b/package/crosstool-ng/crosstool-ng-001-makefile-buildroot-kernel-version.patch
new file mode 100644
index 0000000..2a2c8ac
--- /dev/null
+++ b/package/crosstool-ng/crosstool-ng-001-makefile-buildroot-kernel-version.patch
@@ -0,0 +1,41 @@
+--- crosstool-ng-1.12.1/scripts/build/kernel/linux.sh 2011-09-21 10:50:31.403186872 +0200
++++ host-crosstool-ng-1.12.1/scripts/build/kernel/linux.sh 2011-09-21 10:50:56.932014313 +0200
+@@ -61,21 +61,24 @@
+ return 0
+ fi
+
+- CT_TestAndAbort "Custom kernel tree partially extracted. Remove before resuming" -f "${CT_SRC_DIR}/.linux-custom.extracting"
+- CT_DoExecLog DEBUG touch "${CT_SRC_DIR}/.linux-custom.extracting"
+- CT_DoExecLog DEBUG mkdir "${CT_SRC_DIR}/linux-custom"
+-
+- case "${CT_KERNEL_LINUX_CUSTOM_TARBALL}" in
+- *.tar.bz2) tar_opt=-j;;
+- *.tar.gz|*.tgz) tar_opt=-z;;
+- *.tar) ;;
+- *) CT_Abort "Don't know how to handle '${CT_KERNEL_LINUX_CUSTOM_TARBALL}': unknown extension";;
+- esac
+- CT_DoLog EXTRA "Extracting custom linux kernel"
+- CT_DoExecLog ALL tar x -C "${CT_SRC_DIR}/linux-custom" \
+- --strip-components 1 -v ${tar_opt} \
+- -f "${CT_KERNEL_LINUX_CUSTOM_TARBALL}"
++ CT_TestAndAbort "Custom kernel tree partially extracted. Remove before resuming" -f "${CT_SRC_DIR}/.linux-custom.extracting"
++ CT_DoExecLog DEBUG touch "${CT_SRC_DIR}/.linux-custom.extracting"
+
++ if [ ! -d "${CT_KERNEL_LINUX_CUSTOM_TARBALL}" ]; then
++ CT_DoExecLog DEBUG mkdir "${CT_SRC_DIR}/linux-custom"
++ case "${CT_KERNEL_LINUX_CUSTOM_TARBALL}" in
++ *.tar.bz2) tar_opt=-j;;
++ *.tar.gz|*.tgz) tar_opt=-z;;
++ *.tar) ;;
++ *) CT_Abort "Don't know how to handle '${CT_KERNEL_LINUX_CUSTOM_TARBALL}': unknown extension";;
++ esac
++ CT_DoLog EXTRA "Extracting custom linux kernel"
++ CT_DoExecLog ALL tar x -C "${CT_SRC_DIR}/linux-custom" \
++ --strip-components 1 -v ${tar_opt} \
++ -f "${CT_KERNEL_LINUX_CUSTOM_TARBALL}"
++ else
++ CT_DoExecLog ALL ln -s "${CT_KERNEL_LINUX_CUSTOM_TARBALL}" "${CT_SRC_DIR}/linux-custom"
++ fi
+ CT_DoExecLog ALL mv -v "${CT_SRC_DIR}/.linux-custom.extracting" "${CT_SRC_DIR}/.linux-custom.extracted"
+ else
+ CT_Extract "linux-${CT_KERNEL_VERSION}"
diff --git a/package/crosstool-ng/crosstool-ng-002-config-buildroot-kernel-version.patch b/package/crosstool-ng/crosstool-ng-002-config-buildroot-kernel-version.patch
new file mode 100644
index 0000000..0d98ced
--- /dev/null
+++ b/package/crosstool-ng/crosstool-ng-002-config-buildroot-kernel-version.patch
@@ -0,0 +1,24 @@
+--- crosstool-ng-1.12.1/config/kernel/linux.in 2011-09-21 11:00:49.759188996 +0200
++++ host-crosstool-ng-1.12.1/config/kernel/linux.in 2011-09-21 11:02:45.390254678 +0200
+@@ -144,16 +144,18 @@
+
+ config KERNEL_LINUX_CUSTOM
+ bool
+- prompt "custom tarball"
++ prompt "custom tarball or directory"
+ help
+- Use a local tarball of a complete kernel source tree.
++ Use a local tarball of a complete kernel source tree or
++ a local kernel tree (not pre-installed)
+
+ config KERNEL_LINUX_CUSTOM_TARBALL
+ string
+ prompt "Path to custom tarball"
+ depends on KERNEL_LINUX_CUSTOM
+ help
+- Enter here the path to the tarball of your full kernel tree.
++ Enter here the path to the tarball of your full kernel tree or
++ the path or the local kernel tree
+
+ endchoice
+
diff --git a/package/crosstool-ng/crosstool-ng.mk b/package/crosstool-ng/crosstool-ng.mk
index 076be28..848ead7 100644
--- a/package/crosstool-ng/crosstool-ng.mk
+++ b/package/crosstool-ng/crosstool-ng.mk
@@ -4,6 +4,10 @@ CROSSTOOL_NG_SITE = http://crosstool-ng.org/download/crosstool-ng/
CROSSTOOL_NG_INSTALL_STAGING = NO
CROSSTOOL_NG_INSTALL_TARGET = NO
CROSSTOOL_NG_MAKE = $(MAKE1)
-HOST_CROSSTOOL_NG_DEPENDENCIES = host-gawk host-automake $(if $(BR2_CCACHE),host-ccache)
+HOST_CROSSTOOL_NG_DEPENDENCIES = host-gawk host-automake $(if $(BR2_CCACHE),host-ccache)
+
+ifeq ($(BR2_TOOLCHAIN_CTNG_BUILDROOT_KERNEL), y)
+HOST_CROSSTOOL_NG_DEPENDENCIES += linux-configure
+endif
$(eval $(call AUTOTARGETS,package,crosstool-ng,host))
diff --git a/toolchain/toolchain-crosstool-ng/Config.in b/toolchain/toolchain-crosstool-ng/Config.in
index 2d1e801..5e3fb88 100644
--- a/toolchain/toolchain-crosstool-ng/Config.in
+++ b/toolchain/toolchain-crosstool-ng/Config.in
@@ -46,6 +46,12 @@ config BR2_TOOLCHAIN_CTNG_CONFIG
If unsure, keep the default value.
+config BR2_TOOLCHAIN_CTNG_BUILDROOT_KERNEL
+ bool "Buildroot kernel version"
+ depends on BR2_LINUX_KERNEL
+ help
+ Use buildroot kernel version in crosstool-Ng
+
if BR2_TOOLCHAIN_CTNG_uClibc
comment "Toolchain Options"
diff --git a/toolchain/toolchain-crosstool-ng/crosstool-ng.mk b/toolchain/toolchain-crosstool-ng/crosstool-ng.mk
index 3a205dd..f71c2ae 100644
--- a/toolchain/toolchain-crosstool-ng/crosstool-ng.mk
+++ b/toolchain/toolchain-crosstool-ng/crosstool-ng.mk
@@ -218,6 +218,11 @@ else
CTNG_FIX_DOT_CONFIG_SED += s:^(CT_CC_LANG_CXX)=.*:\# \1 is not set:;
endif
+ifeq ($(BR2_TOOLCHAIN_CTNG_BUILDROOT_KERNEL),y)
+CTNG_FIX_DOT_CONFIG_SED += s:^\# (CT_KERNEL_LINUX_CUSTOM) is not set:\1=y:;
+CTNG_FIX_DOT_CONFIG_SED += s:^(CT_KERNEL_LINUX_CUSTOM_TARBALL)=.*:\1="$(LINUX_DIR)":;
+endif
+
# Shoe-horn CPU variant now
ifneq ($(call qstrip,$(BR2_GCC_TARGET_ARCH)),)
CTNG_FIX_DOT_CONFIG_SED += s:^(CT_ARCH_ARCH)=.*:\1=$(BR2_GCC_TARGET_ARCH):;
--
1.7.0.4
next reply other threads:[~2011-09-22 13:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-22 13:33 sinseman44 [this message]
2011-09-22 13:40 ` [Buildroot] [PATCH] correction : use same kernel in buildroot and in crosstool-ng Vincent BENOIT
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=1316698408-30902-1-git-send-email-sinseman44@gmail.com \
--to=sinseman44@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 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.