From f9cf3632a64429991fa5e6f556b0c4017e0e9435 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 8 Feb 2010 05:51:34 +0000 Subject: [PATCH] MErge en cours x86_64 -> trunk --- NOTES | 9 + functions | 610 ++++++++++------------ functions-update | 16 +- packages-list | 171 +++--- stage0/INSTALL | 17 + stage0/README | 1 + {stage2 => stage0}/cis-ac | 25 +- stage0/cis-binutils | 50 ++ stage0/cis-cloog-ppl | 32 ++ stage0/cis-eglibc | 83 +++ stage0/cis-gcc-pass1 | 74 +++ stage0/cis-gcc-pass2 | 73 +++ stage0/cis-linux-api-headers | 20 + stage2/cis-ac => stage0/cis-ncurses | 32 +- stage0/cis-pre-install | 70 +++ stage0/install-1 | 40 ++ stage0/packages-update | 28 + stage0/stage0-install | 31 ++ stage2/INSTALL | 8 +- stage2/TODO | 11 - stage2/bootscripts/checkfs | 39 -- stage2/bootscripts/halt | 10 - stage2/bootscripts/ifdown | 4 +- stage2/bootscripts/ifup | 2 +- stage2/bootscripts/modules | 66 --- stage2/bootscripts/mountfs | 46 -- stage2/bootscripts/mountkernfs | 27 - stage2/bootscripts/mountnetfs | 6 +- stage2/bootscripts/network | 8 - stage2/bootscripts/rc | 150 ------ stage2/bootscripts/reboot | 10 - stage2/bootscripts/sendsignals | 17 - stage2/bootscripts/setclock | 41 -- stage2/bootscripts/swap | 35 -- stage2/bootscripts/udev | 57 -- stage2/bootscripts/udev_retry | 41 -- stage2/cis-ac | 13 +- stage2/cis-ac-nobuild | 18 +- stage2/cis-binutils | 48 +- stage2/cis-bison | 15 +- stage2/cis-bootscripts | 147 ++---- stage2/cis-bzip2 | 27 +- stage2/cis-compressdoc | 7 +- stage2/cis-coreutils | 23 +- stage2/cis-db4 | 23 - stage2/cis-dhcp | 27 +- stage2/{cis-ac => cis-diffutils} | 18 +- stage2/cis-e2fsprogs | 21 +- stage2/cis-ed | 20 - stage2/cis-eglibc | 133 +++++ stage2/cis-emacs | 87 +-- stage2/cis-findutils | 15 +- stage2/cis-flex | 18 +- stage2/cis-gcc | 70 ++- stage2/{cis-ac-nobuild => cis-gdbm} | 17 +- stage2/cis-glibc | 107 ---- stage2/cis-groff | 20 +- stage2/cis-grub | 31 +- stage2/cis-gzip | 15 +- stage2/cis-hv-utilities | 5 +- stage2/cis-iana | 7 +- stage2/cis-inetutils | 35 +- stage2/cis-iproute2 | 23 +- stage2/cis-kbd | 22 +- stage2/cis-kernel | 84 ++- stage2/cis-man | 27 - stage2/cis-man-pages | 7 +- stage2/cis-module-init-tools | 14 +- stage2/{cis-apr => cis-nano} | 22 +- stage2/cis-ncurses | 40 +- stage2/cis-net-tools | 15 +- stage2/cis-nfs-utils | 16 +- stage2/cis-openssh | 31 +- stage2/cis-openssl | 43 +- stage2/cis-pam | 34 +- stage2/cis-pciutils | 22 +- stage2/cis-perl | 27 - stage2/{cis-ac-nobuild => cis-perl-pass1} | 32 +- stage2/cis-perl-pass2 | 39 ++ stage2/cis-pkg-config | 14 +- stage2/cis-popt | 13 +- stage2/cis-portmap | 9 +- stage2/cis-post-install | 17 +- stage2/cis-procps | 9 +- stage2/cis-psmisc | 22 +- stage2/cis-readline | 27 +- stage2/cis-reiserfsprogs | 15 +- stage2/cis-shadow | 63 ++- stage2/cis-sudo | 17 +- stage2/cis-sysklogd | 11 +- stage2/cis-sysvinit | 81 +-- stage2/cis-tcl | 41 ++ stage2/cis-tcp-wrappers | 21 +- stage2/cis-texinfo | 13 +- stage2/cis-toolchain-adjust | 43 +- stage2/cis-toolchain-test | 21 + stage2/cis-udev | 64 +-- stage2/cis-udev-config | 11 +- stage2/cis-util-linux | 30 -- stage2/cis-util-linux-ng | 30 ++ stage2/cis-zlib | 44 +- stage2/create-config-files | 221 +------- stage2/create-groups | 37 -- stage2/create-users | 13 - stage2/hv-utilities/fix-avi | 2 +- stage2/hv-utilities/hv-video-dvd | 4 +- stage2/hv-utilities/media-write | 8 +- stage2/install-2 | 148 +++--- stage2/makedir | 35 -- stage2/misc/DIR_COLORS | 73 --- stage2/misc/compressdoc | 185 ++++--- stage2/misc/nanorc | 47 ++ stage2/misc/udev-create-persistent-net.sh | 7 + stage2/packages-update | 99 ++-- stage2/setup | 66 --- stage2/stage2-install | 116 ++-- stage2/symlinks | 23 - sysinfos | 70 ++- 118 files changed, 2390 insertions(+), 2805 deletions(-) create mode 100644 stage0/INSTALL create mode 100644 stage0/README copy {stage2 => stage0}/cis-ac (66%) create mode 100755 stage0/cis-binutils create mode 100755 stage0/cis-cloog-ppl create mode 100755 stage0/cis-eglibc create mode 100755 stage0/cis-gcc-pass1 create mode 100755 stage0/cis-gcc-pass2 create mode 100755 stage0/cis-linux-api-headers copy stage2/cis-ac => stage0/cis-ncurses (57%) create mode 100755 stage0/cis-pre-install create mode 100755 stage0/install-1 create mode 100755 stage0/packages-update create mode 100755 stage0/stage0-install delete mode 100755 stage2/bootscripts/checkfs delete mode 100755 stage2/bootscripts/halt delete mode 100755 stage2/bootscripts/modules delete mode 100755 stage2/bootscripts/mountfs delete mode 100755 stage2/bootscripts/mountkernfs delete mode 100755 stage2/bootscripts/rc delete mode 100755 stage2/bootscripts/reboot delete mode 100755 stage2/bootscripts/sendsignals delete mode 100755 stage2/bootscripts/setclock delete mode 100755 stage2/bootscripts/swap delete mode 100644 stage2/bootscripts/udev delete mode 100755 stage2/bootscripts/udev_retry delete mode 100755 stage2/cis-db4 copy stage2/{cis-ac => cis-diffutils} (58%) delete mode 100755 stage2/cis-ed create mode 100755 stage2/cis-eglibc copy stage2/{cis-ac-nobuild => cis-gdbm} (77%) delete mode 100755 stage2/cis-glibc delete mode 100755 stage2/cis-man rename stage2/{cis-apr => cis-nano} (52%) delete mode 100755 stage2/cis-perl copy stage2/{cis-ac-nobuild => cis-perl-pass1} (51%) create mode 100755 stage2/cis-perl-pass2 create mode 100755 stage2/cis-tcl create mode 100755 stage2/cis-toolchain-test delete mode 100755 stage2/cis-util-linux create mode 100755 stage2/cis-util-linux-ng delete mode 100755 stage2/create-groups delete mode 100755 stage2/create-users delete mode 100755 stage2/makedir delete mode 100644 stage2/misc/DIR_COLORS create mode 100644 stage2/misc/nanorc create mode 100755 stage2/misc/udev-create-persistent-net.sh delete mode 100755 stage2/setup delete mode 100755 stage2/symlinks diff --git a/NOTES b/NOTES index 511979e..91626cc 100644 --- a/NOTES +++ b/NOTES @@ -29,3 +29,12 @@ Reduces-size hvlinux perlbug,grolj4,perldoc,a2p,addtinfo,addr2line,cytune,enc2xs,eqn,eqn2graph, infotocap,neonconfig -Remove /usr/lib//*.{a,la} + + + + + +------------ +Après le stage 1: + 1. Monter /mnt/hvrepos (ajouter à /etc/fstab) + 2. Copier les sources de hvlinux diff --git a/functions b/functions index 218df79..b799c51 100644 --- a/functions +++ b/functions @@ -7,27 +7,47 @@ EXIT_SUCCESS=0 EXIT_WARNING=1 EXIT_FAILURE=2 -# The starting position for displaying the "X" sign inside the check box [ ] -CHECK_POSITION=2 -SET_CHECK_POSITION="echo -en \\033[${CHECK_POSITION}G" - +# Position the cursor at the start of the line +SET_CURSOR_START_LINE="\033[1G" # NORMAL prints text in normal color -NORMAL="echo -en \\033[0;39m" +NORMAL="\033[0;39m" # SUCCESS prints text in a green colour -SUCCESS="echo -en \\033[1;32m" +SUCCESS="\033[1;32m" # WARNING prints text in a yellow colour -WARNING="echo -en \\033[1;33m" +WARNING="\033[1;33m" # FAILURE prints text in a red colour -FAILURE="echo -en \\033[1;31m" +FAILURE="\033[1;31m" +# Brackets are blue +BRACKET="\033[1;34m" + +TAR_OPTS="-b8" # It seems that when compiling bash-4.0, using # "make -j 1" is causing problems... -if [ "x${MAKEJOBS}" == "x1" ]; then +if [ "x${MAKEJOBS}" = "x1" ]; then HVMAKE="make" else HVMAKE="make -j ${MAKEJOBS}" fi +case "${HVL_TARGET}" in + "x86_64") + CLFS_BUILDFLAGS="-m64" + CLFS_TARGET="${HVL_TARGET}-unknown-linux-gnu" + ;; + "x86") + # No special flags + CLFS_BUILDFLAGS="" + CLFS_TARGET="i686-unknown-linux-gnu" + ;; + *) + echo "Unsupported target architecture: ${HVL_TARGET}" + return ${EXIT_FAILURE} + ;; +esac + +CLFS=${LFS} + # Extracting the version number from a complete package name. # Arg. #1: Complete package name with version (ex: firefox-3.5.5.source will output 3.5.5) get_pkg_ver() @@ -137,8 +157,8 @@ static_bootscript_add() local START_LEVELS="" local STOP_LEVELS="" - if [ "x${RCLEVEL}" = "xS" ]; then - START_LEVELS="S" + if [ "x${RCLEVEL}" = "xsysinit" ]; then + START_LEVELS="sysinit" STOP_LEVELS="0 6" elif [ "x${RCLEVEL}" = "x3" ]; then START_LEVELS="3 4 5" @@ -149,18 +169,18 @@ static_bootscript_add() fi # Making sure bootscript has correct permissions - chmod -v 740 /etc/rc.d/init.d/${SCRIPTNAME} && + chmod -v 740 ${LFS}/etc/rc.d/init.d/${SCRIPTNAME} && # Removing any old links - for level in S 0 1 2 3 4 5 6; do - cd /etc/rc.d/rc${level}.d && + for level in sysinit 0 1 2 3 4 5 6; do + cd ${LFS}/etc/rc.d/rc${level}.d && rm -v -f $(find . -name "???${SCRIPTNAME}") || exit 1 done && if [ ${START} -ne 0 ]; then # Creating new start links for level in ${START_LEVELS}; do - cd /etc/rc.d/rc${level}.d && + cd ${LFS}/etc/rc.d/rc${level}.d && ln -v -s ../init.d/${SCRIPTNAME} S${START}${SCRIPTNAME} || exit 1 done fi && @@ -168,7 +188,7 @@ static_bootscript_add() if [ ${STOP} -ne 0 ]; then # Creating new stop links for level in ${STOP_LEVELS}; do - cd /etc/rc.d/rc${level}.d && + cd ${LFS}/etc/rc.d/rc${level}.d && ln -v -s ../init.d/${SCRIPTNAME} K${STOP}${SCRIPTNAME} || exit 1 done fi @@ -188,21 +208,21 @@ bootscript_add_manual() local STOP=${4} # Making sure bootscript has correct permissions - chmod 740 /etc/rc.d/init.d/${SCRIPTNAME} && + chmod 740 ${LFS}/etc/rc.d/init.d/${SCRIPTNAME} && # Removing any old links - cd /etc/rc.d/rc${RCLEVEL}.d && + cd ${LFS}/etc/rc.d/rc${RCLEVEL}.d && rm -v -f $(find . -name "???${SCRIPTNAME}") && if [ ${START} -ne 0 ]; then # Creating new start link - cd /etc/rc.d/rc${RCLEVEL}.d && + cd ${LFS}/etc/rc.d/rc${RCLEVEL}.d && ln -v -s ../init.d/${SCRIPTNAME} S${START}${SCRIPTNAME} || exit 1 fi && if [ ${STOP} -ne 0 ]; then # Creating new stop link - cd /etc/rc.d/rc${RCLEVEL}.d && + cd ${LFS}/etc/rc.d/rc${RCLEVEL}.d && ln -v -s ../init.d/${SCRIPTNAME} K${STOP}${SCRIPTNAME} || exit 1 fi } @@ -222,9 +242,9 @@ bootscript_add_rc3() # Arg #1: script name # Arg #2: start number # Arg #3: stop number -bootscript_add_rcS() +bootscript_add_rcsysinit() { - static_bootscript_add ${*} S + static_bootscript_add ${*} sysinit } # Add "export" before the variable name @@ -313,12 +333,11 @@ var_add() # PATH=... matches but not MANPATH=... if grep "^${VARIABLE}=\"" ${FILE} 1> /dev/null 2>&1; then # Variable value is enclosed by double-quotes - sed -i "s!\(^${VARIABLE}=\".*\)\(\"\)!\1${SEP}${VALUE}\"!" ${FILE} + sed -i "s!\(^${VARIABLE}=\".*\)\(\"\)!\1${SEP}${VALUE}\"!" ${FILE} || exit 1 else # Variable value is NOT enclosed by double-quotes - sed -i "s!\(^${VARIABLE}=.*\)!\1${SEP}${VALUE}!" ${FILE} + sed -i "s!\(^${VARIABLE}=.*\)!\1${SEP}${VALUE}!" ${FILE} || exit 1 fi - evaluate_retval # Adding new value to variable (case with export before) # We search for the variable name starting after an export statement, @@ -428,14 +447,19 @@ hv_groupadd() { arguments=${*} + set +e + while [ $# -ne 0 ]; do last_argument=${*} shift done groupadd ${arguments} + error=$? - if [ $? -eq 0 -o $? -eq 9 ]; then + set -e + + if [ ${error} -eq 0 -o ${error} -eq 9 ]; then # 9 means the group already exists return ${EXIT_SUCCESS} else @@ -449,6 +473,8 @@ hv_useradd() { arguments="${*}" + set +e + # The last argument is the username while [ $# -ne 0 ]; do last_argument=${*} @@ -456,8 +482,11 @@ hv_useradd() done useradd ${arguments} + error=$? + + set -e - if [ $? -eq 0 -o $? -eq 9 ]; then + if [ ${error} -eq 0 -o ${error} -eq 9 ]; then # 9 means the user already exists return ${EXIT_SUCCESS} else @@ -467,24 +496,10 @@ hv_useradd() # Evaluates the return value of the process that was run just before this # function was called. -evaluate_retval() +eval_retval() { if [ $? -ne 0 ]; then - echo "*************" - echo "* ERROR *" - echo "*************" - exit 1 - fi -} - -# Evaluates the return value of the process that was run just before this -# function was called. -eval_retval2() -{ - if [ $? -ne 0 ]; then - ${SET_CHECK_POSITION} print_status failure - echo exit ${EXIT_FAILURE} fi } @@ -495,11 +510,37 @@ static_decompressed_dirname() { local PACKAGE=${1} - local DIRNAME=$(tar -tf ${LFS_PKG_DIR}/${PACKAGE}.tar.bz2 | head -n1 | awk -F \/ '{print $1}') + # Remove optional "./" leading component with sed + # and extract base directory name with awk. + local DIRNAME=$(tar ${TAR_OPTS} -tf ${LFS_PKG_DIR}/${PACKAGE}.tar.bz2 | head -n1 | sed 's!^\./!!' | awk -F \/ '{print $1}') echo ${DIRNAME} } +# Applying patch +# First argument is the name of the patch +# Second argument is the package name (target dir in $LFS_TMP) +apply_patch() +{ + local PATCH_FILE=${1} + local TARGET_DIR=${2} + + if [ -z "${PATCH_FILE}" ]; then + echo + echo "apply_patch(): no patch specified." + return ${EXIT_FAILURE} + fi + + if [ ! -f ${LFS_PKG_DIR}/${PATCH_FILE} ]; then + echo + echo "${FUNCNAME}(): patch file '${PATCH_FILE}' not found." + return ${EXIT_FAILURE} + fi + + echo "Applying patch: ${PATCH_FILE}" + patch -Np1 -d ${LFS_TMP}/${TARGET_DIR} -i ${LFS_PKG_DIR}/${PATCH_FILE} +} + # Applying any patch(es) found for the current package. # Will work only if patches have the same base name as # the package, followed by a dash: @@ -529,40 +570,13 @@ apply_patches() if ls ${LFS_PKG_DIR}/${1}-*.patch 1> /dev/null 2>&1; then cd ${LFS_PKG_DIR} for patch in ${1}-*.patch; do - echo "Applying patch: ${patch}:" - patch -Np1 -d ${LFS_TMP}/${TARGET_DIR} -i ${LFS_PKG_DIR}/${patch} || exit 1 + apply_patch ${patch} ${TARGET_DIR} || exit 1 done fi return $? } -# Applying patch -# First argument is the name of the patch -# Second argument is the package name -apply_patch() -{ - PATCH_FILE=${1} - PACKAGE=${2} - - if [ -z "${PATCH_FILE}" ]; then - echo - echo "apply_patch(): no patch specified." - return ${EXIT_FAILURE} - fi - - if [ ! -f ${LFS_PKG_DIR}/${PATCH_FILE} ]; then - echo - echo "${FUNCNAME}(): patch file '${PATCH_FILE}' not found." - return ${EXIT_FAILURE} - fi - - echo "******************************" - echo "* Applying patch: ${PATCH_FILE}" - echo "******************************" - patch -Np1 -d ${LFS_TMP}/${PACKAGE} -i ${LFS_PKG_DIR}/${PATCH_FILE} -} - # Decompression of a package # First argument: package name # Second argument: directory where decompressing (optional) @@ -593,140 +607,19 @@ decompress_package() # Decompressing package # Option 'U' of tar is to remove each file prior to extracting over it cd ${TOPDIR} && - tar -jxvf ${LFS_PKG_DIR}/${PACKAGE}.tar.bz2 && + tar ${TAR_OPTS} -jxvf ${LFS_PKG_DIR}/${PACKAGE}.tar.bz2 && cd - 1> /dev/null 2>&1 } -# Installation of a package, removing source and build directories after. -# -# First argument: package name -# Second argument: script name -# Remaining arguments: additional configure options -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 PACKAGE=${1} - shift - local CUSTOM_SCRIPT=${1} - shift - local CONFIGURE_OPTS=${*} - - static_ipkg ${PACKAGE} ${CUSTOM_SCRIPT} ${PACKAGE} ${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() -{ - # Checking for correct number of arguments - if [ $# -lt 1 ]; then - echo - echo "${FUNCNAME}(): Wrong number of arguments" - echo " command was: \"${FUNCNAME}() $*\"" - exit ${EXIT_FAILURE} - fi - - local PACKAGE=${1} - shift - local CONFIGURE_OPTS=${*} - - static_ipkg ${PACKAGE} cis-ac ${PACKAGE} ${CONFIGURE_OPTS} -} - -# 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() -{ - # Checking for correct number of arguments - if [ $# -lt 1 ]; then - echo - echo "${FUNCNAME}(): Wrong number of arguments" - echo " command was: \"${FUNCNAME}() $*\"" - exit ${EXIT_FAILURE} - fi - - local PACKAGE=${1} - shift - local CONFIGURE_OPTS=${*} - - static_ipkg ${PACKAGE} cis-ac-nobuild ${PACKAGE} ${CONFIGURE_OPTS} -} - -# Installation of a GNOME package. -# -# First argument: package name -ipkg_gnome() -{ - # 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 - - static_ipkg ${1} cis-gnome ${1} -} - -# 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 - - static_ipkg ${1} cis-pm ${1} -} - -# Multiple installation of a package. This is usefull for packages -# that may need to be installed multiple times, at different -# times of the build process, like for GCC pas 1 and GCC pass 2. -# -# First argument: Real package name -# Second argument: Installation script name -# Third argument: Unique identification label in 'install.log' -ipkg_mult() -{ - # Checking for correct number of arguments - if [ $# -ne 3 ]; then - echo - echo "${FUNCNAME}(): Wrong number of arguments" - echo " command was: \"${FUNCNAME}() $*\"" - exit ${EXIT_FAILURE} - fi - - static_ipkg ${1} ${2} ${3} -} - # Installation of a package # # First argument: Real package name # Second argument: Installation script name # Third argument: Unique identification label in 'install.log' # Remaining arguments: Additional configure options -static_ipkg() +ipkg() { - local START_TIME=$(echo `date +%s`) + START_TIME=$(echo `date +%s`) local PACKAGE_NAME=${1} local SCRIPT=./${2} local LABEL=${3} @@ -760,20 +653,22 @@ static_ipkg() fi # Displaying label - echo -n "[ ] Installing" ${LABEL}" " + MSGSTRING="Installing ${LABEL}" + display_checkbox_msg ${MSGSTRING} echo "------------------------" 1>> ${LFS_LOG_FILE} - echo "Installing" ${LABEL} 1>> ${LFS_LOG_FILE} + echo "${MSGSTRING}" 1>> ${LFS_LOG_FILE} echo "Decompressing package" 1>> ${PACKAGE_LOG} 2>&1 && decompress_package ${PACKAGE_NAME} 1> /dev/null 2>> ${PACKAGE_LOG} - eval_retval2 + eval_retval local DECOMPRESSED_DIRNAME=$(static_decompressed_dirname ${PACKAGE_NAME}) # Rename the decompressed package as per the package name if necessary if [ "x${DECOMPRESSED_DIRNAME}" != "x${PACKAGE_NAME}" ]; then - mv ${LFS_TMP}/${DECOMPRESSED_DIRNAME} ${LFS_TMP}/${PACKAGE_NAME} || exit 1 + mv ${LFS_TMP}/${DECOMPRESSED_DIRNAME} ${LFS_TMP}/${PACKAGE_NAME} + eval_retval fi # Displaying package source size in log file @@ -783,16 +678,16 @@ static_ipkg() if [ -d ${LFS_TMP}/${PACKAGE_NAME}-build ]; then echo "Removing old build directory" 1>> ${PACKAGE_LOG} 2>&1 && rm -v -rf ${LFS_TMP}/${PACKAGE_NAME}-build 1> /dev/null 2>> ${PACKAGE_LOG} - eval_retval2 + eval_retval fi # Creating build directory mkdir -v ${LFS_TMP}/${PACKAGE_NAME}-build 1>> ${PACKAGE_LOG} 2>&1 - eval_retval2 + eval_retval # Executing script. ${SCRIPT} ${PACKAGE_NAME} ${CONFIGURE_OPTS} 1>> ${PACKAGE_LOG} 2>&1 - eval_retval2 + eval_retval # Displaying package build size in log file BUILD_SIZE=$(du -h -s -c ${LFS_TMP}/${PACKAGE_NAME} ${LFS_TMP}/${PACKAGE_NAME}-build | grep total | awk '{ print $1 }') @@ -804,134 +699,163 @@ static_ipkg() # Removing source directory echo "Removing source directory" 1>> ${PACKAGE_LOG} 2>&1 && rm -v -rf ${LFS_TMP}/${PACKAGE_NAME} 1> /dev/null 2>> ${PACKAGE_LOG} - eval_retval2 + eval_retval fi if [ -d ${LFS_TMP}/${PACKAGE_NAME}-build ]; then # Removing build directory echo "Removing build directory" 1>> ${PACKAGE_LOG} 2>&1 && rm -v -rf ${LFS_TMP}/${PACKAGE_NAME}-build 1> /dev/null 2>> ${PACKAGE_LOG} - eval_retval2 + eval_retval fi # Writing success string to the end of the log file echo "${LABEL} successfully installed" 1>> ${LFS_LOG_FILE} # Displaying build time after the package name - display_build_time ${START_TIME} - - ${SET_CHECK_POSITION} print_status success return $EXIT_SUCCESS } -# Display the action name, run a command, log its output and display it's -# status -# First argument: action name (string) -# Remaining arguments: command name with it's options -action_checkbox() +# Installation of a package, removing source and build directories after. +# +# First argument: package name +# Second argument: script name +# Remaining arguments: additional configure options +ipkg_cust() { - # Displaying script name - echo -n "[ ]" $1 - $SET_CHECK_POSITION - shift - echo $* 1>> ${LFS_LOG_FILE} - - # Executing command - $* 1>> ${LFS_LOG_FILE} 2>&1 - if [ $? -ne 0 ]; then - print_status failure - echo + # 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 - print_status success + local PACKAGE=${1} + local CUSTOM_SCRIPT=${2} + local LABEL=${PACKAGE} + shift + shift + local CONFIGURE_OPTS=${*} - return $EXIT_SUCCESS + ipkg ${PACKAGE} ${CUSTOM_SCRIPT} ${LABEL} ${CONFIGURE_OPTS} } -# Display the action name, run a command, log its output and display it's -# status and the time it took to execute. -# Note: In case of errors, this function returns an error code instead -# of exiting. -# First argument: action name (string) -# Remaining arguments: command name with it's options -action_checkbox_time() +# 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() { - START_TIME=$(echo `date +%s`) + # Checking for correct number of arguments + if [ $# -lt 1 ]; then + echo + echo "${FUNCNAME}(): Wrong number of arguments" + echo " command was: \"${FUNCNAME}() $*\"" + exit ${EXIT_FAILURE} + fi - # Displaying script name - echo -n "[ ]" $1" " + local PACKAGE=${1} + local LABEL=${PACKAGE} shift - echo $* 1>> ${LFS_LOG_FILE} + local CONFIGURE_OPTS=${*} - # Executing command - $* 1>> ${LFS_LOG_FILE} 2>&1 - if [ $? -ne 0 ]; then - ${SET_CHECK_POSITION} - print_status failure + ipkg ${PACKAGE} cis-ac ${LABEL} ${CONFIGURE_OPTS} +} - return ${EXIT_FAILURE} - else - # Displaying build time after the package name - display_build_time ${START_TIME} - - ${SET_CHECK_POSITION} - print_status success - - return $EXIT_SUCCESS +# 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() +{ + # Checking for correct number of arguments + if [ $# -lt 1 ]; then + echo + echo "${FUNCNAME}(): Wrong number of arguments" + echo " command was: \"${FUNCNAME}() $*\"" + exit ${EXIT_FAILURE} fi + + local PACKAGE=${1} + local LABEL=${PACKAGE} + shift + local CONFIGURE_OPTS=${*} + + ipkg ${PACKAGE} cis-ac-nobuild ${LABEL} ${CONFIGURE_OPTS} } -# Display the action name, run a command, log its output and display it's -# status. Write to install log file when successfully completed so it -# won't be called again after a successfull installation. -# First argument: Message to display during action -# Second argument: script name (will be label) -run_script_log() +# Installation of a GNOME package. +# +# First argument: package name +# Remaining arguments: additional configure options +ipkg_gnome() { - MSGSTRING=${1} - SCRIPT=${2} - LABEL=${SCRIPT} - # Checking for correct number of arguments - if [ $# -lt 2 ]; then - echo "${FUNCNAME}(): Missing argument" + 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} shift - shift - SCRIPT_ARGS=${*} + local CONFIGURE_OPTS=${*} - # Checking if script is valid and executable - if [ ! -x ./${SCRIPT} ]; then - echo "${FUNCNAME}(): script not found: ${SCRIPT}" + ipkg ${PACKAGE} cis-gnome ${LABEL} ${CONFIGURE_OPTS} +} + +# 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 - PACKAGE_LOG=${LFS_LOG_DIR}/${LABEL}.log + local PACKAGE=${1} + local LABEL=${PACKAGE} - # Checking if package was previously successfully installed - if grep "^${LABEL} successfully installed" ${LFS_LOG_FILE} 1> /dev/null 2>&1; - then - return $EXIT_SUCCESS + ipkg ${PACKAGE} cis-pm ${LABEL} +} + +# Run command, no log +# First argument: Message to display during script +# Second argument: command + arguments +rcmd() +{ + START_TIME=$(echo `date +%s`) + + # Checking for correct number of arguments + if [ $# -lt 2 ]; then + echo "${FUNCNAME}(): Missing argument(s)" + exit ${EXIT_FAILURE} fi - - # Displaying script name - echo -n "[ ] ${MSGSTRING}" - echo "------------------------" 1>> ${LFS_LOG_FILE} - echo "Running " ${LABEL} 1>> ${LFS_LOG_FILE} - echo 1>> ${LFS_LOG_FILE} - # Executing command - ./${SCRIPT} ${SCRIPT_ARGS} 1>> ${PACKAGE_LOG} 2>&1 - eval_retval2 + local MSGSTRING=${1} + local CMD=${2} + shift + local CMD_WITH_ARGS=${*} - # Writing success string to the end of the log file - echo "${LABEL} successfully installed" 1>> ${LFS_LOG_FILE} + display_checkbox_msg ${MSGSTRING} + echo ${CMD_WITH_ARGS} 1>> ${LFS_LOG_FILE} - $SET_CHECK_POSITION + # Executing command + ${CMD_WITH_ARGS} 1>> ${LFS_LOG_FILE} 2>&1 + eval_retval + + # Displaying build time after the package name print_status success return $EXIT_SUCCESS @@ -940,40 +864,64 @@ run_script_log() # Display the action name, run a command, log its output and display it's # status. Write to install log file when successfully completed so it # won't be called again after a successfull installation. -# First argument: label (string) -# Second argument: script name -run_cmd_log() + +# First argument: "once" -> script is run only once +# "mult" -> script can be run more than once +# Second argument: Message to display during script +# Third argument: script name (will be label) +rscr() { + START_TIME=$(echo `date +%s`) + # Checking for correct number of arguments - if [ $# -lt 2 ]; then - echo "${FUNCNAME}(): Missing argument" + if [ $# -lt 3 ]; then + echo "${FUNCNAME}(): Missing argument(s)" exit ${EXIT_FAILURE} fi - LABEL=${1} + SCRMODE=${1} + MSGSTRING=${2} + SCRIPT=${3} + LABEL=${SCRIPT} + shift shift - SCRIPT=${*} + SCRIPT_ARGS=${*} - # Checking if package was previously successfully installed - if grep "^${LABEL} successfully installed" ${LFS_LOG_FILE} 1> /dev/null 2>&1; - then - return $EXIT_SUCCESS + # Checking script mode: + if [ "x${SCRMODE}" != "xonce" -a "x${SCRMODE}" != "xmult" ]; then + echo "${FUNCNAME}(): First argument invalid, must be \"once\" or \"mult\" (\"${SCRMODE}\" given)" + exit ${EXIT_FAILURE} fi - - # Displaying script name - echo -n "[ ] ${LABEL}" + + # Checking if script is valid and executable + if [ ! -x ./${SCRIPT} ]; then + echo "${FUNCNAME}(): script not found: ${SCRIPT}" + exit ${EXIT_FAILURE} + fi + + PACKAGE_LOG=${LFS_LOG_DIR}/${LABEL}.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 + return $EXIT_SUCCESS + fi + fi + + display_checkbox_msg ${MSGSTRING} echo "------------------------" 1>> ${LFS_LOG_FILE} - echo "${LABEL}" 1>> ${LFS_LOG_FILE} - echo 1>> ${LFS_LOG_FILE} + echo ${LABEL} 1>> ${LFS_LOG_FILE} - # Executing command - ${SCRIPT} 1>> ${LFS_LOG_FILE} 2>&1 - eval_retval2 + # Executing script + ./${SCRIPT} ${SCRIPT_ARGS} 1>> ${PACKAGE_LOG} 2>&1 + eval_retval - # Writing success string to the end of the log file - echo "${LABEL} successfully installed" 1>> ${LFS_LOG_FILE} + if [ "x${SCRMODE}" = "xonce" ]; then + # Writing success string to the end of the log file + echo "${LABEL} successfully installed" 1>> ${LFS_LOG_FILE} + fi - $SET_CHECK_POSITION + # Displaying build time after the package name print_status success return $EXIT_SUCCESS @@ -1006,12 +954,13 @@ get_total_build_time() echo "${HOURS}.${MIN}" } +# Global variable: START_TIME display_build_time() { END_TIME=$(echo `date +%s`) HOURS=$(( ( ${END_TIME} - ${START_TIME} ) / 3600 )) - echo -n "("${HOURS}"." + echo -n " ("${HOURS}"." echo -n " Build time: ${HOURS}." 1>> ${LFS_LOG_FILE} # Time is inferior to 1 hour... @@ -1034,48 +983,51 @@ display_build_time() echo "h" 1>> ${LFS_LOG_FILE} } +# Global variable: MSGSTRING +display_checkbox_msg() +{ + echo -en "${BRACKET}[ ${BRACKET}]${NORMAL} ${MSGSTRING}" +} + # The print_status prints a coloured "X" letter inside the checkbox to the left -# of the screen (the checkbox is displayed with the action_checkbox function). +# of the screen (the checkbox is already displayed, and the cursor must have +# been saved to where to put the mark). +# 1st arg: status: success, warning or failure +# Global variables: MSGSTRING and START_TIME print_status() { - if [ $# = 0 ]; then + if [ $# -ne 1 ]; then # If no parameters are given to the print_status function, print usage # information. - echo "Usage: ${FUNCNAME}() {success|warning|failure}" + echo "Usage: ${FUNCNAME}() {success|warning|failure} [STRING] [TIME]" return ${EXIT_FAILURE} fi - - case "$1" in + + local COLOR="" + + case "${1}" in success) - $SUCCESS + COLOR=$SUCCESS ;; warning) - $WARNING + COLOR=$WARNING ;; failure) - $FAILURE + COLOR=$FAILURE ;; *) echo "Usage: ${FUNCNAME}() {success|warning|failure}" return ${EXIT_FAILURE} ;; esac - echo "X" - $NORMAL -} -# Testing GCC toolchain -gcc_toolchain_test_stage1() -{ - cd ${LFS_TMP} && - echo 'main(){}' > dummy.c && - cc dummy.c && - readelf -l a.out | grep ': /tools' 1> /dev/null 2>&1 + # Reposition cursor at start of line + echo -en "${SET_CURSOR_START_LINE}" + echo -en "${BRACKET}[${COLOR}X${BRACKET}]${NORMAL} ${MSGSTRING}" - if [ $? -ne 0 ]; then - echo "Testing toolchain failed..." - exit 1 + if [ "x${MSGSTRING}" != "x" ]; then + display_build_time fi - rm dummy.c a.out + echo } diff --git a/functions-update b/functions-update index 8339311..de02b74 100644 --- a/functions-update +++ b/functions-update @@ -56,16 +56,16 @@ update_packages_init() fi # Getting list of all patches from LFS server. - action_checkbox "Fetching LFS patches list" static_fetch_patches_list ${LFS_PATCHES_URL} ${LFS_PATCHES_LIST} + rcmd "Fetching LFS patches list" static_fetch_patches_list ${LFS_PATCHES_URL} ${LFS_PATCHES_LIST} # Getting list of all patches from BLFS server. - action_checkbox "Fetching BLFS patches list" static_fetch_patches_list ${BLFS_PATCHES_URL} ${BLFS_PATCHES_LIST} + rcmd "Fetching BLFS patches list" static_fetch_patches_list ${BLFS_PATCHES_URL} ${BLFS_PATCHES_LIST} # Getting list of all patches from CLFS server. - action_checkbox "Fetching CLFS patches list" static_fetch_patches_list ${CLFS_PATCHES_URL} ${CLFS_PATCHES_LIST} + rcmd "Fetching CLFS patches list" static_fetch_patches_list ${CLFS_PATCHES_URL} ${CLFS_PATCHES_LIST} # Getting list of all patches from hugovil.com server. - action_checkbox "Fetching hugovil.com patches list" static_fetch_patches_list ${HV_PATCHES_URL} ${HV_PATCHES_LIST} + rcmd "Fetching hugovil.com patches list" static_fetch_patches_list ${HV_PATCHES_URL} ${HV_PATCHES_LIST} } # Get patch package if it is not in the repository @@ -82,7 +82,7 @@ static_checkpatch() if [ -n "${PATCHES_FOUND}" ]; then for p in ${PATCHES_FOUND}; do if [ ! -f ${LFS_PKG_DIR}/${p} ]; then - action_checkbox_time "Fetching ${p} from ${PATCHES_URL}" ${WGETCMD} ${PATCHES_URL}/${p} + rcmd "Fetching ${p} from ${PATCHES_URL}" ${WGETCMD} ${PATCHES_URL}/${p} fi done fi @@ -250,7 +250,7 @@ fpkg() fi if [ ! -f ${LFS_PKG_DIR}/${PACK}.tar.bz2 ]; then - action_checkbox_time "Fetching ${PACK}" static_getpkg ${PACK} ${URL} + rcmd "Fetching ${PACK}" static_getpkg ${PACK} ${URL} fi # Check if a patch is available. @@ -427,7 +427,7 @@ lpkg() fi # Create link if it doesn't exist - action_checkbox_time "Linking ${PACKAGE_NAME}${source_link_status}" ln -s ../${SRCSTAGE}/${FILE} ${LFS_PKG_DIR}/${FILE} + rcmd "Linking ${PACKAGE_NAME}${source_link_status}" ln -s ../${SRCSTAGE}/${FILE} ${LFS_PKG_DIR}/${FILE} fi # Create link for patches corresponding to that package: @@ -436,7 +436,7 @@ lpkg() PATCHFILE=$(basename ${patch}) if [ ! -h ${LFS_PKG_DIR}/${PATCHFILE} ]; then # Create link if it doesn't exist - action_checkbox_time "Linking ${PATCHFILE}" ln -s ../${SRCSTAGE}/${PATCHFILE} ${LFS_PKG_DIR}/${PATCHFILE} + rcmd "Linking ${PATCHFILE}" ln -s ../${SRCSTAGE}/${PATCHFILE} ${LFS_PKG_DIR}/${PATCHFILE} fi done fi diff --git a/packages-list b/packages-list index a1aebe3..933a9c8 100644 --- a/packages-list +++ b/packages-list @@ -11,25 +11,25 @@ ALSA_PLUGINS="alsa-plugins-1.0.15" ALSA_UTILS="alsa-utils-1.0.15" ALSA_OSS="alsa-oss-1.0.15" -APR="apr-1.2.12" -APR_UTIL="apr-util-1.2.12" +APR="apr-1.3.9" +APR_UTIL="apr-util-1.3.9" AVR_GDB="gdb-6.4" AVRDUDE="avrdude-5.1" ATK="atk-1.18.0" AUDIOFILE="audiofile-0.2.6" -AUTOCONF="autoconf-2.64" -AUTOMAKE="automake-1.11" +AUTOCONF="autoconf-2.65" +AUTOMAKE="automake-1.11.1" BABL="babl-0.0.22" -BASH="bash-3.2" +BASH="bash-4.0" BC="bc-1.06" BISON="bison-2.4.1" BIND="bind-9.5.0-P2" -BINUTILS="binutils-2.18" -ARM_BINUTILS="binutils-2.18" -AVR_BINUTILS="binutils-2.18" +BINUTILS="binutils-2.20" +ARM_BINUTILS=${BINUTILS} +AVR_BINUTILS=${BINUTILS} BRIDGE_UTILS="bridge-utils-1.4" -BZIP2="bzip2-1.0.4" +BZIP2="bzip2-1.0.5" CAIRO="cairo-1.8.8" CAIROMM="cairomm-1.6.0" @@ -37,23 +37,20 @@ CDRTOOLS="cdrtools-2.01" CDRDAO="cdrdao-1.2.2" CKERMIT="ckermit-8.0.211" CLAMAV="clamav-0.93.3" -COREUTILS="coreutils-6.10" +CLOOG_PPL="cloog-ppl-0.15.7" +COREUTILS="coreutils-7.6" CPIO="cpio-2.9" -CUPS="cups-1.3.11" +CUPS="cups-1.1.23" CURL="curl-7.15.3" CVS_PACKAGE="cvs-1.11.18" -DB4="db-4.6.21" -# Needed by gnome VFS DBUS="dbus-1.2.16" DBUS_GLIB="dbus-glib-0.82" DDCLIENT="ddclient-3.6.7" -# Required by Gnome +DEJAGNU="dejagnu-1.4.4" DESKTOP_FILE_UTILS="desktop-file-utils-0.15" -DHCP="dhcp-3.0.5" +DHCP="dhcp-3.0.6" DIFFUTILS="diffutils-2.8.7" -DVDFS="dvdfs-0.2" -DVDRWTOOLS="dvd+rw-tools-7.1" DOCBOOK_DSSSL_VER="1.79" DOCBOOK_DSSSL="docbook-dsssl-${DOCBOOK_DSSSL_VER}" DOCBOOK_UTILS="docbook-utils-0.6.14" @@ -63,41 +60,41 @@ DOCBOOK_XML="docbook-xml-${DOCBOOK_XML_VER}" DOCBOOK_XSL_VER="1.68.1" DOCBOOK_XSL="docbook-xsl-${DOCBOOK_XSL_VER}" DOSFSTOOLS="dosfstools-3.0.1" +DVDFS="dvdfs-0.2" +DVDRWTOOLS="dvd+rw-tools-7.1" -E2FSPROGS="e2fsprogs-1.40.2" +E2FSPROGS="e2fsprogs-1.41.9" EASYTAG="easytag-2.1" ED="ed-0.8" EGGDBUS="eggdbus-0.5" -EMACS="emacs-22.3" +EGLIBC="eglibc-2.10.1" +EMACS="emacs-23.1" ESOUND="esound-0.2.37" -EXPAT="expat-2.0.0" +ESPGS="espgs-8.15.4" +EXPAT="expat-2.0.1" -LIBFAAD2="faad2-2.7" -LIBFAAC="faac-1.28" FCRON="fcron-3.0.0" FETCHMAIL="fetchmail-6.3.12" FFMPEG="ffmpeg-svn-20539" -FILE_PKG="file-4.26" -FINDUTILS="findutils-4.2.32" FIREFOX="firefox-3.6.source" +FILE_PKG="file-5.03" +FINDUTILS="findutils-4.4.2" FLAC="flac-1.2.1" -FLEX="flex-2.5.33" +FLEX="flex-2.5.35" FONTCONFIG="fontconfig-2.4.2" FREETYPE="freetype-2.3.4" FRIBIDI="fribidi-0.10.7" FUSE="fuse-2.8.1" -GAWK="gawk-3.1.6" +GAWK="gawk-3.1.7" GC="gc6.5" -GCC_CORE="gcc-4.3.2" -GCC_SPECS_PATCH="${GCC_CORE}-specs-1.patch" -ARM_GCC_CORE="gcc-4.3.2" -AVR_GCC_CORE="gcc-4.3.2" +GCC_CORE="gcc-4.4.2" +ARM_GCC_CORE=${GCC_CORE} +AVR_GCC_CORE=${GCC_CORE} GDB="gdb-6.4" GDBM="gdbm-1.8.3" GIT="git-1.5.5" GIT_MANPAGES="git-manpages-1.5.5" -LIBGEDA="libgeda-1.2.0" GEDA_SYMBOLS="geda-symbols-1.2.0" GEDA_GSCHEM="geda-gschem-1.2.0" GEDA_GNETLIST="geda-gnetlist-1.2.0" @@ -106,7 +103,6 @@ GEDA_GATTRIB="geda-gattrib-1.2.0" GEGL="gegl-0.0.22" GETDATE="getdate_rfc868-1.2" GETTEXT="gettext-0.17" -ESPGS="espgs-8.15.4" GHOSTSCRIPT_FONTS_STD="ghostscript-fonts-std-8.11" GHOSTSCRIPT_FONTS_OTHER="ghostscript-fonts-other-6.0" GNASH=" gnash-0.8.5" @@ -115,11 +111,6 @@ GUTENPRINT="gutenprint-5.2.3" GLIB="glib-2.22.3" GTK2="gtk+-2.14.7" GTK_ENGINES="gtk-engines-2.18.4" -GLIBC="glibc-2.10.1" -AVR_LIBC="avr-libc-1.4.5" -# The kernel version specified must not be newer than the -# version of the kernel running on the build machine. -GLIBC_KERNEL_VERSION="2.6.22" GLITZ="glitz-0.5.6" # GNOME2 core packages @@ -157,7 +148,6 @@ NAUTILUS="nautilus-2.28.1" GNOME_CONTROL_CENTER="gnome-control-center-2.28.1" GNOME_APPLETS="gnome-applets-2.28.0" GNOME_SESSION="gnome-session-2.28.0" -YELP="yelp-2.28.0" GNOME_USER_DOCS="gnome-user-docs-2.28.0" # GNOME2 Additional Packages - Libraries @@ -171,7 +161,7 @@ EVOLUTION="evolution-2.12.2" GTKSOURCEVIEW="gtksourceview-1.8.5" SYSTEM_TOOLS_BACKENDS="system-tools-backends-1.4.2" GNOME_AUDIO="gnome-audio-2.0.0" - +GIFLIB="giflib-4.1.4" # GNOME2 Additional Packages - Utilities GEDIT="gedit-2.18.2" EOG="eog-2.18.2" @@ -197,9 +187,9 @@ GOBJECT_INSTROSPECTION="gobject-introspection-0.6.5" GOFFICE="goffice-0.2.2" GNUMERIC="gnumeric-1.6.3" GNUPG="gnupg-1.4.9" -GREP="grep-2.5.3" +GREP="grep-2.5.4" GRIP="grip-3.3.1" -GROFF="groff-1.18.1.4" +GROFF="groff-1.20.1" GRUB="grub-0.97" GSL="gsl-1.11" GSTREAMER="gstreamer-0.10.20" @@ -211,7 +201,7 @@ GST_FFMPEG="gst-ffmpeg-0.10.6" GTK_DOC="gtk-doc-1.4" GLIBMM="glibmm-2.16.2" GTKMM="gtkmm-2.12.7" -GMP="gmp-4.2.3" +GMP="gmp-4.3.1" GUILE="guile-1.8.2" GZIP="gzip-1.3.12" @@ -221,38 +211,44 @@ HICOLOR_ICON_THEME="hicolor-icon-theme-0.11" HTTPD="httpd-2.2.8" # Apache HVCLOCK="hvclock-0.2.0" -IMLIB="imlib-1.9.14" -IANA="iana-etc-2.20" +IANA="iana-etc-2.30" IMAGE_MAGICK="ImageMagick-6.5.0-8" +IMLIB="imlib-1.9.14" INDENT="indent-2.2.10" -INETUTILS="inetutils-1.5" +INETUTILS="inetutils-1.7" INKSCAPE="inkscape-r19727" INTLTOOL="intltool-0.40.6" -IPROUTE2="iproute2-2.6.20-070313" +IPROUTE2="iproute2-2.6.29-1" IPTABLES="iptables-1.3.7" ISO_CODES="iso-codes-1.2" JACK="jack-audio-connection-kit-0.103.0" +JADETEX="jadetex-3.13" JAVA="jre-1.6.0_05" -KBD="kbd-1.12" +KBD="kbd-1.15" KERBEROS5="krb5-1.4.1" -KERNEL="linux-2.6.31.6" +KERNEL="linux-2.6.32.3" KVM="kvm-84" LAME="lame-3.97" LCMS="lcms-1.17" -LESS="less-418" +LESS="less-436" LESSTIF="lesstif-0.95.0" LFS_BOOTSCRIPTS="lfs-bootscripts-20070813" LIBA52="a52dec-0.7.4" LIBART="libart_lgpl-2.3.17" LIBBOOST="boost_1_35_0" +LIBFFI="libffi-3.0.8" LIBDVDCSS="libdvdcss-1.2.10" LIBDVDREAD="libdvdread-0.9.7" -LIBFFI="libffi-3.0.8" +LIBEXIF="libexif-0.6.16" +LIBFAAD2="faad2-2.7" +LIBFAAC="faac-1.28" LIBGAMIN="gamin-0.1.9" +LIBGEDA="libgeda-1.2.0" LIBGLADE="libglade-2.6.0" +LIBGSF="libgsf-1.14.5" LIBIDL="libIDL-0.8.6" LIBPCAP="libpcap-0.9.4" LIBTOOL="libtool-2.2.6a" @@ -267,7 +263,6 @@ LIBMAD="libmad-0.15.1b" LIBJPEG="libjpeg-6b" LIBPNG="libpng-1.2.35" LIBTIFF="tiff-3.7.4" -GIFLIB="giflib-4.1.4" LIBMNG="libmng-1.0.9" LIBMUSICBRAINZ="libmusicbrainz-2.1.5" LIBRSVG="librsvg-2.16.1" @@ -276,8 +271,6 @@ LIBSOUP="libsoup-2.4.1" LIBXML2="libxml2-2.6.26" LIBXSLT="libxslt-1.1.12" LIBXFT="libXft-2.1.12" -LIBGPG_ERROR="libgpg-error-1.5" # For PIDGIN -LIBGCRYPT="libgcrypt-1.2.4" # For PIDGIN LIBUSB="libusb-0.1.10a" LIBGPHOTO2="libgphoto2-2.1.99" LIBXKLAVIER="libxklavier-2.91" @@ -290,25 +283,23 @@ LIBNOTIFY="libnotify-0.4.4" LIBWNCK="libwnck-2.16.1" LILYPOND="lilypond-2.12.2" LTSP_UTILS="ltsp-utils-0.25-0" -TFTP_HPA="tftp-hpa-0.49" MAILMAN="mailman-2.1.8" MAKE_PACKAGE="make-3.81" -MAN="man-1.6b" -MANPAGES="man-pages-3.07" +MAN_DB="man-db-2.5.6" +MANPAGES="man-pages-3.23" METACITY="metacity-2.18.5" -MFOUR="m4-1.4.11" +MFOUR="m4-1.4.13" MILTER_GREYLIST="milter-greylist-4.0" MILTER_SPF="smf-spf-2.0.1" -MKTEMP="mktemp-1.5" -MODULE_INIT_TOOLS="module-init-tools-3.2.2" -MPFR="mpfr-2.3.1" +MODULE_INIT_TOOLS="module-init-tools-3.11.1" +MPFR="mpfr-2.4.1" MUTT="mutt-1.5.20" MYSQL="mysql-5.0.22" -NANO="nano-2.0.1" -NCURSES="ncurses-5.6" -NEON="neon-0.25.5" +NANO="nano-2.2.1" +NCURSES="ncurses-5.7" +NEON="neon-0.29.1" NET_TOOLS="net-tools-1.60" NEWLIB="newlib-1.16.0" NFS_UTILS="nfs-utils-1.1.5" @@ -316,22 +307,20 @@ NMAP="nmap-4.03" NSS="nss-3.12-with-nspr-4.7" OPENJADE="openjade-1.3.2" -JADETEX="jadetex-3.13" OPENLDAP="openldap-2.3.38" OPENSP="OpenSP-1.5.2" -OPENSSH="openssh-4.7p1" -OPENSSL="openssl-0.9.8g" -OPERA="opera-9.64-2480.gcc4-shared-qt3.i386" -OPERA_LANG_FR="ouw900_fr-CA.lng" +OPENSSH="openssh-5.1p1" +OPENSSL="openssl-0.9.8l" +OPENSSL_ROOT_CERTS="BLFS-ca-bundle-20090409" -PAM="Linux-PAM-0.99.7.1" +PAM="Linux-PAM-1.1.0" PANGO="pango-1.20.5" PARTED="parted-1.8.1" PATCH_PACKAGE="patch-2.5.9" -PCIUTILS="pciutils-2.2.4" +PCIUTILS="pciutils-3.1.4" PCMANFM="pcmanfm-0.5" PCRE="pcre-7.2" -PERL="perl-5.8.8" +PERL="perl-5.10.1" PERL_MOD_PDL="PDL-2.4.2" PERL_MOD_PARSE_REDESCENT="Parse-RecDescent-1.94" PERL_MOD_XML_WRITER="XML-Writer-0.600" @@ -351,24 +340,24 @@ PERL_MOD_IO_COMPRESS_ZLIB="IO-Compress-Zlib-2.004" PERL_MOD_COMPRESS_RAW_ZLIB="Compress-Raw-Zlib-2.004" PERL_MOD_NET_DNS="Net-DNS-0.61" PHP="php-5.2.6" -PIDGIN="pidgin-2.1.0" PIXMAN="pixman-0.17.4" -PKG_CONFIG="pkg-config-0.22" POLKIT="polkit-0.94" POPPLER="poppler-0.12.2" -POPT="popt-1.10.4" +PKG_CONFIG="pkg-config-0.23" +POPT="popt-1.15" PORTAUDIO="portaudio-v19_061121" PORTMAP="portmap-6.0" +PPL="ppl-0.10.2" PROCMAIL="procmail-3.22" -PROCPS="procps-3.2.7" -PSMISC="psmisc-22.5" +PROCPS="procps-3.2.8" +PSMISC="psmisc-22.9" PULSEAUDIO="pulseaudio-0.9.12" PYTHON="Python-2.5.2" PYGOBJECT="pygobject-2.16.1" PYGTK="pygtk-2.14.1" -READLINE="readline-5.2" -REISERFSPROGS="reiserfsprogs-3.6.20" +READLINE="readline-6.1" +REISERFSPROGS="reiserfsprogs-3.6.21" RHYTHMBOX="rhythmbox-0.10.1" RSYNC="rsync-3.0.7" @@ -376,7 +365,7 @@ SAMBA="samba-3.0.21c" SANE_BACKENDS="sane-backends-1.0.18" XSANE="xsane-0.97" SASL2="cyrus-sasl-2.1.21" -SED="sed-4.1.5" +SED="sed-4.2.1" SENDMAIL="sendmail-8.13.6" SENDMAIL_GID="bin" SGML_COMMON="sgml-common-0.6.3" @@ -385,7 +374,7 @@ SGML_DTD3="sgml-dtd-${SGML_DTD3_VER}" SGML_DTD4_VER="4.4" SGML_DTD4="sgml-dtd-${SGML_DTD4_VER}" SGML_SPM="SGMLSpm-1.03ii" -SHADOW="shadow-4.0.18.1" +SHADOW="shadow-4.1.4.2" SHARED_MIME_INFO="shared-mime-info-0.60" SPAMASSASSIN="Mail-SpamAssassin-3.2.3" SPEEX="speex-1.2rc1" @@ -396,36 +385,41 @@ SQUIRRELMAIL="squirrelmail-1.5.1" STARTUP_NOTIFICATION="startup-notification-0.8" STRACE="strace-4.5.15" SUBVERSION="subversion-1.6.6" -SUDO="sudo-1.6.8p12" SWEEP="sweep-svn-r586" SYLPHEED="sylpheed-2.7.1" +SUDO="sudo-1.7.2p2" +SWEEP="sweep-svn-r586" SYSKLOGD="sysklogd-1.5" SYSVINIT="sysvinit-2.86" T1LIB="t1lib-5.1.2" TANGO_ICON_THEME="tango-icon-theme-0.8.1" TANGO_ICON_THEME_EXTRAS="tango-icon-theme-extras-0.1.0" -TAR_PACKAGE="tar-1.20" +TAR_PACKAGE="tar-1.22" TCPDUMP="tcpdump-3.9.4" -TCL="tcl8.4.11" -TK="tk8.4.11" +TCL="tcl8.5.7-src" TCPWRAPPERS="tcp_wrappers_7.6" TETEX_SRC="tetex-src-3.0" TETEX_TEXMF="tetex-texmf-3.0" TETEX_TEXMFSRC="tetex-texmfsrc-3.0" TETEX_CM_SUPER="tetex-cm-super" TEXINFO="texinfo-4.13a" +TFTP_HPA="tftp-hpa-0.49" +TK="tk8.4.11" TRANSMISSION="transmission-1.34" UDEV="udev-149" UDEV_CONFIG="udev-config-20090925" UML_UTILITIES="uml_utilities_20070815" UNZIP="unzip-5.52" -UTIL_LINUX="util-linux-2.12r" +UPSTART="upstart-0.6.3" +UTIL_LINUX_NG="util-linux-ng-2.16.1" UW_IMAP="imap-2004g" -WGET="wget-1.10.2" -WHICH="which-2.16" +VORBIS_TOOLS="vorbis-tools-1.1.1" + +WGET="wget-1.11.4" +WHICH="which-2.20" WINDOWMAKER="WindowMaker-0.92.0" WINDOWMAKER_EXTRA="WindowMaker-extra-0.1" WMNOTIFY="wmnotify-0.3.2" @@ -434,6 +428,9 @@ WV="wv-1.2.4" XFREE86="XFree86-4.8.0" XMLTOMAN="xmltoman-0.4" XVIDCORE="xvidcore-1.2.2" +XZ_UTILS="xz-4.999.9beta" + +YELP="yelp-2.28.0" ZIP="zip-2.32" ZLIB="zlib-1.2.3" diff --git a/stage0/INSTALL b/stage0/INSTALL new file mode 100644 index 0000000..acebe70 --- /dev/null +++ b/stage0/INSTALL @@ -0,0 +1,17 @@ +Installation instructions +------------------------- + +1. Create your destination partition and make sure that it is + formatted and mounted. + +2. Create the LFS user. + +3. Copy the hvlinux-src directory, containing packages and installation + scripts, anywhere in your LFS partition (usually in root directory). + If installing from a CD-ROM, mount it under your LFS partition. + Make sure that your files are owned by the LFS user. + +4. Modify the 'sysinfos' configuration file to reflect your + system configuration. + +5. Launch './stage0-install' diff --git a/stage0/README b/stage0/README new file mode 100644 index 0000000..bf2600e --- /dev/null +++ b/stage0/README @@ -0,0 +1 @@ +Stage0: Installation of cross-compilation tools diff --git a/stage2/cis-ac b/stage0/cis-ac similarity index 66% copy from stage2/cis-ac copy to stage0/cis-ac index 7dd8dba..e7fa2bd 100755 --- a/stage2/cis-ac +++ b/stage0/cis-ac @@ -1,27 +1,26 @@ #!/bin/sh +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 ../sysinfos source ../functions source ../packages-list -PACKAGE=${1} -shift -CONFIGURE_OPTS=${*} - # Applying patches (if any) -apply_patches ${PACKAGE} && +apply_patches ${PACKAGE} -cd ${LFS_TMP}/${PACKAGE}-build && +cd ${LFS_TMP}/${PACKAGE}-build ../${PACKAGE}/configure \ - --prefix=/usr \ - --sysconfdir=/etc \ - ${CONFIGURE_OPTS} && -make && -make install && -ldconfig + --prefix=/cross-tools \ + ${CONFIGURE_OPTS} +${HVMAKE} +${HVMAKE} install -# Return last error exit $? diff --git a/stage0/cis-binutils b/stage0/cis-binutils new file mode 100755 index 0000000..b3d1b7c --- /dev/null +++ b/stage0/cis-binutils @@ -0,0 +1,50 @@ +#!/bin/sh +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} + +case "${HVL_TARGET}" in + "x86_64") + # This adds 64 bit support to Binutils. + TARGET_CONFIGURE_OPTS="--enable-64-bit-bfd" + ;; +esac + +# --prefix=/cross-tools +# This tells the configure script to prepare to install the package in the /cross-tools directory. +# --host=${CLFS_HOST} +# When used with --target, this creates a cross-architecture executable that creates files for ${CLFS_TARGET} but runs on ${CLFS_HOST}. +# --target=${CLFS_TARGET} +# When used with --host, this creates a cross-architecture executable that creates files for ${CLFS_TARGET} but runs on ${CLFS_HOST}. +# --with-lib-path=/tools/lib +# This tells the configure script to specify the library search path during the compilation of Binutils, resulting in /tools/lib being passed to the linker. This prevents the linker from searching through library directories on the host. +# --disable-nls +# This disables internationalization as i18n is not needed for the cross-compile tools. +# --enable-shared +# Enable the creation of the shared libraries. +# --disable-multilib +# This option disables the building of a multilib capable Binutils. + +cd ${LFS_TMP}/${1}-build +AR=ar AS=as ../${1}/configure \ + --prefix=/cross-tools \ + --host=${CLFS_HOST} \ + --target=${CLFS_TARGET} \ + --with-sysroot=${CLFS} \ + --with-lib-path=/tools/lib \ + --disable-nls \ + --enable-shared \ + --disable-multilib \ + ${TARGET_CONFIGURE_OPTS} +${HVMAKE} configure-host +${HVMAKE} +${HVMAKE} install +cp -v ../${1}/include/libiberty.h /tools/include + +exit $? diff --git a/stage0/cis-cloog-ppl b/stage0/cis-cloog-ppl new file mode 100755 index 0000000..ee71baa --- /dev/null +++ b/stage0/cis-cloog-ppl @@ -0,0 +1,32 @@ +#!/bin/sh +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 ../sysinfos +source ../functions +source ../packages-list + +# Applying patches (if any) +apply_patches ${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: +cd ${LFS_TMP}/${PACKAGE} +cp -v configure{,.orig} +sed "/LD_LIBRARY_PATH=/d" configure.orig > configure + +cd ${LFS_TMP}/${PACKAGE}-build +../${PACKAGE}/configure \ + --prefix=/cross-tools \ + ${CONFIGURE_OPTS} +${HVMAKE} +${HVMAKE} install + +exit $? diff --git a/stage0/cis-eglibc b/stage0/cis-eglibc new file mode 100755 index 0000000..50f469f --- /dev/null +++ b/stage0/cis-eglibc @@ -0,0 +1,83 @@ +#!/bin/sh +set -o errexit + +# Reading system configuration informations, functions and package versions. +source ../sysinfos +source ../functions +source ../packages-list + +# Manually apply patch +apply_patch ${1}-rpath.patch ${1} + +case "${HVL_TARGET}" in + "x86") + TMP_CFLAGS="-march=$(cut -d- -f1 <<< ${CLFS_TARGET}) -mtune=generic -g -O2" + ;; +esac + +cd ${LFS_TMP}/${1} + +# Disable linking to libgcc_eh: +cp -v Makeconfig{,.orig} +sed -e 's/-lgcc_eh//g' Makeconfig.orig > Makeconfig + +cd ${LFS_TMP}/${1}-build + +# The following lines need to be added to config.cache for Glibc to support NPTL: +cat > config.cache << "EOF" +libc_cv_forced_unwind=yes +libc_cv_c_cleanup=yes +libc_cv_gnu89_inline=yes +EOF + +# Configure options: +# BUILD_CC="gcc" +# This sets Glibc to use the current compiler on our system. This is used to create the tools Glibc uses during its build. +# CC="${CLFS_TARGET}-gcc ${CLFS_BUILDFLAGS}" +# Forces Glibc to build using our target architecture GCC utilizing any special CLFS build flags. +# AR="${CLFS_TARGET}-ar" +# This forces Glibc to use the ar utility we made for our target architecture. +# RANLIB="${CLFS_TARGET}-ranlib" +# This forces Glibc to use the ranlib utility we made for our target architecture. +# +# --disable-profile +# This builds the libraries without profiling information. Omit this option if profiling on the temporary tools is necessary. +# --enable-add-ons +# This tells Glibc to utilize all add-ons that are available. +# --with-tls +# This tells Glibc to use Thread Local Storage. +# --enable-kernel=2.x.x +# Compile the library for support of linux 2.6.x kernels. +# The kernel version specified must not be newer than the +# version of the kernel running on the build machine. +# --with-headers=/tools/include +# Forces glibc to use the linux-libc-headers installed +# in /tools/include, rather than those on the host, which +# may be too old to support needed functionality. +# --with-__thread +# This tells Glibc to use use the __thread for libc and libpthread builds. +# --with-binutils=/cross-tools/bin +# This tells Glibc to use the Binutils that are specific to our target architecture. +# --disable-profile +# Builds the libraries without profiling information. +BUILD_CC="gcc" \ + CC="${CLFS_TARGET}-gcc ${CLFS_BUILDFLAGS}" \ + AR="${CLFS_TARGET}-ar" \ + RANLIB="${CLFS_TARGET}-ranlib" \ + CFLAGS=${TMP_CFLAGS} \ + ../${1}/configure \ + --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 \ + --cache-file=config.cache +${HVMAKE} +${HVMAKE} install + +exit $? diff --git a/stage0/cis-gcc-pass1 b/stage0/cis-gcc-pass1 new file mode 100755 index 0000000..f849774 --- /dev/null +++ b/stage0/cis-gcc-pass1 @@ -0,0 +1,74 @@ +#!/bin/sh +set -o errexit + +# Reading system configuration informations, functions and package versions. +source ../sysinfos +source ../functions +source ../packages-list + +# Manually applying patches +apply_patch ${1}-branch_update-1.patch ${1} + +case "${HVL_TARGET}" in + "x86") + apply_patch ${1}-specs-1.patch ${1} + ;; + "x86_64") + apply_patch ${1}-pure64_specs-1.patch ${1} + ;; +esac + +cd ${LFS_TMP}/${1} + +# Change the StartFile Spec to point to the correct library location: +echo -en '#undef STANDARD_INCLUDE_DIR\n#define STANDARD_INCLUDE_DIR "/tools/include/"\n\n' >> gcc/config/linux.h +echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"\n' >> gcc/config/linux.h +echo -en '\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 ""\n' >> gcc/config/linux.h + +# Alter gcc's C preprocessor's default include search path to use /tools only: +cp -v gcc/Makefile.in{,.orig} +sed -e "s@\(^CROSS_SYSTEM_HEADER_DIR =\).*@\1 /tools/include@g" \ + gcc/Makefile.in.orig > gcc/Makefile.in + +# 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 + +# --with-local-prefix=/tools +# The purpose of this switch is to remove /usr/local/include from gcc's include search path. +# This is not absolutely essential, however, it helps to minimize the influence of the host system. +# --disable-shared +# Disables the creation of the shared libraries. +# --disable-threads +# This will prevent GCC from looking for the multi-thread include files, since they haven't been +# created for this architecture yet. GCC will be able to find the multi-thread information after +# the Glibc headers are created. +# --enable-languages=c +# This option ensures that only the C compiler is built. +cd ${LFS_TMP}/${1}-build +AR=ar LDFLAGS="-Wl,-rpath,/cross-tools/lib" \ + ../${1}/configure \ + --prefix=/cross-tools \ + --build=${CLFS_HOST} \ + --host=${CLFS_HOST} \ + --target=${CLFS_TARGET} \ + --with-sysroot=${CLFS} \ + --with-local-prefix=/tools \ + --disable-nls \ + --disable-shared \ + --with-mpfr=/cross-tools \ + --with-gmp=/cross-tools \ + --with-ppl=/cross-tools \ + --with-cloog=/cross-tools \ + --without-headers \ + --with-newlib \ + --disable-decimal-float \ + --disable-libgomp \ + --disable-libmudflap \ + --disable-libssp \ + --disable-threads \ + --enable-languages=c \ + --disable-multilib +${HVMAKE} all-gcc all-target-libgcc +${HVMAKE} install-gcc install-target-libgcc + +exit $? diff --git a/stage0/cis-gcc-pass2 b/stage0/cis-gcc-pass2 new file mode 100755 index 0000000..0df47dd --- /dev/null +++ b/stage0/cis-gcc-pass2 @@ -0,0 +1,73 @@ +#!/bin/sh +set -o errexit + +# Reading system configuration informations, functions and package versions. +source ../sysinfos +source ../functions +source ../packages-list + +# Manually applying patches +apply_patch ${1}-branch_update-1.patch ${1} + +case "${HVL_TARGET}" in + "x86") + apply_patch ${1}-specs-1.patch ${1} + ;; + "x86_64") + apply_patch ${1}-pure64_specs-1.patch ${1} + ;; +esac + +cd ${LFS_TMP}/${1} + +# Change the StartFile Spec to point to the correct library location: +echo -en '#undef STANDARD_INCLUDE_DIR\n#define STANDARD_INCLUDE_DIR "/tools/include/"\n\n' >> gcc/config/linux.h +echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"\n' >> gcc/config/linux.h +echo -en '\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 ""\n' >> gcc/config/linux.h + +# Alter gcc's C preprocessor's default include search path to use /tools only: +cp -v gcc/Makefile.in{,.orig} +sed -e "s@\(^CROSS_SYSTEM_HEADER_DIR =\).*@\1 /tools/include@g" \ + gcc/Makefile.in.orig > gcc/Makefile.in + +# Configure options: +# --enable-languages=c,c++ +# This option ensures that only the C and C++ compilers are built. +# --enable-__cxa_atexit +# This option allows use of __cxa_atexit, rather than atexit, to register C++ destructors for local +# statics and global objects and is essential for fully standards-compliant handling of +# destructors. It also affects the C++ ABI and therefore results in C++ shared libraries and C++ +# programs that are interoperable with other Linux distributions. +# --enable-c99 +# Enable C99 support for C programs. +# --enable-long-long +# Enables long long support in the compiler. +# --enable-threads=posix +# This enables C++ exception handling for multi-threaded code. +cd ${LFS_TMP}/${1}-build +AR=ar LDFLAGS="-Wl,-rpath,/cross-tools/lib" \ + ../${1}/configure \ + --prefix=/cross-tools \ + --build=${CLFS_HOST} \ + --host=${CLFS_HOST} \ + --target=${CLFS_TARGET} \ + --with-sysroot=${CLFS} \ + --with-local-prefix=/tools \ + --disable-nls \ + --enable-shared \ + --enable-languages=c,c++ \ + --enable-__cxa_atexit \ + --with-mpfr=/cross-tools \ + --with-gmp=/cross-tools \ + --with-ppl=/cross-tools \ + --with-cloog=/cross-tools \ + --enable-c99 \ + --enable-long-long \ + --enable-threads=posix \ + --disable-multilib +${HVMAKE} \ + AS_FOR_TARGET="${CLFS_TARGET}-as" \ + LD_FOR_TARGET="${CLFS_TARGET}-ld" +${HVMAKE} install + +exit $? diff --git a/stage0/cis-linux-api-headers b/stage0/cis-linux-api-headers new file mode 100755 index 0000000..e5ae471 --- /dev/null +++ b/stage0/cis-linux-api-headers @@ -0,0 +1,20 @@ +#!/bin/sh +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} + +${HVMAKE} mrproper +${HVMAKE} ARCH=${HVL_TARGET} headers_check +${HVMAKE} ARCH=${HVL_TARGET} INSTALL_HDR_PATH=dest headers_install +install -dv /tools/include +cp -rv dest/include/* /tools/include + +exit $? diff --git a/stage2/cis-ac b/stage0/cis-ncurses similarity index 57% copy from stage2/cis-ac copy to stage0/cis-ncurses index 7dd8dba..f9fec65 100755 --- a/stage2/cis-ac +++ b/stage0/cis-ncurses @@ -1,27 +1,31 @@ #!/bin/sh +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 ../sysinfos source ../functions source ../packages-list -PACKAGE=${1} -shift -CONFIGURE_OPTS=${*} - # Applying patches (if any) -apply_patches ${PACKAGE} && +apply_patches ${PACKAGE} -cd ${LFS_TMP}/${PACKAGE}-build && +cd ${LFS_TMP}/${PACKAGE}-build ../${PACKAGE}/configure \ - --prefix=/usr \ - --sysconfdir=/etc \ - ${CONFIGURE_OPTS} && -make && -make install && -ldconfig - -# Return last error + --prefix=/cross-tools \ + ${CONFIGURE_OPTS} + +# Only one binary is needed for the Cross-Tools. +${HVMAKE} -C include +${HVMAKE} -C progs tic + +# Install tic +install -m755 progs/tic /cross-tools/bin + exit $? diff --git a/stage0/cis-pre-install b/stage0/cis-pre-install new file mode 100755 index 0000000..f52fc9b --- /dev/null +++ b/stage0/cis-pre-install @@ -0,0 +1,70 @@ +#!/bin/sh +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 + +# Creating basic directories +for subdir in tmp var boot 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 + +# Testing for the presence of the lfs user +# We cannot automatically create the user 'lfs' because the installation media +# can be a CD-ROM (read-only) +# If installing from some kind of live-CD, simply install as root without the LFS user :) +if ! grep "lfs" /etc/passwd 1> /dev/null 2>&1; then + # The option '-k /dev/null' prevents possible copying of files from a + # skeleton directory (default is /etc/skel). + groupadd lfs + useradd -s /bin/bash -g lfs -m -k /dev/null lfs +fi + +cat > /home/lfs/.bashrc << "EOF" +# Setting up the environment +set +h +umask 022 +LC_ALL=POSIX +PATH=/cross-tools/bin:/bin:/usr/bin +CLFS_BUILDFLAGS=_CLFS_BUILDFLAGS_ +CLFS_HOST="$(echo $MACHTYPE | \ + sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")" +CLFS_TARGET=_CLFS_TARGET_ +HVMAKE="make -j ${MAKEJOBS}" + +unset CFLAGS +unset CXXFLAGS + +export LC_ALL PATH CLFS_BUILDFLAGS CLFS_HOST CLFS_TARGET HVMAKE +EOF + +sed -i -e "s!_CLFS_BUILDFLAGS_!${CLFS_BUILDFLAGS}!g" /home/lfs/.bashrc +sed -i -e "s!_CLFS_TARGET_!${CLFS_TARGET}!g" /home/lfs/.bashrc + +chown lfs:lfs /home/lfs/.bashrc + +exit $? diff --git a/stage0/install-1 b/stage0/install-1 new file mode 100755 index 0000000..6f07a43 --- /dev/null +++ b/stage0/install-1 @@ -0,0 +1,40 @@ +#!/bin/sh + +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 + +ipkg_cust ${KERNEL} cis-linux-api-headers +ipkg_ac ${FILE_PKG} +ipkg_cust ${NCURSES} cis-ncurses "--without-debug --without-shared" +CPPFLAGS=-fexceptions \ + ipkg_ac ${GMP} "--enable-cxx" +LDFLAGS="-Wl,-rpath,/cross-tools/lib" \ + ipkg_ac ${MPFR} "--enable-shared --with-gmp=/cross-tools" +LDFLAGS="-Wl,-rpath,/cross-tools/lib" \ + ipkg_ac ${PPL} "--enable-shared \ + --enable-interfaces=c,cxx \ + --disable-optimization \ + --with-libgmp-prefix=/cross-tools \ + --with-libgmpxx-prefix=/cross-tools" +LDFLAGS="-Wl,-rpath,/cross-tools/lib" \ + ipkg_cust ${CLOOG_PPL} cis-cloog-ppl "--enable-shared --with-bits=gmp \ + --with-gmp=/cross-tools --with-ppl=/cross-tools" +ipkg_cust ${BINUTILS} cis-binutils +ipkg ${GCC_CORE} cis-gcc-pass1 "${GCC_CORE}-pass1" +ipkg_cust ${EGLIBC} cis-eglibc +ipkg ${GCC_CORE} cis-gcc-pass2 "${GCC_CORE}-pass2" + +exit $? diff --git a/stage0/packages-update b/stage0/packages-update new file mode 100755 index 0000000..0b071fc --- /dev/null +++ b/stage0/packages-update @@ -0,0 +1,28 @@ +#!/bin/sh + +LFS_STAGE="stage0" +# We don't use LFS or BLFS patches because we want to carefully +# select which patch get applied +USE_CLFS_PATCHES=1 +USE_HV_PATCHES=1 + +# Reading system configuration informations, functions and package versions. +source ../sysinfos +source ../functions +source ../functions-update +source ../packages-list + +update_packages_init + +fpkg ${KERNEL} "http://www.kernel.org/pub/linux/kernel/v2.6" +fpkg ${FILE_PKG} "http://cross-lfs.org/files/packages/svn" +fpkg_gnu ${NCURSES} +fpkg_gnu ${GMP} +fpkg ${MPFR} "http://www.mpfr.org/mpfr-current" +fpkg ${PPL} "http://www.cs.unipr.it/ppl/Download/ftp/releases/$(get_pkg_ver ${PPL})" +fpkg ${CLOOG_PPL} "ftp://gcc.gnu.org/pub/gcc/infrastructure" +fpkg_gnu ${BINUTILS} +fpkg ${GCC_CORE} ${GNU_URL}/gcc/${GCC_CORE} +fpkg ${EGLIBC} "http://cross-lfs.org/files/packages/svn" + +exit $? diff --git a/stage0/stage0-install b/stage0/stage0-install new file mode 100755 index 0000000..20d1f7b --- /dev/null +++ b/stage0/stage0-install @@ -0,0 +1,31 @@ +#!/bin/sh +set -o errexit + +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" + +echo "Performing pre-install" +./cis-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" + +if [ $? -ne 0 ]; then + echo "*** An error occured during ${LFS_STAGE}" + exit 1 +fi + +echo "Total build time: $(get_total_build_time ${LFS_LOG_FILE})h" + +exit 0 diff --git a/stage2/INSTALL b/stage2/INSTALL index 7b08088..b3d9e44 100644 --- a/stage2/INSTALL +++ b/stage2/INSTALL @@ -48,5 +48,9 @@ Note: In this example, the destination partition is /dev/hda6, and 14. login as root, and create the password for the regular user: >$ passwd reguser - - +Post-install guide +------------------ + 1. Compiler nouveau kernel + 2. Ajouter une entrée à /boot/grub/menu.lst + 3. Effacer le répertoire /tools et /cross-tools + 4. Rouler le script stage2/misc/udev-create-persistent-net.sh diff --git a/stage2/TODO b/stage2/TODO index 0039891..75d301f 100644 --- a/stage2/TODO +++ b/stage2/TODO @@ -1,14 +1,3 @@ --Faire un guide post-install: - 1. Compiler nouveau kernel - 2. Ajouter une entrée à /boot/grub/menu.lst - 3. Démonter ${LFS}/boot - 4. Effacer le répertoire /tools - 5. exit (pour sortir de l'environnement chroot) - 6. Démonter ${LFS} - 7. Redémarrer - -Nettoyer tous les link temporaires automatiquement (seulement après avoir redémarré et vérifié que tout fonctionne correctement). - - diff --git a/stage2/bootscripts/checkfs b/stage2/bootscripts/checkfs deleted file mode 100755 index 10acdb2..0000000 --- a/stage2/bootscripts/checkfs +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -# checkfs - -# Source functions library -source /etc/rc.d/init.d/functions - -# Printing the script name in the init log file -log_script_name "$0 $*" - -# If the /fastboot file exists we don't want to run the partition checks -if [ -f /fastboot ]; then - msg_box_nolog "Fast boot mode (no file systems check)" - FSCK_RETURN_CODE=$EXIT_CODE_SUCCESS -else - # Mount the root partition read-only (just in case the kernel mounts it - # read-write and we don't want to run fsck on a read-write mounted - # partition). - cmd_run_log /bin/mount -n -o remount,ro / - if [ $? = 0 ]; then - # Check all the file systems mentioned in /etc/fstab that have the - # fs_passno value set to 1 or 2 (the 6th field. See man fstab for more - # info). - cmd_run_log_box_warn_checkfs "Checking file systems" /sbin/fsck -a -A -C -T - FSCK_RETURN_CODE=$? - if [ ${FSCK_RETURN_CODE} -eq ${EXIT_CODE_FAILURE} ]; then - # Start sulogin so we can repair the damage manually. - boot_failure "FAILURE: fsck failed. Try running fsck without the -a option." - fi - else - # If the remount to read-only mode didn't work abort the fsck and print - # an error. - echo "Cannot check root file system because it could not be mounted" - echo "in read-only mode." - FSCK_RETURN_CODE=$EXIT_CODE_FAILURE - fi -fi - -exit ${FSCK_RETURN_CODE} diff --git a/stage2/bootscripts/halt b/stage2/bootscripts/halt deleted file mode 100755 index 575d648..0000000 --- a/stage2/bootscripts/halt +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# halt - -# -# Call halt. See man halt for the meaning of the parameters -# -/sbin/halt -d -f -i -p - -exit $? diff --git a/stage2/bootscripts/ifdown b/stage2/bootscripts/ifdown index cc0951a..52a20df 100755 --- a/stage2/bootscripts/ifdown +++ b/stage2/bootscripts/ifdown @@ -23,7 +23,7 @@ check_brctl() fi } -if [ "$BOOTPROTO" == "dhcp" ]; then +if [ "x${BOOTPROTO}" = "xdhcp" ]; then # DHCP configuration # Load DHCP client parameters @@ -54,7 +54,7 @@ if [ -n "${BRIDGE_TO}" ]; then fi # Determining if the interface is a bridge: -if [ "x${BRIDGE}" == "xyes" ]; then +if [ "x${BRIDGE}" = "xyes" ]; then # Check that the brctl program is present and executable. if [ ! -x ${BRCTL} ]; then msg_log "*** ERROR: /usr/sbin/brctl not found." diff --git a/stage2/bootscripts/ifup b/stage2/bootscripts/ifup index 7f7d15f..7fb88d3 100755 --- a/stage2/bootscripts/ifup +++ b/stage2/bootscripts/ifup @@ -24,7 +24,7 @@ check_brctl() } # Determining if the interface is a bridge: -if [ "x${BRIDGE}" == "xyes" ]; then +if [ "x${BRIDGE}" = "xyes" ]; then check_brctl cmd_run_log ${BRCTL} addbr ${1} && cmd_run_log ${BRCTL} stp ${1} off || exit 1 diff --git a/stage2/bootscripts/modules b/stage2/bootscripts/modules deleted file mode 100755 index df5f195..0000000 --- a/stage2/bootscripts/modules +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -# modules -# Module auto-loading script - -# Source functions library -source /etc/rc.d/init.d/functions - -log_script_name "$0 $*" - -# Assure that the kernel has module support. -if [ ! -e /proc/ksyms -a ! -e /proc/modules ]; then - exit 0 -fi - -modules_start() -{ - # Exit if there's no modules file - if [ ! -r /etc/sysconfig/modules ]; then - return 0 - fi - - echo "Loading modules:" - - # Only try to load modules if the user has actually given us - # some modules to load. - while read module args; do - # Ignore comments and blank lines. - case "$module" in - ""|"#"*) continue ;; - esac - - # Attempt to load the module, making - # sure to pass any arguments provided. - modprobe ${module} ${args} >/dev/null - - # Print the module name if successful, - # otherwise take note. - if [ $? -eq 0 ]; then - echo " ${module}" - else - failedmod="${failedmod} ${module}" - fi - done < /etc/sysconfig/modules - - # Print a failure message with a list of any - # modules that may have failed to load. - if [ -n "${failedmod}" ]; then - ${FAILURE} - echo "Failed to load modules:${failedmod}" - fi -} - -# See how we were called -case "$1" in - start) - cmd_run_log_box_warn "Loading modules" modules_start - ;; - - *) - echo "Usage: $0 {start}" - exit ${EXIT_CODE_FAILURE} - ;; -esac - -exit $? diff --git a/stage2/bootscripts/mountfs b/stage2/bootscripts/mountfs deleted file mode 100755 index 15cde93..0000000 --- a/stage2/bootscripts/mountfs +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - -# mountfs - -# Source functions library -source /etc/rc.d/init.d/functions - -log_script_name "$0 $*" - -case "$1" in - start) - # Remount the root partition in read-write mode. - cmd_run_log_box "Remounting root file system Read/Write" \ - mount -o remount,rw / - - # Remove the possible /fastboot and /forcefsck files. they are only - # supposed to be used during the next reboot's checkfs which just - # happened. If you want to fastboot or forcefsck again you'll have to - # recreate the files - rm -f /fastboot /forcefsck - - # Walk through /etc/fstab and mount all file systems that don't have - # the noauto option set in the fs_mntops field (the 4th field. See man - # fstab for more info). - cmd_run_log_box "Mounting other file systems" mount -a -O no_netdev - ;; - - stop) - # Unmount all the file systems, mounting the root file system - # read-only (all are unmounted but because root can't be unmounted - # at this point mount will automatically mount it read-only which - # is what is supposed to happen. This way no data can be written - # anymore to disk). - cmd_run_nolog_box "Unmounting file systems" umount -a -d -r -v -t notmpfs,noproc - if [ $? -ne 0 ]; then - exit ${EXIT_CODE_WARNING} - fi - ;; - - *) - echo "Usage: $0 {start|stop}" - exit ${EXIT_CODE_FAILURE} - ;; -esac - -exit $? diff --git a/stage2/bootscripts/mountkernfs b/stage2/bootscripts/mountkernfs deleted file mode 100755 index bcdc60c..0000000 --- a/stage2/bootscripts/mountkernfs +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -# mountkernfs - -# Source functions library -source /etc/rc.d/init.d/functions - -case "$1" in - start) - # The "-n: option tells mount not to write to the /etc/mtab - # file (because /etc/mtab is a symbolic link to /proc/mounts, - # which we are in the process of mounting). - cmd_run_log_box "Mounting /proc file system" mount -n proc - cmd_run_log_box "Mounting /sys file system" mount -n sys - ;; - - stop) - umount -n proc - ;; - - *) - echo "Usage: $0 {start|stop}" - exit ${EXIT_CODE_FAILURE} - ;; -esac - -exit $? diff --git a/stage2/bootscripts/mountnetfs b/stage2/bootscripts/mountnetfs index d397af7..d812d80 100755 --- a/stage2/bootscripts/mountnetfs +++ b/stage2/bootscripts/mountnetfs @@ -27,7 +27,7 @@ mountnetfs_stop() { # did, then give 3 seconds for things to exit # the nice way before killing them off. # This one will work all of the time! - if [ $? == 0 ]; then + if [ $? -eq 0 ]; then /bin/sleep 3 /bin/fuser -km $NETMOUNTS > /dev/null fi @@ -40,7 +40,7 @@ mountnetfs_stop() { /bin/umount -a -O _netdev # save the return value from umount - if [ $? != 0 ]; then + if [ $? -ne 0 ]; then NERRVAL=${EXIT_CODE_FAILURE} fi @@ -48,7 +48,7 @@ mountnetfs_stop() { # by fstype. This list can be extended later as # more network filesystems are supported by mount. /bin/umount -a -t coda,ncpfs,nfs,smbfs - if [ $? == 0 ]; then + if [ $? -eq 0 ]; then return ${NERRVAL} else # make certain that we return an error diff --git a/stage2/bootscripts/network b/stage2/bootscripts/network index 3fa69ff..7817244 100755 --- a/stage2/bootscripts/network +++ b/stage2/bootscripts/network @@ -20,12 +20,6 @@ if [ ! -x /sbin/ip ]; then exit ${EXIT_CODE_FAILURE} fi -# Check that the hostname program is present and executable. -if [ ! -x /bin/hostname ]; then - msg_log "*** ERROR: /bin/hostname not found." - exit ${EXIT_CODE_FAILURE} -fi - CWD=`pwd` cd /etc/sysconfig/network @@ -38,8 +32,6 @@ case "$1" in fi done - cmd_run_log_box "Setting hostname: ${DEFAULT_HOSTNAME}" /bin/hostname ${DEFAULT_HOSTNAME} - if [ -n "${GATEWAY}" ]; then cmd_run_log_box "Adding default route to gateway ${GATEWAY}" ip route add default via ${GATEWAY} fi diff --git a/stage2/bootscripts/rc b/stage2/bootscripts/rc deleted file mode 100755 index 137be04..0000000 --- a/stage2/bootscripts/rc +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/sh - -# rc - -# By Jason Pearce - jason.pearce@linux.org -# Modified by Gerard Beekmans - gerard@linuxfromscratch.org -# print_error_msg based on ideas by Simon Perreault - -# nomis80@videotron.ca - -# Source functions library -source /etc/rc.d/init.d/functions - -# If you uncomment the debug variable below none of the scripts will be -# executed, just the script name and parameters will be echo'ed to the -# screen so you can see how the scripts are called by rc. -#debug="echo" - -# If the return value of the scripts executed in each runlevel (start or stop) -# is not 0 (success) or 1 (warning), something went wrong with error checking -# inside the script. The print_error_msg function will be called and the -# message plus the return value of the K script will be printed to the screen. - -# Prints an error message when an unforeseen error occurred that wasn't -# trapped for some reason by error checking. -print_error_msg() -{ - ${FAILURE} - echo " Error in subscript \"${1}\" (${2})" - ${NORMAL} - echo " Press a key to continue..." - read -} - -# Start script or program. -startup() -{ - ${debug} "$@" -} - -check_script_status() -{ - if [ ! -f $1 ]; then - echo "$1 is not a valid symlink" - return ${EXIT_CODE_FAILURE} - fi - - if [ ! -x $1 ]; then - echo "$1 is not executable, skipping" - return ${EXIT_CODE_FAILURE} - fi - - return ${EXIT_CODE_SUCCESS} -} - -# Configure for displaying only relevant messages to console -/bin/dmesg -n ${LOGLEVEL} - -# Ignore CTRL-C only in this shell, so we can interrupt subprocesses. -trap ":" INT QUIT TSTP - -runlevel=${1} - -# If no runlevel was passed as an argument, we won't change runlevels. -if [ "${runlevel}" = "" ]; then - echo "Usage: ${0} " >&2 - exit ${EXIT_CODE_FAILURE} -fi - -# PREVLEVEL is set by init -# If PREVLEVEL is not set it means that there is no previous runlevel and -# we'll set previous to N. -previous=${PREVLEVEL} -if [ "${previous}" = "" ]; then - previous="N" -fi - -# Is there an rc directory for the new runlevel? -if [ ! -d /etc/rc.d/rc${runlevel}.d ]; then - echo "/etc/rc.d/rc${runlevel}.d directory does not exist" - exit ${EXIT_CODE_FAILURE} -fi - -# First, attempt to stop all services started by previous runlevel, -# and killed in this runlevel (K8 scripts -# If so, first collect all the K* scripts in the new run level. -if [ ${previous} != N ]; then - for kill_script in $(ls /etc/rc.d/rc${runlevel}.d/K* 2> /dev/null); do - if [ -f ${kill_script} ]; then - # "suffix" will contain the script name without the leading Kxx. - suffix="${kill_script##*/K[0-9][0-9]}" - - # If there is a S script in the previous runlevel corresponding - # to this K script, determine what it's full path is. - previous_start="/etc/rc.d/rc${previous}.d/S[0-9][0-9]${suffix}" - - # If no start script was found in the previous run level it could - # be that something was started in rcS.d (sysinit level) so we'll - # determine the path for that possibility as well. - sysinit_start="/etc/rc.d/rcS.d/S[0-9][0-9]${suffix}" - - # Stop the service if there is a start script in the previous run - # level or in the sysinit level. Otherwise, don't execute this K - # script because the service is not active. - if [ -f ${previous_start} -o -f ${sysinit_start} ]; then - startup ${kill_script} stop - retval=${?} - if [ ${retval} -ne ${EXIT_CODE_SUCCESS} -a ${retval} -ne ${EXIT_CODE_WARNING} ]; then - print_error_msg ${kill_script} ${retval} - fi - fi - fi - done -fi - -# Now run the START scripts for this runlevel. -for start_script in $(ls /etc/rc.d/rc${runlevel}.d/S* 2> /dev/null); do - # "suffix" will contain the script name without the leading Sxx. - suffix=${start_script#/etc/rc.d/rc${runlevel}.d/S[0-9][0-9]} - - # If there is a K script in the current runlevel corresponding - # to this S script, determine what it's full path is. - current_stop=/etc/rc.d/rc${runlevel}.d/K[0-9][0-9]${suffix} - - if [ ${previous} != "N" ]; then - # If there is a S script in the previous runlevel corresponding - # to this S script, determine what it's full path is. - previous_start=/etc/rc.d/rc${previous}.d/S[0-9][0-9]${suffix} - else - previous_start="" - fi - - if [ -f "$previous_start" -a ! -f "$current_stop" ]; then - # If the service was started in the previous level and was not stopped - # in this runlevel, then we don't have to re-start it. - continue - else - # If the service was not started in the previous level, or if we just - # stopped it in this runlevel, then we need to start or restart it. - check_script_status ${start_script} - if [ ${?} = ${EXIT_CODE_SUCCESS} ]; then - startup ${start_script} start - retval=${?} - if [ ${retval} -ne ${EXIT_CODE_SUCCESS} -a ${retval} -ne ${EXIT_CODE_WARNING} ]; then - print_error_msg ${start_script} ${retval} - fi - fi - fi -done - -exit ${EXIT_CODE_SUCCESS} diff --git a/stage2/bootscripts/reboot b/stage2/bootscripts/reboot deleted file mode 100755 index 2f6c3e5..0000000 --- a/stage2/bootscripts/reboot +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# reboot - -# Call reboot. See man halt for the meaning of the parameters -echo "System reboot in progress..." - -/sbin/reboot -d -f -i - -exit $? diff --git a/stage2/bootscripts/sendsignals b/stage2/bootscripts/sendsignals deleted file mode 100755 index 6bde3e3..0000000 --- a/stage2/bootscripts/sendsignals +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -# sendsignals - -# Source functions library -source /etc/rc.d/init.d/functions - -log_script_name "$0 $*" - -# Send all the remaining processes the TERM signal -cmd_run_log_box "Sending all processes the TERM signal" /sbin/killall5 -15 - -# Send all the remaining process (after sending them the TERM signal before) -# the KILL signal. -cmd_run_log_box "Sending all processes the KILL signal" /sbin/killall5 -9 - -exit $? diff --git a/stage2/bootscripts/setclock b/stage2/bootscripts/setclock deleted file mode 100755 index 2a00c66..0000000 --- a/stage2/bootscripts/setclock +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -# setclock - -# Source functions library -source /etc/rc.d/init.d/functions - -log_script_name "$0 $*" - -# Load clock parameters -source /etc/sysconfig/clock - -case "$UTC" in - yes|true|1) - TIME_BASE="--utc" - ;; - no|false|0) - TIME_BASE="--localtime" - ;; - *) - exit ${EXIT_CODE_FAILURE} - ;; -esac - -# See how we were called -case "$1" in - start) - cmd_run_log_box "Setting system time from hardware clock value" \ - /sbin/hwclock --hctosys "$TIME_BASE" - ;; - stop) - cmd_run_log_box "Saving system time value in hardware clock" \ - /sbin/hwclock --systohc "$TIME_BASE" - ;; - *) - echo "Usage: $0 {start|stop}" - exit ${EXIT_CODE_FAILURE} - ;; -esac - -exit $? diff --git a/stage2/bootscripts/swap b/stage2/bootscripts/swap deleted file mode 100755 index 083b980..0000000 --- a/stage2/bootscripts/swap +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -# swap - -# Source functions library -source /etc/rc.d/init.d/functions - -log_script_name "$0 $*" - -case "$1" in - start) - cmd_run_log_box "Enabling swap partition" swapon -a - ;; - - stop) - cmd_run_log_box "Disabling swap partition" swapoff -a - ;; - - restart) - $0 stop - sleep 1 - $0 start - ;; - - status) - swapon -s - ;; - - *) - echo "Usage: $0 {start|stop|restart|status}" - exit ${EXIT_CODE_FAILURE} - ;; -esac - -exit $? diff --git a/stage2/bootscripts/udev b/stage2/bootscripts/udev deleted file mode 100644 index 98542e8..0000000 --- a/stage2/bootscripts/udev +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh - -# udev -# Udev cold-plugging script - -# Source functions library -source /etc/rc.d/init.d/functions - -log_script_name "$0 $*" - -udev_start() -{ - # Udev handles uevents itself, so we don't need to have - # the kernel call out to any binary in response to them - echo > /proc/sys/kernel/hotplug && - - # Copy static device nodes to /dev - cp -a /lib/udev/devices/* /dev && - - # Start the udev daemon to continually watch for, and act on, - # uevents - /sbin/udevd --daemon && - - # Now traverse /sys in order to "coldplug" devices that have - # already been discovered - /sbin/udevtrigger && - - # Now wait for udevd to process the uevents we triggered - /sbin/udevsettle -} - -# See how we were called -case "$1" in - start) - if ! grep -q '[[:space:]]sysfs' /proc/mounts; then - boot_failure "FAILURE: Unable to create devices without a SysFS filesystem." - fi - - # Mount a temporary file system over /dev, so that any devices - # made or removed during this boot don't affect the next one. - # The reason we don't write to mtab is because we don't ever - # want /dev to be unavailable (such as by `umount -a'). - mount -n -t tmpfs tmpfs /dev -o mode=755 - if [ ${?} != 0 ]; then - boot_failure "FAILURE: Cannot mount a tmpfs onto /dev." - fi - - cmd_run_log_box_warn "Udevd start" udev_start - ;; - - *) - echo "Usage: $0 {start}" - exit ${EXIT_CODE_FAILURE} - ;; -esac - -exit $? diff --git a/stage2/bootscripts/udev_retry b/stage2/bootscripts/udev_retry deleted file mode 100755 index 1aaa48a..0000000 --- a/stage2/bootscripts/udev_retry +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -# udev_retry -# Udev cold-plugging script (retry) - -# Source functions library -source /etc/rc.d/init.d/functions - -log_script_name "$0 $*" - -udev_retry_start() -{ - # From Debian: "copy the rules generated before / was mounted - # read-write": - for file in /dev/.udev/tmp-rules--*; do - dest=${file##*tmp-rules--} - [ "$dest" = '*' ] && break - cat $file >> /etc/udev/rules.d/$dest - rm -f $file - done - - # Re-trigger the failed uevents in hope they will succeed now - /sbin/udevtrigger --retry-failed && - - # Now wait for udevd to process the uevents we triggered - /sbin/udevsettle -} - -# See how we were called -case "$1" in - start) - cmd_run_log_box_warn "Retrying failed uvents, if any" udev_retry_start - ;; - - *) - echo "Usage: $0 {start}" - exit ${EXIT_CODE_FAILURE} - ;; -esac - -exit $? diff --git a/stage2/cis-ac b/stage2/cis-ac index 7dd8dba..93f3e87 100755 --- a/stage2/cis-ac +++ b/stage2/cis-ac @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name. # Remaining arguments are additional configure options. @@ -12,16 +14,15 @@ shift CONFIGURE_OPTS=${*} # Applying patches (if any) -apply_patches ${PACKAGE} && +apply_patches ${PACKAGE} -cd ${LFS_TMP}/${PACKAGE}-build && +cd ${LFS_TMP}/${PACKAGE}-build ../${PACKAGE}/configure \ --prefix=/usr \ --sysconfdir=/etc \ - ${CONFIGURE_OPTS} && -make && -make install && + ${CONFIGURE_OPTS} +make +make install ldconfig -# Return last error exit $? diff --git a/stage2/cis-ac-nobuild b/stage2/cis-ac-nobuild index 443431d..43e4e0e 100755 --- a/stage2/cis-ac-nobuild +++ b/stage2/cis-ac-nobuild @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name. # Remaining arguments are additional configure options. @@ -11,22 +13,16 @@ 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} && +apply_patches ${PACKAGE} -cd ${LFS_TMP}/${PACKAGE} && +cd ${LFS_TMP}/${PACKAGE} ./configure \ --prefix=/usr \ --sysconfdir=/etc \ - ${CONFIGURE_OPTS} && -make && -make install && + ${CONFIGURE_OPTS} +make +make install ldconfig -# Return last error exit $? diff --git a/stage2/cis-binutils b/stage2/cis-binutils index d49567d..04bddd6 100755 --- a/stage2/cis-binutils +++ b/stage2/cis-binutils @@ -1,30 +1,48 @@ #!/bin/sh +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 -# Saves CFLAGS and CXXFLAGS, and clears them. -save_flags_no_optimizations +PACKAGE=${1} +shift +CONFIGURE_OPTS=${*} # Applying patches (if any) -apply_patches ${1} && +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 -# First, we only want to install the linker. This is done because the -# source and build directories from stage1 were not kept. -cd ${LFS_TMP}/${1}-build && -../${1}/configure \ +cd ${LFS_TMP}/${PACKAGE}-build +../${PACKAGE}/configure \ --prefix=/usr \ - --enable-shared && -make tooldir=/usr && -make check && -make tooldir=/usr install && + --sysconfdir=/etc \ + ${CONFIGURE_OPTS} +make configure-host +make tooldir=/usr -cp -v -f ../${1}/include/libiberty.h /usr/include && +# Install the package: +make tooldir=/usr install -# Restore original CFLAGS and CXXFLAGS values. -restore_flags +# Install the libiberty header file that is needed by some packages: +cp -v ../${PACKAGE}/include/libiberty.h /usr/include -# Return last error exit $? diff --git a/stage2/cis-bison b/stage2/cis-bison index 440d960..306f6d7 100755 --- a/stage2/cis-bison +++ b/stage2/cis-bison @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name. # Reading system configuration informations, functions and package versions. @@ -7,19 +9,18 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${1}-build && +cd ${LFS_TMP}/${1}-build ../${1}/configure \ --prefix=/usr \ - --sysconfdir=/etc && + --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 && +echo '#define YYENABLE_NLS 1' >> config.h +make +make install ldconfig -# Return last error exit $? diff --git a/stage2/cis-bootscripts b/stage2/cis-bootscripts index bb7d77b..9fc3a49 100755 --- a/stage2/cis-bootscripts +++ b/stage2/cis-bootscripts @@ -1,4 +1,5 @@ #!/bin/sh +set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos @@ -7,8 +8,7 @@ source ../packages-list DHCP_USED="no" -# "/etc/sysconfig/network/ifconfig.lo" file creation -cat > /etc/sysconfig/network/ifconfig.lo << "EOF" && +cat > /etc/sysconfig/network/ifconfig.lo << "EOF" ONBOOT="yes" BOOTPROTO="static" IPADDR="127.0.0.1" @@ -19,14 +19,13 @@ 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} && - evaluate_retval - - if [ x${BOOTPROTO[${LOOP_INDEX}]} == "xdhcp" ]; then + 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 @@ -34,15 +33,26 @@ for nic_device in ${INTERFACES}; do 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 "DEFAULT_HOSTNAME=\"${MACHINE_NAME}.${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 && +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 && +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. @@ -53,101 +63,48 @@ NFS_SERVER_ENA="no" # Set FIREWALL_ENA to "yes" to enable the firewall: FIREWALL_ENA="no" -# Set FIREWALL_LAN to the ethernet interface connected to the internal LAN: -FIREWALL_LAN="eth0" # Set FIREWALL_WWW to the ethernet interface connected to the outside world (internet): -FIREWALL_WWW="eth1" -EOF - -# "/etc/resolv.conf" file -if [ x${DHCP_USED} == "xno" ]; then - if [ -f /etc/resolv.conf ]; then - rm -f /etc/resolv.conf || exit 1 - fi - touch /etc/resolv.conf && - for i in $(seq 0 $((${#NAMESERVER[@]} - 1))); do - echo "nameserver ${NAMESERVER[i]}" >> /etc/resolv.conf || exit 1 - done - chmod 644 /etc/resolv.conf - evaluate_retval -fi - -# /etc/hosts file -echo "127.0.0.1 localhost.localdomain localhost" > /etc/hosts -evaluate_retval -if [ x${DHCP_USED} == "xno" ]; then - echo "${IP_ADDRESS[0]} ${MACHINE_NAME}.${DOMAIN} ${MACHINE_NAME}" >> /etc/hosts || exit 1 -fi -chmod 644 /etc/hosts && - -# Clock settings -cat > /etc/sysconfig/clock << "EOF" && -UTC=1 +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" && +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 || exit 1 + 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="functions rc checkfs cleanfs dhcp halt ifdown ifup initlog keyboard modules mountfs \ - mountkernfs mountnetfs network nfs portmap reboot sendsignals setclock sshd swap sysklogd udev udev_retry" -mkdir -p /etc/rc.d/init.d && +STAGE2_BOOTSCRIPTS="dhcp ifdown ifup keyboard mountnetfs network nfs portmap sshd sysklogd" for bootscript in ${STAGE2_BOOTSCRIPTS}; do - cp -a -f bootscripts/${bootscript} /etc/rc.d/init.d || exit 1 -done && - -# Creating runlevels links - -for level in S 0 1 2 3 4 5 6; do - dir=/etc/rc.d/rc${level}.d - if [ -d ${dir} ]; then - # Removing old links - rm -f ${dir}/* || exit 1 - else - # Creating basic directory structure - mkdir -v -p ${dir} || exit 1 - fi -done && - -# rcS.d -bootscript_add_rcS initlog 05 00 && -bootscript_add_rcS mountkernfs 10 00 && -bootscript_add_rcS modules 15 00 && -bootscript_add_rcS udev 20 00 && -bootscript_add_rcS swap 25 94 && -bootscript_add_rcS checkfs 30 00 && -bootscript_add_rcS mountfs 35 95 && -bootscript_add_rcS cleanfs 40 00 && -bootscript_add_rcS udev_retry 45 00 && -bootscript_add_rcS sysklogd 50 93 && -bootscript_add_rcS keyboard 55 00 && -bootscript_add_rcS setclock 60 92 && - -# rc0.d -bootscript_add_manual 0 sendsignals 95 00 && -bootscript_add_manual 0 halt 99 00 && + install -m755 bootscripts/${bootscript} /etc/rc.d/init.d +done -# rc3.d -bootscript_add_rc3 network 05 80 && -bootscript_add_rc3 portmap 10 75 && -bootscript_add_rc3 nfs 15 74 && -bootscript_add_rc3 dhcp 20 73 && -bootscript_add_rc3 sshd 25 70 && -bootscript_add_rc3 mountnetfs 30 10 && +# 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 -# rc6.d is almost identical to rc0.d -bootscript_add_manual 6 sendsignals 95 00 && -bootscript_add_manual 6 reboot 99 00 && +# rc3.d +bootscript_add_rc3 network 05 80 +bootscript_add_rc3 portmap 10 75 +bootscript_add_rc3 nfs 15 74 +bootscript_add_rc3 dhcp 20 73 +bootscript_add_rc3 sshd 25 70 +bootscript_add_rc3 mountnetfs 30 10 chown -R root:root /etc/rc.d /etc/sysconfig -# Return last error exit $? diff --git a/stage2/cis-bzip2 b/stage2/cis-bzip2 index 96f9dbe..aa26310 100755 --- a/stage2/cis-bzip2 +++ b/stage2/cis-bzip2 @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,20 +9,19 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${1} && -make -f Makefile-libbz2_so && -make clean && -make -j ${MAKEJOBS} && -make PREFIX=/usr install && +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 -sfv ../../lib/libbz2.so.1.0 /usr/lib/libbz2.so && -rm -fv /usr/bin/{bunzip2,bzcat,bzip2} && -ln -sfv bzip2 /bin/bunzip2 && -ln -sfv bzip2 /bin/bzcat +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 -# Return last error exit $? diff --git a/stage2/cis-compressdoc b/stage2/cis-compressdoc index 0a77265..16b2240 100755 --- a/stage2/cis-compressdoc +++ b/stage2/cis-compressdoc @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name. # Reading system configuration informations, functions and package versions. @@ -6,9 +8,8 @@ source ../sysinfos source ../functions source ../packages-list -CWD=$(pwd) - -install -m755 ${CWD}/misc/compressdoc /usr/sbin && +# 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 diff --git a/stage2/cis-coreutils b/stage2/cis-coreutils index f96ab6e..a421b65 100755 --- a/stage2/cis-coreutils +++ b/stage2/cis-coreutils @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,23 +9,20 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -#--enable-no-install-program=kill,uptime -# The purpose of this switch is to prevent Coreutils from installing binaries that will be installed by other packages later. -cd ${LFS_TMP}/${1}-build && +cd ${LFS_TMP}/${1}-build ../${1}/configure \ --prefix=/usr \ - --enable-install-program=hostname \ - --enable-no-install-program=kill,uptime && -make -j ${MAKEJOBS} && -make install && + --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,hostname,ln,ls,mkdir,mknod,mv,pwd,readlink,rm} /bin && -mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin && -mv -v /usr/bin/chroot /usr/sbin && +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 +mv -v /usr/bin/{rmdir,stty,sync,true,uname} /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 diff --git a/stage2/cis-db4 b/stage2/cis-db4 deleted file mode 100755 index c6e0f79..0000000 --- a/stage2/cis-db4 +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# 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_unix && -../dist/configure \ - --prefix=/usr \ - --enable-compat185 \ - --enable-cxx && -make && -make docdir=/usr/share/doc/${1} install && -chown -Rv root:root /usr/share/doc/${1} -ldconfig - -# Return last error -exit $? diff --git a/stage2/cis-dhcp b/stage2/cis-dhcp index c6aa80c..45e0875 100755 --- a/stage2/cis-dhcp +++ b/stage2/cis-dhcp @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,15 +9,15 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${1} && -./configure && -make -j ${MAKEJOBS} && -make LIBDIR=/usr/lib INCDIR=/usr/include install && +cd ${LFS_TMP}/${1} +./configure +make -j ${MAKEJOBS} +make LIBDIR=/usr/lib INCDIR=/usr/include install # This is for the DHCP client -cat > /etc/dhclient.conf << "EOF" && +cat > /etc/dhclient.conf << "EOF" # dhclient.conf timeout 15; @@ -29,9 +31,9 @@ interface "eth0"{ } EOF -sed -i -e "s!_DOMAIN_!${DOMAIN}!g" /etc/dhclient.conf && +sed -i -e "s!_DOMAIN_!${DOMAIN}!g" /etc/dhclient.conf -cat > /etc/sysconfig/network/dhcp-client << "EOF" && +cat > /etc/sysconfig/network/dhcp-client << "EOF" # dhcp-client # DHCP client program informations # @@ -41,7 +43,7 @@ DHCP_STOP="-q -r" EOF # Is it really necessary? If necessary, uncomment entries. -cat > /etc/dhclient-exit-hooks << "EOF" && +cat > /etc/dhclient-exit-hooks << "EOF" #!/bin/sh # Load global network parameters @@ -49,14 +51,14 @@ cat > /etc/dhclient-exit-hooks << "EOF" && # Update /etc/hosts only if we have an ip address. if [ -n "${new_ip_address}" ]; then - echo "127.0.0.1 localhost.localdomain localhost" > /etc/hosts && - echo "${new_ip_address} ${DEFAULT_HOSTNAME}" >> /etc/hosts + #echo "127.0.0.1 localhost.localdomain localhost" > /etc/hosts + #echo "${new_ip_address} ${DEFAULT_HOSTNAME}" >> /etc/hosts exit_status=0 else exit_status=1 fi EOF -chmod 740 /etc/dhclient-exit-hooks && +chmod 740 /etc/dhclient-exit-hooks # The following commands will create a base configuration file for a DHCP server. cat > /etc/dhcpd.conf << EOF @@ -74,5 +76,4 @@ subnet 192.168.0.0 netmask 255.255.255.0 { } EOF -# Return last error exit $? diff --git a/stage2/cis-ac b/stage2/cis-diffutils similarity index 58% copy from stage2/cis-ac copy to stage2/cis-diffutils index 7dd8dba..61cc0fd 100755 --- a/stage2/cis-ac +++ b/stage2/cis-diffutils @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name. # Remaining arguments are additional configure options. @@ -12,16 +14,20 @@ shift CONFIGURE_OPTS=${*} # Applying patches (if any) -apply_patches ${PACKAGE} && +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 && +cd ${LFS_TMP}/${PACKAGE}-build ../${PACKAGE}/configure \ --prefix=/usr \ --sysconfdir=/etc \ - ${CONFIGURE_OPTS} && -make && -make install && + ${CONFIGURE_OPTS} +make +make install ldconfig -# Return last error exit $? diff --git a/stage2/cis-e2fsprogs b/stage2/cis-e2fsprogs index 1560056..64dee8a 100755 --- a/stage2/cis-e2fsprogs +++ b/stage2/cis-e2fsprogs @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,16 +9,23 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${1}-build && +cd ${LFS_TMP}/${1}-build ../${1}/configure \ --prefix=/usr \ --with-root-prefix="" \ - --enable-elf-shlibs && -make -j ${MAKEJOBS} && -make install && + --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 -# Return last error +# 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 $? diff --git a/stage2/cis-ed b/stage2/cis-ed deleted file mode 100755 index eb998fc..0000000 --- a/stage2/cis-ed +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -# 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 && -make install && -mv /usr/bin/{ed,red} /bin - -# Return last error -exit $? diff --git a/stage2/cis-eglibc b/stage2/cis-eglibc new file mode 100755 index 0000000..314f30c --- /dev/null +++ b/stage2/cis-eglibc @@ -0,0 +1,133 @@ +#!/bin/sh +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} + +# 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="-march=$(cut -d- -f1 <<< $MACHTYPE) -mtune=generic -g -O2" \ + ../${PACKAGE}/configure \ + --prefix=/usr \ + --disable-profile \ + --enable-add-ons \ + --enable-kernel=2.6.32 \ + --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-$(get_pkg_ver ${PACKAGE}).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 $? diff --git a/stage2/cis-emacs b/stage2/cis-emacs index 65d7516..4137455 100755 --- a/stage2/cis-emacs +++ b/stage2/cis-emacs @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,53 +9,44 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && - -# Saves CFLAGS and CXXFLAGS, and clears them. -save_flags_no_optimizations && +apply_patches ${1} -cd ${LFS_TMP}/${1}-build && +cd ${LFS_TMP}/${1}-build ../${1}/configure \ --prefix=/usr \ - --libexecdir=/usr/sbin && -make -j ${MAKEJOBS} bootstrap && -make install && - -# Restore original CFLAGS and CXXFLAGS values. -restore_flags && + --without-sound \ + --with-x=no \ + --without-dbus \ + --with-xpm=no \ + --with-jpeg=no \ + --with-png=no \ + --with-gif=no \ + --with-tiff=no \ + --without-rsvg \ + --libexecdir=/usr/sbin \ + --localstatedir=/var +make -j ${MAKEJOBS} bootstrap +make install cat > /etc/skel/.emacs << "EOF" ;; ~/.emacs ;; Emacs initialization file -;; Are we running XEmacs or Emacs? -(defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version)) - -;;; Emacs Load Path -(setq load-path (cons "/usr/local/share/emacs/site-lisp" load-path)) - ;; Do not display a splash screen on startup (setq inhibit-splash-screen t) +;; Pour avoir les accents +(set-keyboard-coding-system 'utf-8) + ;; Set up the keyboard so the delete key on both the regular keyboard ;; and the keypad delete the character under the cursor and to the right ;; under X, instead of the default, backspace behavior. (global-set-key [delete] 'delete-char) (global-set-key [kp-delete] 'delete-char) -;; Pour avoir les accents -(set-keyboard-coding-system 'iso-8859-1) - ;; Turn on font-lock mode for Emacs -(cond ((not running-xemacs) - (global-font-lock-mode t) -)) - -;; Turn on font-lock mode for XEmacs -(cond (running-xemacs - (require 'font-lock) -)) +(global-font-lock-mode t) ;; Always end a file with a newline (setq require-final-newline t) @@ -64,10 +57,6 @@ cat > /etc/skel/.emacs << "EOF" ;; Replaces tabs in files with spaces (setq-default indent-tabs-mode nil) -;; Enable wheelmouse support by default -(mwheel-install) -(setq mwheel-follow-mouse t) - ;; Makes the compilation buffer always scrolls to follow ;; output as it comes in. (setq compilation-scroll-output t) @@ -75,33 +64,45 @@ cat > /etc/skel/.emacs << "EOF" ;;=========================================================== ;; Key bindings for compiling programs ;;=========================================================== +;; Must add helper function for the make also, otherwise +;; the first definition caused both F3 and F4 to execute "make clean". (defun compile-make-clean () (interactive) ;; can be called from kbd (compile "make clean")) -;; Must add helper function for the make also, otherwise -;; the first definition caused both F4 and F5 to execute "make clean". + (defun compile-make () (interactive) (compile "make")) -;; replace-string on F2 -(global-set-key [f2] 'replace-string) +(defun checkpatch() + (interactive) + (compile (concat "checkpatch.pl --no-tree --emacs --strict --file " (buffer-file-name)))) -;; replace-string on F3 -(global-set-key [f3] 'query-replace) +;; buffer-cycle.el +;; F1: Switch to previous buffers +(autoload 'cycle-buffer-prev "buffer-cycle" t) +(global-set-key [f1] 'cycle-buffer-prev) +;; F2: Switch to next buffers +(autoload 'cycle-buffer-next "buffer-cycle" t) +(global-set-key [f2] 'cycle-buffer-next) -;; make clean on F4 +;; F4: make clean (global-set-key [f4] 'compile-make-clean) -;; compile on F5 +;; F5: make (global-set-key [f5] 'compile-make) -;; Goto next error on F6 +;; F6: go to next error (global-set-key [f6] 'next-error) -;; Indent code on F8 +;; F7: comment region +(global-set-key [f7] 'comment-region) + +;; F8: code indentation (global-set-key [f8] 'indent-region) + +;; F9: run checkpatch.pl +(global-set-key [f9] 'checkpatch) EOF -# Return last error exit $? diff --git a/stage2/cis-findutils b/stage2/cis-findutils index 1fb8788..b3deadc 100755 --- a/stage2/cis-findutils +++ b/stage2/cis-findutils @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,22 +9,21 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${1}-build && +cd ${LFS_TMP}/${1}-build ../${1}/configure \ --prefix=/usr \ --libexecdir=/usr/lib/findutils \ - --localstatedir=/var/lib/locate && -make -j ${MAKEJOBS} && -make install && + --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 && +mv -v /usr/bin/find /bin sed -i -e 's/find:=${BINDIR}/find:=\/bin/' /usr/bin/updatedb -# Return last error exit $? diff --git a/stage2/cis-flex b/stage2/cis-flex index 449a627..0f3ddb8 100755 --- a/stage2/cis-flex +++ b/stage2/cis-flex @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,18 +9,18 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${1}-build && +cd ${LFS_TMP}/${1}-build ../${1}/configure \ - --prefix=/usr && -make -j ${MAKEJOBS} && -make install && + --prefix=/usr +make -j ${MAKEJOBS} +make install -ln -sfv libfl.a /usr/lib/libl.a && +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" && +cat > /usr/bin/lex << "EOF" #!/bin/sh # /usr/bin/lex @@ -27,4 +29,4 @@ EOF chmod -v 755 /usr/bin/lex # Return last error -exit ${last_error} +exit ${?} diff --git a/stage2/cis-gcc b/stage2/cis-gcc index 3b02999..03e97c0 100755 --- a/stage2/cis-gcc +++ b/stage2/cis-gcc @@ -1,51 +1,41 @@ #!/bin/sh -# First argument of this script is the package name +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 -cd ${LFS_TMP}/${1} && -sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in && - -# The bootstrap build performed in pass1 built GCC with the -fomit-frame-pointer -# compiler flag. Non-bootstrap builds omit this flag by default, so the following sed -# command is used in order to ensure consistent compiler builds. -sed -i 's/^XCFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in && - -# Suppressing the running of the fixincludes script. */ -sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in && - -# GCC provides a gccbug script which detects at compile time whether -# mktemp is present, and hardcodes the result in a test. This will -# cause the script to fall back to using less random names for temporary -# files. We will be installing mktemp later, so the following sed will -# simulate its presence: -sed -i 's/@have_mktemp_command@/yes/' gcc/gccbug.in && - -cd ${LFS_TMP}/${1}-build && -../${1}/configure \ +sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in + +cd ${LFS_TMP}/${PACKAGE}-build +../${PACKAGE}/configure \ --prefix=/usr \ - --libexecdir=/usr/lib \ - --enable-shared \ - --enable-threads=posix \ - --enable-__cxa_atexit \ - --enable-clocale=gnu \ - --enable-languages=c,c++ \ - --disable-bootstrap && -make -j ${MAKEJOBS} && -make install && -ln -v -sf ../usr/bin/cpp /lib && -ln -v -sf gcc /usr/bin/cc && - -# Performing compilation test... -echo 'main(){}' > dummy.c && -cc dummy.c && -readelf -l a.out | grep ': /lib' 1> /dev/null 2>&1 && -rm dummy.c a.out - -# Return last error + --sysconfdir=/etc \ + ${CONFIGURE_OPTS} +make +make install +ldconfig + +ln -svf ../usr/bin/cpp /lib +ln -svf gcc /usr/bin/cc + exit $? diff --git a/stage2/cis-ac-nobuild b/stage2/cis-gdbm similarity index 77% copy from stage2/cis-ac-nobuild copy to stage2/cis-gdbm index 443431d..2511785 100755 --- a/stage2/cis-ac-nobuild +++ b/stage2/cis-gdbm @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name. # Remaining arguments are additional configure options. @@ -17,16 +19,17 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${PACKAGE} && +apply_patches ${PACKAGE} -cd ${LFS_TMP}/${PACKAGE} && -./configure \ +cd ${LFS_TMP}/${PACKAGE}-build +../${PACKAGE}/configure \ --prefix=/usr \ --sysconfdir=/etc \ - ${CONFIGURE_OPTS} && -make && -make install && + ${CONFIGURE_OPTS} +make +make install +make install-compat + ldconfig -# Return last error exit $? diff --git a/stage2/cis-glibc b/stage2/cis-glibc deleted file mode 100755 index 07e9ae6..0000000 --- a/stage2/cis-glibc +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/sh - -# 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} && - -# In the vi_VN.TCVN locale, bash enters an infinite loop at startup. -# It is unknown whether this is a bash bug or a Glibc problem. -# Disable installation of this locale in order to avoid the problem: -sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED && - -# 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: -sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.2 -o|' \ - scripts/test-installation.pl && - -# The ldd shell script contains Bash-specific syntax. Change its -# default program interpreter to /bin/bash in case another /bin/sh -# is installed as described in the Shells chapter of the BLFS book: -sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in && - -# Configure options: -# --disable-profile -# Builds the libraries without profiling information. -# --enable-add-ons -# Use all the add-ons it finds. -# crypt and localdata are now part of glibc. -# --enable-kernel=2.x.x -# Compile the library for support of linux 2.6.x kernels. -# The kernel version specified must not be newer than the -# version of the kernel running on the build machine. -# --without-gd -# Prevents the build of the memusagestat program, which -# strangely enough insists on linking against the host's -# libraries (libgd, libpng, libz, and so forth). - -cd ${LFS_TMP}/${1}-build && -../${1}/configure \ - --prefix=/usr \ - --disable-profile \ - --enable-add-ons \ - --enable-kernel=${GLIBC_KERNEL_VERSION} \ - --libexecdir=/usr/lib/glibc && -make -j ${MAKEJOBS} && -mkdir -p /tools/etc && -touch /tools/etc/ld.so.conf && -make install - -# 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 -v -p /usr/lib/locale && -localedef -i de_DE -f ISO-8859-1 de_DE && -localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro && -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_CA -f UTF-8 fr_CA.UTF-8 && -localedef -i fr_CA -f ISO-8859-1 fr_CA && -localedef -i ca_FR -f UTF-8 ca_FR.UTF-8 && -localedef -i ca_FR -f ISO-8859-1 ca_FR && -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 && - -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 -sf ${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 - -# Return last error -exit $? diff --git a/stage2/cis-groff b/stage2/cis-groff index 202430e..c046397 100755 --- a/stage2/cis-groff +++ b/stage2/cis-groff @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,26 +9,20 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && - -cd ${LFS_TMP}/${1} && +apply_patches ${1} -# Many screen fonts don't have Unicode single quotes and dashes in -# them. Tell Groff to use the ASCII equivalents instead: -sed -i -e 's/2010/002D/' -e 's/2212/002D/' \ - -e 's/2018/0060/' -e 's/2019/0027/' font/devutf8/R.proto && +cd ${LFS_TMP}/${1} PAGE=letter ./configure \ --prefix=/usr \ - --enable-multibyte && + --enable-multibyte # Groff does not like to be made in parallel. -make && -make install && +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 eqn /usr/bin/geqn ln -fsv tbl /usr/bin/gtbl -# Return last error exit $? diff --git a/stage2/cis-grub b/stage2/cis-grub index 02b2bfb..cb35527 100755 --- a/stage2/cis-grub +++ b/stage2/cis-grub @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -6,20 +8,29 @@ source ../sysinfos source ../functions source ../packages-list -# Applying patches (if any) -apply_patches ${1} && +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}/${1}-build && -../${1}/configure \ - --prefix=/usr && -make -j ${MAKEJOBS} && -make install && +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 && +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 -# Return last error exit $? + diff --git a/stage2/cis-gzip b/stage2/cis-gzip index c2433bc..080d4cb 100755 --- a/stage2/cis-gzip +++ b/stage2/cis-gzip @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,16 +9,17 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${1} && +cd ${LFS_TMP}/${1} ./configure \ --prefix=/usr \ - --bindir=/bin && -make -j ${MAKEJOBS} && -make install && + --bindir=/bin +make -j ${MAKEJOBS} +make install -mv -fv /bin/{gzexe,uncompress,zcmp,zdiff,zegrep} /usr/bin && +# 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 diff --git a/stage2/cis-hv-utilities b/stage2/cis-hv-utilities index db682a2..02dc099 100755 --- a/stage2/cis-hv-utilities +++ b/stage2/cis-hv-utilities @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -16,8 +18,7 @@ BIN_UTILITIES="camera-download cd-erase cd-copy pstopdf distro-backup dos2unix \ rotatelogs setdate strip-debug-symbols tarbz2 tildes-clean" for program in ${BIN_UTILITIES}; do - install -v ${SRCDIR}/${program} ${BINDIR} || exit 1 + install -v ${SRCDIR}/${program} ${BINDIR} done -# Return last error exit $? diff --git a/stage2/cis-iana b/stage2/cis-iana index 2f6c42b..ab5d59d 100755 --- a/stage2/cis-iana +++ b/stage2/cis-iana @@ -1,4 +1,5 @@ #!/bin/sh +set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos @@ -6,13 +7,13 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +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} && +cd ${LFS_TMP}/${1} +make -j ${MAKEJOBS} make install # Return last error diff --git a/stage2/cis-inetutils b/stage2/cis-inetutils index 0ae48ef..0114107 100755 --- a/stage2/cis-inetutils +++ b/stage2/cis-inetutils @@ -1,30 +1,35 @@ #!/bin/sh -# First argument of this script is the package name +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 -# This is only a basic installation (no servers) of inetutils. +PACKAGE=${1} +shift +CONFIGURE_OPTS=${*} # Applying patches (if any) -apply_patches ${1} && +apply_patches ${PACKAGE} -cd ${LFS_TMP}/${1}-build && -../${1}/configure \ +# This is only a basic installation (no servers) of inetutils. + +cd ${LFS_TMP}/${PACKAGE}-build +../${PACKAGE}/configure \ --prefix=/usr \ - --libexecdir=/usr/sbin \ --sysconfdir=/etc \ - --localstatedir=/var \ - --disable-logger \ - --disable-syslogd \ - --disable-whois \ - --disable-servers && -make -j ${MAKEJOBS} && -make install && + ${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 -mv -fv /usr/bin/ping /bin +ldconfig -# Return last error exit $? diff --git a/stage2/cis-iproute2 b/stage2/cis-iproute2 index 4f54d75..158983a 100755 --- a/stage2/cis-iproute2 +++ b/stage2/cis-iproute2 @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,21 +9,18 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${1} && +cd ${LFS_TMP}/${1} -# The installation of two manual pages is broken and results in -# dangling symlinks. Fix this with the following command: -sed -i -e '/tc-bfifo.8/d' -e '/tc-pfifo.8/s/pbfifo/bfifo/' Makefile && +# 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 SBINDIR=/sbin -j ${MAKEJOBS} && -make SBINDIR=/sbin install && +make DESTDIR= -# The arpd binary links against the Berkeley DB libraries that reside -# in /usr and uses a database in /var/lib/arpd/arpd.db. Thus, -# according to the FHS, it must be in /usr/sbin. Move it there: -mv -v /sbin/arpd /usr/sbin +make DESTDIR= SBINDIR=/sbin MANDIR=/usr/share/man \ + DOCDIR=/usr/share/doc/${1} install -# Return last error exit $? diff --git a/stage2/cis-kbd b/stage2/cis-kbd index 2b752b8..34bda08 100755 --- a/stage2/cis-kbd +++ b/stage2/cis-kbd @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -6,23 +8,27 @@ source ../sysinfos source ../functions source ../packages-list -# Applying patches (if any) -apply_patches ${1} && +cd ${LFS_TMP}/${1} -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 \ - --datadir=/lib/kbd && -make -j ${MAKEJOBS} && -make install && + --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,openvt,setfont} /bin +mv -v /usr/bin/{kbd_mode,loadkeys,openvt,setfont} /bin -# Return last error exit $? diff --git a/stage2/cis-kernel b/stage2/cis-kernel index a435e06..6e2113a 100755 --- a/stage2/cis-kernel +++ b/stage2/cis-kernel @@ -1,57 +1,48 @@ #!/bin/sh +set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos source ../functions source ../packages-list -# The ARCH variable must be exported for this script -# to work correctly for architectures other than PC. -# eg. export ARCH=powerpc - -# We don't compile anything, we only install headers -#unset CROSS_COMPILE && - -SYSROOT=${SYSROOT:-""} +PACKAGE=${1} +shift +CONFIGURE_OPTS=${*} # Applying patches (if any) -apply_patches ${1} && - -# Move files to their final destination -mkdir -pv ${SYSROOT}/usr/src && -mv ${LFS_TMP}/${1} ${SYSROOT}/usr/src && - -# Remove any previous link. Otherwise, the -# new link would be created inside kernel directory. -cd ${SYSROOT}/usr/src && -rm -fv linux && -ln -sfv ${1} linux && - -# First step, install kernel API headers: -cd ${SYSROOT}/usr/src/${1} && -make -j ${MAKEJOBS} mrproper && -make -j ${MAKEJOBS} headers_check && -make -j ${MAKEJOBS} INSTALL_HDR_PATH=dest headers_install && -mkdir -pv ${SYSROOT}/usr/include && -cp -rv dest/include/* ${SYSROOT}/usr/include && - -# Second, install HV kernel compilation script: -cd ${SYSROOT}/usr/src && - -VERSION=$(get_pkg_ver ${1}) && - -echo "#!/bin/sh" > compile-kernel && -echo "KERNEL_VERSION=${VERSION}" >> compile-kernel && -echo "DEST=/boot" >> compile-kernel && -cat >> compile-kernel << "EOF" && - -make bzImage && -make modules && -make modules_install && - -cp arch/x86/boot/bzImage ${DEST}/vmlinuz-${KERNEL_VERSION} && -cp System.map ${DEST}/System-${KERNEL_VERSION}.map && -cp .config ${DEST}/config-${KERNEL_VERSION} +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/sh" > ${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} + +cat >> ${SCRIPT} << "EOF" if [ $? -ne 0 ]; then echo "*** Kernel compilation error ***." @@ -61,7 +52,6 @@ fi exit 0 EOF -chmod -v u+x compile-kernel +chmod -v u+x ${SCRIPT} -# Return last error exit $? diff --git a/stage2/cis-man b/stage2/cis-man deleted file mode 100755 index 16aef84..0000000 --- a/stage2/cis-man +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -# 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} && - -# SED substitution to add the -R switch to the PAGER variable so that escape -# sequences are properly handled by Less. -sed -i 's@-is@&R@g' configure && - -# SED substitution to comment out the MANPATH /usr/man line in the man.conf -# file to prevent redundant results when using programs such as whatis. -sed -i 's@MANPATH./usr/man@#&@g' src/man.conf.in && - -./configure -confdir=/etc && -make -j ${MAKEJOBS} && -make install - -# Return last error -exit $? diff --git a/stage2/cis-man-pages b/stage2/cis-man-pages index f6637fa..a3ff133 100755 --- a/stage2/cis-man-pages +++ b/stage2/cis-man-pages @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name. # Reading system configuration informations, functions and package versions. @@ -7,10 +9,9 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${1} && +cd ${LFS_TMP}/${1} make install -# Return last error exit $? diff --git a/stage2/cis-module-init-tools b/stage2/cis-module-init-tools index d6ebb52..e2c7ee6 100755 --- a/stage2/cis-module-init-tools +++ b/stage2/cis-module-init-tools @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,19 +9,19 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} # --enable-zlib: To handle compressed kernel modules. -cd ${LFS_TMP}/${1}-build && +cd ${LFS_TMP}/${1}-build ../${1}/configure \ --prefix=/ \ - --enable-zlib && -make -j ${MAKEJOBS} && -make INSTALL=install install && + --enable-zlib \ + --mandir=/usr/share/man +make -j ${MAKEJOBS} +make INSTALL=install install cat > /etc/modprobe.conf << "EOF" # modprobe.conf EOF -# Return last error exit $? diff --git a/stage2/cis-apr b/stage2/cis-nano similarity index 52% rename from stage2/cis-apr rename to stage2/cis-nano index 057c918..48ffe0c 100755 --- a/stage2/cis-apr +++ b/stage2/cis-nano @@ -1,23 +1,29 @@ #!/bin/sh +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 -# Applying patches (if any) -apply_patches ${1} && +PACKAGE=${1} +shift +CONFIGURE_OPTS=${*} -INSTALLBUILDDIR="/usr/lib/$(get_pkg_name ${1})-$(get_pkg_ver_major ${1})" +# Applying patches (if any) +apply_patches ${PACKAGE} -cd ${LFS_TMP}/${1}-build && -../${1}/configure \ +cd ${LFS_TMP}/${PACKAGE}-build +../${PACKAGE}/configure \ --prefix=/usr \ --sysconfdir=/etc \ - --with-installbuilddir=${INSTALLBUILDDIR}/build && -make -j ${MAKEJOBS} && + ${CONFIGURE_OPTS} +make make install +install -m644 ${SCRDIR}/misc/nanorc /etc +ldconfig -# Return last error exit $? diff --git a/stage2/cis-ncurses b/stage2/cis-ncurses index 3b7e884..54e594b 100755 --- a/stage2/cis-ncurses +++ b/stage2/cis-ncurses @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,44 +9,42 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${1}-build && +cd ${LFS_TMP}/${1}-build ../${1}/configure \ --prefix=/usr \ --with-shared \ --without-debug \ - --enable-widec && -make -j ${MAKEJOBS} && -make install && - -# Fix a library that shouldn't be executable. -chmod -v 644 /usr/lib/libncurses++w.a && + --enable-widec +make -j ${MAKEJOBS} +make install -# To be FHS compliant... -mv -fv /usr/lib/libncursesw.so.5* /lib && +# Move the libraries to the /lib directory, where they are expected to reside: +mv -fv /usr/lib/libncursesw.so.5* /lib -# Fixing some symlinks after the move -ln -sfv ../../lib/libncursesw.so.5 /usr/lib/libncursesw.so && +# 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 curses ncurses form panel menu ; do +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 -sfv lib${lib}w.a /usr/lib/lib${lib}.a + ln -sfvT lib${lib}w.a /usr/lib/lib${lib}.a done -ln -sfv libncurses++w.a /usr/lib/libncurses++.a && +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 && +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 -# Return last error +ldconfig + exit $? diff --git a/stage2/cis-net-tools b/stage2/cis-net-tools index e146b94..cb0940a 100755 --- a/stage2/cis-net-tools +++ b/stage2/cis-net-tools @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,16 +9,15 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${1} && -yes "" | make config && +cd ${LFS_TMP}/${1} +yes "" | make config sed -i -e 's|HAVE_IP_TOOLS 0|HAVE_IP_TOOLS 1|g' \ - -e 's|HAVE_MII 0|HAVE_MII 1|g' config.h && + -e 's|HAVE_MII 0|HAVE_MII 1|g' config.h sed -i -e 's|# HAVE_IP_TOOLS=0|HAVE_IP_TOOLS=1|g' \ - -e 's|# HAVE_MII=0|HAVE_MII=1|g' config.make && -make -j ${MAKEJOBS} && + -e 's|# HAVE_MII=0|HAVE_MII=1|g' config.make +make -j ${MAKEJOBS} make update -# Return last error exit $? diff --git a/stage2/cis-nfs-utils b/stage2/cis-nfs-utils index d16a283..bb347e5 100755 --- a/stage2/cis-nfs-utils +++ b/stage2/cis-nfs-utils @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,20 +9,17 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && - -# This package needs the user 'nobody' -hv_useradd -c nobody -d /home -g nogroup -s /bin/bash -u 99 nobody && +apply_patches ${1} # Problem with build directory -cd ${LFS_TMP}/${1} && +cd ${LFS_TMP}/${1} ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --disable-nfsv4 \ - --disable-gss && -make -j ${MAKEJOBS} && -make install && + --disable-gss +make -j ${MAKEJOBS} +make install cat > /etc/exports << "EOF" # NFS file systems export list @@ -32,5 +31,4 @@ cat > /etc/exports << "EOF" #/srv/www/htdocs 192.168.0.0/24(rw,sync) EOF -# Return last error exit $? diff --git a/stage2/cis-openssh b/stage2/cis-openssh index 148ca8d..172c073 100755 --- a/stage2/cis-openssh +++ b/stage2/cis-openssh @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,37 +9,36 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -install -v -m700 -d /var/lib/sshd && -chown -v root:sys /var/lib/sshd && +install -v -m700 -d /var/lib/sshd +chown -v root:sys /var/lib/sshd -hv_groupadd sshd && -hv_useradd -c sshd-privsep -d /var/lib/sshd -g sshd -s /bin/false sshd && +hv_groupadd sshd +hv_useradd -c sshd-privsep -d /var/lib/sshd -g sshd -s /bin/false sshd -cd ${LFS_TMP}/${1}-build && +cd ${LFS_TMP}/${1}-build ../${1}/configure \ --prefix=/usr \ --sysconfdir=/etc/ssh \ --libexecdir=/usr/lib/openssh \ --with-md5-passwords \ - --with-privsep-path=/var/lib/sshd && -make -j ${MAKEJOBS} && -make -j ${MAKEJOBS} install && + --with-privsep-path=/var/lib/sshd +make -j ${MAKEJOBS} +make -j ${MAKEJOBS} install -cd ${LFS_TMP}/${1} && -install -v -m755 -d /usr/share/doc/${1} && +cd ${LFS_TMP}/${1} +install -v -m755 -d /usr/share/doc/${1} install -v -m644 INSTALL LICENCE OVERVIEW README* WARNING.RNG \ - /usr/share/doc/${1} && + /usr/share/doc/${1} # Disabling root logins -sed -i -e "s!^#PermitRootLogin.*!PermitRootLogin no!g" /etc/ssh/sshd_config && +sed -i -e "s!^#PermitRootLogin.*!PermitRootLogin no!g" /etc/ssh/sshd_config # Enabling X11 forwarding -sed -i -e "s!^#X11Forwarding.*!X11Forwarding yes!g" /etc/ssh/sshd_config && +sed -i -e "s!^#X11Forwarding.*!X11Forwarding yes!g" /etc/ssh/sshd_config # Setting MaxAuthTries to 1 sed -i -e "s!^#MaxAuthTries.*!MaxAuthTries 1!g" /etc/ssh/sshd_config -# Return last error exit $? diff --git a/stage2/cis-openssl b/stage2/cis-openssl index 838653d..6299cee 100755 --- a/stage2/cis-openssl +++ b/stage2/cis-openssl @@ -1,23 +1,42 @@ #!/bin/sh -# First argument of this script is the package name +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 ${1} && +apply_patches ${PACKAGE} -cd ${LFS_TMP}/${1} && -./config \ +cd ${LFS_TMP}/${PACKAGE} +decompress_package ${OPENSSL_ROOT_CERTS} ./ 1> /dev/null +MAKEDEPPROG=gcc CC=gcc ./config \ + --prefix=/usr \ --openssldir=/etc/ssl \ - --prefix=/usr shared && -# Install the man pages in /usr/share/man instead of the default -# which is /etc/ssl/man -make -j ${MAKEJOBS} MANDIR=/usr/share/man && -make -j ${MAKEJOBS} MANDIR=/usr/share/man install && -cp -v -r certs /etc/ssl - -# Return last error + shared \ + zlib-dynamic +MAKEDEPPROG=gcc CC=gcc make + +# Install man pages in /usr/share/man instead of /etc/ssl/man +make MANDIR=/usr/share/man install +install -v -d -m755 /usr/share/doc/${PACKAGE} +cp -v -r doc/{HOWTO,README,*.{txt,html,gif}} \ + /usr/share/doc/${PACKAGE} + +cp -rv certs /etc/ssl + +# Create a single file that contains all of the installed certificates: +for pem in /etc/ssl/certs/*.pem; do + cat $pem + echo "" +done > /etc/ssl/ca-bundle.crt + exit $? diff --git a/stage2/cis-pam b/stage2/cis-pam index af7d2b8..e65418e 100755 --- a/stage2/cis-pam +++ b/stage2/cis-pam @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,32 +9,35 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${1}-build && +cd ${LFS_TMP}/${1}-build +# --libdir=/lib +# Necessary to prevent PAM from instaling into /lib64 ../${1}/configure \ --libdir=/lib \ --sbindir=/lib/security \ - --enable-securedir=/lib/security \ --docdir=/usr/share/doc/${1} \ - --enable-read-both-confs && -make -j ${MAKEJOBS} && -make install && + --enable-read-both-confs +make -j ${MAKEJOBS} +make install + +chmod -v 4755 /lib/security/unix_chkpwd + +mv -v /lib/security/pam_tally /sbin -chmod -v 4755 /lib/security/unix_chkpwd && -mv -v /lib/security/pam_tally /sbin && -mv -v /lib/libpam{,c,_misc}.la /usr/lib && -sed -i 's| /lib| /usr/lib|' /usr/lib/libpam_misc.la && +mv -v /lib/libpam{,c,_misc}.la /usr/lib +sed -i 's| /lib| /usr/lib|' /usr/lib/libpam_misc.la if [ -L /lib/libpam.so ]; then for LINK in libpam{,c,_misc}.so; do - ln -v -sf ../../lib/$(readlink /lib/${LINK}) /usr/lib/${LINK} && + ln -svfT ../../lib/$(readlink /lib/${LINK}) /usr/lib/${LINK} rm -v /lib/${LINK} done -fi && +fi -mkdir -p /etc/pam.d && -cat > /etc/pam.d/other << EOF && +mkdir -p /etc/pam.d +cat > /etc/pam.d/other << EOF # /etc/pam.d/other auth required pam_unix.so nullok @@ -50,5 +55,4 @@ other session required pam_unix.so other password required pam_unix.so nullok EOF -# Return last error exit $? diff --git a/stage2/cis-pciutils b/stage2/cis-pciutils index ef44abf..24983fa 100755 --- a/stage2/cis-pciutils +++ b/stage2/cis-pciutils @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name. # Reading system configuration informations, functions and package versions. @@ -7,22 +9,16 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd /${LFS_TMP}/${1} && +cd /${LFS_TMP}/${1} -# This command suppresses some unneeded screen output from the update-pciids -# command if you don't have either Lynx or Wget installed by redirecting the -# stderr output of the embedded which command to /dev/null. -sed -i 's/null ;/null 2>\&1 ;/' update-pciids.sh && +# ZLIB=no: Prevents compression of the pci.ids file which is needed by HAL. +make PREFIX=/usr ZLIB=no -make PREFIX=/usr && -make PREFIX=/usr install && +make PREFIX=/usr install -# Some packages require the PCI static library. -install -v -m 755 -d /usr/include/pci && -install -v -m 644 lib/libpci.a /usr/lib && -install -v -m 644 lib/*.h /usr/include/pci +# Some packages require the PCI static library: +make PREFIX=/usr install-lib -# Return last error exit $? diff --git a/stage2/cis-perl b/stage2/cis-perl deleted file mode 100755 index 4f3cad7..0000000 --- a/stage2/cis-perl +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -# 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} && - -# First create a basic /etc/hosts file to be referenced in one -# of Perl's configuration files as well as the optional testsuite: -echo "127.0.0.1 localhost $(hostname)" > /etc/hosts && - -cd ${LFS_TMP}/${1} && -./configure.gnu \ - --prefix=/usr \ - -Dman1dir=/usr/share/man/man1 \ - -Dman3dir=/usr/share/man/man3 \ - -Dpager="/usr/bin/less -isR" && -# Perl does not like to be made in parallel? -make && -make install - -# Return last error -exit $? diff --git a/stage2/cis-ac-nobuild b/stage2/cis-perl-pass1 similarity index 51% copy from stage2/cis-ac-nobuild copy to stage2/cis-perl-pass1 index 443431d..7738c16 100755 --- a/stage2/cis-ac-nobuild +++ b/stage2/cis-perl-pass1 @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name. # Remaining arguments are additional configure options. @@ -11,22 +13,22 @@ 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} && -./configure \ - --prefix=/usr \ - --sysconfdir=/etc \ - ${CONFIGURE_OPTS} && -make && -make install && +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 -# Return last error +ln -svfT /tools/bin/perl /usr/bin/perl + exit $? diff --git a/stage2/cis-perl-pass2 b/stage2/cis-perl-pass2 new file mode 100755 index 0000000..8ab7a95 --- /dev/null +++ b/stage2/cis-perl-pass2 @@ -0,0 +1,39 @@ +#!/bin/sh +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 $? diff --git a/stage2/cis-pkg-config b/stage2/cis-pkg-config index bea596d..7e17d49 100755 --- a/stage2/cis-pkg-config +++ b/stage2/cis-pkg-config @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name. # Reading system configuration informations, functions and package versions. @@ -7,15 +9,15 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${1}-build && +cd ${LFS_TMP}/${1}-build ../${1}/configure \ - --prefix=/usr && -make -j ${MAKEJOBS} && -make install && + --prefix=/usr +make -j ${MAKEJOBS} +make install -var_add_path "PKG_CONFIG_PATH" /etc/profile "/usr/local/lib/pkgconfig" && +var_add_path "PKG_CONFIG_PATH" /etc/profile "/usr/local/lib/pkgconfig" var_export "PKG_CONFIG_PATH" /etc/profile # Return last error diff --git a/stage2/cis-popt b/stage2/cis-popt index ac238d5..1ccfaa4 100755 --- a/stage2/cis-popt +++ b/stage2/cis-popt @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name. # Reading system configuration informations, functions and package versions. @@ -7,18 +9,17 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${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 && +sed -i -e "/*origOptString ==/c 0)" popt.c ./configure \ --prefix=/usr \ - --sysconfdir=/etc && -make -j ${MAKEJOBS} && + --sysconfdir=/etc +make -j ${MAKEJOBS} make install -# Return last error exit $? diff --git a/stage2/cis-portmap b/stage2/cis-portmap index 7728375..1f34931 100755 --- a/stage2/cis-portmap +++ b/stage2/cis-portmap @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,11 +9,10 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${1} && -make -j ${MAKEJOBS} && +cd ${LFS_TMP}/${1} +make -j ${MAKEJOBS} make install -# Return last error exit $? diff --git a/stage2/cis-post-install b/stage2/cis-post-install index 39f59c2..2b8512f 100755 --- a/stage2/cis-post-install +++ b/stage2/cis-post-install @@ -1,11 +1,12 @@ #!/bin/sh +set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos source ../functions source ../packages-list -cat > /etc/default/useradd << "EOF" && +cat > /etc/default/useradd << "EOF" # useradd defaults file HOME=/home INACTIVE=-1 @@ -15,20 +16,20 @@ SKEL=/etc/skel CREATE_MAIL_SPOOL=yes EOF -chmod -v 644 /etc/default/useradd && +chmod -v 644 /etc/default/useradd if [ -n "${REGUSER}" ]; then - hv_useradd -g users -G audio,video,usb -s /bin/bash -m ${REGUSER} || exit 1 -fi && + hv_useradd -g users -G audio,video,usb -s /bin/bash -m ${REGUSER} +fi -echo "Copying /etc/skel files to root directory" && +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 && +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 /tmp +chown -v root:root /var chown -v root:root /var/log exit $? diff --git a/stage2/cis-procps b/stage2/cis-procps index 7728375..1f34931 100755 --- a/stage2/cis-procps +++ b/stage2/cis-procps @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,11 +9,10 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${1} && -make -j ${MAKEJOBS} && +cd ${LFS_TMP}/${1} +make -j ${MAKEJOBS} make install -# Return last error exit $? diff --git a/stage2/cis-psmisc b/stage2/cis-psmisc index acfde61..9fae283 100755 --- a/stage2/cis-psmisc +++ b/stage2/cis-psmisc @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,22 +9,22 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +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 && +cd ${LFS_TMP}/${1}-build ../${1}/configure \ - --prefix=/usr \ - --exec-prefix="" && -make -j ${MAKEJOBS} && -make install && + --prefix=/usr +make -j ${MAKEJOBS} +make install -# There is no reason for the pstree and pstree.x11 programs to reside -# in /bin. Therefore, move them to /usr/bin: -mv -v /bin/pstree* /usr/bin +# 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 -# Return last error exit $? diff --git a/stage2/cis-readline b/stage2/cis-readline index 13273f6..5a31b38 100755 --- a/stage2/cis-readline +++ b/stage2/cis-readline @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,31 +9,30 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${1} && +cd ${LFS_TMP}/${1} # Reinstalling Readline will cause the old libraries to be moved to # .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 && +sed -i '/MV.*old/d' Makefile.in +sed -i '/{OLDSUFF}/c:' support/shlib-install -cd ${LFS_TMP}/${1}-build && +cd ${LFS_TMP}/${1}-build ../${1}/configure \ --prefix=/usr \ - --libdir=/lib && + --libdir=/lib # SHLIB_LIBS=-lncurses: Forces Readline to link against the libncurses library. -make SHLIB_LIBS=-lncurses && -make install && +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 && +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.5 /usr/lib/libreadline.so && -ln -sfv ../../lib/libhistory.so.5 /usr/lib/libhistory.so +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 -# Return last error exit $? diff --git a/stage2/cis-reiserfsprogs b/stage2/cis-reiserfsprogs index 464d060..c330a8f 100755 --- a/stage2/cis-reiserfsprogs +++ b/stage2/cis-reiserfsprogs @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,17 +9,16 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${1} && +cd ${LFS_TMP}/${1} ./configure \ --prefix=/usr \ - --sbindir=/sbin && + --sbindir=/sbin # Doesn't seem to use CFLAGS... -make -j ${MAKEJOBS} && -make install && -ln -sf reiserfsck /sbin/fsck.reiserfs && +make -j ${MAKEJOBS} +make install +ln -sf reiserfsck /sbin/fsck.reiserfs ln -sf mkreiserfs /sbin/mkfs.reiserfs -# Return last error exit $? diff --git a/stage2/cis-shadow b/stage2/cis-shadow index 9690701..9dda98e 100755 --- a/stage2/cis-shadow +++ b/stage2/cis-shadow @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,51 +9,46 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} + +cd ${LFS_TMP}/${1} -cd ${LFS_TMP}/${1}-build && -../${1}/configure \ - --libdir=/lib \ - --sysconfdir=/etc \ - --enable-shared \ - --without-selinux && # Disable the installation of the groups program and its man page, as # Coreutils provides a better version. -sed -i 's/groups$(EXEEXT) //' src/Makefile && -find man -name Makefile -exec sed -i '/groups/d' {} \; && -make -j ${MAKEJOBS} && -make install && -cp -f ../${1}/etc/{limits,login.access} /etc && - -# Instead of using the default crypt method, we want to use the more secure -# MD5 method of password encryption, which also allows passwords longer than -# 8 characters. We also need to change the obsolete /var/spool/mail location -# for user mailboxes that Shadow uses by default to the /var/mail location -# used currently. We accomplish both these things by changing the relevant -# configuration file while copying it to its destination. -sed -e's@#MD5_CRYPT_ENAB.no@MD5_CRYPT_ENAB yes@' \ - -e 's@/var/spool/mail@/var/mail@' \ - ../${1}/etc/login.defs > /etc/login.defs - -var_add_shadow "ENV_SUPATH" /etc/login.defs "/usr/local/sbin:/usr/local/bin" && +sed -i 's/groups$(EXEEXT) //' src/Makefile.in +find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \; -# Move some misplaced symlinks/programs to their proper locations. -mv /usr/bin/passwd /bin && +# 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 -# Move Shadow's libraries to more appropriate locations. -mv /lib/libshadow.*a /usr/lib && -rm /lib/libshadow.so && -ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so && +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 && +mkdir -p /etc/default # To enable shadowed passwords: -pwconv && +pwconv # To enable shadowed group passwords: grpconv -# Return last error exit $? diff --git a/stage2/cis-sudo b/stage2/cis-sudo index 46a3dc1..dc2a573 100755 --- a/stage2/cis-sudo +++ b/stage2/cis-sudo @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name. # Reading system configuration informations, functions and package versions. @@ -7,16 +9,16 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${1}-build && +cd ${LFS_TMP}/${1}-build ../${1}/configure \ --prefix=/usr \ - --sysconfdir=/etc && -make -j ${MAKEJOBS} && -make install && + --sysconfdir=/etc +make -j ${MAKEJOBS} +make install -cat > /etc/sudoers << EOF && +cat > /etc/sudoers << EOF # User alias specification User_Alias ADMIN = _REGUSER_ @@ -24,8 +26,7 @@ User_Alias ADMIN = _REGUSER_ ADMIN ALL = NOPASSWD: ALL EOF -sed -i -e "s!_REGUSER_!${REGUSER}!g" /etc/sudoers && +sed -i -e "s!_REGUSER_!${REGUSER}!g" /etc/sudoers chmod 600 /etc/sudoers -# Return last error exit $? diff --git a/stage2/cis-sysklogd b/stage2/cis-sysklogd index 80c8fa1..feeb789 100755 --- a/stage2/cis-sysklogd +++ b/stage2/cis-sysklogd @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,11 +9,11 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${1} && -make -j ${MAKEJOBS} && -make install && +cd ${LFS_TMP}/${1} +make -j ${MAKEJOBS} +make install cat > /etc/syslog.conf << "EOF" # /etc/syslog.conf @@ -26,5 +28,4 @@ cron.* -/var/log/cron.log *.emerg * EOF -# Return last error exit $? diff --git a/stage2/cis-sysvinit b/stage2/cis-sysvinit index a3906b3..f198b8a 100755 --- a/stage2/cis-sysvinit +++ b/stage2/cis-sysvinit @@ -1,5 +1,5 @@ #!/bin/sh -# First argument of this script is the package name +set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos @@ -7,79 +7,20 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${1} && -sed -i 's@Sending processes@& started by init@g' src/init.c && -make -j ${MAKEJOBS} -C src && -make -C src install && +cd ${LFS_TMP}/${1} -# Configuring Sysvinit -cat > /etc/inittab << "EOF" && -# /etc/inittab -# -# SysVinit +sed -i 's@Sending processes@& configured via /etc/inittab@g' src/init.c -# Each non-comment line is a data record entry with the following format: -# ::: -# -# id: Unique sequence of 1-4 characters identifying an entry in inittab -# runlevels: lists the runlevels for which the specified action should be taken -# action: describes which action should be taken -# process: specifies the process to be executed +# 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 -# Default runlevel -id:3:initdefault: +make -j ${MAKEJOBS} -C src +make -C src install -# System initialization before anything else (runs when system boots). -si::sysinit:/etc/rc.d/init.d/rc S +# /etc/inittab was installed in stage 1 -# System halting -l0:0:wait:/etc/rc.d/init.d/rc 0 - -# Single-user mode -l1:1:wait:/etc/rc.d/init.d/rc 1 - -# Not used -l2:2:wait:/etc/rc.d/init.d/rc 2 - -# Full multi-user mode -l3:3:wait:/etc/rc.d/init.d/rc 3 - -# Not used -l4:4:wait:/etc/rc.d/init.d/rc 4 - -# Full multi-user mode (X-windows) -l5:5:wait:/etc/rc.d/init.d/rc 5 - -# System reboot -l6:6:wait:/etc/rc.d/init.d/rc 6 - -# Trap CTRL-ALT-DELETE -ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now - -su:S016:once:/sbin/sulogin - -# getty-programs for the normal runlevels -# 'getty' opens a tty port, prompts for a login name and invokes the -# /bin/login command. -# The field MUST be the same as the last -# characters of the device (after "tty"). -1:12345:respawn:/sbin/agetty 38400 tty1 -2:2345:respawn:/sbin/agetty 38400 tty2 -3:2345:respawn:/sbin/agetty 38400 tty3 -4:2345:respawn:/sbin/agetty 38400 tty4 -5:2345:respawn:/sbin/agetty 38400 tty5 -6:2345:respawn:/sbin/agetty 38400 tty6 - -# Run xdm or kdm in runlevel 5 -# kdm or xdm is now a separate service -x:5:respawn:/usr/X11R6/bin/xdm -nodaemon -EOF - -if [ "x${INST_TYPE}" = "xworkstation" ]; then - chmod u+s /sbin/halt || exit 1 -fi - -# Return last error exit $? diff --git a/stage2/cis-tcl b/stage2/cis-tcl new file mode 100755 index 0000000..5be0be5 --- /dev/null +++ b/stage2/cis-tcl @@ -0,0 +1,41 @@ +#!/bin/sh +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} +cd unix +./configure --prefix=/usr \ + --enable-threads \ + --mandir=/usr/share/man +make + +# removes the references to the build directory and replaces them with saner +# system-wide locations: +sed -i \ + -e "s@^\(TCL_SRC_DIR='\).*@\1/usr/include'@" \ + -e "/TCL_B/s@='\(-L\)\?.*unix@='\1/usr/lib@" \ + -e "/SEARCH/s/=.*/=''/" \ + tclConfig.sh + +make install +make install-private-headers + +PKG_VER_BASE=$(echo ${PACKAGE} | sed "s!^tcl\([0-9]*\.[0-9]*\).*!\1!g") + +ln -svfT tclsh${PKG_VER_BASE} /usr/bin/tclsh + +exit $? diff --git a/stage2/cis-tcp-wrappers b/stage2/cis-tcp-wrappers index 92078fb..5a0adeb 100755 --- a/stage2/cis-tcp-wrappers +++ b/stage2/cis-tcp-wrappers @@ -1,20 +1,28 @@ #!/bin/sh -# First argument of this script is the package name +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 ${1} && +apply_patches ${PACKAGE} -cd ${LFS_TMP}/${1} && -make -j ${MAKEJOBS} REAL_DAEMON_DIR=/usr/sbin STYLE=-DPROCESS_OPTIONS linux && -make install && +cd ${LFS_TMP}/${PACKAGE} +sed -i -e "s,^extern char \*malloc();,/* & */," scaffold.c +make -j ${MAKEJOBS} REAL_DAEMON_DIR=/usr/sbin STYLE=-DPROCESS_OPTIONS linux +make install # Creating /etc/hosts.allow -cat > /etc/hosts.allow << "EOF" && +cat > /etc/hosts.allow << "EOF" ALL : LOCAL 192.168.0.0/255.255.255.0 : RFC931 EOF @@ -23,5 +31,4 @@ cat > /etc/hosts.deny << "EOF" ALL: ALL: RFC931 EOF -# Return last error exit $? diff --git a/stage2/cis-texinfo b/stage2/cis-texinfo index 08601bd..e96efd8 100755 --- a/stage2/cis-texinfo +++ b/stage2/cis-texinfo @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,14 +9,13 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${1}-build && +cd ${LFS_TMP}/${1}-build ../${1}/configure \ - --prefix=/usr && -make -j ${MAKEJOBS} && -make install && + --prefix=/usr +make -j ${MAKEJOBS} +make install make TEXMF=/usr/share/texmf install-tex -# Return last error exit $? diff --git a/stage2/cis-toolchain-adjust b/stage2/cis-toolchain-adjust index dece896..4ff2aab 100755 --- a/stage2/cis-toolchain-adjust +++ b/stage2/cis-toolchain-adjust @@ -1,48 +1,17 @@ #!/bin/sh +set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos source ../functions source ../packages-list -# First, backup the /tools linker, and replace it with the adjusted linker -# we made in chapter 5. We'll also create a link to its counterpart in -# /tools/$(gcc -dumpmachine)/bin. -mv -v /tools/bin/{ld,ld-old} && -mv -v /tools/$(gcc -dumpmachine)/bin/{ld,ld-old} && -mv -v /tools/bin/{ld-new,ld} && -ln -sv /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld && - # 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-linux.so.2@/lib/ld-linux.so.2@g' \ - -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \ - -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \ - `dirname $(gcc --print-libgcc-file-name)`/specs && - -# Testing toolchain -cd /tmp && -echo 'main(){}' > dummy.c && -cc dummy.c -Wl,--verbose &> dummy.log && -if [ ! readelf -l a.out | grep 'Requesting program interpreter: /lib/' \ - 1> /dev/null 2>&1 ]; then - exit 1 -fi && - -if [ ! grep "attempt to open /usr/lib/crt.* succeeded" dummy.log 1> /dev/null 2>&1 ]; then - exit 1 -fi && - -if [ ! grep "attempt to open /lib/libc.so.6 succeeded" dummy.log 1> /dev/null 2>&1 ]; then - exit 1 -fi && - -if [ ! grep "found ld-linux.so.2 at /lib/ld-linux.so.2" dummy.log 1> /dev/null 2>&1 ]; then - exit 1 -fi && - -rm dummy.c a.out +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 -# Return last error exit $? diff --git a/stage2/cis-toolchain-test b/stage2/cis-toolchain-test new file mode 100755 index 0000000..bb71697 --- /dev/null +++ b/stage2/cis-toolchain-test @@ -0,0 +1,21 @@ +#!/bin/sh +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 $? diff --git a/stage2/cis-udev b/stage2/cis-udev index 130770e..f661619 100755 --- a/stage2/cis-udev +++ b/stage2/cis-udev @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name. # Reading system configuration informations, functions and package versions. @@ -7,63 +9,35 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && - -cd ${LFS_TMP}/${1} && - -install -dv /lib/{firmware,udev/devices/{pts,shm}} && - -if [ ! -c /lib/udev/devices/null ]; then - mknod -m0666 /lib/udev/devices/null c 1 3 || exit 1 -fi && - -if [ ! -c /lib/udev/devices/kmsg ]; then - mknod -m0600 /lib/udev/devices/kmsg c 1 11 || exit 1 -fi && - -if [ ! -h /lib/udev/devices/fd ]; then - ln -sfv /proc/self/fd /lib/udev/devices/fd || exit 1 -fi && - -if [ ! -h /lib/udev/devices/stdin ]; then - ln -sfv /proc/self/fd/0 /lib/udev/devices/stdin || exit 1 -fi && - -if [ ! -h /lib/udev/devices/stdout ]; then - ln -sfv /proc/self/fd/1 /lib/udev/devices/stdout || exit 1 -fi && - -if [ ! -h /lib/udev/devices/stderr ]; then - ln -sfv /proc/self/fd/2 /lib/udev/devices/stderr || exit 1 -fi && - -if [ ! -h /lib/udev/devices/core ]; then - ln -sfv /proc/kcore /lib/udev/devices/core || exit 1 -fi && +apply_patches ${1} -cd ${LFS_TMP}/${PACKAGE} && +cd ${LFS_TMP}/${1} ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --sbindir=/sbin \ --with-rootlibdir=/lib \ --libexecdir=/lib/udev \ - --docdir=/usr/share/doc/${PACKAGE} \ + --docdir=/usr/share/doc/${1} \ --disable-extras \ - --disable-introspection \ - ${CONFIGURE_OPTS} && -make && -make install && + --disable-introspection +make +make install -cat > /etc/sysconfig/modules << "EOF" && -# Add modules that must be manually loaded in this file, -# one per line. +# 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/ -EOF +# 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/ -chmod -v 644 /etc/sysconfig/modules && +# Now install a file to handle ISDN devices: +install -m644 -v rules/packages/40-isdn.rules \ + /lib/udev/rules.d/ ldconfig -# Return last error exit $? diff --git a/stage2/cis-udev-config b/stage2/cis-udev-config index eabeee9..a7c41e0 100755 --- a/stage2/cis-udev-config +++ b/stage2/cis-udev-config @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name. # Reading system configuration informations, functions and package versions. @@ -7,16 +9,15 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -cd ${LFS_TMP}/${1} && -make install && +cd ${LFS_TMP}/${1} +make install # Install the documentation that explains the LFS-specific rules files: -make install-doc && +make install-doc # Install the documentation that explains the commonly-used rules files provided by Udev: make install-extra-doc -# Return last error exit $? diff --git a/stage2/cis-util-linux b/stage2/cis-util-linux deleted file mode 100755 index a7b0b38..0000000 --- a/stage2/cis-util-linux +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# 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 && -# HAVE_KILL=yes: This prevents the kill program (already installed by -# Procps) from being built and installed again. -# HAVE_SLN=yes: This prevents the sln program (a statically linked -# ln already installed by Glibc) from being built and -# installed again. -make -j ${MAKEJOBS} HAVE_KILL=yes HAVE_SLN=yes && -make HAVE_KILL=yes HAVE_SLN=yes install - -# Return last error -exit $? diff --git a/stage2/cis-util-linux-ng b/stage2/cis-util-linux-ng new file mode 100755 index 0000000..8a83801 --- /dev/null +++ b/stage2/cis-util-linux-ng @@ -0,0 +1,30 @@ +#!/bin/sh +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 $? diff --git a/stage2/cis-zlib b/stage2/cis-zlib index a858ffc..74f9d9c 100755 --- a/stage2/cis-zlib +++ b/stage2/cis-zlib @@ -1,45 +1,35 @@ #!/bin/sh -# First argument of this script is the package name +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 -ZLIB_VERSION=$(get_pkg_ver ${1}) - -# Zlib is known to build its shared library incorrectly if CFLAGS is -# specified in the environment. We need to add the -fPIC directive to CFLAGS -# for the duration of the below configure command, then remove it afterwards. -export CFLAGS="${CFLAGS} -fPIC" +PACKAGE=${1} +shift +CONFIGURE_OPTS=${*} # Applying patches (if any) -apply_patches ${1} && +apply_patches ${PACKAGE} -cd ${LFS_TMP}/${1} && +cd ${LFS_TMP}/${PACKAGE} ./configure \ --prefix=/usr \ - --shared \ - --libdir=/lib && -make -j ${MAKEJOBS} && - -# Installing the shared library -make install && + ${CONFIGURE_OPTS} +make +make install +ldconfig -# The previous command installed a .so file in /lib. We will remove -# it and relink it into /usr/lib: -rm -v /lib/libz.so && -ln -sfv ../../lib/libz.so.${ZLIB_VERSION} /usr/lib/libz.so && - -# Now also build the non-shared (static) library: -make clean && -./configure \ - --prefix=/usr && -make -j ${MAKEJOBS} && -make install && +# 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 -# Return last error exit $? diff --git a/stage2/create-config-files b/stage2/create-config-files index f0ca40a..c44e74b 100755 --- a/stage2/create-config-files +++ b/stage2/create-config-files @@ -1,211 +1,17 @@ #!/bin/sh +set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos source ../functions source ../packages-list -CWD=$(pwd) +# Removing /tools from PATH: +SED_REP='/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin' +sed -i -e "s!^\(PATH=\).*tools.*!\1${SED_REP}!" /etc/profile -echo "Creating /etc/fstab" && -cat > /etc/fstab << "EOF" -# Device Mount point FS-type Options Dump Fsck-order -# ---------------------------------------------------------------------------- -EOF -evaluate_retval -if [ -n "${BOOT_PARTITION}" ]; then - echo "${BOOT_PARTITION} /boot ext2 defaults 1 1" >> /etc/fstab || exit 1 -fi -if [ -n "${SWAP_PARTITION}" ]; then - echo "${SWAP_PARTITION} none swap sw 0 0" >> /etc/fstab || exit 1 -fi -echo "${LFS_PARTITION} / reiserfs defaults,noatime 0 0" >> /etc/fstab && -echo "/dev/cdrom /media/cdrom auto ro,noauto,users 0 0" >> /etc/fstab && -echo "/dev/dvd /media/dvd auto ro,noauto,users 0 0" >> /etc/fstab && -echo "proc /proc proc defaults 0 0" >> /etc/fstab && -echo "sysfs /sys sysfs defaults 0 0" >> /etc/fstab && -echo "devpts /dev/pts devpts gid=4,mode=620 0 0" >> /etc/fstab && -echo "shm /dev/shm tmpfs defaults 0 0" >> /etc/fstab && -echo "none /proc/bus/usb usbfs defaults,devmode=0666 0 0" >> /etc/fstab && - -echo "Creating /etc/profile" && -cat > /etc/profile << "EOF" && -#!/bin/sh -# /etc/profile - -# System wide environment and startup programs -# Functions and aliases go in /etc/bashrc -# This is the first file read by bash during the logon process. - -export USER=`id -un` -export LOGNAME=$USER -export MAIL="/var/mail/$USER" -export HISTFILESIZE=1000 -export HISTSIZE=1000 -export HOSTNAME=`/bin/hostname` -export EDITOR=_DEFAULT_EDITOR_ -export CFLAGS="-pipe -O2" -export CXXFLAGS=${CFLAGS} - -# Set default permissions when creating new files. -if [ `id -gn` = `id -un` -a `id -u` -gt 14 ]; then - # Normal user - umask 002 -else - # Root - umask 022 -fi - -if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then - export INPUTRC=/etc/inputrc -fi - -# This disables generation of 'core' files when an application exit abnormally -ulimit -c 0 - -PATH="/bin:/usr/bin:/usr/local/bin" -if [ $USER = 'root' ]; then - PATH="/sbin:/usr/sbin:$PATH:/usr/local/sbin" -fi - -MANPATH="/usr/share/man:/usr/local/share/man" - -export PATH MANPATH PS1 PS2 - -export LANG="en_US.ISO8859-1" - -# The sort order of ls output is affected by the locale and -# can be overridden by the LC_COLLATE environment variable. -# For example, if LC_COLLATE equals C, dot files appear first, -# followed by names beginning with upper-case letters, then -# followed by names beginning with lower-case letters. But if -# LC_COLLATE equals en_US.ISO8859-1, then leading dots as well -# as case are ignored in determining the sort order. -export LC_COLLATE=C - -EOF - -sed -i -e "s!_DEFAULT_EDITOR_!${DEFAULT_EDITOR}!g" /etc/profile && - -var_add_str "CFLAGS" /etc/profile "-march=${MACHINE_ARCHITECTURE}" && - -echo "Creating /etc/bashrc" && -cat > /etc/bashrc << "EOF" && -#!/bin/sh - -# /etc/bashrc - -# System wide functions and aliases -# Environment stuff goes in /etc/profile - -alias df='df -h' -alias du='du -h -s' -# --show-control-chars is for seeing international characters in filenames -alias ls='ls -h --color=auto --show-control-chars' -alias halt='/sbin/halt' -alias reboot='/sbin/reboot' - -eval $(dircolors --sh /etc/DIR_COLORS) - -# For some unknown reason bash refuses to inherit PS1 in some circumstances -# that I can't figure out. Putting PS1 here ensures that it gets loaded every -# time. -# \h = Display hostname -# \s = Display shell name (bash) -# \v = Display shell version -# \w = Display complete path -# \W = Dispaly only current directory -# \$ = Display '#' -#PS1="\h(\W)\$" - -if [ "$TERM" = "linux" ]; then - #we're on the system console or maybe telnetting in - export PS1="\u(\W)\$" - #export PS1="\[\e[32;1m\]\u@\H > \[\e[0m\]" -else - #we're not on the console, assume an xterm - #export PS1="\[\e]2;\u@\H \w\a\e[32;1m\]>\[\e[0m\] " - export PS1="\[\e]2;[\u] \w\a\e[32;1m\]>\[\e[0m\] " -fi -EOF - -echo "Creating /etc/inputrc" && -cat > /etc/inputrc << "EOF" && -# Begin /etc/inputrc - -# Enable 8bit input -set meta-flag On -set input-meta On -# Turns off 8th bit stripping -set convert-meta Off -# Keep the 8th bit for display -set output-meta On - -# none, visible or audible -set bell-style none - -# All of the following map the escape sequence of the value contained inside -# the 1st argument to the readline specific functions -"\eOd": backward-word -"\eOc": forward-word -# for linux console -"\e[1~": beginning-of-line -"\e[4~": end-of-line -"\e[5~": beginning-of-history -"\e[6~": end-of-history -"\e[3~": delete-char -"\e[2~": quoted-insert -# for xterm -"\eOH": beginning-of-line -"\eOF": end-of-line -EOF - - -echo "Creating /etc/skel and it's files" && -mkdir -p /etc/skel && -cat > /etc/skel/.bash_logout << "EOF" && -# ~/.bash_logout - -clear -EOF - -cat > /etc/skel/.bash_profile << "EOF" && -# ~/.bash_profile - -# User specific environment and startup programs -# This file is the second read by bash during the logon process. - -# Get the aliases and functions -if [ -f ~/.bashrc ]; then - . ~/.bashrc -fi - -BASH_ENV=$HOME/.bashrc - -export BASH_ENV - -unset USERNAME -EOF - -cat > /etc/skel/.bashrc << "EOF" && -# ~/.bashrc - -# User specific aliases and functions -# This file is executed each time an xterm window -# is started. - -# Source global definitions -if [ -f /etc/bashrc ]; then - . /etc/bashrc -fi - -alias rm='rm -i' -alias mv='mv -i' -alias cp='cp -i' -EOF - -echo "Creating /etc/host.conf" && -cat > /etc/host.conf << "EOF" && +echo "Creating /etc/host.conf" +cat > /etc/host.conf << "EOF" # /etc/host.conf # # Lookup names via DNS first then fall back to /etc/hosts. @@ -217,19 +23,6 @@ multi on # Check for IP address spoofing. nospoof on EOF -chmod 644 /etc/host.conf && - -echo "Creating /etc/shells" && -cat > /etc/shells << "EOF" && -/bin/sh -/bin/bash -EOF -chmod 644 /etc/shells && - -echo "Installing /etc/DIR_COLORS" && -install -m644 ${CWD}/misc/DIR_COLORS /etc/DIR_COLORS && - -echo "Creating /etc/shutdown.allow" && -echo "${REGUSER}" > /etc/shutdown.allow +chmod 644 /etc/host.conf exit $? diff --git a/stage2/create-groups b/stage2/create-groups deleted file mode 100755 index 75e784c..0000000 --- a/stage2/create-groups +++ /dev/null @@ -1,37 +0,0 @@ -#!/tools/bin/sh - -# System configuration informations (entered by the user) -source ../sysinfos -source ../functions -source ../packages-list - -# In order for root to be able to login and for the name "root" to be -# recognized, there need to be relevant entries in the /etc/group file. - -cat > /etc/group << "EOF" -root:x:0: -bin:x:1: -sys:x:2: -kmem:x:3: -tty:x:4: -tape:x:5: -daemon:x:6: -floppy:x:7: -disk:x:8: -lp:x:9: -uucp:x:10: -audio:x:11: -video:x:12 -utmp:x:13 -usb:x:14 -cdrom:x:15 -# Used by MTAs (Mail Transport Agents) -mail:x:34:mail -# Default group used by some programs that do not require a group. -nogroup:x:99: -# The default GID used by shadow for new users -users:x:100: - -EOF - -exit $? diff --git a/stage2/create-users b/stage2/create-users deleted file mode 100755 index 46033c4..0000000 --- a/stage2/create-users +++ /dev/null @@ -1,13 +0,0 @@ -#!/tools/bin/sh - -# System configuration informations (entered by the user) -source ../sysinfos -source ../functions -source ../packages-list - -# In order for root to be able to login and for the name "root" to be -# recognized, there need to be relevant entries in the /etc/passwd file. - -echo "root:x:0:0:root:/root:/bin/bash" > /etc/passwd - -exit $? diff --git a/stage2/hv-utilities/fix-avi b/stage2/hv-utilities/fix-avi index b626971..0462a62 100755 --- a/stage2/hv-utilities/fix-avi +++ b/stage2/hv-utilities/fix-avi @@ -122,7 +122,7 @@ else p_top=$p fi -if [ "x${VERBOSE}" == "xyes" ]; then +if [ "x${VERBOSE}" = "xyes" ]; then out_par=$(calc_par $dvd_width $out_height $dvd_dar) echo "Source:" echo " Size................: ${src_width}x${src_height}" diff --git a/stage2/hv-utilities/hv-video-dvd b/stage2/hv-utilities/hv-video-dvd index 230ffee..b3e5f9f 100755 --- a/stage2/hv-utilities/hv-video-dvd +++ b/stage2/hv-utilities/hv-video-dvd @@ -93,7 +93,7 @@ else ARG_DURATION="-t ${DURATION}" fi -if [ "x${dvd_dar}" == "x16:9" ]; then +if [ "x${dvd_dar}" = "x16:9" ]; then ARG_WIDESCREEN="-w" else ARG_WIDESCREEN="" @@ -126,7 +126,7 @@ if [ -f ${outfile} ]; then echo "Fichier <${outfile}> déjà convertit, terminé." else for passe in $(seq ${PASSES}); do - if [ "x${PASSES}" == "x1" ]; then + if [ "x${PASSES}" = "x1" ]; then PASSES_OPT="" else PASSES_OPT="-pass $passe" diff --git a/stage2/hv-utilities/media-write b/stage2/hv-utilities/media-write index dfcfb1c..1f83ab9 100755 --- a/stage2/hv-utilities/media-write +++ b/stage2/hv-utilities/media-write @@ -82,7 +82,7 @@ fi # Create an empty file of $FILES_SIZE dd if=/dev/zero of=${TMP_FILE} bs=1024k count=${FILES_SIZE} -if [ $? != 0 ]; then +if [ $? -ne 0 ]; then echo "Error while creating empty file..." rm -f ${TMP_FILE} exit 1 @@ -90,7 +90,7 @@ fi # Create an extended-2 filesystem on this file echo y | /sbin/mke2fs -m 0 -b 2048 ${TMP_FILE} -if [ $? != 0 ]; then +if [ $? -ne 0 ]; then echo "Error creating file system on empty file..." rm -f ${TMP_FILE} exit 1 @@ -99,7 +99,7 @@ fi # Mount this empty file through the loopback device. mkdir -p ${TMP_MOUNT} mount -o loop -t ext2 ${TMP_FILE} ${TMP_MOUNT} -if [ $? != 0 ]; then +if [ $? -ne 0 ]; then echo "Error mounting empty file..." rm -f ${TMP_FILE} rm -rf $TMP_MOUNT @@ -112,7 +112,7 @@ rmdir ${TMP_MOUNT}/lost+found # Copy files to $TMP_MOUNT and umount it afterwards. echo "Copying files..." cp -a --parents ${FILES_WRITE_LIST} ${TMP_MOUNT} -if [ $? != 0 ]; then +if [ $? -ne 0 ]; then echo "Error while copying files..." umount ${TMP_MOUNT} rm -rf ${TMP_MOUNT} diff --git a/stage2/install-2 b/stage2/install-2 index 2b733bf..a090916 100755 --- a/stage2/install-2 +++ b/stage2/install-2 @@ -1,86 +1,102 @@ #!/bin/sh +LFS_STAGE=stage2 + # Reading system configuration informations, functions and package versions. source ../sysinfos source ../functions source ../packages-list -export LFS_PKG_DIR="$(dirname $(pwd))/packages/stage2" -export LFS_LOG_DIR=/var/log/hvlinux-install/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" +export LFS_TMP=/tmp init_log_file -ipkg ${BZIP2} cis-bzip2 -ipkg_ac ${DIFFUTILS} -ipkg_ac ${FILE_PKG} -ipkg ${FINDUTILS} cis-findutils -ipkg ${FLEX} cis-flex -ipkg ${GRUB} cis-grub -ipkg_ac ${GAWK} "--libexecdir=/usr/lib" -ipkg_ac ${GETTEXT} -ipkg_ac ${GREP} "--bindir=/bin" -ipkg ${GROFF} cis-groff -ipkg ${GZIP} cis-gzip -ipkg ${INETUTILS} cis-inetutils -ipkg ${IPROUTE2} cis-iproute2 -ipkg ${KBD} cis-kbd -ipkg_ac ${LESS} -ipkg_ac ${MAKE_PACKAGE} -ipkg ${MAN} cis-man # Obsoleted -ipkg_ac ${MKTEMP} "--with-libc" -ipkg ${MODULE_INIT_TOOLS} cis-module-init-tools -ipkg_ac ${PATCH_PACKAGE} -ipkg ${PSMISC} cis-psmisc -ipkg ${SHADOW} cis-shadow -ipkg ${SYSKLOGD} cis-sysklogd -ipkg ${SYSVINIT} cis-sysvinit -ipkg_ac ${TAR_PACKAGE} "--bindir=/bin --libexecdir=/usr/sbin" -ipkg ${TEXINFO} cis-texinfo -ipkg ${UDEV} cis-udev -ipkg ${UDEV_CONFIG} cis-udev-config -ipkg ${UTIL_LINUX} cis-util-linux - -# End of standard LFS packages installation. -ipkg_ac ${WHICH} -ipkg ${REISERFSPROGS} cis-reiserfsprogs -ipkg ${PCIUTILS} cis-pciutils -ipkg ${NET_TOOLS} cis-net-tools -ipkg ${DHCP} cis-dhcp -ipkg ${PKG_CONFIG} cis-pkg-config -ipkg_ac_nb ${POPT} -ipkg ${PAM} cis-pam -ipkg ${OPENSSL} cis-openssl -ipkg ${OPENSSH} cis-openssh - -ipkg_ac ${EXPAT} # expat is needed by apr-util. -ipkg ${APR} cis-apr -ipkg_ac ${APR_UTIL} "--with-apr=/usr/bin/apr-1-config" -ipkg_ac ${NEON} "--with-ssl" -ipkg_ac ${SUBVERSION} - -ipkg ${SUDO} cis-sudo -ipkg_ac ${WGET} - -ipkg_ac ${NANO} -ipkg ${EMACS} cis-emacs - -ipkg ${TCPWRAPPERS} cis-tcp-wrappers # Needed by portmap -ipkg_ac_nb ${PORTMAP} -ipkg ${NFS_UTILS} cis-nfs-utils - -run_script_log "Installing bootscripts" cis-bootscripts -run_script_log "Installing HV-utilities" cis-hv-utilities -run_script_log "Compressing man pages" cis-compressdoc -####action_checkbox "Stripping" ./cis-stripping +# Scripts directory +export SCRDIR=$(pwd) + +ipkg_ac ${LIBTOOL} +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 ${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_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} +ipkg_ac ${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 + +# Additional HV packages +ipkg_cust ${NANO} cis-nano --enable-color --enable-multibuffer +ipkg_ac ${WHICH} +ipkg_cust ${EMACS} cis-emacs +ipkg_cust ${PCIUTILS} cis-pciutils +ipkg_cust ${REISERFSPROGS} cis-reiserfsprogs +ipkg_cust ${NET_TOOLS} cis-net-tools +ipkg_cust ${DHCP} cis-dhcp +ipkg_ac_nb ${POPT} +ipkg_cust ${PAM} cis-pam +ipkg_cust ${OPENSSL} cis-openssl +ipkg_cust ${OPENSSH} cis-openssh +ipkg_ac ${EXPAT} +ipkg_ac ${APR} --with-installbuilddir=/usr/lib/apr-1/build +ipkg_ac ${APR_UTIL} --with-apr=/usr/bin/apr-1-config +ipkg_ac ${NEON} --with-ssl +ipkg_cust ${TCL} cis-tcl +ipkg_ac ${SQLITE} +ipkg_ac ${SUBVERSION} +ipkg_cust ${SUDO} cis-sudo +ipkg_ac ${WGET} +ipkg_cust ${TCPWRAPPERS} cis-tcp-wrappers +ipkg_cust ${PORTMAP} cis-portmap +ipkg_cust ${NFS_UTILS} cis-nfs-utils + +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 echo "Total build time: $(get_total_build_time ${LFS_LOG_FILE})h" # Creating root password passwd root || exit 1 -action_checkbox "Performing post-install" ./cis-post-install +rscr mult "Performing post-install" cis-post-install ldconfig lasterror=$? diff --git a/stage2/makedir b/stage2/makedir deleted file mode 100755 index c7394c4..0000000 --- a/stage2/makedir +++ /dev/null @@ -1,35 +0,0 @@ -#!/tools/bin/sh -# This script is called when there is no /bin/sh link, so the shell is set -# to /tools/bin/sh - -install -dv /{bin,boot,dev/pts,etc/opt,home,lib,mnt,proc} && -install -dv /{root,sbin,srv,sys,tmp,usr/local,var,opt} && -for dirname in /usr /usr/local - do - install -dv $dirname/{bin,etc,include,lib,sbin,share,src} && - ln -sf share/{man,doc,info} $dirname && - install -dv $dirname/share/{dict,doc,info,locale,man} && - install -dv $dirname/share/{nls,misc,terminfo,zoneinfo} && - install -dv $dirname/share/man/man{1,2,3,4,5,6,7,8} -done && -install -dv /media/{cdrom,dvd} && -install -dv /var/{lock,log,mail,run,spool} && -install -dv /var/{tmp,opt,cache,lib/misc,local} && -install -dv /opt/{bin,doc,include,info} && -install -dv /opt/{lib,man/man{1,2,3,4,5,6,7,8}} && -install -dv /etc/rc.d/{init.d,rc0.d,rc1.d,rc2.d,rc3.d,rc4.d,rc5.d,rc6.d,rcS.d} && -install -dv /etc/sysconfig/network && -ln -v -sf ../var/tmp /usr && - -# For alsa, nfs and fcron? -install -dv /var/lock/subsys && - -# Required only for hvlinux. -install -dv /tmp/log-init && -ln -v -sf /tmp/log-init/init.log /var/log/init.log && - -install -dv /usr/share/pixmaps && -install -dv /usr/local/share/pixmaps - -# Return with last error... -exit $? diff --git a/stage2/misc/DIR_COLORS b/stage2/misc/DIR_COLORS deleted file mode 100644 index 8a6e26b..0000000 --- a/stage2/misc/DIR_COLORS +++ /dev/null @@ -1,73 +0,0 @@ -# Configuration file for the color ls utility -# This file goes in the /etc directory, and must be world readable. -# You can copy this file to .dir_colors in your $HOME directory to override -# the system defaults. - -# COLOR needs one of these arguments: 'tty' colorizes output to ttys, but not -# pipes. 'all' adds color characters to all output. 'none' shuts colorization -# off. -COLOR tty - -# Below, there should be one TERM entry for each termtype that is colorizable -TERM linux -TERM console -TERM con132x25 -TERM con132x30 -TERM con132x43 -TERM con132x60 -TERM con80x25 -TERM con80x28 -TERM con80x30 -TERM con80x43 -TERM con80x50 -TERM con80x60 -TERM xterm -TERM vt100 - -# EIGHTBIT, followed by '1' for on, '0' for off. (8-bit output) -EIGHTBIT 1 - -# Below are the color init strings for the basic file types. A color init -# string consists of one or more of the following numeric codes: -# Attribute codes: -# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed -# Text color codes: -# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white -# Background color codes: -# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white -NORMAL 00 # global default, although everything should be something. -FILE 00 # normal file -CHR 01;31 # character device driver -FIFO 00;33;40 # pipe -DIR 01;34 # directory -EXEC 00;35 # files with execute permission: -SOCK 01;35;04 # socket -LINK 01;36 # symbolic link -BLK 01;37 # block device driver -ORPHAN 01;05;37;41 # orphaned syminks -MISSING 01;05;37;41 # ... and the files they point to - -# List any file extensions like '.gz' or '.tar' that you would like ls -# to colorize below. Put the extension, a space, and the color init string. -# (and any comments you want to add after a '#') -.cmd 00;35 # executables (bright green) -.exe 00;35 -.com 00;35 -.btm 00;35 -.bat 00;35 -.tar 01;31 # archives or compressed (bright red) -.tgz 01;31 -.bz2 01;31 -.arj 01;31 -.taz 01;31 -.lzh 01;31 -.zip 01;31 -.z 01;31 -.Z 01;31 -.gz 01;31 -.jpg 01;35 # image formats -.gif 01;35;47 -.bmp 01;35 -.xbm 01;35 -.xpm 01;35 -.patch 04;31 diff --git a/stage2/misc/compressdoc b/stage2/misc/compressdoc index b096d50..e8d883b 100755 --- a/stage2/misc/compressdoc +++ b/stage2/misc/compressdoc @@ -1,5 +1,5 @@ #!/bin/bash -# VERSION: 20050112.0027 +# VERSION: 20080421.1623 # # Compress (with bzip2 or gzip) all man pages in a hierarchy and # update symlinks - By Marc Heerdink @@ -13,21 +13,36 @@ # compression level, to parse the man.conf for all occurrences of MANPATH, # to allow for a backup, to allow to keep the newest version of a page. # -# Modified 20040330 by Tushar Teredesai to replace $0 by the name of the +# Modified 20040330 by Tushar Teredesai to replace $0 by the name of the # script. # (Note: It is assumed that the script is in the user's PATH) # # Modified 20050112 by Randy McMurchy to shorten line lengths and # correct grammar errors. # +# Modified 20060128 by Alexander E. Patrakov for compatibility with Man-DB. +# +# Modified 20060311 by Archaic to use Man-DB manpath utility which is a +# replacement for man --path from Man. +# +# Modified 20080421 by Dan Nicholson to properly execute the correct +# compressdoc when working recursively. This means the same compressdoc +# will be used whether a full path was given or it was resolved from PATH. +# +# Modified 20080421 by Dan Nicholson to be more robust with directories +# that don't exist or don't have sufficient permissions. +# +# Modified 20080421 by Lars Bamberger to (sort of) automatically choose +# a compression method based on the size of the manpage. A couple bug +# fixes were added by Dan Nicholson. +# +# Modified 20080421 by Dan Nicholson to suppress warnings from manpath +# since these are emitted when $MANPATH is set. Removed the TODO for +# using the $MANPATH variable since manpath(1) handles this already. +# # TODO: # - choose a default compress method to be based on the available # tool : gzip or bzip2; -# - offer an option to automagically choose the best compression -# methed on a per page basis (eg. check which of -# gzip/bzip2/whatever is the most effective, page per page); -# - when a MANPATH env var exists, use this instead of /etc/man.conf -# (useful for users to (de)compress their man pages; # - offer an option to restore a previous backup; # - add other compression engines (compress, zip, etc?). Needed? @@ -43,79 +58,85 @@ Where comp_method is one of : --gzip, --gz, -g --bzip2, --bz2, -b Compress using gzip or bzip2. + --automatic + Compress using either gzip or bzip2, depending on the + size of the file to be compressed. Files larger than 5 + kB are bzipped, files larger than 1 kB are gzipped and + files smaller than 1 kB are not compressed. --decompress, -d Decompress the man pages. --backup Specify a .tar backup shall be done for all directories. - In case a backup already exists, it is saved as .tar.old - prior to making the new backup. If a .tar.old backup + In case a backup already exists, it is saved as .tar.old + prior to making the new backup. If a .tar.old backup exists, it is removed prior to saving the backup. In backup mode, no other action is performed. And where options are : -1 to -9, --fast, --best - The compression level, as accepted by gzip and bzip2. - When not specified, uses the default compression level - for the given method (-6 for gzip, and -9 for bzip2). + The compression level, as accepted by gzip and bzip2. + When not specified, uses the default compression level + for the given method (-6 for gzip, and -9 for bzip2). Not used when in backup or decompress modes. - --force, -F Force (re-)compression, even if the previous one was - the same method. Useful when changing the compression - ratio. By default, a page will not be re-compressed if - it ends with the same suffix as the method adds + --force, -F Force (re-)compression, even if the previous one was + the same method. Useful when changing the compression + ratio. By default, a page will not be re-compressed if + it ends with the same suffix as the method adds (.bz2 for bzip2, .gz for gzip). - --soft, -S Change hard-links into soft-links. Use with _caution_ - as the first encountered file will be used as a + --soft, -S Change hard-links into soft-links. Use with _caution_ + as the first encountered file will be used as a reference. Not used when in backup mode. - --hard, -H Change soft-links into hard-links. Not used when in + --hard, -H Change soft-links into hard-links. Not used when in backup mode. --conf=dir, --conf dir - Specify the location of man.conf. Defaults to /etc. + Specify the location of man_db.conf. Defaults to /etc. - --verbose, -v Verbose mode, print the name of the directory being - processed. Double the flag to turn it even more verbose, + --verbose, -v Verbose mode, print the name of the directory being + processed. Double the flag to turn it even more verbose, and to print the name of the file being processed. - --fake, -f Fakes it. Print the actual parameters compman will use. + --fake, -f Fakes it. Print the actual parameters compressdoc will use. - dirs A list of space-separated _absolute_ pathnames to the - man directories. When empty, and only then, parse - ${MAN_CONF}/man.conf for all occurrences of MANPATH. + dirs A list of space-separated _absolute_ pathnames to the + man directories. When empty, and only then, use manpath + to parse ${MAN_CONF}/man_db.conf for all valid occurrences + of MANDATORY_MANPATH. Note about compression: There has been a discussion on blfs-support about compression ratios of both gzip and bzip2 on man pages, taking into account the hosting fs, the architecture, etc... On the overall, the conclusion was that gzip - was much more efficient on 'small' files, and bzip2 on 'big' files, + was much more efficient on 'small' files, and bzip2 on 'big' files, small and big being very dependent on the content of the files. - See the original post from Mickael A. Peters, titled + See the original post from Mickael A. Peters, titled "Bootable Utility CD", dated 20030409.1816(+0200), and subsequent posts: http://linuxfromscratch.org/pipermail/blfs-support/2003-April/038817.html - On my system (x86, ext3), man pages were 35564KB before compression. - gzip -9 compressed them down to 20372KB (57.28%), bzip2 -9 got down to + On my system (x86, ext3), man pages were 35564KB before compression. + gzip -9 compressed them down to 20372KB (57.28%), bzip2 -9 got down to 19812KB (55.71%). That is a 1.57% gain in space. YMMV. - What was not taken into consideration was the decompression speed. But - does it make sense to? You gain fast access with uncompressed man - pages, or you gain space at the expense of a slight overhead in time. + What was not taken into consideration was the decompression speed. But + does it make sense to? You gain fast access with uncompressed man + pages, or you gain space at the expense of a slight overhead in time. Well, my P4-2.5GHz does not even let me notice this... :-) EOT ) | less } -# This function checks that the man page is unique amongst bzip2'd, +# This function checks that the man page is unique amongst bzip2'd, # gzip'd and uncompressed versions. # $1 the directory in which the file resides # $2 the file name for the man page -# Returns 0 (true) if the file is the latest and must be taken care of, -# and 1 (false) if the file is not the latest (and has therefore been +# Returns 0 (true) if the file is the latest and must be taken care of, +# and 1 (false) if the file is not the latest (and has therefore been # deleted). function check_unique () { @@ -147,9 +168,9 @@ function check_unique () # Name of the script MY_NAME=`basename $0` -# OK, parse the command-line for arguments, and initialize to some -# sensible state, that is: don't change links state, parse -# /etc/man.conf, be most silent, search man.conf in /etc, and don't +# OK, parse the command-line for arguments, and initialize to some +# sensible state, that is: don't change links state, parse +# /etc/man_db.conf, be most silent, search man_db.conf in /etc, and don't # force (re-)compression. COMP_METHOD= COMP_SUF= @@ -173,6 +194,11 @@ while [ -n "$1" ]; do COMP_METHOD=$1 shift ;; + --automatic) + COMP_SUF=TBD + COMP_METHOD=$1 + shift + ;; --decompress|-d) COMP_SUF= COMP_LVL= @@ -228,7 +254,7 @@ while [ -n "$1" ]; do exit 1 ;; *) - echo "\"$1\" is not an absolute path name" + echo "\"$1\" is not an absolute path name" exit 1 ;; esac @@ -256,29 +282,38 @@ case $VERBOSE_LVL in ;; esac -# Note: on my machine, 'man --path' gives /usr/share/man twice, once +# Note: on my machine, 'man --path' gives /usr/share/man twice, once # with a trailing '/', once without. if [ -z "$MAN_DIR" ]; then - MAN_DIR=`man --path -C "$MAN_CONF"/man.conf \ + MAN_DIR=`manpath -q -C "$MAN_CONF"/man_db.conf \ | sed 's/:/\\n/g' \ | while read foo; do dirname "$foo"/.; done \ | sort -u \ | while read bar; do echo -n "$bar "; done` fi -# If no MANPATH in ${MAN_CONF}/man.conf, abort as well +# If no MANDATORY_MANPATH in ${MAN_CONF}/man_db.conf, abort as well if [ -z "$MAN_DIR" ]; then - echo "No directory specified, and no directory found with \`man --path'" + echo "No directory specified, and no directory found with \`manpath'" exit 1 fi +# Check that the specified directories actually exist and are readable +for DIR in $MAN_DIR; do + if [ ! -d "$DIR" -o ! -r "$DIR" ]; then + echo "Directory '$DIR' does not exist or is not readable" + exit 1 + fi +done + # Fake? if [ "$FAKE" != "no" ]; then echo "Actual parameters used:" echo -n "Compression.......: " case $COMP_METHOD in --bzip2|--bz2|-b) echo -n "bzip2";; - --gzip|__gz|-g) echo -n "gzip";; + --gzip|--gz|-g) echo -n "gzip";; + --automatic) echo -n "compressing";; --decompress|-d) echo -n "decompressing";; *) echo -n "unknown";; esac @@ -287,12 +322,12 @@ if [ "$FAKE" != "no" ]; then echo "Compression suffix: $COMP_SUF" echo -n "Force compression.: " [ "foo$FORCE_OPT" = "foo-F" ] && echo "yes" || echo "no" - echo "man.conf is.......: ${MAN_CONF}/man.conf" + echo "man_db.conf is....: ${MAN_CONF}/man_db.conf" echo -n "Hard-links........: " - [ "foo$LN_OPT" = "foo-S" ] && + [ "foo$LN_OPT" = "foo-S" ] && echo "convert to soft-links" || echo "leave as is" echo -n "Soft-links........: " - [ "foo$LN_OPT" = "foo-H" ] && + [ "foo$LN_OPT" = "foo-H" ] && echo "convert to hard-links" || echo "leave as is" echo "Backup............: $BACKUP" echo "Faking (yes!).....: $FAKE" @@ -311,12 +346,16 @@ fi if [ "$BACKUP" = "yes" ]; then for DIR in $MAN_DIR; do cd "${DIR}/.." + if [ ! -w "`pwd`" ]; then + echo "Directory '`pwd`' is not writable" + exit 1 + fi DIR_NAME=`basename "${DIR}"` echo "Backing up $DIR..." > $DEST_FD0 [ -f "${DIR_NAME}.tar.old" ] && rm -f "${DIR_NAME}.tar.old" - [ -f "${DIR_NAME}.tar" ] && + [ -f "${DIR_NAME}.tar" ] && mv "${DIR_NAME}.tar" "${DIR_NAME}.tar.old" - tar -cfv "${DIR_NAME}.tar" "${DIR_NAME}" > $DEST_FD1 + tar -cvf "${DIR_NAME}.tar" "${DIR_NAME}" > $DEST_FD1 done exit 0 fi @@ -325,15 +364,19 @@ fi # I need to take into account the localized man, so I'm going recursive for DIR in $MAN_DIR; do MEM_DIR=`pwd` + if [ ! -w "$DIR" ]; then + echo "Directory '$DIR' is not writable" + exit 1 + fi cd "$DIR" for FILE in *; do # Fixes the case were the directory is empty if [ "foo$FILE" = "foo*" ]; then continue; fi # Fixes the case when hard-links see their compression scheme change - # (from not compressed to compressed, or from bz2 to gz, or from gz + # (from not compressed to compressed, or from bz2 to gz, or from gz # to bz2) - # Also fixes the case when multiple version of the page are present, + # Also fixes the case when multiple version of the page are present, # which are either compressed or not. if [ ! -L "$FILE" -a ! -e "$FILE" ]; then continue; fi @@ -341,20 +384,40 @@ for DIR in $MAN_DIR; do if [ "$FILE" = "whatis" ]; then continue; fi if [ -d "$FILE" ]; then - cd "${MEM_DIR}" # Go back to where we ran "$0", - # in case "$0"=="./compressdoc" ... # We are going recursive to that directory echo "-> Entering ${DIR}/${FILE}..." > $DEST_FD0 # I need not pass --conf, as I specify the directory to work on - # But I need exit in case of error - "$MY_NAME" ${COMP_METHOD} ${COMP_LVL} ${LN_OPT} ${VERBOSE_OPT} \ - ${FORCE_OPT} "${DIR}/${FILE}" || exit 1 + # But I need exit in case of error. We must change back to the + # original directory so $0 is resolved correctly. + (cd "$MEM_DIR" && eval "$0" ${COMP_METHOD} ${COMP_LVL} ${LN_OPT} \ + ${VERBOSE_OPT} ${FORCE_OPT} "${DIR}/${FILE}") || exit $? echo "<- Leaving ${DIR}/${FILE}." > $DEST_FD1 - cd "$DIR" # Needed for the next iteration of the loop else # !dir if ! check_unique "$DIR" "$FILE"; then continue; fi + # With automatic compression, get the uncompressed file size of + # the file (dereferencing symlinks), and choose an appropriate + # compression method. + if [ "$COMP_METHOD" = "--automatic" ]; then + declare -i SIZE + case "$FILE" in + *.bz2) + SIZE=$(bzcat "$FILE" | wc -c) ;; + *.gz) + SIZE=$(zcat "$FILE" | wc -c) ;; + *) + SIZE=$(wc -c < "$FILE") ;; + esac + if (( $SIZE >= (5 * 2**10) )); then + COMP_SUF=.bz2 + elif (( $SIZE >= (1 * 2**10) )); then + COMP_SUF=.gz + else + COMP_SUF= + fi + fi + # Check if the file is already compressed with the specified method BASE_FILE=`basename "$FILE" .gz` BASE_FILE=`basename "$BASE_FILE" .bz2` @@ -396,8 +459,8 @@ for DIR in $MAN_DIR; do elif [ -f "$FILE" ]; then # Take care of hard-links: build the list of files hard-linked # to the one we are {de,}compressing. - # NB. This is not optimum has the file will eventually be - # compressed as many times it has hard-links. But for now, + # NB. This is not optimum has the file will eventually be + # compressed as many times it has hard-links. But for now, # that's the safe way. inode=`ls -li "$FILE" | awk '{print $1}'` HLINKS=`find . \! -name "$FILE" -inum $inode` @@ -453,7 +516,7 @@ for DIR in $MAN_DIR; do fi else - # There is a problem when we get neither a symlink nor a plain + # There is a problem when we get neither a symlink nor a plain # file. Obviously, we shall never ever come here... :-( echo -n "Whaooo... \"${DIR}/${FILE}\" is neither a symlink " echo "nor a plain file. Please check:" diff --git a/stage2/misc/nanorc b/stage2/misc/nanorc new file mode 100644 index 0000000..b2f4e7b --- /dev/null +++ b/stage2/misc/nanorc @@ -0,0 +1,47 @@ +set autoindent +set const +set fill 72 +set historylog +set multibuffer +set regexp +set smooth +set suspend + +## Nanorc files +include /usr/share/nano/nanorc.nanorc + +## C/C++ +include /usr/share/nano/c.nanorc + +## HTML +include /usr/share/nano/html.nanorc + +## Patch files +include /usr/share/nano/patch.nanorc + +## Manpages +include /usr/share/nano/man.nanorc + +## Groff +include /usr/share/nano/groff.nanorc + +## Perl +include /usr/share/nano/perl.nanorc + +## Python +include /usr/share/nano/python.nanorc + +## Bourne shell scripts +include /usr/share/nano/sh.nanorc + +include /usr/share/nano/gentoo.nanorc + +## Syntax Highlight Pack +## CSS +include /usr/share/nano/css.nanorc + +## php +include /usr/share/nano/php.nanorc + +## makefile .am +include /usr/share/nano/gentoo.nanorc diff --git a/stage2/misc/udev-create-persistent-net.sh b/stage2/misc/udev-create-persistent-net.sh new file mode 100755 index 0000000..d0650b8 --- /dev/null +++ b/stage2/misc/udev-create-persistent-net.sh @@ -0,0 +1,7 @@ +#/bin/sh + +# Pre-generate the rules to ensure the same names get assigned to the same devices at every boot, including the first: + +for NIC in /sys/class/net/* ; do + INTERFACE=${NIC##*/} udevadm test --action=add $NIC +done diff --git a/stage2/packages-update b/stage2/packages-update index 4579102..4eb36ca 100755 --- a/stage2/packages-update +++ b/stage2/packages-update @@ -3,6 +3,7 @@ LFS_STAGE="stage2" USE_LFS_PATCHES=1 USE_BLFS_PATCHES=1 +USE_CLFS_PATCHES=1 USE_HV_PATCHES=1 # Reading system configuration informations, functions and package versions. @@ -13,89 +14,91 @@ source ../packages-list update_packages_init -# Begin +# These packages were already downloaded for stage0: +lpkg 0 ${KERNEL} +lpkg 0 ${EGLIBC} +lpkg 0 ${GMP} +lpkg 0 ${MPFR} +lpkg 0 ${PPL} +lpkg 0 ${CLOOG_PPL} +lpkg 0 ${BINUTILS} +lpkg 0 ${GCC_CORE} -# These packages are needed first for stage1: -lpkg 1 ${BINUTILS} -lpkg 1 ${GCC_CORE} -lpkg 1 ${KERNEL} -lpkg 1 ${GLIBC} +# These packages were already downloaded for stage1: +lpkg 1 ${ZLIB} +lpkg 1 ${SED} lpkg 1 ${NCURSES} +lpkg 1 ${UTIL_LINUX_NG} +lpkg 1 ${E2FSPROGS} +lpkg 1 ${COREUTILS} +lpkg 1 ${MFOUR} +lpkg 1 ${BISON} +lpkg 1 ${FLEX} lpkg 1 ${BASH} lpkg 1 ${BZIP2} -lpkg 1 ${COREUTILS} lpkg 1 ${DIFFUTILS} +lpkg 1 ${FILE_PKG} lpkg 1 ${FINDUTILS} lpkg 1 ${GAWK} lpkg 1 ${GETTEXT} lpkg 1 ${GREP} lpkg 1 ${GZIP} lpkg 1 ${MAKE_PACKAGE} +lpkg 1 ${MODULE_INIT_TOOLS} lpkg 1 ${PATCH_PACKAGE} -lpkg 1 ${SED} +lpkg 1 ${SYSVINIT} lpkg 1 ${TAR_PACKAGE} lpkg 1 ${TEXINFO} -lpkg 1 ${UTIL_LINUX} +lpkg 1 ${UDEV} +lpkg 1 ${XZ_UTILS} +lpkg 1 ${NANO} # These packages are only for stage2 fpkg ${PERL} http://ftp.funet.fi/pub/CPAN/src fpkg ${MANPAGES} http://www.kernel.org/pub/linux/docs/manpages -fpkg ${DB4} http://download.oracle.com/berkeley-db -fpkg_sf ${E2FSPROGS} +fpkg ${PKG_CONFIG} http://pkgconfig.freedesktop.org/releases fpkg ${IANA} http://www.sethwklein.net/projects/iana-etc/downloads -fpkg_gnu ${MFOUR} -fpkg_gnu ${BISON} fpkg ${PROCPS} http://procps.sourceforge.net -fpkg_gnu ${LIBTOOL} fpkg_gnu ${READLINE} -fpkg ${ZLIB} http://www.zlib.net +fpkg_gnu ${LIBTOOL} +fpkg_gnu ${GDBM} +fpkg_gnu ${INETUTILS} fpkg_gnu ${AUTOCONF} fpkg_gnu ${AUTOMAKE} - -fpkg ${LESS} http://www.greenwoodsoftware.com/less fpkg_gnu ${GROFF} -fpkg_sf ${FLEX} -fpkg_gnu ${INETUTILS} -fpkg_hv ${IPROUTE2} -fpkg ${FILE_PKG} "ftp://ftp.gw.com/mirrors/unix/file/" +fpkg ${IPROUTE2} http://devresources.linux-foundation.org/dev/iproute2/download fpkg ${KBD} http://www.kernel.org/pub/linux/utils/kbd -fpkg ${GRUB} ftp://alpha.gnu.org/gnu/grub -fpkg ${MAN} http://primates.ximian.com/~flucifredi/man -fpkg ${MKTEMP} ftp://ftp.mktemp.org/pub/mktemp -fpkg ${MODULE_INIT_TOOLS} http://www.kernel.org/pub/linux/utils/kernel/module-init-tools +fpkg ${LESS} http://www.greenwoodsoftware.com/less +fpkg ${MAN_DB} http://download.savannah.gnu.org/releases/man-db fpkg_sf ${PSMISC} fpkg_hv ${SHADOW} fpkg ${SYSKLOGD} http://www.infodrom.org/projects/sysklogd/download -fpkg ${SYSVINIT} ftp://ftp.cistron.nl/pub/people/miquels/sysvinit -fpkg ${UDEV} http://www.kernel.org/pub/linux/utils/kernel/hotplug -fpkg ${UDEV_CONFIG} "http://www.linuxfromscratch.org/lfs/downloads/development" +fpkg ${UDEV_CONFIG} http://www.linuxfromscratch.org/lfs/downloads/development +fpkg ${GRUB} ftp://alpha.gnu.org/gnu/grub # Additional packages (not in original LFS, only for hvlinux). -fpkg ${NANO} http://www.nano-editor.org/dist/v2.0 -fpkg_hv ${REISERFSPROGS} -fpkg ${PAM} http://www.kernel.org/pub/linux/libs/pam/pre/library +fpkg_gnu ${EMACS} +fpkg_gnu ${WHICH} +fpkg ${REISERFSPROGS} http://www.kernel.org/pub/linux/utils/fs/reiserfs +fpkg ${PCIUTILS} ftp://ftp.kernel.org/pub/software/utils/pciutils +fpkg ${NET_TOOLS} http://www.tazenda.demon.co.uk/phil/net-tools +fpkg ${DHCP} ftp://ftp.isc.org/isc/dhcp/dhcp-3.0-history +fpkg ${POPT} http://rpm5.org/files/popt +fpkg ${PAM} http://www.kernel.org/pub/linux/libs/pam/library fpkg ${OPENSSL} ftp://ftp.openssl.org/source +fpkg ${OPENSSL_ROOT_CERTS} http://anduin.linuxfromscratch.org/files/BLFS fpkg ${OPENSSH} ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable -fpkg ${DHCP} ftp://ftp.isc.org/isc/dhcp/dhcp-3.0-history -fpkg ${NFS_UTILS} ftp://ftp.kernel.org/pub/linux/utils/nfs -fpkg_gnu ${WHICH} -fpkg ${TCPWRAPPERS} ftp://ftp.porcupine.org/pub/security -fpkg ${APR} http://apache.sunsite.ualberta.ca/apr fpkg_sf ${EXPAT} +fpkg ${APR} http://apache.sunsite.ualberta.ca/apr fpkg ${APR_UTIL} http://apache.sunsite.ualberta.ca/apr -fpkg ${NEON} http://www.webdav.org/neon +fpkg ${NEON} http://www.webdav.org/neon +fpkg_sf ${TCL} +fpkg ${SQLITE} http://www.sqlite.org fpkg ${SUBVERSION} http://subversion.tigris.org/downloads -fpkg ${SUDO} http://www.courtesan.com/sudo/dist -fpkg ${PKG_CONFIG} http://pkgconfig.freedesktop.org/releases -fpkg ${NET_TOOLS} http://www.tazenda.demon.co.uk/phil/net-tools -fpkg_hv ${POPT} -fpkg_hv ${PORTMAP} -fpkg_gnu ${EMACS} - +fpkg ${SUDO} http://www.sudo.ws/sudo/dist fpkg_gnu ${WGET} -fpkg ${PCIUTILS} ftp://ftp.kernel.org/pub/software/utils/pciutils - -fpkg_lfs ${LFS_BOOTSCRIPTS} +fpkg ${TCPWRAPPERS} ftp://ftp.porcupine.org/pub/security +fpkg ${PORTMAP} http://neil.brown.name/portmap +fpkg ${NFS_UTILS} ftp://ftp.kernel.org/pub/linux/utils/nfs -# Return last error exit $? diff --git a/stage2/setup b/stage2/setup deleted file mode 100755 index 05de721..0000000 --- a/stage2/setup +++ /dev/null @@ -1,66 +0,0 @@ -#!/tools/bin/sh - -# The first argument to the setup script is the working directory. -cd ${1} - -# Reading system configuration informations, functions and package versions. -source ../sysinfos -source ../functions -source ../packages-list - -export LFS_PKG_DIR="$(dirname $(dirname $(pwd)))/packages/stage2" -export LFS_LOG_DIR=/var/log/hvlinux-install/stage2 -export LFS_LOG_FILE=${LFS_LOG_DIR}/install.log -export LFS_TMP="/tmp" - -init_log_file - -run_cmd_log "Changing ownership of /tools files to root" chown -R 0:0 /tools && -run_script_log "Creating basic directory structure" makedir && - -# The first mode change ensures that not just everybody can enter the /root -# directory -- the same as a normal user would do with his or her home -# directory. The second mode change makes sure that any user can write to the -# /tmp and /var/tmp directories, but cannot remove other users' files from them. -# The latter is prohibited by the so-called "sticky bit" -- the highest bit in -# the 1777 bit mask. -run_cmd_log "Setting permissions for /root" chmod 0750 /root && -run_cmd_log "Setting permissions for /tmp and /var/tmp" \ - chmod 1777 /tmp /var/tmp && - -# To remove the warning message: -# "warning: can't open /etc/fstab: No such file or directory" -touch /etc/fstab && -# We must use the -n option. If not, a regular "/etc/mtab" file will be created, -# and the mtab link we try to create later will not work. -action_checkbox "Mounting the /proc filesystem" mount -n proc /proc -t proc && - -action_checkbox "Mounting the /dev/pts filesystem" \ - mount -n -t devpts -o gid=4,mode=620 none /dev/pts && - -run_script_log "Creating essential symlinks" symlinks && -run_script_log "Creating default groups" create-groups && -run_script_log "Creating default users" create-users && - -run_script_log "Creating default configuration files" create-config-files && - -touch /var/run/utmp && -touch /var/log/{btmp,lastlog,wtmp} && -chgrp utmp /var/run/utmp /var/log/lastlog /var/log/btmp && -chmod 664 /var/run/utmp /var/log/lastlog && -chmod 600 /var/log/btmp && - -# Executing the install-1 script -./install-1 - -last_error=$? - -umount /dev/pts -umount proc - - -if [ $? != 0 -o ${last_error} != 0 ]; then - exit 1 -fi - -exit 0 diff --git a/stage2/stage2-install b/stage2/stage2-install index f9d0058..c212cf6 100755 --- a/stage2/stage2-install +++ b/stage2/stage2-install @@ -1,57 +1,91 @@ #!/bin/sh -# System configuration informations (entered by the user) +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 -# Finding the path, relative to ${LFS} of the sources directory. -S1=$(pwd) -CHROOT_WD=${S1#${LFS}} +init_log_file -# We need /dev/null and /dev/console before udev is started. -mkdir -p ${LFS}/dev && -if [ ! -c ${LFS}/dev/null ]; then - mknod ${LFS}/dev/null -m 0666 c 1 3 || exit 1 -fi -if [ ! -c ${LFS}/dev/console ]; then - mknod ${LFS}/dev/console -m 0666 c 5 1 || exit 1 -fi +# Scripts directory +export SCRDIR=$(pwd) -# Mounting and populating /dev for the chroot environment. -# May fail if it is already mountewd, but it is ok. -mount -v --bind /dev ${LFS}/dev 1> /dev/null 2>&1 - -# If something went wrong, proc, dev and devpts may still be mounted. -umount -n ${LFS}/proc 1> /dev/null 2>&1 -umount -n ${LFS}/dev/pts 1> /dev/null 2>&1 - -# Making sure that if a separate boot partition is defined, it is mounted. -if [ -n "${BOOT_PARTITION}" ]; then - if ! grep "${BOOT_PARTITION}" /etc/mtab | grep "${LFS}/boot" 1> /dev/null 2>&1; then - echo "You defined \"${BOOT_PARTITION}\" as your boot partition," - echo "but it is not mounted in your LFS partition. You must" - echo "mount it before running this script again." - exit 1; - fi -fi +ipkg ${PERL} cis-perl-pass1 "${PERL}-pass1" +ipkg_cust ${KERNEL} cis-kernel +ipkg_cust ${MANPAGES} cis-man-pages +ipkg_cust ${EGLIBC} cis-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" + +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" + +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_CORE} 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 -# Option '-i' of env starts with a new environment. -# The argument to the setup script is the working directory. -chroot ${LFS} /tools/bin/env -i \ - HOME=/root \ - TERM=$TERM \ - PS1='\u:\w\$ ' \ - PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \ - /tools/bin/bash -c "${CHROOT_WD}/setup ${CHROOT_WD}" +rscr mult "Testing toolchain" cis-toolchain-test -# Unmounting /dev for the chroot environment. -umount ${LFS}/dev +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" -# At the end, we should remove the '/tools' directory -# mv /mnt/linux/tools /mnt/linux/tmp +/bin/bash +h -c ./install-2 exit $? diff --git a/stage2/symlinks b/stage2/symlinks deleted file mode 100755 index cf1e175..0000000 --- a/stage2/symlinks +++ /dev/null @@ -1,23 +0,0 @@ -#!/tools/bin/sh - -# System configuration informations (entered by the user) -source ../sysinfos -source ../functions -source ../packages-list - -# Some programs hard-wire paths to programs which don't exist yet. In order to -# satisfy these programs, we create a number of symbolic links which will be -# replaced by real files when we're installing all the software. - -# We must not use "-sf" to force the creation of a symlink, because we don't want -# to write over a valid program if the install script needs to be re-started. - -# Creating the /etc/mtab symlink -ln -s /proc/mounts /etc/mtab - -ln -s /tools/bin/{bash,cat,pwd,stty} /bin -ln -s /tools/bin/perl /usr/bin -ln -s /tools/lib/libgcc_s.so{,.1} /usr/lib -ln -s bash /bin/sh - -exit 0 diff --git a/sysinfos b/sysinfos index d1a7480..dd902db 100644 --- a/sysinfos +++ b/sysinfos @@ -9,16 +9,16 @@ MAKEJOBS=1 # Installation type: server, ltsp-server or workstation. -INST_TYPE="ltsp-server" +INST_TYPE="server" # New user to create REGUSER="hugo" # Destination path where to install new Linux-HV system -LFS="/" +LFS="/mnt/hvlinux-x86" # Destination partition where to install new Linux-HV system -LFS_PARTITION="/dev/sda10" +LFS_PARTITION="/dev/sda8" # Boot partition (if applicable) BOOT_PARTITION="/dev/sda1" @@ -26,68 +26,60 @@ BOOT_PARTITION="/dev/sda1" # Swap partition (if applicable) SWAP_PARTITION="/dev/sda2" +# Define this when cross-compiling to the desired target +# architecture. Default is x86 32-bits architecture (i686). +# x86 (i686) +# x86_64 (AMD Athlon 64) +HVL_TARGET="x86" + # Used for setting '-march=xxx' option in CFLAGS and CPPFLAGS MACHINE_ARCHITECTURE="athlon-xp" -# Keyboard mapping (example: us) -KEYBOARD="cf" +DEFAULT_EDITOR="emacs" -HV_XF86_KEYBOARD_LAYOUT="us,ca" -HV_XF86_KEYBOARD_VARIANT="intl,fr" -HV_XF86_KEYBOARD_OPTIONS="grp:alt_shift_toggle" -XF86_CARD_DRIVER="nv" +# Keyboard mapping (example: us) +KEYBOARD="us" # Sound card support: yes or no -SOUND_CARD="yes" +SOUND_CARD="no" # Removable media drives CDROM="/dev/hdc" DVD="/dev/hdc" -HV_FONTS_PATH="/usr/share/fonts" - # Define this if you want to use a remote CUPS print server #CUPS_SERVER="server.hugovil.com" -#-------------------- -# SCANNER definitions -#-------------------- -# Set to yes to have SANE support -SANE_SUPPORT="yes" -# Define to the driver name corresponding to your scanner, if you have one -# (see SANE documentation for drivers name). Comment out if you will be using -# a scanner on a remote computer. -SANE_DRIVER="epson" -# If your scanner is located onto a remote computer, define the following -# variable to the IP address of that remote computer. -SANE_SERVER="" - TIMEZONE="America/Montreal" # General network settings -INTERFACES="eth0" +INTERFACES="eth0 eth1 eth2" # GATEWAY is not required if using DHCP -GATEWAY="" -MACHINE_NAME="serveur" +GATEWAY="192.168.1.1" +MACHINE_NAME="server64" DOMAIN="hugovil.com" -LAN_NETWORK_MASK="192.168.0.0/24" +LAN_NETWORK_MASK="192.168.0.0/24" # Utilise par sane in stage3 # Define to yes if you have a dynamic address and you use a dynamic dns # service. USE_DYNAMIC_DNS="no" -# Network interface card #1 settings (INTERNET) -BOOTPROTO[0]="dhcp" -IP_ADDRESS[0]="" +# Network interface card eth0 settings (ROUTEUR/INTERNET) +BOOTPROTO[0]="static" +IP_ADDRESS[0]="192.168.1.2" +PREFIX_LENGTH[0]=24 + +# Network interface card eth1 settings (LAN) +BOOTPROTO[1]="static" +IP_ADDRESS[1]="192.168.0.1" +PREFIX_LENGTH[1]=24 -# Network interface card #2 settings (LAN) -#BOOTPROTO[1]="static" -#IP_ADDRESS[1]="192.168.0.1" -#PREFIX_LENGTH[1]=24 +# Network interface card eth2 settings (MVPMC) +BOOTPROTO[2]="static" +IP_ADDRESS[2]="192.168.99.1" +PREFIX_LENGTH[2]=24 # DNS servers addresses (not required if using DHCP) -#NAMESERVER[0]="24.200.243.250" -#NAMESERVER[1]="24.201.245.106" -#NAMESERVER[2]="24.200.243.242" +NAMESERVER[0]="192.168.1.1" # Define this if you want the mail addressed to the root user automatically # be forwarded to someone else -- 2.20.1