scripts/build/kernel/linux.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Oct 09 19:17:49 2008 +0000 (2008-10-09)
changeset 914 0b164a321177
parent 847 af75fc1fe0fc
child 965 45ddf096def1
permissions -rw-r--r--
Remove CT_BROKEN.
Only one component is actually BROKEN (libelf), make it depend on EXPERIMENTAL, but state BROKEN in the prompt.
ltrace (which depends on libelf) is now marked as EXPERIMENTAL, with the reference to the BROKEN libelf in the help entry.

/trunk/docs/overview.txt | 6 0 6 0 ------
/trunk/config/debug/ltrace.in | 7 4 3 0 ++++---
/trunk/config/global/ct-behave.in | 8 0 8 0 --------
/trunk/config/tools/libelf.in | 5 3 2 0 +++--
4 files changed, 7 insertions(+), 19 deletions(-)
     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
     4 
     5 do_print_filename() {
     6     echo "linux-${CT_KERNEL_VERSION}"
     7 }
     8 
     9 # Download the kernel
    10 do_kernel_get() {
    11     if [ "${CT_KERNEL_LINUX_USE_CUSTOM_DIR}" != "y" ]; then
    12         CT_GetFile "${CT_KERNEL_FILE}" {ftp,http}://ftp.kernel.org/pub/linux/kernel/v2.{6{,/testing},4,2}
    13     fi
    14     return 0
    15 }
    16 
    17 # Extract kernel
    18 do_kernel_extract() {
    19     if [ "${CT_KERNEL_LINUX_USE_CUSTOM_DIR}" != "y" ]; then
    20         CT_ExtractAndPatch "${CT_KERNEL_FILE}"
    21     fi
    22     return 0
    23 }
    24 
    25 # Wrapper to the actual headers install method
    26 do_kernel_headers() {
    27     CT_DoStep INFO "Installing kernel headers"
    28 
    29     if [ "${CT_KERNEL_LINUX_USE_CUSTOM_DIR}" = "y" ]; then
    30         do_kernel_preinstalled
    31     else
    32         do_kernel_install
    33     fi
    34 
    35     CT_EndStep
    36 }
    37 
    38 # Install kernel headers using headers_install from kernel sources.
    39 do_kernel_install() {
    40     CT_DoLog DEBUG "Using kernel's headers_install"
    41 
    42     mkdir -p "${CT_BUILD_DIR}/build-kernel-headers"
    43     cd "${CT_BUILD_DIR}/build-kernel-headers"
    44 
    45     # Only starting with 2.6.18 does headers_install is usable. We only
    46     # have 2.6 version available, so only test for sublevel.
    47     k_sublevel=$(awk '/^SUBLEVEL =/ { print $3 }' "${CT_SRC_DIR}/${CT_KERNEL_FILE}/Makefile")
    48     [ ${k_sublevel} -ge 18 ] || CT_Abort "Kernel version >= 2.6.18 is needed to install kernel headers."
    49 
    50     V_OPT="V=${CT_KERNEL_LINUX_VERBOSE_LEVEL}"
    51 
    52     CT_DoLog EXTRA "Installing kernel headers"
    53     CT_DoExecLog ALL                                \
    54     make -C "${CT_SRC_DIR}/${CT_KERNEL_FILE}"       \
    55          O=$(pwd)                                   \
    56          ARCH=${CT_KERNEL_ARCH}                     \
    57          INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr"   \
    58          ${V_OPT}                                   \
    59          headers_install
    60 
    61     if [ "${CT_KERNEL_LINUX_INSTALL_CHECK}" = "y" ]; then
    62         CT_DoLog EXTRA "Checking installed headers"
    63         CT_DoExecLog ALL                                \
    64         make -C "${CT_SRC_DIR}/${CT_KERNEL_FILE}"       \
    65              O=$(pwd)                                   \
    66              ARCH=${CT_KERNEL_ARCH}                     \
    67              INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr"   \
    68              ${V_OPT}                                   \
    69              headers_check
    70         find "${CT_SYSROOT_DIR}" -type f -name '.check*' -exec rm {} \;
    71     fi
    72 }
    73 
    74 # Use preinstalled headers (most probably by using make headers_install in a
    75 # modified (read: customised) kernel tree, or using pre-2.6.18 headers, such
    76 # as 2.4). In this case, simply copy the headers in place
    77 do_kernel_preinstalled() {
    78     CT_DoLog EXTRA "Copying preinstalled kernel headers"
    79 
    80     mkdir -p "${CT_SYSROOT_DIR}/usr"
    81     cd "${CT_KERNEL_LINUX_CUSTOM_DIR}"
    82     CT_DoExecLog ALL cp -rv include "${CT_SYSROOT_DIR}/usr"
    83 }