Add an option to forbid downloads.
Idea and code-base from Don Elwell <don@manifoldlabs.com>, adapted by me.
/trunk/scripts/functions | 6 6 0 0 ++++++
/trunk/config/global/download.in | 18 18 0 0 ++++++++++++++++++
2 files changed, 24 insertions(+)
1 # This file declares functions to install the kernel headers for linux
2 # Copyright 2007 Yann E. MORIN
3 # Licensed under the GPL v2. See COPYING in the root of this package
5 CT_DoKernelTupleValues() {
6 # Nothing to do, keep the default value
12 if [ "${CT_KERNEL_LINUX_USE_CUSTOM_DIR}" != "y" ]; then
13 CT_GetFile "linux-${CT_KERNEL_VERSION}" \
14 {ftp,http}://ftp.{de.,eu.,}kernel.org/pub/linux/kernel/v2.{6{,/testing},4,2}
21 if [ "${CT_KERNEL_LINUX_USE_CUSTOM_DIR}" != "y" ]; then
22 CT_Extract "linux-${CT_KERNEL_VERSION}"
23 CT_Patch "linux-${CT_KERNEL_VERSION}"
28 # Wrapper to the actual headers install method
30 CT_DoStep INFO "Installing kernel headers"
32 if [ "${CT_KERNEL_LINUX_USE_CUSTOM_DIR}" = "y" ]; then
33 do_kernel_preinstalled
41 # Install kernel headers using headers_install from kernel sources.
43 CT_DoLog DEBUG "Using kernel's headers_install"
45 mkdir -p "${CT_BUILD_DIR}/build-kernel-headers"
46 cd "${CT_BUILD_DIR}/build-kernel-headers"
48 # Only starting with 2.6.18 does headers_install is usable. We only
49 # have 2.6 version available, so only test for sublevel.
50 k_sublevel=$(gawk '/^SUBLEVEL =/ { print $3 }' "${CT_SRC_DIR}/linux-${CT_KERNEL_VERSION}/Makefile")
51 [ ${k_sublevel} -ge 18 ] || CT_Abort "Kernel version >= 2.6.18 is needed to install kernel headers."
53 V_OPT="V=${CT_KERNEL_LINUX_VERBOSE_LEVEL}"
55 CT_DoLog EXTRA "Installing kernel headers"
57 make -C "${CT_SRC_DIR}/linux-${CT_KERNEL_VERSION}" \
59 ARCH=${CT_KERNEL_ARCH} \
60 INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr" \
64 if [ "${CT_KERNEL_LINUX_INSTALL_CHECK}" = "y" ]; then
65 CT_DoLog EXTRA "Checking installed headers"
67 make -C "${CT_SRC_DIR}/linux-${CT_KERNEL_VERSION}" \
69 ARCH=${CT_KERNEL_ARCH} \
70 INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr" \
73 find "${CT_SYSROOT_DIR}" -type f -name '.check*' -exec rm {} \;
77 # Use preinstalled headers (most probably by using make headers_install in a
78 # modified (read: customised) kernel tree, or using pre-2.6.18 headers, such
79 # as 2.4). In this case, simply copy the headers in place
80 do_kernel_preinstalled() {
81 CT_DoLog EXTRA "Copying preinstalled kernel headers"
83 mkdir -p "${CT_SYSROOT_DIR}/usr"
84 cd "${CT_KERNEL_LINUX_CUSTOM_DIR}"
85 CT_DoExecLog ALL cp -rv include "${CT_SYSROOT_DIR}/usr"