}
# Installation of a package
-#
-# First argument: Real package name
-# Second argument: Installation script name
-# Third argument: Unique identification label in 'install.log'
+# Arg. #1: Package name and version (ex: gcc-4.5.1)
# Remaining arguments: Additional configure options
+# Options:
+# -h Display this help and returns
+# -l Unique identification label in 'install.log'
+# (default is package name and version)
+# -m Installation mode:
+# ac Standard autoconf package, build in separate dir
+# acnb Standard autoconf package, building in source dir
+# nb No autoconf (configure)
+# gnome
+# xorg
+# pm
+# -s Name of script to execute (default is ipkg.sh)
ipkg()
{
START_TIME=$(echo `date +%s`)
+
+ export IPKG_MODE="ac"
+ export HVLABEL="" # Global variable
+ local SCRIPT=./ipkg.sh
+
+ while getopts "hl:m:" flag ;do
+ case ${flag} in
+ l)
+ # Alternate label
+ HVLABEL=${OPTARG}
+ ;;
+ m)
+ # Installation mode
+ case ${OPTARG} in
+ ac|acnb|noac|gnome|xorg|pm)
+ IPKG_MODE=${OPTARG}
+ ;;
+ *)
+ echo "${FUNCNAME}(): Unsupported mode: ${OPTARG}."
+ return 1
+ ;;
+ esac
+ ;;
+ s)
+ # Alternate script name
+ SCRIPT=${OPTARG}
+ ;;
+ ?)
+ echo "${FUNCNAME}(): Invalid option: ${OPTARG}."
+ return 1
+ ;;
+ esac
+ done
+ shift `expr "${OPTIND}" - 1`
+
+ unset OPTSTRING
+ unset OPTIND
+ unset OPTARG
+
local PACKAGE_NAME=${1}
- local SCRIPT=./${2}
- local LABEL=${3}
-
+
# Checking for correct number of arguments
- if [ $# -lt 3 ]; then
+ if [ $# -lt 1 ]; then
echo
echo "${FUNCNAME}(): Missing argument"
echo " command was: \"${FUNCNAME}() $*\""
exit ${EXIT_FAILURE}
fi
- shift
- shift
shift
local CONFIGURE_OPTS=${*}
+ if [ -z "${HVLABEL}" ]; then
+ # Default label = package name and version
+ HVLABEL=${PACKAGE_NAME}
+ fi
+
# Checking if script is valid and executable
if [ ! -x ${SCRIPT} ]; then
echo
- echo "${FUNCNAME}(): script not found: ${SCRIPT}"
+ echo "${FUNCNAME}(): cannot execute script: ${SCRIPT}"
exit ${EXIT_FAILURE}
fi
- PACKAGE_LOG=${LFS_LOG_DIR}/${LABEL}.log
+ PACKAGE_LOG=${LFS_LOG_DIR}/${HVLABEL}.log
# Checking if package was previously successfully installed
- if grep "^${LABEL} successfully installed" ${LFS_LOG_FILE} \
+ if grep "^${HVLABEL} successfully installed" ${LFS_LOG_FILE} \
1> /dev/null 2>&1; then
return $EXIT_SUCCESS
fi
# Displaying label
- MSGSTRING="Installing ${LABEL}"
+ MSGSTRING="Installing ${HVLABEL}"
display_checkbox_msg ${MSGSTRING}
echo "------------------------" 1>> ${LFS_LOG_FILE}
fi
# Writing success string to the end of the log file
- echo "${LABEL} successfully installed" 1>> ${LFS_LOG_FILE}
+ echo "${HVLABEL} successfully installed" 1>> ${LFS_LOG_FILE}
# Displaying build time after the package name
print_status success
return $EXIT_SUCCESS
}
-# Installation of a package, removing source and build directories after.
-# Try to merge this function with static_ipkg()???
-#
-# First argument: package name
-# Second argument: script name
-# Remaining arguments: additional configure options
-ipkg_cust()
-{
- # Checking for correct number of arguments
- if [ $# -lt 2 ]; then
- echo
- echo "${FUNCNAME}(): Wrong number of arguments"
- echo " command was: \"${FUNCNAME}() $*\""
- exit ${EXIT_FAILURE}
- fi
-
- local PACKAGE=${1}
- local LABEL=${PACKAGE}
- local CUSTOM_SCRIPT=${2}
- shift
- shift
- local CONFIGURE_OPTS=${*}
-
- ipkg ${PACKAGE} ${CUSTOM_SCRIPT} ${LABEL} ${CONFIGURE_OPTS}
-}
-
-# Static function called by:
-# ipkg_ac
-# ipkg_ac_nb
-# ipkg_gnome
-#
-# First argument: script name
-# Second argument: package name
-# Remaining arguments: additional configure options
-static_ipkg()
-{
- # Checking for correct number of arguments
- if [ $# -lt 2 ]; then
- echo
- echo "${FUNCNAME}(): Wrong number of arguments"
- echo " command was: \"${FUNCNAME}() $*\""
- exit ${EXIT_FAILURE}
- fi
-
- local SCRIPT=${1}
- local PACKAGE=${2}
- local LABEL=${PACKAGE}
- shift
- shift
- local CONFIGURE_OPTS=${*}
-
- ipkg ${PACKAGE} ${SCRIPT} ${LABEL} ${CONFIGURE_OPTS}
-}
-
-
-# Installation of a package conforming to GNU autotools.
-# The package must be able to be built outside the
-# source directory.
-#
-# First argument: package name
-# Remaining arguments: additional configure options
-ipkg_ac()
-{
- static_ipkg cis-ac ${*}
-}
-
-# Installation of a package conforming to GNU autotools,
-# but that must be built inside the source directory.
-#
-# First argument: package name
-# Remaining arguments: additional configure options
-ipkg_ac_nb()
-{
- static_ipkg cis-ac-nobuild ${*}
-}
-
-# Installation of a GNOME package.
-#
-# First argument: package name
-# Remaining arguments: additional configure options
-ipkg_gnome()
-{
- static_ipkg cis-gnome ${*}
-}
-
-# Installation of a PERL module
-#
-# First argument: package name
-ipkg_pm()
-{
- # Checking for correct number of arguments
- if [ $# -ne 1 ]; then
- echo
- echo "${FUNCNAME}(): Wrong number of arguments"
- echo " command was: \"${FUNCNAME}() $*\""
- exit ${EXIT_FAILURE}
- fi
-
- local PACKAGE=${1}
- local LABEL=${PACKAGE}
-
- ipkg ${PACKAGE} cis-pm ${LABEL}
-}
-
# Run command, no log
# First argument: Message to display during script
# Second argument: command + arguments
SCRMODE=${1}
MSGSTRING=${2}
SCRIPT=${3}
- LABEL=${SCRIPT}
+ HVLABEL=${SCRIPT}
shift
shift
SCRIPT_ARGS=${*}
exit ${EXIT_FAILURE}
fi
- PACKAGE_LOG=${LFS_LOG_DIR}/${LABEL}.log
+ PACKAGE_LOG=${LFS_LOG_DIR}/${HVLABEL}.log
if [ "x${SCRMODE}" = "xonce" ]; then
# Checking if package was previously successfully installed
- if grep "^${LABEL} successfully installed" ${LFS_LOG_FILE} 1> /dev/null 2>&1; then
+ if grep "^${HVLABEL} successfully installed" ${LFS_LOG_FILE} 1> /dev/null 2>&1; then
return $EXIT_SUCCESS
fi
fi
display_checkbox_msg ${MSGSTRING}
echo "------------------------" 1>> ${LFS_LOG_FILE}
- echo ${LABEL} 1>> ${LFS_LOG_FILE}
+ echo ${HVLABEL} 1>> ${LFS_LOG_FILE}
# Executing script
./${SCRIPT} ${SCRIPT_ARGS} 1>> ${PACKAGE_LOG} 2>&1
if [ "x${SCRMODE}" = "xonce" ]; then
# Writing success string to the end of the log file
- echo "${LABEL} successfully installed" 1>> ${LFS_LOG_FILE}
+ echo "${HVLABEL} successfully installed" 1>> ${LFS_LOG_FILE}
fi
# Displaying build time after the package name
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# 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=/cross-tools \
- ${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
-
-exit $?
#!/bin/bash
-source ~/.bashrc
-
LFS_STAGE=stage0
+# Let shell functions inherit ERR trap. Same as `set -E'.
+set -o errtrace
+
+# Setting ERR trap does implicit `set -o errexit'.
+trap myerr ERR
+
+function myerr()
+{
+ echo
+ echo "*** An error occured during ${LFS_STAGE}"
+ exit 1
+}
+
# Reading system configuration informations, functions and package versions.
source ../sysinfos
source ../functions
export LFS_LOG_FILE=${LFS_LOG_DIR}/install.log
export LFS_TMP="${LFS}/tmp"
-init_log_file
-
-# Scripts directory
-export SCRDIR=$(pwd)
-
-ipkg_ac ${KERNEL}
-
-case "${HVL_TARGET}" in
- x86*)
- ipkg_ac ${FILE_PKG}
- ipkg_ac ${NCURSES} "\
- --without-debug \
- --without-shared"
- ;;
-esac
-
-CPPFLAGS=-fexceptions \
- ipkg_ac ${GMP} "--enable-cxx"
-
-export LDFLAGS="-Wl,-rpath,/cross-tools/lib"
-
-ipkg_ac ${MPFR} "\
- --enable-shared \
- --with-gmp=/cross-tools"
-ipkg_ac ${MPC} "\
- --with-gmp=/cross-tools \
- --with-mpfr=/cross-tools"
-ipkg_ac ${PPL} "\
- --enable-shared \
- --enable-interfaces=c,cxx \
- --disable-optimization \
- --with-libgmp-prefix=/cross-tools \
- --with-libgmpxx-prefix=/cross-tools"
-ipkg_ac ${CLOOG_PPL} "\
- --enable-shared \
- --with-bits=gmp \
- --with-gmp=/cross-tools \
- --with-ppl=/cross-tools"
-
-LDFLAGS=""
-
-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 $?
+echo "Performing pre-install"
+./pre-install
+
+# Logging-in as 'lfs' user, and executing the install-2 script. The
+# 'su -' command starts with a clean environment and enters the home
+# directory of the user.
+su - lfs -c "cd ${PWD}; ./install-2"
+
+echo "Total build time: $(get_total_build_time ${LFS_LOG_FILE})h"
+
+exit 0
--- /dev/null
+#!/bin/bash
+
+source ~/.bashrc
+
+LFS_STAGE=stage0
+
+# Reading system configuration informations, functions and package versions.
+source ../sysinfos
+source ../functions
+source ../packages-list
+
+export LFS_PKG_DIR="$(dirname $(pwd))/packages/${LFS_STAGE}"
+export LFS_LOG_DIR=${LFS}/var/log/hvlinux-install/${LFS_STAGE}
+export LFS_LOG_FILE=${LFS_LOG_DIR}/install.log
+export LFS_TMP="${LFS}/tmp"
+
+init_log_file
+
+# Scripts directory
+export SCRDIR=$(pwd)
+
+ipkg -m noac ${KERNEL}
+
+case "${HVL_TARGET}" in
+ x86*)
+ ipkg ${FILE_PKG}
+ ipkg ${NCURSES}
+ ;;
+esac
+
+CPPFLAGS=-fexceptions \
+ ipkg ${GMP} "--enable-cxx"
+
+export LDFLAGS="-Wl,-rpath,/cross-tools/lib"
+
+ipkg ${MPFR} "\
+ --enable-shared \
+ --with-gmp=/cross-tools"
+ipkg ${MPC} "\
+ --with-gmp=/cross-tools \
+ --with-mpfr=/cross-tools"
+ipkg ${PPL} "\
+ --enable-shared \
+ --enable-interfaces=c,cxx \
+ --disable-optimization \
+ --with-libgmp-prefix=/cross-tools \
+ --with-libgmpxx-prefix=/cross-tools"
+ipkg ${CLOOG_PPL} "\
+ --enable-shared \
+ --with-bits=gmp \
+ --with-gmp=/cross-tools \
+ --with-ppl=/cross-tools"
+
+LDFLAGS=""
+
+ipkg ${BINUTILS}
+ipkg -l "${GCC}-pass1" ${GCC}
+ipkg ${EGLIBC}
+ipkg -l "${GCC}-pass2" ${GCC}
+
+exit $?
--- /dev/null
+#!/bin/bash
+set -o errexit
+
+# First argument of this script is the package name.
+# Remaining arguments are additional configure options.
+
+PACKAGE=${1}
+shift
+CONFIGURE_OPTS=${*}
+
+# 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=/cross-tools \
+ ${CONFIGURE_OPTS}"
+
+source ${SCRDIR}/../functions-ac
+
+exit $?
--with-mpfr=/cross-tools \
--with-gmp=/cross-tools"
- if [ -n "${GCC_PASS1}" ]; then
+ if [ "x${HVLABEL}" = "x${GCC}-pass1" ]; then
CONFIGURE_OPTS="${CONFIGURE_OPTS} \
--disable-shared \
--without-headers \
sed -e "s@\(^CROSS_SYSTEM_HEADER_DIR =\).*@\1 /tools/include@g" \
-i gcc/Makefile.in
- if [ -n "${GCC_PASS1}" ]; then
+ if [ "x${HVLABEL}" = "x${GCC}-pass1" ]; then
# We will create a dummy limits.h so the build will not use the one
# provided by the host distro:
touch /tools/include/limits.h
hvbuild()
{
- if [ -n "${GCC_PASS1}" ]; then
+ if [ "x${HVLABEL}" = "x${GCC}-pass1" ]; then
${HVMAKE} all-gcc all-target-libgcc
${HVMAKE} install-gcc install-target-libgcc
else
#!/bin/bash
-HV_NO_CONFIGURE_SCRIPT=1
-
hvbuild()
{
cd ${LFS_TMP}/${PACKAGE}
#!/bin/bash
+CONFIGURE_OPTS="\
+ --without-debug \
+ --without-shared \
+ ${CONFIGURE_OPTS}"
+
hvbuid()
{
# Only one binary is needed for the Cross-Tools.
+++ /dev/null
-#!/bin/bash
-
-HV_NO_CONFIGURE_SCRIPT=1
-
-hvpatch()
-{
- # Manually apply patch
- apply_patch ${1}-branch_update-1.patch ${PACKAGE}
-
- case "${HVL_TARGET}" in
- arm926t)
- apply_patch ${PACKAGE}-config-arm926t.patch ${PACKAGE}
- ;;
- esac
-}
-
-hvbuild()
-{
- 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
-}
+++ /dev/null
-#!/bin/bash
-
-LFS_STAGE=stage0
-
-# Let shell functions inherit ERR trap. Same as `set -E'.
-set -o errtrace
-
-# Setting ERR trap does implicit `set -o errexit'.
-trap myerr ERR
-
-function myerr()
-{
- echo
- echo "*** An error occured during ${LFS_STAGE}"
- exit 1
-}
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-export LFS_PKG_DIR="$(dirname $(pwd))/packages/${LFS_STAGE}"
-export LFS_LOG_DIR=${LFS}/var/log/hvlinux-install/${LFS_STAGE}
-export LFS_LOG_FILE=${LFS_LOG_DIR}/install.log
-export LFS_TMP="${LFS}/tmp"
-
-echo "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"
-
-echo "Total build time: $(get_total_build_time ${LFS_LOG_FILE})h"
-
-exit 0
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# 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=/tools \
- --build=${CLFS_HOST} \
- --host=${CLFS_TARGET} \
- ${CONFIGURE_OPTS}"
-
-# Default configure function
-hvconfig()
-{
- cd ${LFS_TMP}/${PACKAGE}-build
-
- echo "Running configure with options:"
- echo " <${CONFIGURE_OPTS}>"
-
- CC="${CC} ${CLFS_BUILDFLAGS}" CXX="${CXX} ${CLFS_BUILDFLAGS}" \
- ../${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
-
-exit $?
#!/bin/bash
-set -o errexit
-source ~/.bashrc
+LFS_STAGE=stage1
+
+# Let shell functions inherit ERR trap. Same as `set -E'.
+set -o errtrace
+
+# Setting ERR trap does implicit `set -o errexit'.
+trap myerr ERR
+
+function myerr()
+{
+ echo
+ echo "*** An error occured during ${LFS_STAGE}"
+ exit 1
+}
# Reading system configuration informations, functions and package versions.
source ../sysinfos
source ../functions
source ../packages-list
-export LFS_PKG_DIR="$(dirname $(pwd))/packages/stage1"
-export LFS_LOG_DIR=${LFS}/var/log/hvlinux-install/stage1
+export LFS_PKG_DIR="$(dirname $(pwd))/packages/${LFS_STAGE}"
+export LFS_LOG_DIR=${LFS}/var/log/hvlinux-install/${LFS_STAGE}
export LFS_LOG_FILE=${LFS_LOG_DIR}/install.log
export LFS_TMP="${LFS}/tmp"
init_log_file
-# Building temporary system
-export CC="${CLFS_TARGET}-gcc"
-export CXX="${CLFS_TARGET}-g++"
-export AR="${CLFS_TARGET}-ar"
-export AS="${CLFS_TARGET}-as"
-export RANLIB="${CLFS_TARGET}-ranlib"
-export LD="${CLFS_TARGET}-ld"
-export STRIP="${CLFS_TARGET}-strip"
-
-# Scripts directory
-export SCRDIR=$(pwd)
-
-HOST_CC=gcc CPPFLAGS=-fexceptions \
- ipkg_ac ${GMP} "--enable-cxx"
-ipkg_ac ${MPFR} "--enable-shared"
-ipkg_ac ${MPC}
-ipkg_ac ${PPL} "\
- --enable-shared \
- --enable-interfaces=c,cxx \
- --disable-optimization \
- --with-libgmp-prefix=/tools \
- --with-libgmpxx-prefix=/tools"
-ipkg_ac ${CLOOG_PPL} "\
- --enable-shared \
- --with-bits=gmp \
- --with-gmp=/tools \
- --with-ppl=/tools"
-ipkg_ac ${ZLIB}
-ipkg_ac ${BINUTILS} "\
- --target=${CLFS_TARGET} \
- --with-lib-path=/tools/lib \
- --disable-nls \
- --enable-shared \
- --disable-multilib"
-ipkg_ac ${GCC} "\
- --target=${CLFS_TARGET} \
- --disable-multilib \
- --with-local-prefix=/tools \
- --libexecdir=/tools/lib \
- --disable-nls \
- --disable-libstdcxx-pch \
- --enable-long-long \
- --enable-c99 \
- --enable-shared \
- --enable-threads=posix \
- --enable-__cxa_atexit \
- --enable-languages=c,c++"
-ipkg_ac ${NCURSES} "\
- --with-shared \
- --without-debug \
- --without-ada \
- --enable-overwrite \
- --with-build-cc=gcc"
-ipkg_ac ${BASH} "--without-bash-malloc"
-ipkg_ac ${BISON}
-ipkg_ac ${BZIP2}
-ipkg_ac ${COREUTILS} "--enable-install-program=hostname"
-ipkg_ac ${DIFFUTILS}
-ipkg_ac ${FINDUTILS}
-ipkg_ac ${FILE_PKG}
-ipkg_ac ${FLEX}
-ipkg_ac ${GAWK}
-ipkg_ac ${GETTEXT} "--disable-shared"
-ipkg_ac ${GREP} "\
- --disable-perl-regexp \
- --without-included-regex"
-ipkg_ac ${GZIP}
-ipkg_ac ${MFOUR}
-ipkg_ac ${MAKE_PACKAGE}
-ipkg_ac ${PATCH_PACKAGE}
-ipkg_ac ${SED}
-ipkg_ac ${TAR_PACKAGE}
-ipkg_ac ${TEXINFO}
-ipkg_ac ${XZ_UTILS}
+rscr mult "Performing pre-install" pre-install
-# Chapter 7
-rscr once "Creating directory structure" create-directories
-rscr once "Creating symbolic links" create-symlinks
+# Logging-in as 'lfs' user, and executing the install-2 script. The
+# 'su -' command starts with a clean environment and enters the home
+# directory of the user.
+su - lfs -c "cd ${PWD}; ./install-2"
-ipkg_ac ${NANO} "--enable-color --enable-multibuffer"
-ipkg_ac ${UTIL_LINUX_NG}
-ipkg_ac ${E2FSPROGS}
-ipkg_ac ${SYSVINIT}
-ipkg_ac ${MODULE_INIT_TOOLS}
-ipkg_ac ${UDEV}
-ipkg_ac ${KERNEL}
+rscr mult "Performing post-install" post-install
-rscr once "Creating default users" create-users
-rscr once "Creating default groups" create-groups
-rscr once "Creating default log files" create-logfiles
-rscr once "Creating default config files" create-config-files
-rscr once "Installing bootscripts" install-bootscripts
+echo "Total build time: $(get_total_build_time ${LFS_LOG_FILE})h"
-exit $?
+exit 0
--- /dev/null
+#!/bin/bash
+set -o errexit
+
+source ~/.bashrc
+
+# Reading system configuration informations, functions and package versions.
+source ../sysinfos
+source ../functions
+source ../packages-list
+
+export LFS_PKG_DIR="$(dirname $(pwd))/packages/stage1"
+export LFS_LOG_DIR=${LFS}/var/log/hvlinux-install/stage1
+export LFS_LOG_FILE=${LFS_LOG_DIR}/install.log
+export LFS_TMP="${LFS}/tmp"
+
+init_log_file
+
+# Building temporary system
+export CC="${CLFS_TARGET}-gcc"
+export CXX="${CLFS_TARGET}-g++"
+export AR="${CLFS_TARGET}-ar"
+export AS="${CLFS_TARGET}-as"
+export RANLIB="${CLFS_TARGET}-ranlib"
+export LD="${CLFS_TARGET}-ld"
+export STRIP="${CLFS_TARGET}-strip"
+
+# Scripts directory
+export SCRDIR=$(pwd)
+
+HOST_CC=gcc CPPFLAGS=-fexceptions \
+ ipkg ${GMP} "--enable-cxx"
+ipkg ${MPFR} "--enable-shared"
+ipkg ${MPC}
+ipkg ${PPL} "\
+ --enable-shared \
+ --enable-interfaces=c,cxx \
+ --disable-optimization \
+ --with-libgmp-prefix=/tools \
+ --with-libgmpxx-prefix=/tools"
+ipkg ${CLOOG_PPL} "\
+ --enable-shared \
+ --with-bits=gmp \
+ --with-gmp=/tools \
+ --with-ppl=/tools"
+ipkg -m acnb ${ZLIB}
+ipkg ${BINUTILS}
+ipkg ${GCC}
+ipkg ${NCURSES} "\
+ --with-shared \
+ --without-debug \
+ --without-ada \
+ --enable-overwrite \
+ --with-build-cc=gcc"
+ipkg ${BASH} "--without-bash-malloc"
+ipkg ${BISON}
+ipkg -m noac ${BZIP2}
+ipkg ${COREUTILS} "--enable-install-program=hostname"
+ipkg ${DIFFUTILS}
+ipkg ${FINDUTILS}
+ipkg ${FILE_PKG}
+ipkg ${FLEX}
+ipkg ${GAWK}
+ipkg ${GETTEXT} "--disable-shared"
+ipkg ${GREP} "\
+ --disable-perl-regexp \
+ --without-included-regex"
+ipkg ${GZIP}
+ipkg ${MFOUR}
+ipkg ${MAKE_PACKAGE}
+ipkg ${PATCH_PACKAGE}
+ipkg ${SED}
+ipkg ${TAR_PACKAGE}
+ipkg ${TEXINFO}
+ipkg ${XZ_UTILS}
+
+# Chapter 7
+rscr once "Creating directory structure" create-directories
+rscr once "Creating symbolic links" create-symlinks
+
+ipkg ${NANO} "--enable-color --enable-multibuffer"
+ipkg ${UTIL_LINUX_NG}
+ipkg ${E2FSPROGS}
+ipkg -m noac ${SYSVINIT}
+ipkg ${MODULE_INIT_TOOLS}
+ipkg ${UDEV}
+ipkg -m noac ${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 "Creating default config files" create-config-files
+rscr once "Installing bootscripts" install-bootscripts
+
+exit $?
--- /dev/null
+#!/bin/bash
+set -o errexit
+
+# First argument of this script is the package name.
+# Remaining arguments are additional configure options.
+
+PACKAGE=${1}
+shift
+CONFIGURE_OPTS=${*}
+
+# 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=/tools \
+ --build=${CLFS_HOST} \
+ --host=${CLFS_TARGET} \
+ ${CONFIGURE_OPTS}"
+
+CC="${CC} ${CLFS_BUILDFLAGS}"
+CXX="${CXX} ${CLFS_BUILDFLAGS}"
+
+source ${SCRDIR}/../functions-ac
+
+ldconfig
+
+exit $?
#!/bin/bash
+CONFIGURE_OPTS="\
+ --target=${CLFS_TARGET} \
+ --with-lib-path=/tools/lib \
+ --disable-nls \
+ --enable-shared \
+ --disable-multilib \
+ ${CONFIGURE_OPTS}"
+
hvconfig_pre()
{
case "${HVL_TARGET}" in
#!/bin/bash
-# This package doesn't have a configure script...
-hvconfig()
+hvbuild()
{
cd ${LFS_TMP}/${PACKAGE}
# Bzip2's default Makefile target automatically runs the testsuite as well.
# Disable the tests since they won't work on a multi-architecture build:
sed -e 's@^\(all:.*\) test@\1@g' -i Makefile
-}
-hvbuild()
-{
${HVMAKE} CC="${CC} ${CLFS_BUILDFLAGS}" AR="${AR}" RANLIB="${RANLIB}"
${HVMAKE} PREFIX=/tools install
}
#!/bin/bash
-hvconfig()
-{
- cd ${LFS_TMP}/${PACKAGE}-build
+CC="${CC} ${CLFS_BUILDFLAGS}"
+PKG_CONFIG=true
- CC="${CC} ${CLFS_BUILDFLAGS}" PKG_CONFIG=true \
- ../${PACKAGE}/configure \
- --prefix=/tools \
- --enable-elf-shlibs \
- --with-linker=${LD} \
- --host=${CLFS_TARGET} \
- --disable-libblkid \
- --disable-libuuid \
- --disable-fsck \
- --disable-uuidd
-}
+CONFIGURE_OPTS="\
+ --prefix=/tools \
+ --enable-elf-shlibs \
+ --with-linker=${LD} \
+ --host=${CLFS_TARGET} \
+ --disable-libblkid \
+ --disable-libuuid \
+ --disable-fsck \
+ --disable-uuidd"
hvbuild()
{
#!/bin/bash
+CONFIGURE_OPTS="\
+ --target=${CLFS_TARGET} \
+ --disable-multilib \
+ --with-local-prefix=/tools \
+ --libexecdir=/tools/lib \
+ --disable-nls \
+ --disable-libstdcxx-pch \
+ --enable-long-long \
+ --enable-c99 \
+ --enable-shared \
+ --enable-threads=posix \
+ --enable-__cxa_atexit \
+ --enable-languages=c,c++ \
+ ${CONFIGURE_OPTS}"
+
hvpatch()
{
# Manually applying patches if specified
#!/bin/bash
+CONFIGURE_OPTS="\
+ --prefix=/tools \
+ --build=${CLFS_HOST} \
+ --host=${CLFS_TARGET} \
+ ${CONFIGURE_OPTS}"
+
# 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:
{
cd ${LFS_TMP}/${PACKAGE}/gettext-tools
- FINAL_CFG_OPTS="\
- --prefix=/tools \
- --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}" \
- ./configure ${FINAL_CFG_OPTS}
+ ./configure ${CONFIGURE_OPTS}
}
hvbuild()
#!/bin/bash
-HV_NO_CONFIGURE_SCRIPT=1
-
hvbuild()
{
cd ${LFS_TMP}/${PACKAGE}
#!/bin/bash
-HV_NO_CONFIGURE_SCRIPT=1
-
-hvconfig_pre()
+hvbuild()
{
cd ${LFS_TMP}/${PACKAGE}
-e 's@\(mknod \)-m \([0-9]* \)\(.* \)p@\1\3p; chmod \2\3@g' \
-e "s@/usr/lib@/tools/lib@" \
-i src/Makefile
-}
-hvbuild()
-{
make -C src clobber
make -C src CC="${CC} ${CLFS_BUILDFLAGS}"
make -C src install INSTALL=install ROOT=${LFS}
hvconfig_pre()
{
cd ${LFS_TMP}/${PACKAGE}
-
install -dv ${LFS}/lib/{firmware,udev/devices/{pts,shm}}
}
CC="${CC} ${CLFS_BUILDFLAGS}"
-hvconfig()
-{
- cd ${LFS_TMP}/${PACKAGE}
-
- ./configure \
- --prefix=/tools
-}
+CONFIGURE_OPTS="\
+ --prefix=/tools"
+++ /dev/null
-#!/bin/bash
-
-LFS_STAGE=stage1
-
-# Let shell functions inherit ERR trap. Same as `set -E'.
-set -o errtrace
-
-# Setting ERR trap does implicit `set -o errexit'.
-trap myerr ERR
-
-function myerr()
-{
- echo
- echo "*** An error occured during ${LFS_STAGE}"
- exit 1
-}
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-export LFS_PKG_DIR="$(dirname $(pwd))/packages/${LFS_STAGE}"
-export LFS_LOG_DIR=${LFS}/var/log/hvlinux-install/${LFS_STAGE}
-export LFS_LOG_FILE=${LFS_LOG_DIR}/install.log
-export LFS_TMP="${LFS}/tmp"
-
-init_log_file
-
-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" post-install
-
-echo "Total build time: $(get_total_build_time ${LFS_LOG_FILE})h"
-
-exit 0
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# 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
-
-ldconfig
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-DHCP_USED="no"
-
-cat > /etc/sysconfig/network/ifconfig.lo << "EOF"
-ONBOOT="yes"
-BOOTPROTO="static"
-IPADDR="127.0.0.1"
-PREFIX_LENGTH=8
-IFSCOPE="scope host"
-EOF
-
-LOOP_INDEX="0"
-for nic_device in ${INTERFACES}; do
- file="/etc/sysconfig/network/ifconfig.${nic_device}"
- echo "ONBOOT=\"yes\"" > ${file}
- echo "BOOTPROTO=\"${BOOTPROTO[${LOOP_INDEX}]}\"" >> ${file}
- echo "IPADDR=\"${IP_ADDRESS[${LOOP_INDEX}]}\"" >> ${file}
- echo "PREFIX_LENGTH=\"${PREFIX_LENGTH[${LOOP_INDEX}]}\"" >> ${file}
- echo "IFSCOPE=\"\"" >> ${file}
-
- if [ "x${BOOTPROTO[${LOOP_INDEX}]}" = "xdhcp" ]; then
- GATEWAY=""
- DHCP_USED="yes"
- fi
-
- LOOP_INDEX=$((${LOOP_INDEX} + 1))
-done
-
-# "/etc/resolv.conf" file
-if [ "x${DHCP_USED}" = "xno" ]; then
- if [ -f /etc/resolv.conf ]; then
- rm -f /etc/resolv.conf
- fi
- touch /etc/resolv.conf
- for i in $(seq 0 $((${#NAMESERVER[@]} - 1))); do
- echo "nameserver ${NAMESERVER[i]}" >> /etc/resolv.conf
- done
- chmod 644 /etc/resolv.conf
-fi
-
-# "/etc/sysconfig/network/network-parameters" file creation
-echo "#!/bin/sh" > /etc/sysconfig/network/network-parameters
-echo "DOMAINNAME=\"${DOMAIN}\"" >> /etc/sysconfig/network/network-parameters
-echo "INTERFACES_UP=\"lo ${INTERFACES}\"" >> /etc/sysconfig/network/network-parameters
-echo "INTERFACES_DN=\"${INTERFACES} lo\"" >> /etc/sysconfig/network/network-parameters
-echo "GATEWAY=\"${GATEWAY}\"" >> /etc/sysconfig/network/network-parameters
-
-cat >> /etc/sysconfig/network/network-parameters << EOF
-
-# On which network interface(s) to activate the DHCP server.
-# Leave empty or comment the line to disable the DHCP server.
-#DHCP_SERVER_IF="eth0"
-
-# Set to "yes" to enable the NFS server:
-NFS_SERVER_ENA="no"
-
-# Set FIREWALL_ENA to "yes" to enable the firewall:
-FIREWALL_ENA="no"
-# Set FIREWALL_WWW to the ethernet interface connected to the outside world (internet):
-FIREWALL_WWW="eth0"
-# Set FIREWALL_LAN to the ethernet interface connected to the internal LAN:
-FIREWALL_LAN="eth1"
-EOF
-
-# Keyboard settings
-cat > /etc/sysconfig/keyboard << "EOF"
-# Keyboard language: us, cf, fr, etc.
-KEYBOARD=us
-EOF
-
-# Replacing 'KEYBOARD=us' entry with appropriate keyboard layout specified by user in sysinfos
-if [ "x${KEYBOARD}" != "x" ]; then
- sed -i s/KEYBOARD=us/KEYBOARD=${KEYBOARD}/ /etc/sysconfig/keyboard
-fi
-
-# Removing /tools from the PATH environment variable during boot for bootscripts:
-sed -i -e "s!^\(export PATH=\).*tools.*!\1/bin:/usr/bin:/sbin:/usr/sbin!" /etc/rc.d/init.d/functions
-
-# Copying boot scripts
-STAGE2_BOOTSCRIPTS="ifdown ifup keyboard mountnetfs network sysklogd"
-for bootscript in ${STAGE2_BOOTSCRIPTS}; do
- install -m755 bootscripts/${bootscript} /etc/rc.d/init.d
-done
-
-# Necessary because bootscript_add_* scripts use ${LFS} when
-# writing/modifyng files
-export LFS=
-
-# rcsysinit.d
-bootscript_add_rcsysinit sysklogd 50 93
-bootscript_add_rcsysinit keyboard 55 00
-
-# rc3.d
-bootscript_add_rc3 network 05 80
-bootscript_add_rc3 mountnetfs 30 10
-
-chown -R root:root /etc/rc.d /etc/sysconfig
-
-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 -f Makefile-libbz2_so
-make clean
-make -j ${MAKEJOBS}
-make PREFIX=/usr install
-
-cp -fv bzip2-shared /bin/bzip2
-cp -afv libbz2.so* /lib
-ln -sfvT ../../lib/libbz2.so.1.0 /usr/lib/libbz2.so
-rm -fv /usr/bin/{bunzip2,bzcat,bzip2}
-ln -sfvT bzip2 /bin/bunzip2
-ln -sfvT bzip2 /bin/bzcat
-
-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
-
-# If not already installed by previous invocation of this script:
-install -m755 ${SCRDIR}/misc/compressdoc /usr/sbin
-
-# Compressing man pages with bzip2
-/usr/sbin/compressdoc --bz2
-
-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}
-
-# The above patch will cause the Diffutils build system to attempt to rebuild
-# the diff.1 man page using the unavailable program help2man:
-cd ${LFS_TMP}/${PACKAGE}
-touch man/diff.1
-
-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
-
-# 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 \
- --libexecdir=/usr/lib/findutils \
- --localstatedir=/var/lib/locate
-make -j ${MAKEJOBS}
-make install
-
-# Some of the scripts in the LFS-Bootscripts package depend on find.
-# As /usr may not be available during the early stages of booting, this
-# program needs to be on the root partition. The updatedb script also
-# needs to be modified to correct an explicit path:
-mv -v /usr/bin/find /bin
-sed -i -e 's/find:=${BINDIR}/find:=\/bin/' /usr/bin/updatedb
-
-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=${*}
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}-build
-../${PACKAGE}/configure \
- --prefix=/usr \
- --sysconfdir=/etc \
- ${CONFIGURE_OPTS}
-make
-make install
-make install-compat
-
-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}
-
-PAGE=letter ./configure \
- --prefix=/usr \
- --enable-multibyte
-# Groff does not like to be made in parallel.
-make
-make install
-
-# Some documentation programs, such as xman, will not work properly without
-# the following symlinks:
-ln -fsv eqn /usr/bin/geqn
-ln -fsv tbl /usr/bin/gtbl
-
-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
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Manually applying patches because of order
-apply_patch ${PACKAGE}-use_mmap-1.patch ${PACKAGE}
-apply_patch ${PACKAGE}-256byte_inode-1.patch ${PACKAGE}
-apply_patch ${PACKAGE}-ext4-1.patch ${PACKAGE}
-apply_patch ${PACKAGE}-fixes-1.patch ${PACKAGE}
-
-GRUB_STAGE_FILES="/usr/lib/grub/i386-pc"
-
-cd ${LFS_TMP}/${PACKAGE}-build
-../${PACKAGE}/configure \
- --prefix=/usr \
- --sysconfdir=/etc \
- ${CONFIGURE_OPTS}
-make -j ${MAKEJOBS}
-make install
-
-mkdir -p /boot/grub
-cp -a ${GRUB_STAGE_FILES}/stage{1,2} /boot/grub
-cp -a ${GRUB_STAGE_FILES}/{e2fs,reiserfs}_stage1_5 /boot/grub
-
-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}
-./configure \
- --prefix=/usr \
- --bindir=/bin
-make -j ${MAKEJOBS}
-make install
-
-# Move some programs that do not need to be on the root filesystem:
-mv -fv /bin/{gzexe,uncompress,zcmp,zdiff,zegrep} /usr/bin
-mv -fv /bin/{zfgrep,zforce,zgrep,zless,zmore,znew} /usr/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
-
-SRCDIR="./hv-utilities"
-PREFIX="/usr/local"
-BINDIR="${PREFIX}/bin"
-SYSBINDIR="${PREFIX}/sbin"
-BIN_UTILITIES="camera-download cd-erase cd-copy pstopdf distro-backup dos2unix \
- dvd-ram-format fix-avi gztobz2 hv-backup hv-video-dvd mail-files \
- mail-if-fail mail-statistics media-write pstopdf replace.pl \
- rotatelogs setdate strip-debug-symbols tarbz2 tildes-clean"
-
-for program in ${BIN_UTILITIES}; do
- install -v ${SRCDIR}/${program} ${BINDIR}
-done
-
-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}
-
-# This is only a basic installation (no servers) of inetutils.
-
-cd ${LFS_TMP}/${PACKAGE}-build
-../${PACKAGE}/configure \
- --prefix=/usr \
- --sysconfdir=/etc \
- ${CONFIGURE_OPTS}
-make
-make install
-
-# Move some programs to their FHS-compliant place:
-mv -v /usr/bin/{hostname,ping,ping6} /bin
-mv -v /usr/bin/traceroute /sbin
-
-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
-
-cd ${LFS_TMP}/${1}
-
-# The Kbd package doesn't come shipped with the standard configure scripts, so generate them now:
-autoreconf
-
-# Applying patches (if any)
-apply_patches ${1}
-
-# --datadir=/lib/kbd
-# This option puts keyboard layout data in a directory that will
-# always be on the root partition instead of the default /usr/share/kbd
-cd ${LFS_TMP}/${1}
-./configure \
- --prefix=/usr \
- --datadir=/lib/kbd
-make -j ${MAKEJOBS}
-make install
-
-# Some of the scripts in the LFS-Bootscripts package depend on kbd_mode,
-# openvt, and setfont. As /usr may not be available during the early stages
-# of booting, those binaries need to be on the root partition:
-mv -v /usr/bin/{kbd_mode,loadkeys,openvt,setfont} /bin
-
-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}
-
-# --enable-zlib: To handle compressed kernel modules.
-cd ${LFS_TMP}/${1}-build
-../${1}/configure \
- --prefix=/ \
- --enable-zlib \
- --mandir=/usr/share/man
-make -j ${MAKEJOBS}
-make INSTALL=install install
-
-cat > /etc/modprobe.conf << "EOF"
-# modprobe.conf
-EOF
-
-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}
-
-# This version of Perl now builds the Compress::Raw::Zlib module. By default
-# Perl will use an internal copy of the Zlib source for the build. Issue the
-# following command so that Perl will use the Zlib library installed on the system:
-sed -i -e "s|BUILD_ZLIB\s*= True|BUILD_ZLIB = False|" \
- -e "s|INCLUDE\s*= ./zlib-src|INCLUDE = /usr/include|" \
- -e "s|LIB\s*= ./zlib-src|LIB = /usr/lib|" \
- ext/Compress-Raw-Zlib/config.in
-
-sh Configure -des \
- -Dprefix=/usr \
- -Dvendorprefix=/usr \
- -Dman1dir=/usr/share/man/man1 \
- -Dman3dir=/usr/share/man/man3 \
- -Dpager="/usr/bin/less -isR"
-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}
-# fix taken backported from the development version of popt fixes
-# a problem identified by the included testsuite:
-sed -i -e "/*origOptString ==/c 0)" popt.c
-
-./configure \
- --prefix=/usr \
- --sysconfdir=/etc
-make -j ${MAKEJOBS}
-make install
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-cat > /etc/default/useradd << "EOF"
-# useradd defaults file
-HOME=/home
-INACTIVE=-1
-EXPIRE=
-SHELL=/bin/bash
-SKEL=/etc/skel
-CREATE_MAIL_SPOOL=yes
-EOF
-
-chmod -v 644 /etc/default/useradd
-
-if [ -n "${REGUSER}" ]; then
- hv_useradd -g users -G audio,video,usb -s /bin/bash -m ${REGUSER}
-fi
-
-echo "Copying /etc/skel files to root directory"
-# Copy skel files to root directory. First create a copy to change owner
-cp -au /etc/skel/.??* /root
-
-# Fixing ownership of directories /tmp and /var/log (may have been created by
-# a regular user when fetching packages).
-chown -v root:root /tmp
-chown -v root:root /var
-chown -v root:root /var/log
-
-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}
-
-# By default, Psmisc's pidof program is not installed. This usually is
-# not a problem because it is installed later in the Sysvinit package,
-# which provides a better pidof program.
-
-cd ${LFS_TMP}/${1}-build
-../${1}/configure \
- --prefix=/usr
-make -j ${MAKEJOBS}
-make install
-
-# By default, Psmisc's pidof program is not installed. This usually is not a
-# problem because it is installed later in the Sysvinit package, which provides
-# a better pidof program. If Sysvinit will not be used for a particular system,
-# complete the installation of Psmisc by creating the following symlink:
-#ln -sv killall /bin/pidof
-
-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}
-
-# Disable the installation of the groups program and its man page, as
-# Coreutils provides a better version.
-sed -i 's/groups$(EXEEXT) //' src/Makefile.in
-find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \;
-
-# Disable the installation of Chinese and Korean manual pages, since Man-DB
-# cannot format them properly:
-sed -i -e 's/ ko//' -e 's/ zh_CN zh_TW//' man/Makefile.in
-
-# Instead of using the default crypt method, use the more secure MD5 method
-# of password encryption, which also allows passwords longer than 8 characters.
-# It is also necessary to change the obsolete /var/spool/mail location for user
-# mailboxes that Shadow uses by default to the /var/mail location used currently:
-sed -i -e 's@#ENCRYPT_METHOD DES@ENCRYPT_METHOD MD5@' \
- -e 's@/var/spool/mail@/var/mail@' etc/login.defs
-
-cd ${LFS_TMP}/${1}-build
-../${1}/configure \
- --sysconfdir=/etc \
- --without-selinux
-make -j ${MAKEJOBS}
-make install
-
-var_add_shadow "ENV_SUPATH" /etc/login.defs "/usr/local/sbin:/usr/local/bin"
-
-# Move some misplaced symlinks/programs to their proper locations.
-mv /usr/bin/passwd /bin
-
-# The -D option of the useradd program requires this directory for it
-# to work properly.
-mkdir -p /etc/default
-
-# To enable shadowed passwords:
-pwconv
-
-# To enable shadowed group passwords:
-grpconv
-
-exit $?
+++ /dev/null
-#!/bin/bash
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-/tools/bin/find /{,usr/}{bin,lib,sbin} -type f \
- -exec /tools/bin/strip --strip-debug '{}' ';'
-
-# Return success
-exit 0
+++ /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
-
-cat > /etc/syslog.conf << "EOF"
-# /etc/syslog.conf
-
-auth,authpriv.* -/var/log/auth.log
-*.*;auth,authpriv.none -/var/log/sys.log
-daemon.* -/var/log/daemon.log
-kern.* -/var/log/kern.log
-mail.* -/var/log/mail.log
-user.* -/var/log/user.log
-cron.* -/var/log/cron.log
-*.emerg *
-EOF
-
-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}
-
-cd ${LFS_TMP}/${1}
-
-sed -i 's@Sending processes@& configured via /etc/inittab@g' src/init.c
-
-# A maintained version of the wall program was installed earlier by
-# Util-linux-ng. Suppress the installation of Sysvinit's version:
-sed -i -e 's/utmpdump wall/utmpdump/' \
- -e 's/mountpoint.1 wall.1/mountpoint.1/' src/Makefile
-
-make -j ${MAKEJOBS} -C src
-make -C src install
-
-# /etc/inittab was installed in stage 1
-
-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
-make TEXMF=/usr/share/texmf install-tex
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Amend the GCC specs file so that it points to the new dynamic linker, and so
-# that GCC knows where to find its start files.
-gcc -dumpspecs | \
- sed \
- -e 's@/tools/lib/ld@/lib/ld@g' \
- -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' > \
- `dirname $(gcc --print-libgcc-file-name)`/specs
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Testing toolchain
-cd /tmp
-echo 'main(){}' > dummy.c
-gcc dummy.c -Wl,--verbose &> dummy.log
-
-if ! readelf -l a.out | grep 'Requesting program interpreter: /lib/ld-linux.*.so.2' 1> /dev/null 2>&1 ; then
- echo "String 'Requesting program interpreter: /lib/ld-linux.*.so.2' not found"
- exit 1
-fi
-
-rm dummy.{c,log} a.out
-
-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}
-./configure \
- --prefix=/usr \
- --sysconfdir=/etc \
- --sbindir=/sbin \
- --with-rootlibdir=/lib \
- --libexecdir=/lib/udev \
- --docdir=/usr/share/doc/${1} \
- --disable-extras \
- --disable-introspection
-make
-make install
-
-# Udev has to be configured in order to work properly, as its default
-# configuration does not cover all devices. First install two extra
-# rules files from Udev to help support device-mapper and RAID setups:
-install -m644 -v rules/packages/64-*.rules \
- /lib/udev/rules.d/
-
-# Now install a file to create symlinks for certain hand-held devices:
-install -m644 -v rules/packages/40-pilot-links.rules \
- /lib/udev/rules.d/
-
-# Now install a file to handle ISDN devices:
-install -m644 -v rules/packages/40-isdn.rules \
- /lib/udev/rules.d/
-
-install -m755 ${SCRDIR}/misc/udev-create-persistent-net.sh /usr/local/bin
-
-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}
-make install
-
-# Install the documentation that explains the LFS-specific rules files:
-make install-doc
-
-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
+
+# If not already installed by previous invocation of this script:
+install -m755 ${SCRDIR}/misc/compressdoc /usr/sbin
+
+# Compressing man pages with bzip2
+/usr/sbin/compressdoc --bz2
+
+exit $?
--- /dev/null
+#!/bin/bash
+
+LFS_STAGE=stage2
+
+export LFS_PKG_DIR="$(dirname $(pwd))/packages/${LFS_STAGE}"
+export LFS_LOG_DIR=/var/log/hvlinux-install/${LFS_STAGE}
+export LFS_LOG_FILE=${LFS_LOG_DIR}/install.log
+export LFS_TMP=/tmp
+
+# Reading system configuration informations, functions and package versions.
+source ../sysinfos
+source ../functions
+source ../packages-list
+source /etc/profile
+
+if [ "x${USER}" != "xroot" ]; then
+ echo "You must be the superuser to install hvlinux."
+ exit 1
+fi
+
+init_log_file
+
+# Scripts directory
+export SCRDIR=$(pwd)
+
+ipkg -l "${PERL}-pass1" ${PERL}
+ipkg -m noac ${KERNEL}
+ipkg -m noac ${MANPAGES}
+ipkg ${EGLIBC}
+rscr once "Adjusting toolchain" toolchain-adjust
+rscr mult "Testing toolchain" toolchain-test
+
+export CC="gcc -isystem /usr/include"
+export CXX="g++ -isystem /usr/include"
+export LDFLAGS="-Wl,-rpath-link,/lib"
+
+CPPFLAGS=-fexceptions \
+ ipkg ${GMP} "--enable-cxx --enable-mpbsd"
+ipkg ${MPFR} "--enable-shared --with-gmp=/usr"
+ipkg ${MPC}
+CPPFLAGS=-fexceptions \
+ ipkg ${PPL} "--enable-shared --disable-optimization"
+ipkg ${CLOOG_PPL} "--enable-shared --with-gmp --with-ppl"
+
+unset CC
+unset CXX
+unset LDFLAGS
+
+ipkg ${ZLIB}
+ipkg ${BINUTILS}
+ipkg ${GCC}
+rscr mult "Testing toolchain" toolchain-test
+ipkg ${SED} "--bindir=/bin"
+ipkg ${PKG_CONFIG}
+ipkg ${NCURSES}
+ipkg ${UTIL_LINUX_NG}
+ipkg ${E2FSPROGS}
+ipkg ${COREUTILS}
+ipkg -m noac ${IANA}
+ipkg ${MFOUR}
+ipkg ${BISON}
+ipkg ${PROCPS}
+ipkg ${LIBTOOL}
+ipkg ${FLEX}
+ipkg -m noac ${IPROUTE2}
+ipkg -l "${PERL}-pass2" ${PERL}
+ipkg ${READLINE}
+ipkg ${AUTOCONF}
+ipkg ${AUTOMAKE}
+ipkg ${BASH} "--bindir=/bin --without-bash-malloc --with-installed-readline"
+
+/bin/bash +h -c ./install-2
+
+exit $?
# Scripts directory
export SCRDIR=$(pwd)
-ipkg_cust ${GDBM} cis-gdbm
-ipkg_cust ${INETUTILS} cis-inetutils \
- --libexecdir=/usr/sbin \
- --localstatedir=/var \
- --disable-ifconfig \
- --disable-logger \
- --disable-syslogd \
- --disable-whois \
- --disable-servers
-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_ac ${GETTEXT}
-ipkg_ac ${GREP} "--bindir=/bin --without-included-regex"
-ipkg_cust ${GROFF} cis-groff
-ipkg_cust ${GZIP} cis-gzip
-
-ipkg_cust ${KBD} cis-kbd
-ipkg_ac ${LESS}
-ipkg_ac ${MAKE_PACKAGE}
-ipkg_ac ${MAN_DB} \
+ipkg ${GDBM}
+ipkg ${INETUTILS}
+ipkg -m noac ${BZIP2}
+ipkg ${DIFFUTILS}
+ipkg ${FILE_PKG}
+ipkg ${GAWK} "--libexecdir=/usr/lib"
+ipkg ${FINDUTILS}
+ipkg ${GETTEXT}
+ipkg ${GREP} "--bindir=/bin --without-included-regex"
+ipkg ${GROFF}
+ipkg ${GZIP}
+ipkg ${KBD}
+ipkg ${LESS}
+ipkg ${MAKE_PACKAGE}
+ipkg ${MAN_DB} "\
--libexecdir=/usr/lib \
--disable-setuid \
--with-browser=/usr/bin/lynx \
--with-vgrind=/usr/bin/vgrind \
- --with-grap=/usr/bin/grap
-ipkg_cust ${MODULE_INIT_TOOLS} cis-module-init-tools
-ipkg_ac ${PATCH_PACKAGE}
-ipkg_cust ${PSMISC} cis-psmisc
-ipkg_cust ${SHADOW} cis-shadow
-ipkg_cust ${SYSKLOGD} cis-sysklogd
-ipkg_cust ${SYSVINIT} cis-sysvinit
-ipkg_ac ${TAR_PACKAGE} "--bindir=/bin --libexecdir=/usr/sbin"
-ipkg_cust ${TEXINFO} cis-texinfo
-ipkg_cust ${UDEV} cis-udev
-ipkg_cust ${UDEV_CONFIG} cis-udev-config
-#ipkg_cust ${GRUB} cis-grub
+ --with-grap=/usr/bin/grap"
+ipkg ${MODULE_INIT_TOOLS}
+ipkg ${PATCH_PACKAGE}
+ipkg ${PSMISC}
+ipkg -m noac ${SHADOW}
+ipkg ${SYSKLOGD}
+ipkg ${SYSVINIT}
+ipkg ${TAR_PACKAGE} "--bindir=/bin --libexecdir=/usr/sbin"
+ipkg ${TEXINFO}
+ipkg ${UDEV}
+ipkg -m noac ${UDEV_CONFIG}
+ipkg ${GRUB}
-rscr once "Installing HV-utilities" cis-hv-utilities
-rscr mult "Compressing man pages" cis-compressdoc
-rscr once "Installing bootscripts" cis-bootscripts
-#rscr mult "Stripping" cis-stripping
+rscr once "Installing HV-utilities" install-hv-utilities
+rscr mult "Compressing man pages" compressdoc
+rscr once "Installing bootscripts" install-bootscripts
+#rscr mult "Stripping" stripping
echo "Total build time: $(get_total_build_time ${LFS_LOG_FILE})h"
# Creating root password
passwd root || exit 1
-rscr mult "Performing post-install" cis-post-install
+rscr mult "Performing post-install" post-install
ldconfig
lasterror=$?
--- /dev/null
+#!/bin/bash
+set -o errexit
+
+# Reading system configuration informations, functions and package versions.
+source ../sysinfos
+source ../functions
+source ../packages-list
+
+DHCP_USED="no"
+
+cat > /etc/sysconfig/network/ifconfig.lo << "EOF"
+ONBOOT="yes"
+BOOTPROTO="static"
+IPADDR="127.0.0.1"
+PREFIX_LENGTH=8
+IFSCOPE="scope host"
+EOF
+
+LOOP_INDEX="0"
+for nic_device in ${INTERFACES}; do
+ file="/etc/sysconfig/network/ifconfig.${nic_device}"
+ echo "ONBOOT=\"yes\"" > ${file}
+ echo "BOOTPROTO=\"${BOOTPROTO[${LOOP_INDEX}]}\"" >> ${file}
+ echo "IPADDR=\"${IP_ADDRESS[${LOOP_INDEX}]}\"" >> ${file}
+ echo "PREFIX_LENGTH=\"${PREFIX_LENGTH[${LOOP_INDEX}]}\"" >> ${file}
+ echo "IFSCOPE=\"\"" >> ${file}
+
+ if [ "x${BOOTPROTO[${LOOP_INDEX}]}" = "xdhcp" ]; then
+ GATEWAY=""
+ DHCP_USED="yes"
+ fi
+
+ LOOP_INDEX=$((${LOOP_INDEX} + 1))
+done
+
+# "/etc/resolv.conf" file
+if [ "x${DHCP_USED}" = "xno" ]; then
+ if [ -f /etc/resolv.conf ]; then
+ rm -f /etc/resolv.conf
+ fi
+ touch /etc/resolv.conf
+ for i in $(seq 0 $((${#NAMESERVER[@]} - 1))); do
+ echo "nameserver ${NAMESERVER[i]}" >> /etc/resolv.conf
+ done
+ chmod 644 /etc/resolv.conf
+fi
+
+# "/etc/sysconfig/network/network-parameters" file creation
+echo "#!/bin/sh" > /etc/sysconfig/network/network-parameters
+echo "DOMAINNAME=\"${DOMAIN}\"" >> /etc/sysconfig/network/network-parameters
+echo "INTERFACES_UP=\"lo ${INTERFACES}\"" >> /etc/sysconfig/network/network-parameters
+echo "INTERFACES_DN=\"${INTERFACES} lo\"" >> /etc/sysconfig/network/network-parameters
+echo "GATEWAY=\"${GATEWAY}\"" >> /etc/sysconfig/network/network-parameters
+
+cat >> /etc/sysconfig/network/network-parameters << EOF
+
+# On which network interface(s) to activate the DHCP server.
+# Leave empty or comment the line to disable the DHCP server.
+#DHCP_SERVER_IF="eth0"
+
+# Set to "yes" to enable the NFS server:
+NFS_SERVER_ENA="no"
+
+# Set FIREWALL_ENA to "yes" to enable the firewall:
+FIREWALL_ENA="no"
+# Set FIREWALL_WWW to the ethernet interface connected to the outside world (internet):
+FIREWALL_WWW="eth0"
+# Set FIREWALL_LAN to the ethernet interface connected to the internal LAN:
+FIREWALL_LAN="eth1"
+EOF
+
+# Keyboard settings
+cat > /etc/sysconfig/keyboard << "EOF"
+# Keyboard language: us, cf, fr, etc.
+KEYBOARD=us
+EOF
+
+# Replacing 'KEYBOARD=us' entry with appropriate keyboard layout specified by user in sysinfos
+if [ "x${KEYBOARD}" != "x" ]; then
+ sed -i s/KEYBOARD=us/KEYBOARD=${KEYBOARD}/ /etc/sysconfig/keyboard
+fi
+
+# Removing /tools from the PATH environment variable during boot for bootscripts:
+sed -i -e "s!^\(export PATH=\).*tools.*!\1/bin:/usr/bin:/sbin:/usr/sbin!" /etc/rc.d/init.d/functions
+
+# Copying boot scripts
+STAGE2_BOOTSCRIPTS="ifdown ifup keyboard mountnetfs network sysklogd"
+for bootscript in ${STAGE2_BOOTSCRIPTS}; do
+ install -m755 bootscripts/${bootscript} /etc/rc.d/init.d
+done
+
+# Necessary because bootscript_add_* scripts use ${LFS} when
+# writing/modifyng files
+export LFS=
+
+# rcsysinit.d
+bootscript_add_rcsysinit sysklogd 50 93
+bootscript_add_rcsysinit keyboard 55 00
+
+# rc3.d
+bootscript_add_rc3 network 05 80
+bootscript_add_rc3 mountnetfs 30 10
+
+chown -R root:root /etc/rc.d /etc/sysconfig
+
+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
+
+SRCDIR="./hv-utilities"
+PREFIX="/usr/local"
+BINDIR="${PREFIX}/bin"
+SYSBINDIR="${PREFIX}/sbin"
+BIN_UTILITIES="camera-download cd-erase cd-copy pstopdf distro-backup dos2unix \
+ dvd-ram-format fix-avi gztobz2 hv-backup hv-video-dvd mail-files \
+ mail-if-fail mail-statistics media-write pstopdf replace.pl \
+ rotatelogs setdate strip-debug-symbols tarbz2 tildes-clean"
+
+for program in ${BIN_UTILITIES}; do
+ install -v ${SRCDIR}/${program} ${BINDIR}
+done
+
+exit $?
--- /dev/null
+#!/bin/bash
+set -o errexit
+
+# First argument of this script is the package name.
+# Remaining arguments are additional configure options.
+
+PACKAGE=${1}
+shift
+CONFIGURE_OPTS=${*}
+
+# 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}"
+
+source ${SCRDIR}/../functions-ac
+
+ldconfig
+
+exit $?
--- /dev/null
+#!/bin/bash
+
+hvbuild()
+{
+ cd ${LFS_TMP}/${PACKAGE}
+ make -f Makefile-libbz2_so
+ make clean
+ make -j ${MAKEJOBS}
+ make PREFIX=/usr install
+
+ cp -fv bzip2-shared /bin/bzip2
+ cp -afv libbz2.so* /lib
+ ln -sfvT ../../lib/libbz2.so.1.0 /usr/lib/libbz2.so
+ rm -fv /usr/bin/{bunzip2,bzcat,bzip2}
+ ln -sfvT bzip2 /bin/bunzip2
+ ln -sfvT bzip2 /bin/bzcat
+}
--- /dev/null
+#!/bin/bash
+
+hvconfig_pre()
+{
+ # A patch will cause the Diffutils build system to attempt to rebuild
+ # the diff.1 man page using the unavailable program help2man:
+ touch ${LFS_TMP}/${PACKAGE}/man/diff.1
+}
--- /dev/null
+#!/bin/bash
+
+CONFIGURE_OPTS="\
+ --libexecdir=/usr/lib/findutils \
+ --localstatedir=/var/lib/locate \
+ ${CONFIGURE_OPTS}"
+
+hvbuild_post()
+{
+ # Some of the scripts in the LFS-Bootscripts package depend on find. As
+ # /usr may not be available during the early stages of booting, this program
+ # needs to be on the root partition. The updatedb script also needs to be
+ # modified to correct an explicit path:
+ mv -v /usr/bin/find /bin
+ sed -i -e 's/find:=${BINDIR}/find:=\/bin/' /usr/bin/updatedb
+}
--- /dev/null
+#!/bin/bash
+
+hvbuild_port()
+{
+ make install-compat
+}
--- /dev/null
+#!/bin/bash
+
+PAGE=letter
+
+CONFIGURE_OPTS="\
+ --enable-multibyte
+ ${CONFIGURE_OPTS}"
+
+# Groff does not like to be made in parallel.
+
+hvbuild_post()
+{
+ # Some documentation programs, such as xman, will not work properly without
+ # the following symlinks:
+ ln -fsv eqn /usr/bin/geqn
+ ln -fsv tbl /usr/bin/gtbl
+}
--- /dev/null
+#!/bin/bash
+
+CONFIGURE_OPTS="\
+ --bindir=/bin
+ ${CONFIGURE_OPTS}"
+
+hvbuild_post()
+{
+ # Move some programs that do not need to be on the root filesystem:
+ mv -fv /bin/{gzexe,uncompress,zcmp,zdiff,zegrep} /usr/bin
+ mv -fv /bin/{zfgrep,zforce,zgrep,zless,zmore,znew} /usr/bin
+}
--- /dev/null
+#!/bin/bash
+
+CONFIGURE_OPTS="\
+ --libexecdir=/usr/sbin \
+ --localstatedir=/var \
+ --disable-ifconfig \
+ --disable-logger \
+ --disable-syslogd \
+ --disable-whois \
+ --disable-servers"
+
+hvbuild_post()
+{
+ # Move some programs to their FHS-compliant place:
+ mv -v /usr/bin/{hostname,ping,ping6} /bin
+ mv -v /usr/bin/traceroute /sbin
+}
#!/bin/bash
-HV_NO_CONFIGURE_SCRIPT=1
-
hvbuild()
{
# The arpd binary included in this package is dependent on Berkeley DB.
--- /dev/null
+#!/bin/bash
+
+# --datadir=/lib/kbd
+# This option puts keyboard layout data in a directory that will
+# always be on the root partition instead of the default /usr/share/kbd
+CONFIGURE_OPTS="\
+ --datadir=/lib/kbd
+ ${CONFIGURE_OPTS}"
+
+hvbuild_post()
+{
+ # Some of the scripts in the LFS-Bootscripts package depend on kbd_mode,
+ # openvt, and setfont. As /usr may not be available during the early stages
+ # of booting, those binaries need to be on the root partition:
+ mv -v /usr/bin/{kbd_mode,loadkeys,openvt,setfont} /bin
+}
#!/bin/bash
-HV_NO_CONFIGURE_SCRIPT=1
-
hvbuild()
{
# The kernel sources were already copied into /usr/src in stage0
#!/bin/bash
-HV_NO_CONFIGURE_SCRIPT=1
-
hvbuild()
{
- cd ${LFS_TMP}/${PACKAGE}
- make install
+ make -C ${LFS_TMP}/${PACKAGE} install
}
--- /dev/null
+#!/bin/bash
+
+# --enable-zlib-dynamic: To handle compressed kernel modules.
+CONFIGURE_OPTS="\
+ --enable-zlib-dynamic \
+ --mandir=/usr/share/man \
+ ${CONFIGURE_OPTS}"
+
+hvbuild()
+{
+ make -j ${MAKEJOBS}
+
+ # INSTALL=install
+ # Normally, make install will not install the binaries if they already
+ # exist. This option overrides that behavior by calling install instead
+ # of using the default wrapper script.
+ make INSTALL=install install
+}
+
+hvbuild_post()
+{
+ cat > /etc/modprobe.conf << "EOF"
+# modprobe.conf
+EOF
+}
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
+ if [ "x${HVLABEL}" = "x${PERL}-pass1" ]; then
+ # 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
+
+ CONFIGURE_OPTS="\
+ --prefix=/tools \
+ -Dcc=gcc"
+ else
+ # By default, Perl's Compress::Raw::Zlib module builds and links against
+ # its own internal copy of Zlib. The following command will tell it to
+ # use the system-installed Zlib:
+ sed -i -e '/^BUILD_ZLIB/s/True/False/' \
+ -e '/^INCLUDE/s,\./zlib-src,/usr/include,' \
+ -e '/^LIB/s,\./zlib-src,/usr/lib,' \
+ ${LFS_TMP}/${PACKAGE}/cpan/Compress-Raw-Zlib/config.in
+
+ CONFIGURE_OPTS="\
+ --prefix=/usr \
+ -Dvendorprefix=/usr \
+ -Dman1dir=/usr/share/man/man1 \
+ -Dman3dir=/usr/share/man/man3 \
+ -Dpager=\"/bin/less -isR\" \
+ -Dusethreads -Duseshrplib"
+ fi
}
hvconfig()
{
cd ${LFS_TMP}/${PACKAGE}
-
- ./configure.gnu \
- --prefix=/tools \
- -Dcc="gcc"
+ ./configure.gnu ${CONFIGURE_OPTS}
}
hvbuild_post()
{
- ln -svfT /tools/bin/perl /usr/bin/perl
+ if [ "x${HVLABEL}" = "x${PERL}-pass1" ]; then
+ ln -svfT /tools/bin/perl /usr/bin/perl
+ fi
}
--- /dev/null
+#!/bin/bash
+
+hvbuild_post()
+{
+ # Move the killall and fuser programs to the location specified by the FHS:
+ mv -v /usr/bin/fuser /bin
+ mv -v /usr/bin/killall /bin
+}
--- /dev/null
+#!/bin/bash
+
+CONFIGURE_OPTS="\
+ --without-selinux
+ ${CONFIGURE_OPTS}"
+
+hvconfig_pre()
+{
+ cd ${LFS_TMP}/${PACKAGE}
+
+ # Disable the installation of the groups program and its man page, as
+ # Coreutils provides a better version.
+ sed -i 's/groups$(EXEEXT) //' src/Makefile.in
+ find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \;
+
+ # Disable the installation of Chinese and Korean manual pages, since Man-DB
+ # cannot format them properly:
+ sed -i -e 's/ ko//' -e 's/ zh_CN zh_TW//' man/Makefile.in
+
+ # Instead of using the default crypt method, use the more secure MD5 method
+ # of password encryption, which also allows passwords longer than 8 characters.
+ # It is also necessary to change the obsolete /var/spool/mail location for user
+ # mailboxes that Shadow uses by default to the /var/mail location used currently:
+ sed -i -e 's@#ENCRYPT_METHOD DES@ENCRYPT_METHOD MD5@' \
+ -e 's@/var/spool/mail@/var/mail@' etc/login.defs
+}
+
+hvbuild_post()
+{
+ var_add_shadow "ENV_SUPATH" /etc/login.defs "/usr/local/sbin:/usr/local/bin"
+
+ # Move some misplaced symlinks/programs to their proper locations.
+ mv /usr/bin/passwd /bin
+
+ # The -D option of the useradd program requires this directory for it
+ # to work properly.
+ mkdir -p /etc/default
+
+ # To enable shadowed passwords:
+ pwconv
+
+ # To enable shadowed group passwords:
+ grpconv
+}
--- /dev/null
+#!/bin/bash
+
+hvbuild_post()
+{
+ cat > /etc/syslog.conf << "EOF"
+# /etc/syslog.conf
+
+auth,authpriv.* -/var/log/auth.log
+*.*;auth,authpriv.none -/var/log/sys.log
+daemon.* -/var/log/daemon.log
+kern.* -/var/log/kern.log
+mail.* -/var/log/mail.log
+user.* -/var/log/user.log
+cron.* -/var/log/cron.log
+*.emerg *
+EOF
+}
--- /dev/null
+#!/bin/bash
+
+hvconfig_pre()
+{
+ cd ${LFS_TMP}/${PACKAGE}
+
+ sed -i 's@Sending processes@& configured via /etc/inittab@g' src/init.c
+
+ # A maintained version of the wall program was installed earlier by
+ # Util-linux-ng. Suppress the installation of Sysvinit's version:
+ sed -i -e 's/utmpdump wall/utmpdump/' \
+ -e 's/mountpoint.1 wall.1/mountpoint.1/' src/Makefile
+}
+
+hvbuild()
+{
+ make -j ${MAKEJOBS} -C src
+ make -C src install
+}
--- /dev/null
+#!/bin/bash
+
+hvbuild_post()
+{
+ make TEXMF=/usr/share/texmf install-tex
+}
--- /dev/null
+#!/bin/bash
+
+CONFIGURE_OPTS="\
+ --sbindir=/sbin \
+ --with-rootlibdir=/lib \
+ --libexecdir=/lib/udev \
+ --docdir=/usr/share/doc/${PACKAGE} \
+ --disable-extras \
+ --disable-introspection \
+ ${CONFIGURE_OPTS}"
+
+hvbuild_post()
+{
+ # Udev has to be configured in order to work properly, as its default
+ # configuration does not cover all devices. First install two extra
+ # rules files from Udev to help support device-mapper and RAID setups:
+ install -m644 -v rules/packages/64-*.rules \
+ /lib/udev/rules.d/
+
+ # Now install a file to create symlinks for certain hand-held devices:
+ install -m644 -v rules/packages/40-pilot-links.rules \
+ /lib/udev/rules.d/
+
+ # Now install a file to handle ISDN devices:
+ install -m644 -v rules/packages/40-isdn.rules \
+ /lib/udev/rules.d/
+
+ install -m755 ${SCRDIR}/misc/udev-create-persistent-net.sh /usr/local/bin
+}
--- /dev/null
+#!/bin/bash
+
+hvbuild()
+{
+ cd ${LFS_TMP}/${PACKAGE}
+ make install
+
+ # Install the documentation that explains the LFS-specific rules files:
+ make install-doc
+}
--- /dev/null
+#!/bin/bash
+set -o errexit
+
+# Reading system configuration informations, functions and package versions.
+source ../sysinfos
+source ../functions
+source ../packages-list
+
+cat > /etc/default/useradd << "EOF"
+# useradd defaults file
+HOME=/home
+INACTIVE=-1
+EXPIRE=
+SHELL=/bin/bash
+SKEL=/etc/skel
+CREATE_MAIL_SPOOL=yes
+EOF
+
+chmod -v 644 /etc/default/useradd
+
+if [ -n "${REGUSER}" ]; then
+ hv_useradd -g users -G audio,video,usb -s /bin/bash -m ${REGUSER}
+fi
+
+echo "Copying /etc/skel files to root directory"
+# Copy skel files to root directory. First create a copy to change owner
+cp -au /etc/skel/.??* /root
+
+# Fixing ownership of directories /tmp and /var/log (may have been created by
+# a regular user when fetching packages).
+chown -v root:root /tmp
+chown -v root:root /var
+chown -v root:root /var/log
+
+exit $?
+++ /dev/null
-#!/bin/bash
-
-LFS_STAGE=stage2
-
-export LFS_PKG_DIR="$(dirname $(pwd))/packages/${LFS_STAGE}"
-export LFS_LOG_DIR=/var/log/hvlinux-install/${LFS_STAGE}
-export LFS_LOG_FILE=${LFS_LOG_DIR}/install.log
-export LFS_TMP=/tmp
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-source /etc/profile
-
-if [ "x${USER}" != "xroot" ]; then
- echo "You must be the superuser to install hvlinux."
- exit 1
-fi
-
-init_log_file
-
-# Scripts directory
-export SCRDIR=$(pwd)
-
-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"
-
-CC="gcc -isystem /usr/include" LDFLAGS="-Wl,-rpath-link,/lib" \
- 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"
-
-CC="gcc -isystem /usr/include" LDFLAGS="-Wl,-rpath-link,/lib" \
- 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_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
-
-exit $?
--- /dev/null
+#!/bin/bash
+
+# Reading system configuration informations, functions and package versions.
+source ../sysinfos
+source ../functions
+source ../packages-list
+
+/tools/bin/find /{,usr/}{bin,lib,sbin} -type f \
+ -exec /tools/bin/strip --strip-debug '{}' ';'
+
+# Return success
+exit 0
--- /dev/null
+#!/bin/bash
+set -o errexit
+
+# Reading system configuration informations, functions and package versions.
+source ../sysinfos
+source ../functions
+source ../packages-list
+
+# Amend the GCC specs file so that it points to the new dynamic linker, and so
+# that GCC knows where to find its start files.
+gcc -dumpspecs | \
+ sed \
+ -e 's@/tools/lib/ld@/lib/ld@g' \
+ -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' > \
+ `dirname $(gcc --print-libgcc-file-name)`/specs
+
+exit $?
--- /dev/null
+#!/bin/bash
+set -o errexit
+
+# Reading system configuration informations, functions and package versions.
+source ../sysinfos
+source ../functions
+source ../packages-list
+
+# Testing toolchain
+cd /tmp
+echo 'main(){}' > dummy.c
+gcc dummy.c -Wl,--verbose &> dummy.log
+
+if ! readelf -l a.out | grep 'Requesting program interpreter: /lib/ld-linux.*.so.2' 1> /dev/null 2>&1 ; then
+ echo "String 'Requesting program interpreter: /lib/ld-linux.*.so.2' not found"
+ exit 1
+fi
+
+rm dummy.{c,log} a.out
+
+exit $?
+++ /dev/null
-../stage2/cis-ac-nobuild
\ No newline at end of file