-#!/bin/sh
+#!/bin/bash
# This file is 'sourced' by other scripts, therefore the above line is of no
# use, except when modifying the file in emacs to have syntax highlighting.
fi
case "${HVL_TARGET}" in
+ arm*)
+ CLFS_BUILDFLAGS="-mabi=apcs-gnu"
+ CLFS_TARGET="${HVL_TARGET}-unknown-linux-gnueabi"
+ CLFS_ARCH=$(echo ${CLFS_TARGET} | sed -e 's/-.*//' -e 's/arm.*/arm/g')
+ CLFS_ENDIAN=$(echo ${CLFS_ARCH} | sed -e 's/armeb/BIG/' -e 's/arm/LITTLE/')
+ if [ "${CLFS_ENDIAN}" = "LITTLE" ]; then
+ CLFS_NOT_ENDIAN="BIG"
+ else
+ CLFS_NOT_ENDIAN="LITTLE"
+ fi
+ ;;
"x86_64")
CLFS_BUILDFLAGS="-m64"
CLFS_TARGET="${HVL_TARGET}-unknown-linux-gnu"
+ CLFS_ARCH=${HVL_TARGET}
;;
"x86")
# No special flags
CLFS_BUILDFLAGS=""
CLFS_TARGET="i686-unknown-linux-gnu"
+ CLFS_ARCH=${HVL_TARGET}
;;
*)
echo "Unsupported target architecture: ${HVL_TARGET}"
;;
esac
+CLFS_HOST="$(echo $MACHTYPE | \
+ sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")"
+
+export CLFS_BUILDFLAGS CLFS_TARGET CLFS_ARCH CLFS_HOST CLFS_ENDIAN CLFS_NOT_ENDIAN
+
CLFS=${LFS}
# Extracting the version number from a complete package name.
-#!/bin/sh
+#!/bin/bash
LFS_PKG_BASE="$(dirname $(pwd))/packages"
LFS_PKG_DIR="${LFS_PKG_BASE}/${LFS_STAGE}"
BLFS_XORG_URL="http://anduin.linuxfromscratch.org/files/BLFS/svn/xorg"
XORG_URL="http://xorg.freedesktop.org/releases/individual"
-WGETCMD="wget --directory-prefix=${LFS_PKG_DIR} --timeout=15 --tries=3 -nc --continue --no-check-certificate -o ${WGET_LOG_FILE}"
+WGETCMD="wget --directory-prefix=${LFS_PKG_DIR} --timeout=15 --tries=3 -nc --continue --no-check-certificate --no-verbose --output-file=${WGET_LOG_FILE}"
LFS_PATCHES_LIST=${LFS_PKG_DIR}/patches-list-lfs.html
BLFS_PATCHES_LIST=${LFS_PKG_DIR}/patches-list-blfs.html
PATCHES_LIST_FILENAME=${2}
${WGETCMD} "${PATCHES_URL}/" &&
+
+ # Append log to global log file
+ cat ${WGET_LOG_FILE} >> ${LFS_LOG_FILE} &&
+
mv ${LFS_PKG_DIR}/index.html ${PATCHES_LIST_FILENAME}
}
echo "404 NOTFOUND"
return 0
elif grep "No such file" ${WGET_LOG_FILE} 1> /dev/null 2>&1; then
+ echo "No such file"
return 0
else
return 1
MY_ARCH_EXT="tar.bz2 tar.gz tgz tar.Z"
fi
- echo " MY_ARCH_EXT=${MY_ARCH_EXT}"
-
for arch_ext in ${MY_ARCH_EXT}; do
# Don't take any chance: remove any partially downloaded file.
# If we arrive here, it means the final destination file was not found
# so we can safely remove any file prior to trying to download it.
rm -f ${LFS_PKG_DIR}/${PACK}.${arch_ext}
+ echo "Tryng to fetch ${PACK}.${arch_ext}"
+
${WGETCMD} ${URL}/${PACK}.${arch_ext}
wget_status=$?
- # Failure: if it was a connection timeout, don't try for other file extensions.
+ # Append log to global log file
+ cat ${WGET_LOG_FILE} >> ${LFS_LOG_FILE}
+
+ # Failure: if it was a connection timeout, don't try for other file
+ # extensions.
if grep "failed: Connection timed out" ${WGET_LOG_FILE} 1> /dev/null 2>&1; then
echo "Error, wget reported: Connection timed out"
return 1
fi
if detect_file_not_found; then
- # Try next archive extension if web server reported that file is not found.
+ # Try next archive extension if web server reported that file is not
+ # found.
continue;
fi
# Check for available patches with PACKAGE (TARGET) name.
static_getpatch ${PACK}
- # Check for available patches with SRC_FILENAME name.
- static_getpatch ${SRC_FILENAME}
+ if [ ${SRC_FILENAME} != ${PACK} ]; then
+ # Check for available patches with SRC_FILENAME name.
+ static_getpatch ${SRC_FILENAME}
- # Rename any patch fetched (in fpkg call) and replace SOURCE by TARGET in
- # patch name.
- if ls ${LFS_PKG_DIR}/${SRC_FILENAME}-*.patch 1> /dev/null 2>&1; then
- rename ${SRC_FILENAME} ${PACK} ${LFS_PKG_DIR}/${SRC_FILENAME}-*.patch
+ # Rename any patch fetched (in fpkg call) and replace SOURCE by TARGET
+ # in patch name.
+ if ls ${LFS_PKG_DIR}/${SRC_FILENAME}-*.patch 1> /dev/null 2>&1; then
+ echo "CMD=${SRC_FILENAME} ${PACK} ${LFS_PKG_DIR}/${SRC_FILENAME}-*.patch"
+ rename ${SRC_FILENAME} ${PACK} ${LFS_PKG_DIR}/${SRC_FILENAME}-*.patch
+ fi
fi
}
EASYTAG="easytag-2.1"
ED="ed-1.4"
EGGDBUS="eggdbus-0.6"
-EGLIBC="eglibc-2.10.1"
+EGLIBC="eglibc-2.10.1-20090825-r8873"
+UCLIBC="uClibc-0.9.30.1"
EMACS="emacs-23.1"
ESOUND="esound-0.2.37"
EXPAT="expat-2.0.1"
KBD="kbd-1.15"
KERBEROS5="krb5-1.4.1"
-KERNEL="linux-2.6.32.3"
+KERNEL="linux-2.6.32.9"
KVM="kvm-84"
LAME="lame-3.97"
MILTER_GREYLIST="milter-greylist-4.0"
MILTER_SPF="smf-spf-2.0.1"
MODULE_INIT_TOOLS="module-init-tools-3.11.1"
-MPFR="mpfr-2.4.1"
+MPFR="mpfr-2.4.2"
MUTT="mutt-1.5.20"
MYSQL="mysql-5.1.42"
-#!/bin/sh
+#!/bin/bash
set -o errexit
# First argument of this script is the package name.
-#!/bin/sh
+#!/bin/bash
set -o errexit
# Reading system configuration informations, functions and package versions.
"x86_64")
# This adds 64 bit support to Binutils.
TARGET_CONFIGURE_OPTS="--enable-64-bit-bfd"
+ ########## --with-lib-path=/tools/lib
;;
esac
-#!/bin/sh
+#!/bin/bash
set -o errexit
# First argument of this script is the package name.
-#!/bin/sh
+#!/bin/bash
set -o errexit
# Reading system configuration informations, functions and package versions.
# Configure options:
# BUILD_CC="gcc"
-# This sets Glibc to use the current compiler on our system. This is used to create the tools Glibc uses during its build.
+# This sets Glibc to use the current compiler on our system. This is used to
+# create the tools Glibc uses during its build.
# CC="${CLFS_TARGET}-gcc ${CLFS_BUILDFLAGS}"
-# Forces Glibc to build using our target architecture GCC utilizing any special CLFS build flags.
+# Forces Glibc to build using our target architecture GCC utilizing any
+# special CLFS build flags.
# AR="${CLFS_TARGET}-ar"
-# This forces Glibc to use the ar utility we made for our target architecture.
+# This forces Glibc to use the ar utility we made for our target
+# architecture.
# RANLIB="${CLFS_TARGET}-ranlib"
-# This forces Glibc to use the ranlib utility we made for our target architecture.
+# This forces Glibc to use the ranlib utility we made for our target
+# architecture.
#
# --disable-profile
-# This builds the libraries without profiling information. Omit this option if profiling on the temporary tools is necessary.
+# This builds the libraries without profiling information.
# --enable-add-ons
# This tells Glibc to utilize all add-ons that are available.
# --with-tls
# --with-__thread
# This tells Glibc to use use the __thread for libc and libpthread builds.
# --with-binutils=/cross-tools/bin
-# This tells Glibc to use the Binutils that are specific to our target architecture.
+# This tells Glibc to use the Binutils that are specific to our target
+# architecture.
# --disable-profile
# Builds the libraries without profiling information.
BUILD_CC="gcc" \
-#!/bin/sh
+#!/bin/bash
set -o errexit
# Reading system configuration informations, functions and package versions.
# Manually applying patches
apply_patch ${1}-branch_update-1.patch ${1}
+case "${HVL_TARGET}" in
+ "x86*")
+ TARGET_CONFIGURE_OPTS="--with-ppl=/cross-tools \
+ --with-cloog=/cross-tools \
+ --with-local-prefix=/tools \
+ --disable-multilib"
+ ;;
+esac
+
case "${HVL_TARGET}" in
"x86")
apply_patch ${1}-specs-1.patch ${1}
touch /tools/include/limits.h
# --with-local-prefix=/tools
-# The purpose of this switch is to remove /usr/local/include from gcc's include search path.
-# This is not absolutely essential, however, it helps to minimize the influence of the host system.
+# Remove /usr/local/include from gcc's include search path. This is not
+# absolutely essential, however, it helps to minimize the influence of the
+# host system.
# --disable-shared
# Disables the creation of the shared libraries.
# --disable-threads
-# This will prevent GCC from looking for the multi-thread include files, since they haven't been
-# created for this architecture yet. GCC will be able to find the multi-thread information after
-# the Glibc headers are created.
+# Prevents GCC from looking for the multi-thread include files, since they
+# haven't been created for this architecture yet. GCC will be able to find
+# the multi-thread information after the libc headers are created.
# --enable-languages=c
# This option ensures that only the C compiler is built.
cd ${LFS_TMP}/${1}-build
--host=${CLFS_HOST} \
--target=${CLFS_TARGET} \
--with-sysroot=${CLFS} \
- --with-local-prefix=/tools \
--disable-nls \
--disable-shared \
--with-mpfr=/cross-tools \
--with-gmp=/cross-tools \
- --with-ppl=/cross-tools \
- --with-cloog=/cross-tools \
--without-headers \
--with-newlib \
--disable-decimal-float \
--disable-libssp \
--disable-threads \
--enable-languages=c \
- --disable-multilib
+ ${TARGET_CONFIGURE_OPTS}
${HVMAKE} all-gcc all-target-libgcc
${HVMAKE} install-gcc install-target-libgcc
+case "${HVL_TARGET}" in
+ arm*)
+ # Workaround for uClibc
+ echo "#include \"/cross-tools/lib/gcc/arm926t-unknown-linux-gnueabi/4.4.2/include-fixed/limits.h\"" > /tools/include/limits.h
+ ;;
+esac
+
exit $?
-#!/bin/sh
+#!/bin/bash
set -o errexit
# Reading system configuration informations, functions and package versions.
# Manually applying patches
apply_patch ${1}-branch_update-1.patch ${1}
+case "${HVL_TARGET}" in
+ "x86*")
+ TARGET_CONFIGURE_OPTS="--with-ppl=/cross-tools \
+ --with-cloog=/cross-tools \
+ --disable-multilib"
+ ;;
+ arm*)
+ # Removing workaround for uClibc
+ echo "" > /tools/include/limits.h
+ ;;
+esac
+
case "${HVL_TARGET}" in
"x86")
apply_patch ${1}-specs-1.patch ${1}
# --enable-languages=c,c++
# This option ensures that only the C and C++ compilers are built.
# --enable-__cxa_atexit
-# This option allows use of __cxa_atexit, rather than atexit, to register C++ destructors for local
-# statics and global objects and is essential for fully standards-compliant handling of
-# destructors. It also affects the C++ ABI and therefore results in C++ shared libraries and C++
-# programs that are interoperable with other Linux distributions.
+# This option allows use of __cxa_atexit, rather than atexit, to register
+# C++ destructors for local
+# statics and global objects and is essential for fully standards-compliant
+# handling of destructors. It also affects the C++ ABI and therefore results
+# in C++ shared libraries and C++ programs that are interoperable with other
+# Linux distributions.
# --enable-c99
# Enable C99 support for C programs.
# --enable-long-long
--enable-__cxa_atexit \
--with-mpfr=/cross-tools \
--with-gmp=/cross-tools \
- --with-ppl=/cross-tools \
- --with-cloog=/cross-tools \
--enable-c99 \
--enable-long-long \
--enable-threads=posix \
- --disable-multilib
+ ${TARGET_CONFIGURE_OPTS}
${HVMAKE} \
AS_FOR_TARGET="${CLFS_TARGET}-as" \
LD_FOR_TARGET="${CLFS_TARGET}-ld"
-#!/bin/sh
+#!/bin/bash
set -o errexit
# Reading system configuration informations, functions and package versions.
cd ${LFS_TMP}/${1}
${HVMAKE} mrproper
-${HVMAKE} ARCH=${HVL_TARGET} headers_check
-${HVMAKE} ARCH=${HVL_TARGET} INSTALL_HDR_PATH=dest headers_install
+${HVMAKE} ARCH=${CLFS_ARCH} headers_check
+${HVMAKE} ARCH=${CLFS_ARCH} INSTALL_HDR_PATH=dest headers_install
install -dv /tools/include
cp -rv dest/include/* /tools/include
-#!/bin/sh
+#!/bin/bash
set -o errexit
# First argument of this script is the package name.
-#!/bin/sh
+#!/bin/bash
set -o errexit
# Reading system configuration informations, functions and package versions.
exit 1
fi
+# Testing for the presence of the lfs user
+# We cannot always automatically create the user 'lfs' because the installation media
+# can be a CD-ROM (read-only)
+# If installing from some kind of live-CD, simply install as root without the LFS
+# user :)
+if ! grep "lfs" /etc/passwd 1> /dev/null 2>&1; then
+ # The option '-k /dev/null' prevents possible copying of files from a
+ # skeleton directory (default is /etc/skel).
+ groupadd lfs
+ useradd -s /bin/bash -g lfs -m -k /dev/null lfs
+fi
+
# Creating basic directories
for subdir in tmp var boot tools cross-tools; do
dir=${LFS}/${subdir}
ln -sfvT ${LFS}/${subdir} /${subdir}
done
-# Testing for the presence of the lfs user
-# We cannot automatically create the user 'lfs' because the installation media
-# can be a CD-ROM (read-only)
-# If installing from some kind of live-CD, simply install as root without the LFS user :)
-if ! grep "lfs" /etc/passwd 1> /dev/null 2>&1; then
- # The option '-k /dev/null' prevents possible copying of files from a
- # skeleton directory (default is /etc/skel).
- groupadd lfs
- useradd -s /bin/bash -g lfs -m -k /dev/null lfs
-fi
-
cat > /home/lfs/.bashrc << "EOF"
# Setting up the environment
set +h
umask 022
LC_ALL=POSIX
PATH=/cross-tools/bin:/bin:/usr/bin
-CLFS_BUILDFLAGS=_CLFS_BUILDFLAGS_
-CLFS_HOST="$(echo $MACHTYPE | \
- sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")"
-CLFS_TARGET=_CLFS_TARGET_
HVMAKE="make -j ${MAKEJOBS}"
unset CFLAGS
unset CXXFLAGS
-export LC_ALL PATH CLFS_BUILDFLAGS CLFS_HOST CLFS_TARGET HVMAKE
+export LC_ALL PATH HVMAKE
EOF
-sed -i -e "s!_CLFS_BUILDFLAGS_!${CLFS_BUILDFLAGS}!g" /home/lfs/.bashrc
-sed -i -e "s!_CLFS_TARGET_!${CLFS_TARGET}!g" /home/lfs/.bashrc
-
chown lfs:lfs /home/lfs/.bashrc
exit $?
--- /dev/null
+#!/bin/bash
+set -o errexit
+
+# Reading system configuration informations, functions and package versions.
+source ../sysinfos
+source ../functions
+source ../packages-list
+
+# Manually apply patch
+apply_patch ${1}-branch_update-1.patch ${1}
+
+case "${HVL_TARGET}" in
+ arm926t)
+ apply_patch ${1}-config-arm926t.patch ${1}
+ ;;
+esac
+
+cd ${LFS_TMP}/${1}
+
+sed -e "s@\(^CROSS_COMPILER_PREFIX=\).*@\1\"${CLFS_TARGET}-\"@" \
+ -e "s@\(^KERNEL_HEADERS=\).*@\1\"/tools/include\"@" \
+ -e "s@.*\(DEVEL_PREFIX=\).*@\1\"/tools/\"@" \
+ -e "s@.*\(^ARCH_${CLFS_NOT_ENDIAN}_ENDIAN\).*@# \1 is not set@g" \
+ -e "s@.*\(ARCH_${CLFS_ENDIAN}_ENDIAN\).*@\1=y@g" \
+ -e "s@.*\(ARCH_WANTS_${CLFS_ENDIAN}_ENDIAN\).*@\1=y@g" \
+ -i .config
+
+${HVMAKE} CROSS=${CLFS_TARGET}- CC="${CLFS_TARGET}-gcc ${BUILD}"
+${HVMAKE} PREFIX=${CLFS} install
+
+exit $?
-#!/bin/sh
+#!/bin/bash
source ~/.bashrc
init_log_file
ipkg_cust ${KERNEL} cis-linux-api-headers
-ipkg_ac ${FILE_PKG}
-ipkg_cust ${NCURSES} cis-ncurses "--without-debug --without-shared"
+
+case "${HVL_TARGET}" in
+ x86*)
+ ipkg_ac ${FILE_PKG}
+ ipkg_cust ${NCURSES} cis-ncurses "--without-debug --without-shared"
+ ;;
+esac
+
CPPFLAGS=-fexceptions \
ipkg_ac ${GMP} "--enable-cxx"
LDFLAGS="-Wl,-rpath,/cross-tools/lib" \
ipkg_ac ${MPFR} "--enable-shared --with-gmp=/cross-tools"
-LDFLAGS="-Wl,-rpath,/cross-tools/lib" \
- ipkg_ac ${PPL} "--enable-shared \
- --enable-interfaces=c,cxx \
- --disable-optimization \
- --with-libgmp-prefix=/cross-tools \
- --with-libgmpxx-prefix=/cross-tools"
-LDFLAGS="-Wl,-rpath,/cross-tools/lib" \
- ipkg_cust ${CLOOG_PPL} cis-cloog-ppl "--enable-shared --with-bits=gmp \
- --with-gmp=/cross-tools --with-ppl=/cross-tools"
+
+case "${HVL_TARGET}" in
+ x86*)
+ LDFLAGS="-Wl,-rpath,/cross-tools/lib" \
+ ipkg_ac ${PPL} "--enable-shared \
+ --enable-interfaces=c,cxx \
+ --disable-optimization \
+ --with-libgmp-prefix=/cross-tools \
+ --with-libgmpxx-prefix=/cross-tools"
+ LDFLAGS="-Wl,-rpath,/cross-tools/lib" \
+ ipkg_cust ${CLOOG_PPL} cis-cloog-ppl "--enable-shared --with-bits=gmp \
+ --with-gmp=/cross-tools --with-ppl=/cross-tools"
+ ;;
+esac
+
ipkg_cust ${BINUTILS} cis-binutils
ipkg ${GCC_CORE} cis-gcc-pass1 "${GCC_CORE}-pass1"
-ipkg_cust ${EGLIBC} cis-eglibc
+
+case "${HVL_TARGET}" in
+ x86*)
+ ipkg_cust ${EGLIBC} cis-eglibc
+ ;;
+ arm*)
+ ipkg_cust ${UCLIBC} cis-uclibc
+ ;;
+esac
+
ipkg ${GCC_CORE} cis-gcc-pass2 "${GCC_CORE}-pass2"
exit $?
-#!/bin/sh
+#!/bin/bash
LFS_STAGE="stage0"
# We don't use LFS or BLFS patches because we want to carefully
fi
fpkg ${KERNEL} "http://www.kernel.org/pub/linux/kernel/v2.6"
-fpkg ${FILE_PKG} "http://cross-lfs.org/files/packages/svn"
+fpkg ${FILE_PKG} "ftp://ftp.astron.com/pub/file"
fpkg_gnu ${NCURSES}
fpkg_gnu ${GMP}
-fpkg ${MPFR} "http://www.mpfr.org/mpfr-current"
-fpkg ${PPL} "http://www.cs.unipr.it/ppl/Download/ftp/releases/$(get_pkg_ver ${PPL})"
+fpkg_gnu ${MPFR}
+fpkg -s "$(get_pkg_ver ${PPL})" ${PPL} \
+ "http://www.cs.unipr.it/ppl/Download/ftp/releases"
fpkg ${CLOOG_PPL} "ftp://gcc.gnu.org/pub/gcc/infrastructure"
fpkg_gnu ${BINUTILS}
-fpkg ${GCC_CORE} ${GNU_URL}/gcc/${GCC_CORE}
-fpkg ${EGLIBC} "http://cross-lfs.org/files/packages/svn"
+fpkg_gnu ${GCC_CORE} "gcc/${GCC_CORE}"
+
+case "${HVL_TARGET}" in
+ x86*)
+ fpkg ${EGLIBC} "http://cross-lfs.org/files/packages/svn"
+ ;;
+ arm*)
+ fpkg ${UCLIBC} "http://www.uclibc.org/downloads"
+ ;;
+esac
exit $?
-#!/bin/sh
+#!/bin/bash
set -o errexit
LFS_STAGE=stage0
echo "PATH=\${PATH}:${LFS}/cross-tools/bin" >> ${SCRIPT}
echo "" >> ${SCRIPT}
-echo "make ARCH=${HVL_TARGET} CROSS_COMPILE=${CLFS_TARGET}- menuconfig &&" >> ${SCRIPT}
+echo "make ARCH=${CLFS_ARCH} CROSS_COMPILE=${CLFS_TARGET}- menuconfig &&" >> ${SCRIPT}
# Compile the kernel image:
-echo "make ARCH=${HVL_TARGET} CROSS_COMPILE=${CLFS_TARGET}- &&" >> ${SCRIPT}
+echo "make ARCH=${CLFS_ARCH} CROSS_COMPILE=${CLFS_TARGET}- &&" >> ${SCRIPT}
# Install the kernel:
-echo "cp -v arch/${HVL_TARGET}/boot/bzImage \${DEST}/vmlinuz-\${KERNEL_NAME} &&" >> ${SCRIPT}
+echo "cp -v arch/${CLFS_ARCH}/boot/bzImage \${DEST}/vmlinuz-\${KERNEL_NAME} &&" >> ${SCRIPT}
# Install map file:
echo "cp -v System.map \${DEST}/System.map-\${KERNEL_NAME} &&" >> ${SCRIPT}
-#!/bin/sh
+#!/bin/bash
# This file contains the informations specific to the target system
# onto which Linux-HV will be installed
MAKEJOBS=1
# Installation type: server, ltsp-server or workstation.
-INST_TYPE="ltsp-server"
+INST_TYPE="server"
# New user to create
REGUSER="hugo"
# Destination path where to install new Linux-HV system
-LFS=""
+LFS="/mnt/hvlinux-arm"
# Destination partition where to install new Linux-HV system
LFS_PARTITION="/dev/sda8"
# Define this when cross-compiling to the desired target
# architecture. Default is x86 32-bits architecture (i686).
+# arm926t - ARM 926T little endian
# x86 (i686)
# x86_64 (AMD Athlon 64)
-HVL_TARGET="x86"
+HVL_TARGET="arm926t"
# Used for setting '-march=xxx' option in CFLAGS and CPPFLAGS
-MACHINE_ARCHITECTURE="athlon-xp"
+MACHINE_ARCHITECTURE=""
DEFAULT_EDITOR="emacs"