Some people are reposrting that ftp does not work on their network, probably due to proxies, while http does work.
Some (most) of the sites we use toretrieve tarballs have http equivallent for the ftp service. Use http as a failover.
There's no solution for those sites that do not have such an http equivalent.
/trunk/scripts/build/binutils.sh | 5 2 3 0 ++---
/trunk/scripts/build/libc_glibc.sh | 4 2 2 0 ++--
/trunk/scripts/build/libc_uClibc.sh | 2 1 1 0 +-
/trunk/scripts/build/debug/400-ltrace.sh | 2 1 1 0 +-
/trunk/scripts/build/debug/300-gdb.sh | 8 3 5 0 +++-----
/trunk/scripts/build/kernel_linux.sh | 7 2 5 0 ++-----
/trunk/scripts/build/cc_gcc.sh | 6 2 4 0 ++----
/trunk/scripts/build/gmp.sh | 4 1 3 0 +---
8 files changed, 14 insertions(+), 24 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
6 [ "${CT_KERNEL}" = "linux" ] || return 0
7 case "${CT_KERNEL_LINUX_HEADERS_SANITISED}" in
8 y) echo "linux-libc-headers-${CT_KERNEL_VERSION}";;
9 *) echo "linux-${CT_KERNEL_VERSION}";;
15 if [ "${CT_KERNEL_LINUX_HEADERS_USE_CUSTOM_DIR}" != "y" ]; then
16 CT_GetFile "${CT_KERNEL_FILE}" \
17 {ftp,http}://ftp.kernel.org/pub/linux/kernel/v2.{6{,/testing},4,2} \
18 http://ep09.pld-linux.org/~mmazur/linux-libc-headers
25 if [ "${CT_KERNEL_LINUX_HEADERS_USE_CUSTOM_DIR}" != "y" ]; then
26 CT_ExtractAndPatch "${CT_KERNEL_FILE}"
31 # Check kernel configuration
32 do_kernel_check_config() {
33 # Only the copied or sanitised headers need a config file.
34 # Pre-existing headers as well as headers_install don't.
35 if [ "${CT_KERNEL_LINUX_NEEDS_CONFIG}" = "y" \
36 -a \( -z "${CT_KERNEL_LINUX_CONFIG_FILE}" \
37 -o ! -r "${CT_KERNEL_LINUX_CONFIG_FILE}" \
40 CT_DoLog WARN "You did not provide a kernel configuration file!"
41 CT_DoLog WARN "I will try to generate one for you, but beware!"
43 CT_DoStep INFO "Building a default configuration file for linux kernel"
45 mkdir -p "${CT_BUILD_DIR}/build-kernel-defconfig"
46 cd "${CT_BUILD_DIR}/build-kernel-defconfig"
47 make -C "${CT_SRC_DIR}/${CT_KERNEL_FILE}" O=`pwd` \
48 ARCH=${CT_KERNEL_ARCH} defconfig 2>&1 |CT_DoLog ALL
50 CT_KERNEL_LINUX_CONFIG_FILE="`pwd`/.config"
56 # Wrapper to the actual headers install method
58 CT_DoStep INFO "Installing kernel headers"
60 # Special case when using pre-installed headers
61 if [ "${CT_KERNEL_LINUX_HEADERS_USE_CUSTOM_DIR}" = "y" ]; then
62 do_kernel_preinstalled
64 # We need to enter this directory to find the kernel version strings
65 cd "${CT_SRC_DIR}/${CT_KERNEL_FILE}"
66 if [ "${CT_KERNEL_LINUX_HEADERS_SANITISED}" != "y" ]; then
67 k_version=`awk '/^VERSION =/ { print $3 }' Makefile`
68 k_patchlevel=`awk '/^PATCHLEVEL =/ { print $3 }' Makefile`
69 k_sublevel=`awk '/^SUBLEVEL =/ { print $3 }' Makefile`
70 k_extraversion=`awk '/^EXTRAVERSION =/ { print $3 }' Makefile`
72 k_version=`echo "${CT_KERNEL_VERSION}." |cut -d . -f 1`
73 k_patchlevel=`echo "${CT_KERNEL_VERSION}." |cut -d . -f 2`
74 k_sublevel=`echo "${CT_KERNEL_VERSION}." |cut -d . -f 3`
75 k_extraversion=`echo "${CT_KERNEL_VERSION}." |cut -d . -f 4`
78 case "${k_version}.${k_patchlevel}" in
80 *) CT_Abort "Unsupported kernel version \"linux-${k_version}.${k_patchlevel}\".";;
83 # Kernel version that support verbosity will use this, others will ignore it:
84 V_OPT="V=${CT_KERNEL_LINUX_VERBOSE_LEVEL}"
86 if [ "${CT_KERNEL_LINUX_HEADERS_INSTALL}" = "y" ]; then
88 elif [ "${CT_KERNEL_LINUX_HEADERS_SANITISED}" = "y" ]; then
90 else [ "${CT_KERNEL_LINUX_HEADERS_COPY}" = "y" ];
98 # Install kernel headers using headers_install from kernel sources.
100 CT_DoLog DEBUG "Using kernel's headers_install"
102 mkdir -p "${CT_BUILD_DIR}/build-kernel-headers"
103 cd "${CT_BUILD_DIR}/build-kernel-headers"
105 case "${k_version}.${k_patchlevel}" in
106 2.6) [ ${k_sublevel} -ge 18 ] || CT_Abort "Kernel version >= 2.6.18 is needed to install kernel headers.";;
107 *) CT_Abort "Kernel version >= 2.6.18 is needed to install kernel headers.";;
110 CT_DoLog EXTRA "Installing kernel headers"
111 make -C "${CT_SRC_DIR}/${CT_KERNEL_FILE}" \
113 ARCH=${CT_KERNEL_ARCH} \
114 INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr" \
116 headers_install 2>&1 |CT_DoLog ALL
118 if [ "${CT_KERNEL_LINUX_HEADERS_INSTALL_CHECK}" = "y" ]; then
119 CT_DoLog EXTRA "Checking installed headers"
120 make -C "${CT_SRC_DIR}/${CT_KERNEL_FILE}" \
122 ARCH=${CT_KERNEL_ARCH} \
123 INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr" \
125 headers_check 2>&1 |CT_DoLog ALL
126 find "${CT_SYSROOT_DIR}" -type f -name '.check*' -exec rm {} \;
130 # Install kernel headers from oldish Mazur's sanitised headers.
131 do_kernel_sanitised() {
132 CT_DoLog EXTRA "Copying sanitised headers"
133 cd "${CT_SRC_DIR}/${CT_KERNEL_FILE}"
134 cp -rv include/linux "${CT_HEADERS_DIR}" 2>&1 |CT_DoLog ALL
135 cp -rv "include/asm-${CT_KERNEL_ARCH}" "${CT_HEADERS_DIR}/asm" 2>&1 |CT_DoLog ALL
138 # Install kernel headers by plain copy.
140 CT_DoLog DEBUG "Copying plain kernel headers"
141 CT_DoLog WARN "You are using plain kernel headers. You really shouldn't do that."
142 CT_DoLog WARN "You'd be better off by using installed headers (or sanitised headers)."
144 # 2.2 and 2.4 don't support building out-of-tree. 2.6 does.
145 CT_DoLog EXTRA "Preparing kernel headers"
146 case "${k_version}.${k_patchlevel}" in
147 2.2|2.4) cd "${CT_SRC_DIR}/${CT_KERNEL_FILE}"
148 cp "${CT_KERNEL_LINUX_CONFIG_FILE}" .config
149 CT_DoYes "" |make ARCH=${CT_KERNEL_ARCH} oldconfig
150 # 2.4 doesn't follow V=# for verbosity... :-(
151 make ARCH=${CT_KERNEL_ARCH} symlinks include/linux/version.h
153 2.6) mkdir -p "${CT_BUILD_DIR}/build-kernel-headers"
154 cd "${CT_BUILD_DIR}/build-kernel-headers"
155 cp "${CT_KERNEL_LINUX_CONFIG_FILE}" .config
156 CT_DoYes "" |make -C "${CT_SRC_DIR}/${CT_KERNEL_FILE}" \
157 O="`pwd`" ${V_OPT} ARCH=${CT_KERNEL_ARCH} \
159 case "${CT_KERNEL_ARCH}" in
160 sh*) # sh does secret stuff in 'make prepare' that can't be
161 # triggered separately, but happily, it doesn't use
162 # target gcc, so we can use it.
163 # Update: this fails on 2.6.11, as it installs
164 # elfconfig.h, which requires target compiler :-(
165 make ${PARALLELMFLAGS} \
166 ARCH=${CT_KERNEL_ARCH} ${V_OPT} \
167 prepare include/linux/version.h
169 arm*|cris*) make ${PARALLELMFLAGS} \
170 ARCH=${CT_KERNEL_ARCH} ${V_OPT} \
171 include/asm include/linux/version.h \
172 include/asm-${CT_KERNEL_ARCH}/.arch
174 mips*) # for linux-2.6, 'make prepare' for mips doesn't
175 # actually create any symlinks. Hope generic is ok.
176 # Note that glibc ignores all -I flags passed in CFLAGS,
177 # so you have to use -isystem.
178 make ${PARALLELMFLAGS} \
179 ARCH=${CT_KERNEL_ARCH} ${V_OPT} \
180 include/asm include/linux/version.h
181 TARGET_CFLAGS="${TARGET_CFLAGS} -isystem ${LINUX_HEADER_DIR}/include/asm-mips/mach-generic"
183 *) make ${PARALLELMFLAGS} \
184 ARCH=${CT_KERNEL_ARCH} ${V_OPT} \
185 include/asm include/linux/version.h
189 esac 2>&1 |CT_DoLog ALL
191 CT_DoLog EXTRA "Copying kernel headers"
192 cp -rv include/asm-generic "${CT_HEADERS_DIR}/asm-generic" 2>&1 |CT_DoLog ALL
193 cp -rv include/linux "${CT_HEADERS_DIR}" 2>&1 |CT_DoLog ALL
194 cp -rv include/asm-${CT_KERNEL_ARCH} "${CT_HEADERS_DIR}/asm" 2>&1 |CT_DoLog ALL
197 # Use preinstalled headers (most probably by using make headers_install in a
198 # modified (read: customised) kernel tree). In this case, simply copy
199 # the headers in place
200 do_kernel_preinstalled() {
201 CT_DoLog EXTRA "Copying preinstalled kernel headers"
203 mkdir -p "${CT_SYSROOT_DIR}/usr"
204 cd "${CT_KERNEL_LINUX_HEADERS_CUSTOM_DIR}"
205 cp -rv include "${CT_SYSROOT_DIR}/usr" 2>&1 |CT_DoLog ALL