From ea604716d9852e5b5fe0e158b822ea0878f3925f Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Tue, 3 Mar 2009 18:43:38 +0000 Subject: When using custom Linux kernel headers, allow using a tarball. /trunk/scripts/build/kernel/linux.sh | 19 16 3 0 ++++++++++++++++--- /trunk/config/kernel/linux.in | 35 26 9 0 ++++++++++++++++++++++++++--------- 2 files changed, 42 insertions(+), 12 deletions(-) diff --git a/config/kernel/linux.in b/config/kernel/linux.in index c5b8752..2dcb34b 100644 --- a/config/kernel/linux.in +++ b/config/kernel/linux.in @@ -286,20 +286,37 @@ endif config KERNEL_LINUX_USE_CUSTOM_DIR bool - prompt "Use custom directory" + prompt "Use custom headers" help If you have some kernel headers lying around, you can enter the path below. -config KERNEL_LINUX_CUSTOM_DIR - string - prompt "Where are those custom headers?" - depends on KERNEL_LINUX_USE_CUSTOM_DIR +if KERNEL_LINUX_USE_CUSTOM_DIR + +config KERNEL_LINUX_CUSTOM_IS_TARBALL + bool + prompt "This is a tarball" + default n help - Enter the base directory where the headers are to be found. + If you say 'n' here, the path below is expected to point to a directory + containing readily prepared headers + + If you say 'y' here, then the path below is expected to point to a + tarball of such a directory. + + Eg., if your headers are available in: /foo/bar/buz/my_hdrs/include, + say 'n' here, and enter: /foo/bar/buz/my_hdrs below. - Eg. if the headers are in /some/place/include, then enter /some/place. - This is the same path you entered when you typed: - make INSTALL_HDR_PATH=/some/place headers_install + Now, passing a tarball around is easier than passing a directory, so + if you want to, you can make a tarball of /foo/bar/buz/my_hdrs/include, + say 'y' here, and enter the path to this tarball below. + +config KERNEL_LINUX_CUSTOM_PATH + string + prompt "Path to custom headers directory/tarball" + help + See KERNEL_LINUX_CUSTOM_IS_TARBALL, above. + +endif # KERNEL_LINUX_USE_CUSTOM_DIR endchoice diff --git a/scripts/build/kernel/linux.sh b/scripts/build/kernel/linux.sh index c8dbead..6563260 100644 --- a/scripts/build/kernel/linux.sh +++ b/scripts/build/kernel/linux.sh @@ -78,9 +78,22 @@ do_kernel_install() { # modified (read: customised) kernel tree, or using pre-2.6.18 headers, such # as 2.4). In this case, simply copy the headers in place do_kernel_preinstalled() { - CT_DoLog EXTRA "Copying preinstalled kernel headers" + local tar_opt + + CT_DoLog EXTRA "Installing custom kernel headers" mkdir -p "${CT_SYSROOT_DIR}/usr" - cd "${CT_KERNEL_LINUX_CUSTOM_DIR}" - CT_DoExecLog ALL cp -rv include "${CT_SYSROOT_DIR}/usr" + cd "${CT_SYSROOT_DIR}/usr" + if [ "${CT_KERNEL_LINUX_CUSTOM_IS_TARBALL}" = "y" ]; then + case "${CT_KERNEL_LINUX_CUSTOM_PATH}" in + *.tar) ;; + *.tgz) tar_opt=--gzip;; + *.tar.gz) tar_opt=--gzip;; + *.tar.bz2) tar_opt=--bzip2;; + *.tar.lzma) tar_opt=--lzma;; + esac + CT_DoExecLog ALL tar x ${tar_opt} -vf ${CT_KERNEL_LINUX_CUSTOM_PATH} + else + CT_DoExecLog ALL cp -rv "${CT_KERNEL_LINUX_CUSTOM_PATH}/include" . + fi } -- cgit v0.10.2-6-g49f6