summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2011-09-22 20:49:38 (GMT)
committerSinseman44 <sinseman44@gmail.com>2011-09-22 20:49:38 (GMT)
commitbcb784e8261703b4a61b5fb8bea1b833c7abfc18 (patch)
tree4a02617481b56ad9ec5dc5d96ebac6839e2f9c73
parente8fc5b34079387acb831a5aeaa89549982a9e6f9 (diff)
kernel/linux: use a custom kernel source directory
Allows using either a tarball or a directory as the custom kernel source location. Signed-off-by: Vincent BENOIT <sinseman44@gmail.com> [yann.morin.1998@anciens.enib.fr: fix space damage, detailed commit message] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
-rw-r--r--config/kernel/linux.in11
-rw-r--r--scripts/build/kernel/linux.sh32
2 files changed, 26 insertions, 17 deletions
diff --git a/config/kernel/linux.in b/config/kernel/linux.in
index b8935d9..618e4c9 100644
--- a/config/kernel/linux.in
+++ b/config/kernel/linux.in
@@ -140,16 +140,17 @@ config KERNEL_V_2_6_27_59
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 or local kernel directory of a complete kernel source tree.
-config KERNEL_LINUX_CUSTOM_TARBALL
+config KERNEL_LINUX_CUSTOM_LOCATION
string
- prompt "Path to custom tarball"
+ prompt "Path to custom source, tarball or directory"
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
+ kernel directory
endchoice
diff --git a/scripts/build/kernel/linux.sh b/scripts/build/kernel/linux.sh
index c8c08c7..e6d9061 100644
--- a/scripts/build/kernel/linux.sh
+++ b/scripts/build/kernel/linux.sh
@@ -25,17 +25,23 @@ do_kernel_get() {
fi
if [ "${CT_KERNEL_LINUX_CUSTOM}" = "y" ]; then
- # Wee need to know the custom tarball extension,
- # so we can cerate a properly-named symlink, which
- # we use later on in 'extract'
- case "${CT_KERNEL_LINUX_CUSTOM_TARBALL}" in
- *.tar.bz2) custom_name="linux-custom.tar.bz2";;
- *.tar.gz|*.tgz) custom_name="linux-custom.tar.gz";;
- *.tar) custom_name="linux-custom.tar";;
- *) CT_Abort "Unknown extension for custom linux tarball '${CT_KERNEL_LINUX_CUSTOM_TARBALL}'";;
- esac
- CT_DoExecLog DEBUG ln -sf "${CT_KERNEL_LINUX_CUSTOM_TARBALL}" \
- "${CT_TARBALLS_DIR}/${custom_name}"
+ if [ ! -d "${CT_KERNEL_LINUX_CUSTOM_LOCATION}" ]; then
+ # Wee need to know the custom tarball extension,
+ # so we can create a properly-named symlink, which
+ # we use later on in 'extract'
+ case "${CT_KERNEL_LINUX_CUSTOM_LOCATION}" in
+ *.tar.bz2) custom_name="linux-custom.tar.bz2";;
+ *.tar.gz|*.tgz) custom_name="linux-custom.tar.gz";;
+ *.tar) custom_name="linux-custom.tar";;
+ *) CT_Abort "Unknown extension for custom linux tarball '${CT_KERNEL_LINUX_CUSTOM_LOCATION}'";;
+ esac
+ CT_DoExecLog DEBUG ln -sf "${CT_KERNEL_LINUX_CUSTOM_LOCATION}" \
+ "${CT_TARBALLS_DIR}/${custom_name}"
+ else
+ custom_name="linux-custom"
+ CT_DoExecLog DEBUG ln -s "${CT_KERNEL_LINUX_CUSTOM_LOCATION}" \
+ "${CT_SRC_DIR}/${custom_name}"
+ fi
else # Not a custom tarball
case "${CT_KERNEL_VERSION}" in
2.6.*.*|3.*.*)
@@ -64,9 +70,11 @@ do_kernel_get() {
# Extract kernel
do_kernel_extract() {
- if [ "${CT_KERNEL_LINUX_USE_CUSTOM_HEADERS}" = "y" ]; then
+ if [ "${CT_KERNEL_LINUX_USE_CUSTOM_HEADERS}" = "y" \
+ -o -d "${CT_KERNEL_LINUX_CUSTOM_LOCATION}" ]; then
return 0
fi
+
# This also handles the custom tarball
CT_Extract "linux-${CT_KERNEL_VERSION}"
CT_Patch "linux" "${CT_KERNEL_VERSION}"