-Started converting stage2 to package definition files.
-Now booting ok after stage 1.
AVRDUDE="avrdude-5.1"
ATK="atk-1.28.0"
AUDIOFILE="audiofile-0.2.6"
-AUTOCONF="autoconf-2.65"
+AUTOCONF="autoconf-2.67"
AUTOMAKE="automake-1.11.1"
BABL="babl-0.1.2"
JASPER="jasper-1.900.1"
JAVA="jre-1.6.0_05"
-KBD="kbd-1.15"
+KBD="kbd-1.15.2"
KERBEROS5="krb5-1.4.1"
KERNEL="linux-2.6.36"
KVM="kvm-84"
LIBSPF2="libspf2-1.2.5"
LIBTASN1="libtasn1-2.3"
LIBTHEORA="libtheora-1.1.1"
-LIBTOOL="libtool-2.2.6a"
+LIBTOOL="libtool-2.2.10"
LIBVORBIS="libvorbis-1.2.3"
VORBIS_TOOLS="vorbis-tools-1.2.0"
LIBUSB="libusb-1.0.2"
MAILMAN="mailman-2.1.8"
MAKE_PACKAGE="make-3.82"
MAN_DB="man-db-2.5.6"
-MANPAGES="man-pages-3.23"
+MANPAGES="man-pages-3.30"
METACITY="metacity-2.18.5"
MFOUR="m4-1.4.14"
MILTER_GREYLIST="milter-greylist-4.0"
PCIUTILS="pciutils-3.1.4"
PCMANFM="pcmanfm-0.5"
PCRE="pcre-8.00"
-PERL="perl-5.10.1"
+PERL="perl-5.12.1"
PERL_MOD_PDL="PDL-2.4.6"
PERL_MOD_PARSE_REDESCENT="Parse-RecDescent-1.965001"
PERL_MOD_XML_WRITER="XML-Writer-0.606"
PPL="ppl-0.10.2"
PROCMAIL="procmail-3.22"
PROCPS="procps-3.2.8"
-PSMISC="psmisc-22.9"
+PSMISC="psmisc-22.12"
PULSEAUDIO="pulseaudio-0.9.21"
PYCAIRO="pycairo-1.8.8"
PYGOBJECT="pygobject-2.20.0"
source ${SCRDIR}/../functions
source ${SCRDIR}/../packages-list
-DEFAULT_CONFIGURE_PREFIX=/cross-tools
+# Setting default configure options for all scripts
+CONFIGURE_OPTS="\
+ --prefix=/cross-tools \
+ ${CONFIGURE_OPTS}"
# Default configure function
-hvconfigure()
+hvconfig()
{
cd ${LFS_TMP}/${PACKAGE}-build
- FINAL_CFG_OPTS="\
- --prefix=${DEFAULT_CONFIGURE_PREFIX} \
- ${CONFIGURE_OPTS}"
-
echo "Running configure with options:"
- echo " <${FINAL_CFG_OPTS}>"
+ echo " <${CONFIGURE_OPTS}>"
- ../${PACKAGE}/configure ${FINAL_CFG_OPTS}
+ ../${PACKAGE}/configure ${CONFIGURE_OPTS}
}
# Default build function
hvpatch
# Execute config-cache function if applicable
-if function_exists config_cache ; then
+if function_exists hvconfig_cache ; then
echo "Running configure cache script"
- config_cache
+ hvconfig_cache
CONFIGURE_OPTS="${CONFIGURE_OPTS} --cache-file=${LFS_TMP}/${PACKAGE}-build/config.cache"
fi
# Execute pre-configure function if applicable
-if function_exists configure_pre ; then
+if function_exists hvconfig_pre ; then
echo "Running configure pre-script"
- configure_pre
+ hvconfig_pre
fi
if [ -n "${HV_NO_CONFIGURE_SCRIPT}" ]; then
echo "Not calling configure because ${PACKAGE} has no configure script"
else
- hvconfigure
+ hvconfig
fi
# Execute post-configure function if applicable
-if function_exists configure_post ; then
+if function_exists hvconfig_post ; then
echo "Running configure post-script"
- configure_post
+ hvconfig_post
fi
hvbuild
+# Execute post-build function if applicable
+if function_exists hvbuild_post ; then
+ echo "Running build post-script"
+ hvbuild_post
+fi
+
exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Making sure that this script was executed by the root user
-if [ "x${USER}" != "xroot" ]; then
- echo "You must be the superuser to install hvlinux."
- exit 1
-fi
-
-# Making sure that the LFS directory is accessible
-if [ ! -d ${LFS} ]; then
- echo "LFS destination directory not found."
- 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 tools cross-tools; do
- dir=${LFS}/${subdir}
- if [ ! -d ${dir} ]; then
- install -dv ${dir}
- fi
-done
-
-chown -R lfs:lfs ${LFS}
-
-# Creating a link from the host root directory to LFS cross-tools directories
-for subdir in tools cross-tools; do
- ln -sfvT ${LFS}/${subdir} /${subdir}
-done
-
-cat > /home/lfs/.bashrc << "EOF"
-# Setting up the environment
-set +h
-umask 022
-LC_ALL=POSIX
-PATH=/cross-tools/bin:/bin:/usr/bin
-HVMAKE="make -j ${MAKEJOBS}"
-
-unset CFLAGS
-unset CXXFLAGS
-
-export LC_ALL PATH HVMAKE
-EOF
-
-chown lfs:lfs /home/lfs/.bashrc
-
-exit $?
LDFLAGS=""
-AR=ar AS=as \
- ipkg_ac ${BINUTILS} "\
- --host=${CLFS_HOST} \
- --target=${CLFS_TARGET} \
- --with-sysroot=${CLFS} \
- --with-lib-path=/tools/lib \
- --disable-nls \
- --enable-shared \
- --disable-multilib"
-
-GCC_PASS1="1" AR=ar LDFLAGS="-Wl,-rpath,/cross-tools/lib" \
- ipkg ${GCC} cis-ac "${GCC}-pass1"
-
-BUILD_CC="gcc" \
- CC="${CLFS_TARGET}-gcc ${CLFS_BUILDFLAGS}" \
- AR="${CLFS_TARGET}-ar" \
- RANLIB="${CLFS_TARGET}-ranlib" \
- ipkg_ac ${EGLIBC} "\
- --host=${CLFS_TARGET} \
- --build=${CLFS_HOST} \
- --disable-profile \
- --enable-add-ons \
- --with-tls \
- --enable-kernel=$(get_pkg_ver ${KERNEL}) \
- --with-__thread \
- --with-binutils=/cross-tools/bin \
- --with-headers=/tools/include"
-
-GCC_PASS2="1" AR=ar LDFLAGS="-Wl,-rpath,/cross-tools/lib" \
- ipkg ${GCC} cis-ac "${GCC}-pass2"
+ipkg_ac ${BINUTILS}
+GCC_PASS1="1" ipkg ${GCC} cis-ac "${GCC}-pass1"
+ipkg_ac ${EGLIBC}
+GCC_PASS2="1" ipkg ${GCC} cis-ac "${GCC}-pass2"
exit $?
#!/bin/bash
-configure_pre()
+export AR=ar
+export AS=as
+
+CONFIGURE_OPTS="\
+ --host=${CLFS_HOST} \
+ --target=${CLFS_TARGET} \
+ --with-sysroot=${CLFS} \
+ --with-lib-path=/tools/lib \
+ --disable-nls \
+ --enable-shared \
+ --disable-multilib \
+ ${CONFIGURE_OPTS}"
+
+hvconfig_pre()
{
case "${HVL_TARGET}" in
"x86_64")
#!/bin/bash
-# Prevents the configure script from setting LD_LIBRARY_PATH when it finds PPL.
-# This will prevent any conflicts with libraries from the host system.
-configure_pre()
+hvconfig_pre()
{
+ # Prevents the configure script from setting LD_LIBRARY_PATH when it finds PPL.
+ # This will prevent any conflicts with libraries from the host system.
sed -e "/LD_LIBRARY_PATH=/d" -i ${LFS_TMP}/${PACKAGE}/configure
}
#!/bin/bash
-hvpatch()
-{
- case "${HVL_TARGET}" in
- "x86" | "x86_64")
- # Manually apply patch
- #apply_patch ${1}-rpath.patch ${1}
- ;;
- esac
-}
+BUILD_CC="gcc"
+CC="${CLFS_TARGET}-gcc ${CLFS_BUILDFLAGS}"
+AR="${CLFS_TARGET}-ar"
+RANLIB="${CLFS_TARGET}-ranlib"
+
+CONFIGURE_OPTS="\
+ --prefix=/tools \
+ --host=${CLFS_TARGET} \
+ --build=${CLFS_HOST} \
+ --disable-profile \
+ --enable-add-ons \
+ --with-tls \
+ --enable-kernel=$(get_pkg_ver ${KERNEL}) \
+ --with-__thread \
+ --with-binutils=/cross-tools/bin \
+ --with-headers=/tools/include"
# For Glibc to support NPTL:
-config_cache()
+hvconfig_cache()
{
cat > ${LFS_TMP}/${PACKAGE}-build/config.cache << EOF
libc_cv_forced_unwind=yes
EOF
}
-configure_pre()
+hvconfig_pre()
{
case "${HVL_TARGET}" in
"x86")
# Disable linking to libgcc_eh:
sed -e 's/-lgcc_eh//g' -i Makeconfig
-
- DEFAULT_CONFIGURE_PREFIX=/tools
}
#!/bin/bash
+AR=ar
+LDFLAGS="-Wl,-rpath,/cross-tools/lib"
+
hvpatch()
{
# Manually applying patches if specified
esac
}
-configure_pre()
+hvconfig_pre()
{
# Common options for passes 1 & 2
CONFIGURE_OPTS="${CONFIGURE_OPTS} \
--- /dev/null
+#!/bin/bash
+set -o errexit
+
+# Reading system configuration informations, functions and package versions.
+source ../sysinfos
+source ../functions
+source ../packages-list
+
+# Making sure that this script was executed by the root user
+if [ "x${USER}" != "xroot" ]; then
+ echo "You must be the superuser to install hvlinux."
+ exit 1
+fi
+
+# Making sure that the LFS directory is accessible
+if [ ! -d ${LFS} ]; then
+ echo "LFS destination directory not found."
+ 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 tools cross-tools; do
+ dir=${LFS}/${subdir}
+ if [ ! -d ${dir} ]; then
+ install -dv ${dir}
+ fi
+done
+
+chown -R lfs:lfs ${LFS}
+
+# Creating a link from the host root directory to LFS cross-tools directories
+for subdir in tools cross-tools; do
+ ln -sfvT ${LFS}/${subdir} /${subdir}
+done
+
+cat > /home/lfs/.bashrc << "EOF"
+# Setting up the environment
+set +h
+umask 022
+LC_ALL=POSIX
+PATH=/cross-tools/bin:/bin:/usr/bin
+HVMAKE="make -j ${MAKEJOBS}"
+
+unset CFLAGS
+unset CXXFLAGS
+
+export LC_ALL PATH HVMAKE
+EOF
+
+chown lfs:lfs /home/lfs/.bashrc
+
+exit $?
export LFS_TMP="${LFS}/tmp"
echo "Performing pre-install"
-./cis-pre-install
+./pre-install
# Logging-in as 'lfs' user, and executing the install-1 script. The
# 'su -' command starts with a clean environment and enters the home
source ${SCRDIR}/../functions
source ${SCRDIR}/../packages-list
-DEFAULT_CONFIGURE_PREFIX=/tools
+# Setting default configure options for all scripts
+CONFIGURE_OPTS="\
+ --prefix=/tools \
+ --build=${CLFS_HOST} \
+ --host=${CLFS_TARGET} \
+ ${CONFIGURE_OPTS}"
# Default configure function
-hvconfigure()
+hvconfig()
{
cd ${LFS_TMP}/${PACKAGE}-build
- FINAL_CFG_OPTS="\
- --prefix=${DEFAULT_CONFIGURE_PREFIX} \
- --build=${CLFS_HOST} \
- --host=${CLFS_TARGET} \
- ${CONFIGURE_OPTS}"
-
echo "Running configure with options:"
- echo " <${FINAL_CFG_OPTS}>"
+ echo " <${CONFIGURE_OPTS}>"
CC="${CC} ${CLFS_BUILDFLAGS}" CXX="${CXX} ${CLFS_BUILDFLAGS}" \
- ../${PACKAGE}/configure ${FINAL_CFG_OPTS}
+ ../${PACKAGE}/configure ${CONFIGURE_OPTS}
}
# Default build function
hvpatch
# Execute config-cache function if applicable
-if function_exists config_cache ; then
+if function_exists hvconfig_cache ; then
echo "Running configure cache script"
- config_cache
+ hvconfig_cache
CONFIGURE_OPTS="${CONFIGURE_OPTS} --cache-file=${LFS_TMP}/${PACKAGE}-build/config.cache"
fi
# Execute pre-configure function if applicable
-if function_exists configure_pre ; then
+if function_exists hvconfig_pre ; then
echo "Running configure pre-script"
- configure_pre
+ hvconfig_pre
fi
if [ -n "${HV_NO_CONFIGURE_SCRIPT}" ]; then
echo "Not calling configure because ${PACKAGE} has no configure script"
else
- hvconfigure
+ hvconfig
fi
# Execute post-configure function if applicable
-if function_exists configure_post ; then
+if function_exists hvconfig_post ; then
echo "Running configure post-script"
- configure_post
+ hvconfig_post
fi
hvbuild
+# Execute post-build function if applicable
+if function_exists hvbuild_post ; then
+ echo "Running build post-script"
+ hvbuild_post
+fi
+
exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Clock settings
-cat > ${LFS}/etc/sysconfig/clock << "EOF"
-UTC=1
-EOF
-
-# Copying boot scripts
-STAGE1_BOOTSCRIPTS="checkfs cleanfs functions halt hostname initlog modules mountfs \
- mountkernfs rc reboot sendsignals setclock swap udev"
-mkdir -p ${LFS}/etc/rc.d/init.d
-for bootscript in ${STAGE1_BOOTSCRIPTS}; do
- install -m755 bootscripts/${bootscript} ${LFS}/etc/rc.d/init.d
-done
-
-# Creating runlevels links
-for level in sysinit 0 1 2 3 4 5 6; do
- dir=${LFS}/etc/rc.d/rc${level}.d
- if [ -d ${dir} ]; then
- # Removing old links
- rm -f ${dir}/*
- else
- # Creating basic directory structure
- mkdir -v -p ${dir}
- fi
-done
-
-# rcsysinit.d
-bootscript_add_rcsysinit initlog 05 00
-bootscript_add_rcsysinit hostname 10 00
-bootscript_add_rcsysinit mountkernfs 15 00
-bootscript_add_rcsysinit modules 20 00
-bootscript_add_rcsysinit udev 25 00
-bootscript_add_rcsysinit checkfs 30 00
-bootscript_add_rcsysinit mountfs 35 95
-bootscript_add_rcsysinit swap 40 94
-bootscript_add_rcsysinit cleanfs 45 00
-bootscript_add_rcsysinit setclock 60 92
-
-# rc0.d
-bootscript_add_manual 0 sendsignals 95 00
-bootscript_add_manual 0 halt 99 00
-
-# rc6.d is almost identical to rc0.d
-bootscript_add_manual 6 sendsignals 95 00
-bootscript_add_manual 6 reboot 99 00
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# We need /dev/null and /dev/console before udev is started.
-mkdir -pv ${LFS}/dev
-
-if [ ! -c ${LFS}/dev/console ]; then
- mknod -m 0600 ${LFS}/dev/console c 5 1
-fi
-
-if [ ! -c ${LFS}/dev/null ]; then
- mknod -m 0666 ${LFS}/dev/null c 1 3
-fi
-
-# Static UDEV devices
-if [ ! -c ${LFS}/lib/udev/devices/null ]; then
- mknod -m0666 ${LFS}/lib/udev/devices/null c 1 3
-fi
-
-if [ ! -c ${LFS}/lib/udev/devices/kmsg ]; then
- mknod -m0666 ${LFS}/lib/udev/devices/kmsg c 1 11
-fi
-
-if [ ! -h ${LFS}/lib/udev/devices/fd ]; then
- ln -sfv /proc/self/fd ${LFS}/lib/udev/devices/fd
-fi
-
-if [ ! -h ${LFS}/lib/udev/devices/stdin ]; then
- ln -sfv /proc/self/fd/0 ${LFS}/lib/udev/devices/stdin
-fi
-
-if [ ! -h ${LFS}/lib/udev/devices/stdout ]; then
- ln -sfv /proc/self/fd/1 ${LFS}/lib/udev/devices/stdout
-fi
-
-if [ ! -h ${LFS}/lib/udev/devices/stderr ]; then
- ln -sfv /proc/self/fd/2 ${LFS}/lib/udev/devices/stderr
-fi
-
-if [ ! -h ${LFS}/lib/udev/devices/core ]; then
- ln -sfv /proc/kcore ${LFS}/lib/udev/devices/core
-fi
-
-# Change the ownership for ${LFS} and its subdirectories
-chown -Rv root:root ${LFS}
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Making sure that this script was executed by the root user
-if [ "x${USER}" != "xroot" ]; then
- echo "You must be the superuser to install hvlinux."
- exit 1
-fi
-
-# Making sure that the LFS directory is accessible
-if [ ! -d ${LFS} ]; then
- echo "LFS destination directory not found."
- exit 1
-fi
-
-# Make lfs the owner in case the installation is restarted
-chown -Rv lfs:lfs ${LFS}
-
-exit $?
ipkg_ac ${SYSVINIT}
ipkg_ac ${MODULE_INIT_TOOLS}
ipkg_ac ${UDEV}
+ipkg_ac ${KERNEL}
rscr once "Creating default users" create-users
rscr once "Creating default groups" create-groups
rscr once "Creating default log files" create-logfiles
-rscr once "Installing kernel sources" install-linux-minimal
rscr once "Creating default config files" create-config-files
-rscr once "Installing bootscripts" cis-bootscripts
+rscr once "Installing bootscripts" install-bootscripts
exit $?
--- /dev/null
+#!/bin/bash
+set -o errexit
+
+# Reading system configuration informations, functions and package versions.
+source ../sysinfos
+source ../functions
+source ../packages-list
+
+# Clock settings
+cat > ${LFS}/etc/sysconfig/clock << "EOF"
+UTC=1
+EOF
+
+# Copying boot scripts
+STAGE1_BOOTSCRIPTS="checkfs cleanfs functions halt hostname initlog modules mountfs \
+ mountkernfs rc reboot sendsignals setclock swap udev"
+mkdir -p ${LFS}/etc/rc.d/init.d
+for bootscript in ${STAGE1_BOOTSCRIPTS}; do
+ install -m755 bootscripts/${bootscript} ${LFS}/etc/rc.d/init.d
+done
+
+# Creating runlevels links
+for level in sysinit 0 1 2 3 4 5 6; do
+ dir=${LFS}/etc/rc.d/rc${level}.d
+ if [ -d ${dir} ]; then
+ # Removing old links
+ rm -f ${dir}/*
+ else
+ # Creating basic directory structure
+ mkdir -v -p ${dir}
+ fi
+done
+
+# rcsysinit.d
+bootscript_add_rcsysinit initlog 05 00
+bootscript_add_rcsysinit hostname 10 00
+bootscript_add_rcsysinit mountkernfs 15 00
+bootscript_add_rcsysinit modules 20 00
+bootscript_add_rcsysinit udev 25 00
+bootscript_add_rcsysinit checkfs 30 00
+bootscript_add_rcsysinit mountfs 35 95
+bootscript_add_rcsysinit swap 40 94
+bootscript_add_rcsysinit cleanfs 45 00
+bootscript_add_rcsysinit setclock 60 92
+
+# rc0.d
+bootscript_add_manual 0 sendsignals 95 00
+bootscript_add_manual 0 halt 99 00
+
+# rc6.d is almost identical to rc0.d
+bootscript_add_manual 6 sendsignals 95 00
+bootscript_add_manual 6 reboot 99 00
+
+exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${KERNEL}
-
-# Move kernel source files to their final destination
-mkdir -pv ${LFS}/usr/src
-decompress_package ${PACKAGE} ${LFS}/usr/src
-
-cd ${LFS}/usr/src/${PACKAGE}
-${HVMAKE} mrproper
-
-# Install HV kernel compilation script:
-VERSION=$(get_pkg_ver ${PACKAGE})
-SCRIPT=${LFS}/usr/src/compile-kernel-minimal
-
-echo "#!/bin/bash" > ${SCRIPT}
-echo "set -o errexit" >> ${SCRIPT}
-echo "KERNEL_VERSION=${VERSION}" >> ${SCRIPT}
-echo "KERNEL_NAME=clfs-\${KERNEL_VERSION}" >> ${SCRIPT}
-echo "DEST=${LFS}/boot" >> ${SCRIPT}
-echo "PATH=\${PATH}:${LFS}/cross-tools/bin" >> ${SCRIPT}
-echo "" >> ${SCRIPT}
-
-echo "make ARCH=${CLFS_ARCH} CROSS_COMPILE=${CLFS_TARGET}- menuconfig" >> ${SCRIPT}
-
-# Compile the kernel image:
-echo "make ARCH=${CLFS_ARCH} CROSS_COMPILE=${CLFS_TARGET}-" >> ${SCRIPT}
-
-# Install the kernel:
-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}
-
-# Install config file:
-echo "cp -v .config \${DEST}/config-\${KERNEL_NAME}" >> ${SCRIPT}
-
-chmod -v u+x ${SCRIPT}
-
-exit $?
# will break one of the C++ test scripts in eglibc. The following prevents
# future problems by skipping the check for named pipes, as well as other tests
# that can not run while cross-compiling or that do not run properly:
-config_cache()
+hvconfig_cache()
{
cat > ${LFS_TMP}/${PACKAGE}-build/config.cache << EOF
ac_cv_func_mmap_fixed_mapped=yes
EOF
}
-hvbuild()
+hvbuild_post()
{
- ${HVMAKE}
- ${HVMAKE} install
-
ln -svfT bash /tools/bin/sh
}
#!/bin/bash
-configure_pre()
+hvconfig_pre()
{
case "${HVL_TARGET}" in
"x86_64")
#!/bin/bash
# This package doesn't have a configure script...
-hvconfigure()
+hvconfig()
{
cd ${LFS_TMP}/${PACKAGE}
# Prevents the configure script from setting LD_LIBRARY_PATH when it finds PPL.
# This will prevent any conflicts with libraries from the host system.
-configure_pre()
+hvconfig_pre()
{
sed -e "/LD_LIBRARY_PATH=/d" -i ${LFS_TMP}/${PACKAGE}/configure
}
# Configure cannot properly determine how to get free space when cross-compiling
# and as a result the df program will not be built. Add the following entries to
# config.cache to correct this, and fix various cross-compiling issues:
-config_cache()
+hvconfig_cache()
{
cat > ${LFS_TMP}/${PACKAGE}-build/config.cache << EOF
fu_cv_sys_stat_statfs2_bsize=yes
EOF
}
-configure_pre()
+hvconfig_pre()
{
# Fix a bug when the uname patch is automatically applied
touch ${LFS_TMP}/${PACKAGE}/man/{uname,hostname}.1
#!/bin/bash
-hvconfigure()
+hvconfig()
{
cd ${LFS_TMP}/${PACKAGE}-build
# Install the static libraries and headers:
${HVMAKE} install-libs
+}
+hvbuild_post()
+{
# Create needed symlinks for a bootable system:
LINKS="fsck.ext2 fsck.ext3 fsck.ext4 e2fsck"
# The following cache entries set the values for tests that do not run while
# cross-compiling:
-config_cache()
+hvconfig_cache()
{
cat > ${LFS_TMP}/${PACKAGE}-build/config.cache << EOF
gl_cv_func_wcwidth_works=yes
# When Cross Compiling the configure script does not determine the correct
# values for the following, Set the values manually:
-config_cache()
+hvconfig_cache()
{
cat > ${LFS_TMP}/${PACKAGE}-build/config.cache << EOF
ac_cv_func_malloc_0_nonnull=yes
EOF
}
-configure_pre()
+hvconfig_pre()
{
# Make sure that Flex doesn't try to include headers from /usr/include.
sed -e "s/-I@includedir@//g" -i ${LFS_TMP}/${PACKAGE}/Makefile.in
esac
}
-configure_pre()
+hvconfig_pre()
{
cd ${LFS_TMP}/${PACKAGE}
gcc/Makefile.in.orig > gcc/Makefile.in
}
-configure_post()
+hvconfig_post()
{
# Prevent GCC from looking in the wrong directories for headers and
# libraries:
# When cross-compiling the Gettext configure script assumes we don't have a
# working wcwidth when we do. The following will fix possible compilation
# errors because of this assumption:
-config_cache()
+hvconfig_cache()
{
cat > ${LFS_TMP}/${PACKAGE}-build/config.cache << EOF
gl_cv_func_wcwidth_works=yes
EOF
}
-hvconfigure()
+hvconfig()
{
cd ${LFS_TMP}/${PACKAGE}/gettext-tools
# When Cross Compiling the configure script does not determine the correct values
# for the following, Set the values manually:
-config_cache()
+hvconfig_cache()
{
cat > ${LFS_TMP}/${PACKAGE}-build/config.cache << EOF
ac_cv_func_malloc_0_nonnull=yes
--- /dev/null
+#!/bin/bash
+
+HV_NO_CONFIGURE_SCRIPT=1
+
+hvbuild()
+{
+ cd ${LFS_TMP}/${PACKAGE}
+
+ # Move kernel source files to their final destination
+ mkdir -pv ${LFS}/usr/src
+ decompress_package ${PACKAGE} ${LFS}/usr/src
+
+ cd ${LFS}/usr/src/${PACKAGE}
+ ${HVMAKE} mrproper
+
+ # Install HV kernel compilation script:
+ VERSION=$(get_pkg_ver ${PACKAGE})
+ SCRIPT=${LFS}/usr/src/compile-kernel-minimal
+
+ echo "#!/bin/bash" > ${SCRIPT}
+ echo "set -o errexit" >> ${SCRIPT}
+ echo "KERNEL_VERSION=${VERSION}" >> ${SCRIPT}
+ echo "KERNEL_NAME=clfs-\${KERNEL_VERSION}" >> ${SCRIPT}
+ echo "DEST=${LFS}/boot" >> ${SCRIPT}
+ echo "PATH=\${PATH}:${LFS}/cross-tools/bin" >> ${SCRIPT}
+ echo "" >> ${SCRIPT}
+
+ echo "make ARCH=${CLFS_ARCH} CROSS_COMPILE=${CLFS_TARGET}- menuconfig" >> ${SCRIPT}
+
+ # Compile the kernel image:
+ echo "make ARCH=${CLFS_ARCH} CROSS_COMPILE=${CLFS_TARGET}-" >> ${SCRIPT}
+
+ # Install the kernel:
+ 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}
+
+ # Install config file:
+ echo "cp -v .config \${DEST}/config-\${KERNEL_NAME}" >> ${SCRIPT}
+
+ chmod -v u+x ${SCRIPT}
+}
#!/bin/bash
# Configure can not properly determine the results of the following tests:
-config_cache()
+hvconfig_cache()
{
cat > ${LFS_TMP}/${PACKAGE}-build/config.cache << EOF
gl_cv_func_btowc_eof=yes
EOF
}
-configure_pre()
+hvconfig_pre()
{
# Add a missing include statement into one of the source files:
sed -e '/"m4.h"/i\#include <sys/stat.h>' -i ${LFS_TMP}/${PACKAGE}/src/path.c
#!/bin/bash
-hvconfigure()
-{
- cd ${LFS_TMP}/${PACKAGE}-build
+CC="${CC} ${CLFS_BUILDFLAGS}"
- CC="${CC} ${CLFS_BUILDFLAGS}" \
- ../${PACKAGE}/configure \
- --prefix=/ \
- --bindir=/bin \
- --sbindir=/sbin \
- --build=${CLFS_HOST} \
- --host=${CLFS_TARGET}
-}
+CONFIGURE_OPTS="\
+ --prefix=/ \
+ --bindir=/bin \
+ --sbindir=/sbin \
+ --build=${CLFS_HOST} \
+ --host=${CLFS_TARGET}"
hvbuild()
{
#!/bin/bash
-configure_post()
+hvconfig_post()
{
# When PPL is cross-compiled, it does not check whether GMP was compiled
# with support for exceptions, and simply assumes it was not. This
HV_NO_CONFIGURE_SCRIPT=1
-configure_pre()
+hvconfig_pre()
{
cd ${LFS_TMP}/${PACKAGE}
#!/bin/bash
# Configure can not properly determine the results of a few tests.
-config_cache()
+hvconfig_cache()
{
cat > ${LFS_TMP}/${PACKAGE}-build/config.cache << EOF
gl_cv_func_wcwidth_works=yes
#!/bin/bash
-configure_pre()
-{
- cd ${LFS_TMP}/${PACKAGE}
+CC="${CC} ${CLFS_BUILDFLAGS}"
- install -dv ${LFS}/lib/{firmware,udev/devices/{pts,shm}}
-}
+CONFIGURE_OPTS="\
+ --prefix=/usr \
+ --build=${CLFS_HOST} \
+ --host=${CLFS_TARGET} \
+ --exec-prefix="" \
+ --sysconfdir=/etc \
+ --libexecdir=/lib/udev \
+ --libdir=/usr/lib \
+ --disable-extras \
+ --disable-introspection"
-hvconfigure()
+hvconfig_pre()
{
- cd ${LFS_TMP}/${PACKAGE}-build
+ cd ${LFS_TMP}/${PACKAGE}
- CC="${CC} ${CLFS_BUILDFLAGS}" ../${PACKAGE}/configure \
- --prefix=/usr \
- --build=${CLFS_HOST} \
- --host=${CLFS_TARGET} \
- --exec-prefix="" \
- --sysconfdir=/etc \
- --libexecdir=/lib/udev \
- --libdir=/usr/lib \
- --disable-extras \
- --disable-introspection
+ install -dv ${LFS}/lib/{firmware,udev/devices/{pts,shm}}
}
hvbuild()
#!/bin/bash
-hvconfigure()
-{
- cd ${LFS_TMP}/${PACKAGE}-build
+CC="${CC} ${CLFS_BUILDFLAGS}"
+CXX="${CXX} ${CLFS_BUILDFLAGS}"
- CC="${CC} ${CLFS_BUILDFLAGS}" CXX="${CXX} ${CLFS_BUILDFLAGS}" \
- ../${PACKAGE}/configure \
- --build=${CLFS_HOST} \
- --host=${CLFS_TARGET} \
- --enable-login-utils \
- --disable-makeinstall-chown
-}
+CONFIGURE_OPTS="\
+ --build=${CLFS_HOST} \
+ --host=${CLFS_TARGET} \
+ --enable-login-utils \
+ --disable-makeinstall-chown"
hvbuild()
{
${HVMAKE}
${HVMAKE} DESTDIR=${LFS} install
+}
+hvbuild_post()
+{
# Copy Libraries and includes to /tools:
rm -fv ${LFS}/usr/lib/lib{blkid,uuid}.la
cp -v ${LFS}/usr/lib/lib{blkid,uuid}* /tools/lib
#!/bin/bash
-hvconfigure()
+CC="${CC} ${CLFS_BUILDFLAGS}"
+
+hvconfig()
{
cd ${LFS_TMP}/${PACKAGE}
- CC="${CC} ${CLFS_BUILDFLAGS}" ./configure \
+ ./configure \
--prefix=/tools
}
--- /dev/null
+#!/bin/bash
+set -o errexit
+
+# Reading system configuration informations, functions and package versions.
+source ../sysinfos
+source ../functions
+source ../packages-list
+
+# We need /dev/null and /dev/console before udev is started.
+mkdir -pv ${LFS}/dev
+
+if [ ! -c ${LFS}/dev/console ]; then
+ mknod -m 0600 ${LFS}/dev/console c 5 1
+fi
+
+if [ ! -c ${LFS}/dev/null ]; then
+ mknod -m 0666 ${LFS}/dev/null c 1 3
+fi
+
+# Static UDEV devices
+if [ ! -c ${LFS}/lib/udev/devices/null ]; then
+ mknod -m0666 ${LFS}/lib/udev/devices/null c 1 3
+fi
+
+if [ ! -c ${LFS}/lib/udev/devices/kmsg ]; then
+ mknod -m0666 ${LFS}/lib/udev/devices/kmsg c 1 11
+fi
+
+if [ ! -h ${LFS}/lib/udev/devices/fd ]; then
+ ln -sfv /proc/self/fd ${LFS}/lib/udev/devices/fd
+fi
+
+if [ ! -h ${LFS}/lib/udev/devices/stdin ]; then
+ ln -sfv /proc/self/fd/0 ${LFS}/lib/udev/devices/stdin
+fi
+
+if [ ! -h ${LFS}/lib/udev/devices/stdout ]; then
+ ln -sfv /proc/self/fd/1 ${LFS}/lib/udev/devices/stdout
+fi
+
+if [ ! -h ${LFS}/lib/udev/devices/stderr ]; then
+ ln -sfv /proc/self/fd/2 ${LFS}/lib/udev/devices/stderr
+fi
+
+if [ ! -h ${LFS}/lib/udev/devices/core ]; then
+ ln -sfv /proc/kcore ${LFS}/lib/udev/devices/core
+fi
+
+# Change the ownership for ${LFS} and its subdirectories
+chown -Rv root:root ${LFS}
+
+exit $?
--- /dev/null
+#!/bin/bash
+set -o errexit
+
+# Reading system configuration informations, functions and package versions.
+source ../sysinfos
+source ../functions
+source ../packages-list
+
+# Making sure that this script was executed by the root user
+if [ "x${USER}" != "xroot" ]; then
+ echo "You must be the superuser to install hvlinux."
+ exit 1
+fi
+
+# Making sure that the LFS directory is accessible
+if [ ! -d ${LFS} ]; then
+ echo "LFS destination directory not found."
+ exit 1
+fi
+
+# Make lfs the owner in case the installation is restarted
+chown -Rv lfs:lfs ${LFS}
+
+exit $?
init_log_file
-rscr mult "Performing pre-install" cis-pre-install
+rscr mult "Performing pre-install" pre-install
# Logging-in as 'lfs' user, and executing the install-1 script. The
# 'su -' command starts with a clean environment and enters the home
# directory of the user.
su - lfs -c "cd ${PWD}; ./install-1"
-rscr mult "Performing post-install" cis-post-install
+rscr mult "Performing post-install" post-install
echo "Total build time: $(get_total_build_time ${LFS_LOG_FILE})h"
# First argument of this script is the package name.
# Remaining arguments are additional configure options.
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
PACKAGE=${1}
shift
CONFIGURE_OPTS=${*}
-# Applying patches (if any)
-apply_patches ${PACKAGE}
+# Reading system configuration informations, functions and package versions.
+source ${SCRDIR}/../sysinfos
+source ${SCRDIR}/../functions
+source ${SCRDIR}/../packages-list
+
+# Setting default configure options for all scripts
+CONFIGURE_OPTS="\
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ ${CONFIGURE_OPTS}"
+
+# Default configure function
+hvconfig()
+{
+ cd ${LFS_TMP}/${PACKAGE}-build
+
+ echo "Running configure with options:"
+ echo " <${CONFIGURE_OPTS}>"
+
+ ../${PACKAGE}/configure ${CONFIGURE_OPTS}
+}
+
+# Default build function
+hvbuild()
+{
+ ${HVMAKE}
+ ${HVMAKE} install
+}
+
+hvpatch()
+{
+ # Applying patches (if any)
+ apply_patches ${PACKAGE}
+}
+
+PACKAGE_DEF=${SCRDIR}/pkg/$(get_pkg_name ${PACKAGE})
+
+if [ -f ${PACKAGE_DEF} ]; then
+ echo "Load custom package functions and definitions"
+ source ${PACKAGE_DEF}
+fi
+
+hvpatch
+
+# Execute config-cache function if applicable
+if function_exists hvconfig_cache ; then
+ echo "Running configure cache script"
+ hvconfig_cache
+
+ CONFIGURE_OPTS="${CONFIGURE_OPTS} --cache-file=${LFS_TMP}/${PACKAGE}-build/config.cache"
+fi
+
+# Execute pre-configure function if applicable
+if function_exists hvconfig_pre ; then
+ echo "Running configure pre-script"
+ hvconfig_pre
+fi
+
+if [ -n "${HV_NO_CONFIGURE_SCRIPT}" ]; then
+ echo "Not calling configure because ${PACKAGE} has no configure script"
+else
+ hvconfig
+fi
+
+# Execute post-configure function if applicable
+if function_exists hvconfig_post ; then
+ echo "Running configure post-script"
+ hvconfig_post
+fi
+
+hvbuild
+
+# Execute post-build function if applicable
+if function_exists hvbuild_post ; then
+ echo "Running build post-script"
+ hvbuild_post
+fi
-cd ${LFS_TMP}/${PACKAGE}-build
-../${PACKAGE}/configure \
- --prefix=/usr \
- --sysconfdir=/etc \
- ${CONFIGURE_OPTS}
-make
-make install
ldconfig
exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}
-./configure \
- --prefix=/usr \
- --sysconfdir=/etc \
- ${CONFIGURE_OPTS}
-make
-make install
-ldconfig
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}
-
-case "${HVL_TARGET}" in
- "x86_64")
- # Libiberty uses gcc -print-multi-os-directory to determine where to
- # install libiberty.a. Because our temporary GCC is still
- # multilib-aware, the command returns ../lib64 which causes the archive
- # to be installed into /usr/lib64. The following sed will prevent this:
- sed -i 's%\(^MULTIOSDIR = \).*%\1 ../lib%' libiberty/Makefile.in
-
- # This adds 64 bit support to Binutils.
- CONFIGURE_OPTS="${CONFIGURE_OPTS} --enable-64-bit-bfd"
- ;;
-esac
-
-cd ${LFS_TMP}/${PACKAGE}-build
-../${PACKAGE}/configure \
- --prefix=/usr \
- --sysconfdir=/etc \
- ${CONFIGURE_OPTS}
-make configure-host
-make tooldir=/usr
-
-# Install the package:
-make tooldir=/usr install
-
-# Install the libiberty header file that is needed by some packages:
-cp -v ../${PACKAGE}/include/libiberty.h /usr/include
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}-build
-../${1}/configure \
- --prefix=/usr \
- --sysconfdir=/etc
-# The configure system causes bison to be built without support for
-# internationalization of error messages if a bison program is not
-# already in $PATH. The following addition will correct this:
-echo '#define YYENABLE_NLS 1' >> config.h
-make
-make install
-ldconfig
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}-build
-../${1}/configure \
- --prefix=/usr \
- --enable-no-install-program=kill,uptime
-make -j ${MAKEJOBS}
-make install
-
-# Move some programs to their proper FHS locations:
-mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin
-mv -v /usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm} /bin
-# Now specify new path to mv to eliminate error message:
-# "/usr/bin/mv: No such file or directory"
-/bin/mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin
-/bin/mv -v /usr/bin/chroot /usr/sbin
-
-# Some of the scripts in the LFS-Bootscripts package depend on head
-# sleep and nice. As /usr may not be available during the early stages
-# of booting, those binaries need to be on the root partition:
-/bin/mv -v /usr/bin/{head,sleep,nice} /bin
-
-# Return last error
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}-build
-../${1}/configure \
- --prefix=/usr \
- --with-root-prefix="" \
- --enable-elf-shlibs \
- --disable-libblkid \
- --disable-libuuid \
- --disable-uuidd \
- --disable-fsck
-make -j ${MAKEJOBS}
-make install
-# Install the static libraries and headers:
-make install-libs
-
-# Make the installed static libraries writable so debugging symbols can be removed later:
-chmod -v u+w /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-EGLIBC_VER=$(echo ${PACKAGE} | sed "s!eglibc-\([0-9]*\.[0-9]*\.[0-9]*\)-.*!\1!g")
-
-case "${HVL_TARGET}" in
- "x86" | "x86_64")
- # Manually apply patch
- apply_patch ${PACKAGE}-rpath.patch ${PACKAGE}
- ;;
-esac
-
-TMP_CFLAGS="-mtune=generic -g -O2"
-
-case "${HVL_TARGET}" in
- "x86")
- TMP_CFLAGS="-march=$(cut -d- -f1 <<< ${CLFS_TARGET}) ${TMP_CFLAGS}"
- ;;
-esac
-
-# When running make install, a script called test-installation.pl
-# performs a small sanity test on our newly installed Glibc. However,
-# because our toolchain still points to the /tools directory, the
-# sanity test would be carried out against the wrong Glibc. We can
-# force the script to check the Glibc we have just installed with:
-cd ${LFS_TMP}/${PACKAGE}
-LINKER=$(readelf -l $(file /tools/lib/libc-* | cut -f1 -d:) | sed -n 's@.*interpret.*/tools\(.*\)]$@\1@p')
-sed -i "s|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=${LINKER} -o|" \
- scripts/test-installation.pl
-unset LINKER
-
-cd ${LFS_TMP}/${PACKAGE}-build
-
-case "${HVL_TARGET}" in
- "x86_64")
- # Tell EGLIBC to install its libraries into /lib:
- echo "slibdir=/lib" >> configparms
- CONFIGURE_OPTS="${CONFIGURE_OPTS} --libdir=/usr/lib"
- ;;
-esac
-
-# Configure options:
-# --libexecdir=/usr/lib/eglibc
-# Changes the location of the pt_chown program from its default of /usr/libexec to /usr/lib/eglibc.
-CFLAGS=${TMP_CFLAGS} \
- ../${PACKAGE}/configure \
- --prefix=/usr \
- --disable-profile \
- --enable-add-ons \
- --enable-kernel=$(get_pkg_ver ${KERNEL}) \
- --libexecdir=/usr/lib/eglibc \
- ${CONFIGURE_OPTS}
-make
-touch /etc/ld.so.conf
-
-case "${HVL_TARGET}" in
- "x86_64")
- # The install will finish by checking that everything is correctly
- # installed. Unfortunately, it will test for a multilib installation.
- # On x86_64 Pure64 this means it will try to test the non-existent
- # 32-bit loader which has a different name from the 64-bit loader
- # (unlike on other 64-bit architectures). We fool it by creating a
- # symlink to the real loader.
- ln -svfT ld-${EGLIBC_VER}.so /lib/ld-linux.so.2
- make install
-
- # Now we can remove this symlink.
- rm -v /lib/ld-linux.so.2
-
- # We also need to correct the /usr/bin/ldd script - if you look at this,
- # you will see it references not only the 32-bit linker, but also /lib64
- # where it thinks the 64-bit linker is.
- cp -v /usr/bin/ldd{,.bak}
- sed '/RTLDLIST/s%/ld-linux.so.2 /lib64%%' /usr/bin/ldd.bak >/usr/bin/ldd
- rm -v /usr/bin/ldd.bak
- ;;
- *)
- make install
- ;;
-esac
-
-# The following instructions, instead of the install-locales target
-# above, will install the minimum set of locales necessary for the
-# tests to run successfully:
-mkdir -pv /usr/lib/locale
-localedef -i cs_CZ -f UTF-8 cs_CZ.UTF-8
-localedef -i de_DE -f ISO-8859-1 de_DE
-localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
-localedef -i de_DE -f UTF-8 de_DE.UTF-8
-localedef -i en_HK -f ISO-8859-1 en_HK
-localedef -i en_PH -f ISO-8859-1 en_PH
-localedef -i en_US -f ISO-8859-1 en_US
-localedef -i en_US -f UTF-8 en_US.UTF-8
-localedef -i es_MX -f ISO-8859-1 es_MX
-localedef -i fa_IR -f UTF-8 fa_IR
-localedef -i fr_FR -f ISO-8859-1 fr_FR
-localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
-localedef -i fr_FR -f UTF-8 fr_FR.UTF-8
-localedef -i it_IT -f ISO-8859-1 it_IT
-localedef -i ja_JP -f EUC-JP ja_JP
-localedef -i tr_TR -f UTF-8 tr_TR.UTF-8
-localedef -i zh_CN -f GB18030 zh_CN.GB18030
-
-# French canadian locales:
-localedef -i ca_FR -f UTF-8 ca_FR.UTF-8
-localedef -i ca_FR -f ISO-8859-1 ca_FR
-localedef -i fr_CA -f UTF-8 fr_CA.UTF-8
-localedef -i fr_CA -f ISO-8859-1 fr_CA
-
-cat > /etc/nsswitch.conf << "EOF"
-# /etc/nsswitch.conf
-
-passwd: files
-group: files
-shadow: files
-
-hosts: files dns
-networks: files
-
-protocols: files
-services: files
-ethers: files
-rpc: files
-EOF
-
-ln -svfT ${TIMEZONE} /usr/share/zoneinfo/localtime
-cp --remove-destination /usr/share/zoneinfo/${TIMEZONE} /etc/localtime
-
-cat > /etc/ld.so.conf << "EOF"
-# /etc/ld.so.conf
-/usr/local/lib
-/opt/lib
-EOF
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}-build
-../${1}/configure \
- --prefix=/usr
-make -j ${MAKEJOBS}
-make install
-
-ln -sfv libfl.a /usr/lib/libl.a
-
-# Create a bash script called lex that calls flex and have it emulate lex.
-cat > /usr/bin/lex << "EOF"
-#!/bin/sh
-# /usr/bin/lex
-
-exec /usr/bin/flex -l "$@"
-EOF
-chmod -v 755 /usr/bin/lex
-
-# Return last error
-exit ${?}
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Manually applying patches
-apply_patch ${PACKAGE}-branch_update-1.patch ${PACKAGE}
-
-case "${HVL_TARGET}" in
- "x86_64")
- # Apply the following patch so that GCC links to /lib instead of /lib64:
- apply_patch ${PACKAGE}-pure64-1.patch ${PACKAGE}
- ;;
-esac
-
-cd ${LFS_TMP}/${PACKAGE}
-
-# Applying a sed substitution that will suppress the installation of
-# libiberty.a. We want to use the Binutils version of libiberty.a
-sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in
-
-cd ${LFS_TMP}/${PACKAGE}-build
-../${PACKAGE}/configure \
- --prefix=/usr \
- --sysconfdir=/etc \
- ${CONFIGURE_OPTS}
-make
-make install
-ldconfig
-
-ln -svf ../usr/bin/cpp /lib
-ln -svf gcc /usr/bin/cc
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-# iana-etc installs /etc/services and /etc/protocols using data from the
-# Internet Assigned Numbers Authority.
-
-cd ${LFS_TMP}/${1}
-make -j ${MAKEJOBS}
-make install
-
-# Return last error
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}
-
-# The arpd binary included in this package is dependent on Berkeley DB.
-# Because arpd is not a very common requirement on a base Linux system,
-# remove the dependency on Berkeley DB by applying the sed command below
-sed -i '/^TARGETS/s@arpd@@g' misc/Makefile
-
-make DESTDIR= DOCDIR=/usr/share/doc/iproute2 \
- MANDIR=/usr/share/man
-
-make DESTDIR= DOCDIR=/usr/share/doc/iproute2 \
- MANDIR=/usr/share/man install
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-# The kernel sources were already copied into /usr/src in stage0
-cd /usr/src/${PACKAGE}
-make mrproper
-make headers_check
-# Remove any previous headers install
-rm -rf dest
-make INSTALL_HDR_PATH=dest headers_install
-cp -rv dest/include/* /usr/include
-find /usr/include -name .install -or -name ..install.cmd | xargs rm -fv
-rm -rf dest
-
-# Install HV kernel compilation script:
-VERSION=$(get_pkg_ver ${PACKAGE})
-SCRIPT=/usr/src/compile-kernel
-
-echo "#!/bin/bash" > ${SCRIPT}
-echo "set -o errexit" >> ${SCRIPT}
-echo "KERNEL_VERSION=${VERSION}" >> ${SCRIPT}
-echo "KERNEL_NAME=clfs-\${KERNEL_VERSION}" >> ${SCRIPT}
-echo "DEST=/boot" >> ${SCRIPT}
-echo "ARCH=${HVL_TARGET}" >> ${SCRIPT}
-echo "unset CROSS_COMPILE" >> ${SCRIPT}
-echo "" >> ${SCRIPT}
-echo "make" >> ${SCRIPT}
-echo "make modules" >> ${SCRIPT}
-echo "make modules_install" >> ${SCRIPT}
-echo "cp -v arch/${HVL_TARGET}/boot/bzImage \${DEST}/vmlinuz-\${KERNEL_NAME}" >> ${SCRIPT}
-echo "cp -v System.map \${DEST}/System.map-\${KERNEL_NAME}" >> ${SCRIPT}
-echo "cp -v .config \${DEST}/config-\${KERNEL_NAME}" >> ${SCRIPT}
-
-chmod -v u+x ${SCRIPT}
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}
-make install
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}-build
-../${1}/configure \
- --prefix=/usr \
- --with-shared \
- --without-debug \
- --enable-widec
-make -j ${MAKEJOBS}
-make install
-
-# Move the libraries to the /lib directory, where they are expected to reside:
-mv -fv /usr/lib/libncursesw.so.5* /lib
-
-# Because the libraries have been moved, one symlink points to a non-existent file:
-ln -sfvT ../../lib/libncursesw.so.5 /usr/lib/libncursesw.so
-
-# Many applications still expect the linker to be able to find
-# non-wide-character Ncurses libraries. Trick such applications
-# into linking with wide-character libraries by means of symlinks
-# and linker scripts:
-for lib in ncurses form panel menu ; do
- rm -vf /usr/lib/lib${lib}.so
- echo "INPUT(-l${lib}w)" >/usr/lib/lib${lib}.so
- ln -sfvT lib${lib}w.a /usr/lib/lib${lib}.a
-done
-ln -sfvT libncurses++w.a /usr/lib/libncurses++.a
-
-# Finally, make sure that old applications that look for
-# -lcurses at build time are still buildable:
-rm -vf /usr/lib/libcursesw.so
-echo "INPUT(-lncursesw)" >/usr/lib/libcursesw.so
-ln -sfv libncurses.so /usr/lib/libcurses.so
-ln -sfv libncursesw.a /usr/lib/libcursesw.a
-ln -sfv libncurses.a /usr/lib/libcurses.a
-
-ldconfig
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}
-
-# Change a hardcoded path from /usr/include to /tools/include:
-sed -i 's@/usr/include@/tools/include@g' ext/Errno/Errno_pm.PL
-
-./configure.gnu \
- --prefix=/tools \
- -Dcc="gcc" \
- ${CONFIGURE_OPTS}
-make
-make install
-ldconfig
-
-ln -svfT /tools/bin/perl /usr/bin/perl
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}-build
-../${1}/configure \
- --prefix=/usr
-make -j ${MAKEJOBS}
-make install
-
-var_add_path "PKG_CONFIG_PATH" /etc/profile "/usr/local/lib/pkgconfig"
-var_export "PKG_CONFIG_PATH" /etc/profile
-
-# Return last error
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}
-make -j ${MAKEJOBS}
-make install
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}
-
-# Reinstalling Readline will cause the old libraries to be moved to
-# <libraryname>.old. While this is normally not a problem, in some
-# cases it can trigger a linking bug in ldconfig. This can be
-# avoided by issuing the following two seds:
-sed -i '/MV.*old/d' Makefile.in
-sed -i '/{OLDSUFF}/c:' support/shlib-install
-
-cd ${LFS_TMP}/${1}-build
-../${1}/configure \
- --prefix=/usr \
- --libdir=/lib
-# SHLIB_LIBS=-lncurses: Forces Readline to link against the libncurses library.
-make SHLIB_LIBS=-lncurses
-make install
-# Now move the static libraries to a more appropriate location:
-mv -v /lib/lib{readline,history}.a /usr/lib
-
-# Next, remove the .so files in /lib and relink them into /usr/lib:
-rm -v /lib/lib{readline,history}.so
-ln -sfv ../../lib/libreadline.so.6 /usr/lib/libreadline.so
-ln -sfv ../../lib/libhistory.so.6 /usr/lib/libhistory.so
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}
-
-# The FHS recommends that we use /var/lib/hwclock, instead of the usual
-# /etc, as the location for the adjtime file. To make the hwclock program
-# FHS-compliant, run the following:
-sed -e 's@etc/adjtime@var/lib/hwclock/adjtime@g' -i $(grep -rl '/etc/adjtime' .)
-mkdir -pv /var/lib/hwclock
-
-./configure --enable-arch --enable-partx --enable-write
-
-make -j ${MAKEJOBS}
-make install
-
-# Move the logger binary to /bin as it is needed by the CLFS-Bootscripts package:
-mv -v /usr/bin/logger /bin
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}
-./configure \
- --prefix=/usr \
- ${CONFIGURE_OPTS}
-make
-make install
-ldconfig
-
-# The previous command installed two .so files into /usr/lib.
-# We will move it into /lib and then relink it to /usr/lib:
-mv -v /usr/lib/libz.so.* /lib
-ln -svf ../../lib/libz.so.1 /usr/lib/libz.so
-
-# Fix the permissions on the static library:
-chmod 644 /usr/lib/libz.a
-
-exit $?
# Scripts directory
export SCRDIR=$(pwd)
-ipkg_ac ${LIBTOOL}
ipkg_cust ${GDBM} cis-gdbm
ipkg_cust ${INETUTILS} cis-inetutils \
--libexecdir=/usr/sbin \
--disable-syslogd \
--disable-whois \
--disable-servers
-ipkg_cust ${PERL} cis-perl-pass2
-ipkg_ac ${AUTOCONF}
-ipkg_ac ${AUTOMAKE}
ipkg_cust ${BZIP2} cis-bzip2
ipkg_cust ${DIFFUTILS} cis-diffutils
ipkg_ac ${FILE_PKG}
ipkg_ac ${GAWK} "--libexecdir=/usr/lib"
ipkg_cust ${FINDUTILS} cis-findutils
-ipkg_cust ${FLEX} cis-flex
ipkg_ac ${GETTEXT}
+ipkg_ac ${GREP} "--bindir=/bin --without-included-regex"
ipkg_cust ${GROFF} cis-groff
ipkg_cust ${GZIP} cis-gzip
-ipkg_cust ${IPROUTE2} cis-iproute2
+
ipkg_cust ${KBD} cis-kbd
ipkg_ac ${LESS}
ipkg_ac ${MAKE_PACKAGE}
lpkg 0 ${EGLIBC}
lpkg 0 ${GMP}
lpkg 0 ${MPFR}
+lpkg 0 ${MPC}
lpkg 0 ${PPL}
lpkg 0 ${CLOOG_PPL}
lpkg 0 ${BINUTILS}
lpkg 1 ${XZ_UTILS}
# These packages are only for stage2
-fpkg ${PERL} http://ftp.funet.fi/pub/CPAN/src
+fpkg -e tar.gz ${PERL} http://www.cpan.org/src/5.0
fpkg ${MANPAGES} http://www.kernel.org/pub/linux/docs/manpages
fpkg ${PKG_CONFIG} http://pkgconfig.freedesktop.org/releases
fpkg ${IANA} http://www.sethwklein.net/projects/iana-etc/downloads
--- /dev/null
+#!/bin/bash
+
+CC="gcc -isystem /usr/include"
+LDFLAGS="-Wl,-rpath-link,/lib"
+
+CONFIGURE_OPTS="\
+ --libdir=/usr/lib \
+ --enable-shared \
+ --disable-multilib \
+ ${CONFIGURE_OPTS}"
+
+hvconfig_pre()
+{
+ case "${HVL_TARGET}" in
+ "x86_64")
+ # Libiberty uses gcc -print-multi-os-directory to determine where to
+ # install libiberty.a. Because our temporary GCC is still
+ # multilib-aware, the command returns ../lib64 which causes the archive
+ # to be installed into /usr/lib64. The following sed will prevent this:
+ sed -i 's%\(^MULTIOSDIR = \).*%\1 ../lib%' \
+ ${LFS_TMP}/${PACKAGE}/libiberty/Makefile.in
+
+ # This adds 64 bit support to Binutils.
+ CONFIGURE_OPTS="${CONFIGURE_OPTS} --enable-64-bit-bfd"
+ ;;
+ esac
+}
+
+hvbuild()
+{
+ make configure-host
+ make tooldir=/usr
+ make tooldir=/usr install
+}
+
+hvbuild_post()
+{
+ # Install the libiberty header file that is needed by some packages:
+ cp -v ../${PACKAGE}/include/libiberty.h /usr/include
+}
--- /dev/null
+#!/bin/bash
+
+hvconfig_post()
+{
+ # The configure system causes bison to be built without support for
+ # internationalization of error messages if a bison program is not
+ # already in $PATH. The following addition will correct this:
+ echo '#define YYENABLE_NLS 1' >> config.h
+}
--- /dev/null
+#!/bin/bash
+
+CONFIGURE_OPTS="\
+ --enable-no-install-program=kill,uptime \
+ ${CONFIGURE_OPTS}"
+
+hvbuild_post()
+{
+ # Move some programs to their proper FHS locations:
+ mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin
+ mv -v /usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm} /bin
+
+ # Now specify new path to mv to eliminate error message:
+ # "/usr/bin/mv: No such file or directory"
+ /bin/mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin
+ /bin/mv -v /usr/bin/chroot /usr/sbin
+
+ # Some of the scripts in the LFS-Bootscripts package depend on head
+ # sleep and nice. As /usr may not be available during the early stages
+ # of booting, those binaries need to be on the root partition:
+ /bin/mv -v /usr/bin/{head,sleep,nice} /bin
+}
--- /dev/null
+#!/bin/bash
+
+PKG_CONFIG=true
+
+CONFIGURE_OPTS="\
+ --with-root-prefix="" \
+ --enable-elf-shlibs \
+ --disable-libblkid \
+ --disable-libuuid \
+ --disable-fsck \
+ --disable-uuidd \
+ ${CONFIGURE_OPTS}"
+
+hvbuild_post()
+{
+ # Install the static libraries and headers:
+ make install-libs
+
+ # Make the installed static libraries writable so debugging symbols can be removed later:
+ chmod -v u+w /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a
+}
--- /dev/null
+#!/bin/bash
+
+hvconfig_pre()
+{
+ CFLAGS="-mtune=generic -g -O2"
+
+ CONFIGURE_OPTS="\
+ --disable-profile \
+ --enable-add-ons \
+ --enable-kernel=$(get_pkg_ver ${KERNEL}) \
+ --libexecdir=/usr/lib/eglibc \
+ ${CONFIGURE_OPTS}"
+
+ case "${HVL_TARGET}" in
+ "x86")
+ CFLAGS="-march=$(cut -d- -f1 <<< ${CLFS_TARGET}) ${CFLAGS}"
+ ;;
+ esac
+
+ # When running make install, a script called test-installation.pl performs a
+ # small sanity test on our newly installed Glibc. However, because our
+ # toolchain still points to the /tools directory, the sanity test would be
+ # carried out against the wrong Glibc. We can force the script to check the
+ # Glibc we have just installed with:
+ cd ${LFS_TMP}/${PACKAGE}
+ LINKER=$(readelf -l $(file /tools/lib/libc-* | cut -f1 -d:) | sed -n 's@.*interpret.*/tools\(.*\)]$@\1@p')
+ sed -i "s|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=${LINKER} -o|" \
+ scripts/test-installation.pl
+ unset LINKER
+
+ cd ${LFS_TMP}/${PACKAGE}-build
+
+ case "${HVL_TARGET}" in
+ "x86_64")
+ # Tell EGLIBC to install its libraries into /lib:
+ echo "slibdir=/lib" >> configparms
+ CONFIGURE_OPTS="${CONFIGURE_OPTS} --libdir=/usr/lib"
+ ;;
+ esac
+}
+
+hvbuild()
+{
+ make
+ touch /etc/ld.so.conf
+
+ case "${HVL_TARGET}" in
+ "x86_64")
+ # The install will finish by checking that everything is correctly
+ # installed. Unfortunately, it will test for a multilib installation.
+ # On x86_64 Pure64 this means it will try to test the non-existent
+ # 32-bit loader which has a different name from the 64-bit loader
+ # (unlike on other 64-bit architectures). We fool it by creating a
+ # symlink to the real loader.
+ EGLIBC_VER_BASE=$(echo ${PACKAGE} | sed "s!eglibc-\([^-]*\)-.*!\1!g")
+ ln -svfT ld-${EGLIBC_VER_BASE}.so /lib/ld-linux.so.2
+ make install
+
+ # Now we can remove this symlink.
+ rm -v /lib/ld-linux.so.2
+
+ # We also need to correct the /usr/bin/ldd script - if you look at this,
+ # you will see it references not only the 32-bit linker, but also /lib64
+ # where it thinks the 64-bit linker is.
+ cp -v /usr/bin/ldd{,.bak}
+ sed '/RTLDLIST/s%/ld-linux.so.2 /lib64%%' /usr/bin/ldd.bak >/usr/bin/ldd
+ rm -v /usr/bin/ldd.bak
+ ;;
+ *)
+ make install
+ ;;
+ esac
+
+ # The following instructions, instead of the install-locales target
+ # above, will install the minimum set of locales necessary for the
+ # tests to run successfully:
+ mkdir -pv /usr/lib/locale
+ localedef -i cs_CZ -f UTF-8 cs_CZ.UTF-8
+ localedef -i de_DE -f ISO-8859-1 de_DE
+ localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
+ localedef -i de_DE -f UTF-8 de_DE.UTF-8
+ localedef -i en_HK -f ISO-8859-1 en_HK
+ localedef -i en_PH -f ISO-8859-1 en_PH
+ localedef -i en_US -f ISO-8859-1 en_US
+ localedef -i en_US -f UTF-8 en_US.UTF-8
+ localedef -i es_MX -f ISO-8859-1 es_MX
+ localedef -i fa_IR -f UTF-8 fa_IR
+ localedef -i fr_FR -f ISO-8859-1 fr_FR
+ localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
+ localedef -i fr_FR -f UTF-8 fr_FR.UTF-8
+ localedef -i it_IT -f ISO-8859-1 it_IT
+ localedef -i ja_JP -f EUC-JP ja_JP
+ localedef -i tr_TR -f UTF-8 tr_TR.UTF-8
+ localedef -i zh_CN -f GB18030 zh_CN.GB18030
+
+ # French canadian locales:
+ localedef -i ca_FR -f UTF-8 ca_FR.UTF-8
+ localedef -i ca_FR -f ISO-8859-1 ca_FR
+ localedef -i fr_CA -f UTF-8 fr_CA.UTF-8
+ localedef -i fr_CA -f ISO-8859-1 fr_CA
+
+ cat > /etc/nsswitch.conf << "EOF"
+# /etc/nsswitch.conf
+
+passwd: files
+group: files
+shadow: files
+
+hosts: files dns
+networks: files
+
+protocols: files
+services: files
+ethers: files
+rpc: files
+EOF
+
+ ln -svfT ${TIMEZONE} /usr/share/zoneinfo/localtime
+ cp --remove-destination /usr/share/zoneinfo/${TIMEZONE} /etc/localtime
+
+ cat > /etc/ld.so.conf << "EOF"
+# /etc/ld.so.conf
+/usr/local/lib
+/opt/lib
+EOF
+}
--- /dev/null
+#!/bin/bash
+
+hvbuild_post()
+{
+ ln -sfv libfl.a /usr/lib/libl.a
+
+ # Create a bash script called lex that calls flex and have it emulate lex.
+ cat > /usr/bin/lex << "EOF"
+#!/bin/sh
+# /usr/bin/lex
+
+exec /usr/bin/flex -l "$@"
+EOF
+ chmod -v 755 /usr/bin/lex
+}
--- /dev/null
+#!/bin/bash
+
+CC="gcc -Wl,-rpath-link,/lib -isystem /usr/include"
+CXX="g++ -Wl,-rpath-link,/lib -isystem /usr/include"
+
+CONFIGURE_OPTS="\
+ --libexecdir=/usr/lib \
+ --enable-shared \
+ --enable-threads=posix \
+ --enable-__cxa_atexit \
+ --enable-c99 \
+ --enable-long-long \
+ --enable-clocale=gnu \
+ --enable-languages=c,c++ \
+ --disable-multilib \
+ --disable-libstdcxx-pch \
+ ${CONFIGURE_OPTS}"
+
+hvpatch()
+{
+ # Manually applying patches if specified
+ if [ -n "${GCC_PATCHES}" ]; then
+ for p in ${GCC_PATCHES}; do
+ apply_patch ${PACKAGE}-${p}.patch ${PACKAGE}
+ done
+ fi
+
+ case "${HVL_TARGET}" in
+ "x86_64")
+ # Apply the following patch so that GCC links to /lib instead of /lib64:
+ apply_patch ${PACKAGE}-pure64-2.patch ${PACKAGE}
+ ;;
+ esac
+}
+
+hvconfig_pre()
+{
+ # Applying a sed substitution that will suppress the installation of
+ # libiberty.a. We want to use the Binutils version of libiberty.a
+ sed -i 's/install_to_$(INSTALL_DEST) //' ${LFS_TMP}/${PACKAGE}/libiberty/Makefile.in
+}
+
+hvbuild_post()
+{
+ ln -svf ../usr/bin/cpp /lib
+ ln -svf gcc /usr/bin/cc
+}
--- /dev/null
+#!/bin/bash
+
+HV_NO_CONFIGURE_SCRIPT=1
+
+hvbuild()
+{
+ # The arpd binary included in this package is dependent on Berkeley DB.
+ # Because arpd is not a very common requirement on a base Linux system,
+ # remove the dependency on Berkeley DB by applying the sed command below
+ sed -i '/^TARGETS/s@arpd@@g' ${LFS_TMP}/${PACKAGE}/misc/Makefile
+
+ make DESTDIR= DOCDIR=/usr/share/doc/iproute2 \
+ MANDIR=/usr/share/man
+
+ make DESTDIR= DOCDIR=/usr/share/doc/iproute2 \
+ MANDIR=/usr/share/man install
+}
--- /dev/null
+#!/bin/bash
+
+HV_NO_CONFIGURE_SCRIPT=1
+
+hvbuild()
+{
+ # The kernel sources were already copied into /usr/src in stage0
+ cd /usr/src/${PACKAGE}
+ make mrproper
+ make headers_check
+
+ # Remove any previous headers install
+ rm -rf dest
+ make INSTALL_HDR_PATH=dest headers_install
+ cp -rv dest/include/* /usr/include
+ find /usr/include -name .install -or -name ..install.cmd | xargs rm -fv
+ rm -rf dest
+
+ # Install HV kernel compilation script:
+ VERSION=$(get_pkg_ver ${PACKAGE})
+ SCRIPT=/usr/src/compile-kernel
+
+ echo "#!/bin/bash" > ${SCRIPT}
+ echo "set -o errexit" >> ${SCRIPT}
+ echo "KERNEL_VERSION=${VERSION}" >> ${SCRIPT}
+ echo "KERNEL_NAME=clfs-\${KERNEL_VERSION}" >> ${SCRIPT}
+ echo "DEST=/boot" >> ${SCRIPT}
+ echo "ARCH=${HVL_TARGET}" >> ${SCRIPT}
+ echo "unset CROSS_COMPILE" >> ${SCRIPT}
+ echo "" >> ${SCRIPT}
+ echo "make" >> ${SCRIPT}
+ echo "make modules" >> ${SCRIPT}
+ echo "make modules_install" >> ${SCRIPT}
+ echo "cp -v arch/${HVL_TARGET}/boot/bzImage \${DEST}/vmlinuz-\${KERNEL_NAME}" >> ${SCRIPT}
+ echo "cp -v System.map \${DEST}/System.map-\${KERNEL_NAME}" >> ${SCRIPT}
+ echo "cp -v .config \${DEST}/config-\${KERNEL_NAME}" >> ${SCRIPT}
+
+ chmod -v u+x ${SCRIPT}
+}
--- /dev/null
+#!/bin/bash
+
+HV_NO_CONFIGURE_SCRIPT=1
+
+hvbuild()
+{
+ cd ${LFS_TMP}/${PACKAGE}
+ make install
+}
--- /dev/null
+#!/bin/bash
+
+CONFIGURE_OPTS="\
+ --libdir=/lib \
+ --with-shared \
+ --without-debug \
+ --enable-widec \
+ --with-manpage-format=normal \
+ ${CONFIGURE_OPTS}"
+
+hvbuild_post()
+{
+ # Move the Ncurses static libraries to the proper location:
+ mv -v /lib/lib{panelw,menuw,formw,ncursesw,ncurses++w}.a /usr/lib
+
+ # Create symlinks in /usr/lib:
+ rm -v /lib/lib{ncursesw,menuw,panelw,formw}.so
+ ln -svfT ../../lib/libncursesw.so.5 /usr/lib/libncursesw.so
+ ln -svfT ../../lib/libmenuw.so.5 /usr/lib/libmenuw.so
+ ln -svfT ../../lib/libpanelw.so.5 /usr/lib/libpanelw.so
+ ln -svfT ../../lib/libformw.so.5 /usr/lib/libformw.so
+
+ # Make our Ncurses compatible for older and non-widec compatible programs can build properly.
+ # Many applications still expect the linker to be able to find
+ # non-wide-character Ncurses libraries. Trick such applications
+ # into linking with wide-character libraries by means of symlinks
+ # and linker scripts:
+ for lib in curses ncurses form panel menu ; do
+ rm -vf /usr/lib/lib${lib}.so
+ echo "INPUT(-l${lib}w)" > /usr/lib/lib${lib}.so
+ ln -sfvT lib${lib}w.a /usr/lib/lib${lib}.a
+ done
+ ln -sfvT libncursesw.so /usr/lib/libcursesw.so
+ ln -sfvT libncursesw.a /usr/lib/libcursesw.a
+ ln -sfvT libncurses++w.a /usr/lib/libncurses++.a
+ ln -sfvT ncursesw5-config /usr/bin/ncurses5-config
+
+ # Create a symlink for /usr/share/terminfo in /usr/lib for compatibility:
+ ln -sfvT ../share/terminfo /usr/lib/terminfo
+}
--- /dev/null
+#!/bin/bash
+
+hvconfig_pre()
+{
+ # Change a hardcoded path from /usr/include to /tools/include:
+ sed -i 's@/usr/include@/tools/include@g' ${LFS_TMP}/${PACKAGE}/ext/Errno/Errno_pm.PL
+}
+
+hvconfig()
+{
+ cd ${LFS_TMP}/${PACKAGE}
+
+ ./configure.gnu \
+ --prefix=/tools \
+ -Dcc="gcc"
+}
+
+hvbuild_post()
+{
+ ln -svfT /tools/bin/perl /usr/bin/perl
+}
--- /dev/null
+#!/bin/bash
+
+hvbuild_post()
+{
+ var_add_path "PKG_CONFIG_PATH" /etc/profile "/usr/local/lib/pkgconfig"
+ var_export "PKG_CONFIG_PATH" /etc/profile
+}
--- /dev/null
+#!/bin/bash
+
+hvconfig_pre()
+{
+ # The following fixes an issue with Make 3.82:
+ sed -i -r '/^-include/s/\*(.*)/proc\1 ps\1/' ${LFS_TMP}/${PACKAGE}/Makefile
+}
--- /dev/null
+#!/bin/bash
+
+CONFIGURE_OPTS="\
+ --libdir=/lib
+ ${CONFIGURE_OPTS}"
+
+hvconfig_pre()
+{
+ cd ${LFS_TMP}/${PACKAGE}
+
+ # Reinstalling Readline will cause the old libraries to be moved to
+ # <libraryname>.old. While this is normally not a problem, in some
+ # cases it can trigger a linking bug in ldconfig. This can be
+ # avoided by issuing the following two seds:
+ sed -i '/MV.*old/d' Makefile.in
+ sed -i '/{OLDSUFF}/c:' support/shlib-install
+}
+
+hvbuild()
+{
+ # SHLIB_LIBS=-lncurses: Forces Readline to link against the libncurses library.
+ make SHLIB_LIBS=-lncurses
+ make install
+}
+
+hvbuild_post()
+{
+ # Now move the static libraries to a more appropriate location:
+ mv -v /lib/lib{readline,history}.a /usr/lib
+
+ # Next, remove the .so files in /lib and relink them into /usr/lib:
+ rm -v /lib/lib{readline,history}.so
+ ln -sfv ../../lib/libreadline.so.6 /usr/lib/libreadline.so
+ ln -sfv ../../lib/libhistory.so.6 /usr/lib/libhistory.so
+}
--- /dev/null
+#!/bin/bash
+
+hvconfig_pre()
+{
+ # The FHS recommends that we use /var/lib/hwclock, instead of the usual
+ # /etc, as the location for the adjtime file. To make the hwclock program
+ # FHS-compliant, run the following:
+ sed -e 's@etc/adjtime@var/lib/hwclock/adjtime@g' -i $(grep -rl '/etc/adjtime' .)
+ mkdir -pv /var/lib/hwclock
+}
+
+hvconfig()
+{
+ cd ${LFS_TMP}/${PACKAGE}
+
+ ./configure \
+ --enable-arch \
+ --enable-partx \
+ --enable-write \
+ --disable-wall
+}
+
+hvbuild_post()
+{
+ # Move the logger binary to /bin as it is needed by the CLFS-Bootscripts package:
+ mv -v /usr/bin/logger /bin
+}
--- /dev/null
+#!/bin/bash
+
+CC="gcc -isystem /usr/include"
+CXX="g++ -isystem /usr/include"
+LDFLAGS="-Wl,-rpath-link,/lib"
+
+CONFIGURE_OPTS="\
+ --shared \
+ ${CONFIGURE_OPTS}"
+
+hvconfig()
+{
+ cd ${LFS_TMP}/${PACKAGE}
+ ./configure ${CONFIGURE_OPTS}
+}
+
+hvbuild_post()
+{
+ # The previous command installed two .so files into /usr/lib.
+ # We will move it into /lib and then relink it to /usr/lib:
+ mv -v /usr/lib/libz.so.* /lib
+ ln -svf ../../lib/libz.so.1 /usr/lib/libz.so
+
+ # Fix the permissions on the static library:
+ chmod 644 /usr/lib/libz.a
+}
# Scripts directory
export SCRDIR=$(pwd)
-ipkg ${PERL} cis-perl-pass1 "${PERL}-pass1"
-ipkg_cust ${KERNEL} cis-kernel
-ipkg_cust ${MANPAGES} cis-man-pages
-ipkg_cust ${EGLIBC} cis-eglibc
+PERL_PASS1="1" ipkg ${PERL} cis-ac "${PERL}-pass1"
+ipkg_ac ${KERNEL}
+ipkg_ac ${MANPAGES}
+ipkg_ac ${EGLIBC}
rscr once "Adjusting toolchain" cis-toolchain-adjust
rscr mult "Testing toolchain" cis-toolchain-test
CPPFLAGS=-fexceptions CC="gcc -isystem /usr/include" \
CXX="g++ -isystem /usr/include" LDFLAGS="-Wl,-rpath-link,/lib" \
- ipkg_ac ${GMP} "--enable-cxx --enable-mpbsd"
+ ipkg_ac ${GMP} "--enable-cxx --enable-mpbsd"
CC="gcc -isystem /usr/include" LDFLAGS="-Wl,-rpath-link,/lib" \
- ipkg_ac ${MPFR} "--enable-shared --with-gmp=/usr"
+ ipkg_ac ${MPFR} "--enable-shared --with-gmp=/usr"
+
+CC="gcc -isystem /usr/include" LDFLAGS="-Wl,-rpath-link,/lib" \
+ ipkg_ac ${MPC}
CPPFLAGS=-fexceptions CC="gcc -isystem /usr/include" \
CXX="g++ -isystem /usr/include" \
LDFLAGS="-Wl,-rpath-link,/lib" \
- ipkg_ac ${PPL} "--enable-shared --disable-optimization"
+ ipkg_ac ${PPL} "--enable-shared --disable-optimization"
CC="gcc -isystem /usr/include" LDFLAGS="-Wl,-rpath-link,/lib" \
- ipkg_ac ${CLOOG_PPL} "--enable-shared --with-gmp --with-ppl"
-
-CC="gcc -isystem /usr/include" CXX="g++ -isystem /usr/include" \
- LDFLAGS="-Wl,-rpath-link,/lib" \
- ipkg_cust ${ZLIB} cis-zlib "--shared"
-
-CC="gcc -isystem /usr/include" \
- LDFLAGS="-Wl,-rpath-link,/lib" \
- ipkg_cust ${BINUTILS} cis-binutils \
- --libdir=/usr/lib \
- --enable-shared \
- --disable-multilib
-
-CC="gcc -Wl,-rpath-link,/lib -isystem /usr/include" \
- CXX="g++ -Wl,-rpath-link,/lib -isystem /usr/include" \
- ipkg_cust ${GCC} cis-gcc \
- --libexecdir=/usr/lib \
- --enable-shared \
- --enable-threads=posix \
- --enable-__cxa_atexit \
- --enable-c99 \
- --enable-long-long \
- --enable-clocale=gnu \
- --enable-languages=c,c++ \
- --disable-multilib \
- --disable-libstdcxx-pch
+ ipkg_ac ${CLOOG_PPL} "--enable-shared --with-gmp --with-ppl"
+ipkg_ac ${ZLIB}
+ipkg_ac ${BINUTILS}
+ipkg_ac ${GCC}
rscr mult "Testing toolchain" cis-toolchain-test
-ipkg_ac ${SED} "--bindir=/bin"
-ipkg_cust ${PKG_CONFIG} cis-pkg-config
-ipkg_cust ${NCURSES} cis-ncurses
-ipkg_cust ${UTIL_LINUX_NG} cis-util-linux-ng
-ipkg_cust ${E2FSPROGS} cis-e2fsprogs
-ipkg_cust ${COREUTILS} cis-coreutils
-ipkg_cust ${IANA} cis-iana
-ipkg_ac ${MFOUR}
-ipkg_cust ${BISON} cis-bison
-ipkg_cust ${PROCPS} cis-procps
-ipkg_ac ${GREP} "--bindir=/bin --without-included-regex"
-ipkg_cust ${READLINE} cis-readline
-ipkg_ac ${BASH} "--bindir=/bin --without-bash-malloc --with-installed-readline"
+ipkg_ac ${SED} "--bindir=/bin"
+ipkg_ac ${PKG_CONFIG}
+ipkg_ac ${NCURSES}
+ipkg_ac ${UTIL_LINUX_NG}
+ipkg_ac ${E2FSPROGS}
+ipkg_ac ${COREUTILS}
+HV_NO_CONFIGURE_SCRIPT=1 ipkg_ac ${IANA}
+ipkg_ac ${MFOUR}
+ipkg_ac ${BISON}
+ipkg_ac ${PROCPS}
+ipkg_ac ${LIBTOOL}
+ipkg_ac ${FLEX}
+ipkg_ac ${IPROUTE2}
+PERL_PASS2="1" ipkg ${PERL} cis-ac "${PERL}-pass2"
+ipkg_ac ${READLINE}
+ipkg_ac ${AUTOCONF}
+ipkg_ac ${AUTOMAKE}
+ipkg_ac ${BASH} "--bindir=/bin --without-bash-malloc --with-installed-readline"
/bin/bash +h -c ./install-2