# HG changeset patch # User "Yann E. MORIN" # Date 1236105818 0 # Node ID 814d458b1878445485327e80708db4d7c0bab8b1 # Parent 63d8500c8fc1423c99ea5364044577562d4bfc86 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 -r 63d8500c8fc1 -r 814d458b1878 config/kernel/linux.in --- a/config/kernel/linux.in Tue Mar 03 17:50:53 2009 +0000 +++ b/config/kernel/linux.in Tue Mar 03 18:43:38 2009 +0000 @@ -286,20 +286,37 @@ 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 +if KERNEL_LINUX_USE_CUSTOM_DIR + +config KERNEL_LINUX_CUSTOM_IS_TARBALL + bool + prompt "This is a tarball" + default n + help + 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. + + 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 "Where are those custom headers?" - depends on KERNEL_LINUX_USE_CUSTOM_DIR + prompt "Path to custom headers directory/tarball" help - Enter the base directory where the headers are to be found. - - 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 + See KERNEL_LINUX_CUSTOM_IS_TARBALL, above. + +endif # KERNEL_LINUX_USE_CUSTOM_DIR endchoice diff -r 63d8500c8fc1 -r 814d458b1878 scripts/build/kernel/linux.sh --- a/scripts/build/kernel/linux.sh Tue Mar 03 17:50:53 2009 +0000 +++ b/scripts/build/kernel/linux.sh Tue Mar 03 18:43:38 2009 +0000 @@ -78,9 +78,22 @@ # 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 }