Completed transition to new ipkg method (ipkg.def), successfully booting after stage 1
authorgobo72 <gobo72@364a67c3-989e-7be9-548d-dae8560ea662>
Sun, 7 Nov 2010 01:37:02 +0000 (01:37 +0000)
committergobo72 <gobo72@364a67c3-989e-7be9-548d-dae8560ea662>
Sun, 7 Nov 2010 01:37:02 +0000 (01:37 +0000)
47 files changed:
functions
functions-ac
stage0/INSTALL
stage0/install-1
stage0/ipkg.def
stage0/pkg/binutils
stage0/pkg/eglibc
stage0/pkg/gcc
stage0/pkg/ncurses
stage0/stage.def
stage1/INSTALL
stage1/install-2
stage1/ipkg.def
stage1/pkg/binutils
stage1/pkg/coreutils
stage1/pkg/e2fsprogs
stage1/pkg/flex
stage1/pkg/gcc
stage1/pkg/gettext
stage1/pkg/m4
stage1/pkg/module-init-tools
stage1/pkg/sysvinit
stage1/pkg/udev
stage1/pkg/util-linux-ng
stage1/pkg/zlib
stage1/stage.def
stage2/INSTALL
stage2/install-1
stage2/ipkg.def [new file with mode: 0644]
stage2/ipkg.sh [deleted file]
stage2/pkg/binutils
stage2/pkg/coreutils
stage2/pkg/e2fsprogs
stage2/pkg/eglibc
stage2/pkg/findutils
stage2/pkg/gcc
stage2/pkg/groff
stage2/pkg/gzip
stage2/pkg/inetutils
stage2/pkg/kbd
stage2/pkg/module-init-tools
stage2/pkg/ncurses
stage2/pkg/readline
stage2/pkg/shadow
stage2/pkg/util-linux-ng
stage2/pkg/zlib
stage2/stage.def

index 7497f3a..2ccd965 100644 (file)
--- a/functions
+++ b/functions
@@ -1,6 +1,6 @@
 #!/bin/bash
-# This file is 'sourced' by other scripts, therefore the above line is of no
-# use, except when modifying the file in emacs to have syntax highlighting.
+set -o errtrace # Let shell functions inherit ERR trap.
+set -o errexit
 
 # Constants for return codes
 EXIT_SUCCESS=0
@@ -733,6 +733,28 @@ ipkg_trap_handler()
     exit 1
 }
 
+ipkg_display_build_infos()
+{
+    echo "hvlinux: configure options:"
+    for opt in ${CONFIGURE_OPTS}; do
+        echo "  ${opt}"
+    done
+    echo "hvlinux: environment variables:"
+    echo "  HOST:     ${CLFS_HOST}"
+    echo "  TARGET:   ${CLFS_TARGET}"
+    echo "  BUILD64:  ${BUILD64}"
+    echo "  CFLAGS:   ${CFLAGS}"
+    echo "  CPPFLAGS: ${CPPFLAGS}"
+    echo "  CXXFLAGS: ${CFLAGS}"
+    echo "  LDFLAGS:  ${LDFLAGS}"
+    echo "  RANLIB:   ${RANLIB}"
+    echo "  CC:       ${CC}"
+    echo "  CXX:      ${CXX}"
+    echo "  AR:       ${AR}"
+    echo "  AS:       ${AS}"
+    echo "  PATH:     ${PATH}"
+}
+
 # Installation of a package
 # Arg. #1: Package name and version (ex: gcc-4.5.1)
 # Remaining arguments: Additional configure options
@@ -832,6 +854,12 @@ ipkg()
     echo "------------------------" 1>> ${LFS_LOG_FILE}
     echo "${MSGSTRING}" 1>> ${LFS_LOG_FILE}
 
+    exec 7>&1 # Save current "value" of stdout.
+    # All output from commands in this block sent to file $LFS_LOG_FILE.
+    exec >> ${LFS_LOG_FILE} 2>&1
+    ipkg_display_build_infos
+    exec 1>&7 7>&- # Restore stdout and close file descriptor #7.
+
     # All output from commands in this block sent to file $PACKAGE_LOG.
     exec > ${PACKAGE_LOG} 2>&1
 
index d4b3fbf..618c47f 100644 (file)
@@ -11,8 +11,8 @@ function_exists()
     return $?
 }
 
-unset -f hvconfig_cache
 unset -f hvconfig_pre
+unset -f hvconfig_cache
 unset -f hvconfig_post
 unset -f hvbuild_post
 
@@ -44,9 +44,6 @@ ipkg_decompress_package()
 # Default configure function
 hvconfig()
 {
-    echo "Running configure with options:"
-    echo "  <${CONFIGURE_OPTS}>"
-
     if [ "x${IPKG_MODE}" = "xacnb" ]; then
         # Broken autoconf package that must build in source dir
         cd ${LFS_TMP}/${PACKAGE}
@@ -113,19 +110,22 @@ ipkg_script()
 
     hvpatch
 
+    # Execute pre-configure function if applicable
+    if function_exists hvconfig_pre ; then
+        echo "Running configure pre-script"
+        hvconfig_pre
+    fi
+
     # Execute config-cache function if applicable
     if function_exists hvconfig_cache ; then
         echo "Running configure cache script"
         hvconfig_cache
-
-        CONFIGURE_OPTS="${CONFIGURE_OPTS} --cache-file=${LFS_TMP}/${PACKAGE}-build/config.cache"
+        CONFIGURE_OPTS="\
+            ${CONFIGURE_OPTS} \
+            --cache-file=${LFS_TMP}/${PACKAGE}-build/config.cache"
     fi
 
-    # Execute pre-configure function if applicable
-    if function_exists hvconfig_pre ; then
-        echo "Running configure pre-script"
-        hvconfig_pre
-    fi
+    ipkg_display_build_infos
 
     if [ "x${IPKG_MODE}" = "xnoac" ]; then
         echo "Not calling configure because ${PACKAGE} has no configure script"
@@ -146,4 +146,6 @@ ipkg_script()
         echo "Running build post-script"
         hvbuild_post
     fi
+
+    ipkg_finish
 }
index acebe70..fa2a3eb 100644 (file)
@@ -4,14 +4,7 @@ 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
+2. Modify the 'sysinfos' configuration file to reflect your
    system configuration.
 
-5. Launch './stage0-install'
+3. Launch './install-1'
index 22fb3aa..1d6b6c8 100755 (executable)
@@ -1,5 +1,4 @@
 #!/bin/bash
-set -o errtrace # Let shell functions inherit ERR trap.  Same as `set -E'.
 
 # Reading system configuration informations, functions and package versions.
 source ../sysinfos
index 2f22bfe..312982d 100644 (file)
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+export BUILD64="-m64"
+
 # Setting default configure options for all scripts
 CONFIGURE_OPTS="\
       --prefix=/cross-tools \
index 922e22c..443714d 100644 (file)
@@ -1,33 +1,36 @@
 #!/bin/bash
 
-export AR=ar
-export AS=as
-
-CONFIGURE_OPTS="\
-    --host=${CLFS_HOST} \
-    --target=${CLFS_TARGET} \
-    --with-sysroot=${CLFS} \
-    --with-lib-path=/tools/lib \
-    --disable-nls \
-    --enable-shared \
-    --disable-multilib \
-    ${CONFIGURE_OPTS}"
-
 hvconfig_pre()
 {
+    export AR=ar
+    export AS=as
+
+    CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \
+        --host=${CLFS_HOST} \
+        --target=${CLFS_TARGET} \
+        --with-sysroot=${CLFS} \
+        --with-lib-path=/tools/lib \
+        --disable-nls \
+        --enable-shared \
+        --disable-multilib"
+
     case "${HVL_TARGET}" in
         "x86_64")
             # This adds 64 bit support to Binutils.
            CONFIGURE_OPTS="${CONFIGURE_OPTS} --enable-64-bit-bfd"
            ;;
     esac
-
 }
 
-hvbuild()
+hvconfig_post()
 {
+    unset AR
+    unset AS
     ${HVMAKE} configure-host
-    ${HVMAKE}
-    ${HVMAKE} install
+}
+
+hvbuild_post()
+{
     cp -v ../${PACKAGE}/include/libiberty.h /tools/include
 }
index fe9dfe2..268e0b9 100644 (file)
@@ -1,35 +1,24 @@
 #!/bin/bash
 
-BUILD_CC="gcc"
-CC="${CLFS_TARGET}-gcc ${CLFS_BUILDFLAGS}"
-AR="${CLFS_TARGET}-ar"
-RANLIB="${CLFS_TARGET}-ranlib"
-
-CONFIGURE_OPTS="\
-    --prefix=/tools \
-    --host=${CLFS_TARGET} \
-    --build=${CLFS_HOST} \
-    --disable-profile \
-    --enable-add-ons \
-    --with-tls \
-    --enable-kernel=$(get_pkg_ver ${KERNEL}) \
-    --with-__thread \
-    --with-binutils=/cross-tools/bin \
-    --with-headers=/tools/include"
-
-# For Glibc to support NPTL:
-hvconfig_cache()
-{
-cat > ${LFS_TMP}/${PACKAGE}-build/config.cache << EOF
-libc_cv_forced_unwind=yes
-libc_cv_c_cleanup=yes
-libc_cv_gnu89_inline=yes
-libc_cv_ssp=no
-EOF
-}
-
 hvconfig_pre()
 {
+    export BUILD_CC="gcc"
+    export CC="${CLFS_TARGET}-gcc ${CLFS_BUILDFLAGS}"
+    export AR="${CLFS_TARGET}-ar"
+    export RANLIB="${CLFS_TARGET}-ranlib"
+
+    CONFIGURE_OPTS="\
+        --prefix=/tools \
+        --host=${CLFS_TARGET} \
+        --build=${CLFS_HOST} \
+        --disable-profile \
+        --enable-add-ons \
+        --with-tls \
+        --enable-kernel=$(get_pkg_ver ${KERNEL}) \
+        --with-__thread \
+        --with-binutils=/cross-tools/bin \
+        --with-headers=/tools/include"
+
     case "${HVL_TARGET}" in
         "x86")
             CFLAGS="-march=$(cut -d- -f1 <<< ${CLFS_TARGET}) -mtune=native -g -O2"
@@ -46,3 +35,23 @@ hvconfig_pre()
     # Disable linking to libgcc_eh:
     sed -e 's/-lgcc_eh//g' -i Makeconfig
 }
+
+# For Glibc to support NPTL:
+hvconfig_cache()
+{
+cat > ${LFS_TMP}/${PACKAGE}-build/config.cache << EOF
+libc_cv_forced_unwind=yes
+libc_cv_c_cleanup=yes
+libc_cv_gnu89_inline=yes
+libc_cv_ssp=no
+EOF
+}
+
+hvconfig_post()
+{
+    unset BUILD_CC
+    unset CC
+    unset AR
+    unset RANLIB
+    unset CFLAGS
+}
index 423b932..433e601 100644 (file)
@@ -1,8 +1,5 @@
 #!/bin/bash
 
-AR=ar
-LDFLAGS="-Wl,-rpath,/cross-tools/lib"
-
 hvpatch()
 {
     # Manually applying patches if specified
@@ -24,8 +21,12 @@ hvpatch()
 
 hvconfig_pre()
 {
+    export AR=ar
+    export LDFLAGS="-Wl,-rpath,/cross-tools/lib"
+
     # Common options for passes 1 & 2
-    CONFIGURE_OPTS="${CONFIGURE_OPTS} \
+    CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \
         --build=${CLFS_HOST} \
         --host=${CLFS_HOST} \
         --target=${CLFS_TARGET} \
@@ -33,7 +34,10 @@ hvconfig_pre()
         --with-local-prefix=/tools \
         --disable-nls \
         --with-mpfr=/cross-tools \
-        --with-gmp=/cross-tools"
+        --with-gmp=/cross-tools \
+        --with-ppl=/cross-tools \
+        --with-cloog=/cross-tools \
+        --disable-multilib"
 
     if [ "x${HVLABEL}" = "x${GCC}-pass1" ]; then
         CONFIGURE_OPTS="${CONFIGURE_OPTS} \
@@ -56,14 +60,6 @@ hvconfig_pre()
             --enable-threads=posix"
     fi
 
-    case "${HVL_TARGET}" in
-        *)
-            CONFIGURE_OPTS="${CONFIGURE_OPTS} --with-ppl=/cross-tools \
-            --with-cloog=/cross-tools \
-            --disable-multilib"
-            ;;
-    esac
-
     cd ${LFS_TMP}/${PACKAGE}
 
     # Change the StartFile Spec to point to the correct library location:
@@ -83,6 +79,12 @@ hvconfig_pre()
     fi
 }
 
+hvconfig_post()
+{
+    unset AR
+    unset LDFLAGS
+}
+
 hvbuild()
 {
     if [ "x${HVLABEL}" = "x${GCC}-pass1" ]; then
index 846af37..52fce24 100644 (file)
@@ -1,9 +1,12 @@
 #!/bin/bash
 
-CONFIGURE_OPTS="\
-    --without-debug \
-    --without-shared \
-    ${CONFIGURE_OPTS}"
+hvconfig_pre()
+{
+    CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \
+        --without-debug \
+        --without-shared"
+}
 
 hvbuid()
 {
index 32f39f9..de61a29 100644 (file)
@@ -1,3 +1,3 @@
 #!/bin/bash
 
-LFS_STAGE=stage0
+export LFS_STAGE=stage0
index 78eff66..4b18f88 100644 (file)
@@ -2,17 +2,7 @@
 Installation instructions
 -------------------------
 
-1. Create your destination partition and make sure that it is
-   formatted and mounted.
-
-2. 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.
-
-3. Modify the 'sysinfos' configuration file to reflect your
-   system configuration.
-
-4. Launch './stage1-install'
+1. Launch './install-1'
 
 Post-install guide
 ------------------
index 4dfe6e7..d2d11c7 100755 (executable)
@@ -11,13 +11,6 @@ source ../packages-list
 init_log_file
 
 # Building temporary system
-export CC="${CLFS_TARGET}-gcc"
-export CXX="${CLFS_TARGET}-g++"
-export AR="${CLFS_TARGET}-ar"
-export AS="${CLFS_TARGET}-as"
-export RANLIB="${CLFS_TARGET}-ranlib"
-export LD="${CLFS_TARGET}-ld"
-export STRIP="${CLFS_TARGET}-strip"
 
 HOST_CC=gcc CPPFLAGS=-fexceptions \
     ipkg ${GMP} "--enable-cxx"
@@ -52,7 +45,7 @@ ipkg ${FINDUTILS}
 ipkg ${FILE_PKG}
 ipkg ${FLEX}
 ipkg ${GAWK}
-ipkg ${GETTEXT} "--disable-shared"
+ipkg ${GETTEXT}
 ipkg ${GREP} "\
     --disable-perl-regexp \
     --without-included-regex"
index 7545a87..46cd0ba 100644 (file)
@@ -7,5 +7,10 @@ CONFIGURE_OPTS="\
       --host=${CLFS_TARGET} \
       ${CONFIGURE_OPTS}"
 
-CC="${CC} ${CLFS_BUILDFLAGS}"
-CXX="${CXX} ${CLFS_BUILDFLAGS}"
+export CC="${CLFS_TARGET}-gcc ${CLFS_BUILDFLAGS}"
+export CXX="${CLFS_TARGET}-g++ ${CLFS_BUILDFLAGS}"
+export AR="${CLFS_TARGET}-ar"
+export AS="${CLFS_TARGET}-as"
+export RANLIB="${CLFS_TARGET}-ranlib"
+export LD="${CLFS_TARGET}-ld"
+export STRIP="${CLFS_TARGET}-strip"
index cc0ae1b..9ea2aad 100644 (file)
@@ -1,15 +1,15 @@
 #!/bin/bash
 
-CONFIGURE_OPTS="\
-    ${CONFIGURE_OPTS} \
-    --target=${CLFS_TARGET} \
-    --with-lib-path=/tools/lib \
-    --disable-nls \
-    --enable-shared \
-    --disable-multilib"
-
 hvconfig_pre()
 {
+    CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \
+        --target=${CLFS_TARGET} \
+        --with-lib-path=/tools/lib \
+        --disable-nls \
+        --enable-shared \
+        --disable-multilib"
+
     case "${HVL_TARGET}" in
         "x86_64")
             # This adds 64 bit support to Binutils.
@@ -18,9 +18,7 @@ hvconfig_pre()
     esac
 }
 
-hvbuild()
+hvconfig_post()
 {
     ${HVMAKE} configure-host
-    ${HVMAKE}
-    ${HVMAKE} install
 }
index d454d93..2895591 100644 (file)
@@ -1,5 +1,11 @@
 #!/bin/bash
 
+hvconfig_pre()
+{
+    # Fix a bug when the uname patch is automatically applied
+    touch ${LFS_TMP}/${PACKAGE}/man/{uname,hostname}.1
+}
+
 # Configure cannot properly determine how to get free space when cross-compiling
 # and as a result the df program will not be built. Add the following entries to
 # config.cache  to correct this, and fix various cross-compiling issues:
@@ -10,9 +16,3 @@ fu_cv_sys_stat_statfs2_bsize=yes
 gl_cv_func_working_mkstemp=yes
 EOF
 }
-
-hvconfig_pre()
-{
-    # Fix a bug when the uname patch is automatically applied
-    touch ${LFS_TMP}/${PACKAGE}/man/{uname,hostname}.1
-}
index 49f5977..df03725 100644 (file)
@@ -1,17 +1,24 @@
 #!/bin/bash
 
-CC="${CC} ${CLFS_BUILDFLAGS}"
-PKG_CONFIG=true
+hvconfig_pre()
+{
+    export PKG_CONFIG=true
+
+    CONFIGURE_OPTS="\
+        --prefix=/tools \
+        --enable-elf-shlibs \
+        --with-linker=${LD} \
+        --host=${CLFS_TARGET} \
+        --disable-libblkid \
+        --disable-libuuid \
+        --disable-fsck \
+        --disable-uuidd"
+}
 
-CONFIGURE_OPTS="\
-    --prefix=/tools \
-    --enable-elf-shlibs \
-    --with-linker=${LD} \
-    --host=${CLFS_TARGET} \
-    --disable-libblkid \
-    --disable-libuuid \
-    --disable-fsck \
-    --disable-uuidd"
+hvconfig_post()
+{
+    unset PKG_CONFIG
+}
 
 hvbuild()
 {
index 0d60fdc..63c19d8 100644 (file)
@@ -1,5 +1,11 @@
 #!/bin/bash
 
+hvconfig_pre()
+{
+    # Make sure that Flex doesn't try to include headers from /usr/include.
+    sed -e "s/-I@includedir@//g" -i ${LFS_TMP}/${PACKAGE}/Makefile.in
+}
+
 # When Cross Compiling the configure script does not determine the correct
 # values for the following, Set the values manually:
 hvconfig_cache()
@@ -9,9 +15,3 @@ ac_cv_func_malloc_0_nonnull=yes
 ac_cv_func_realloc_0_nonnull=yes
 EOF
 }
-
-hvconfig_pre()
-{
-    # Make sure that Flex doesn't try to include headers from /usr/include.
-    sed -e "s/-I@includedir@//g" -i ${LFS_TMP}/${PACKAGE}/Makefile.in
-}
index eccf480..2a2c2ea 100644 (file)
@@ -1,20 +1,5 @@
 #!/bin/bash
 
-CONFIGURE_OPTS="\
-    ${CONFIGURE_OPTS} \
-    --target=${CLFS_TARGET} \
-    --disable-multilib \
-    --with-local-prefix=/tools \
-    --libexecdir=/tools/lib \
-    --disable-nls \
-    --disable-libstdcxx-pch \
-    --enable-long-long \
-    --enable-c99 \
-    --enable-shared \
-    --enable-threads=posix \
-    --enable-__cxa_atexit \
-    --enable-languages=c,c++"
-
 hvpatch()
 {
     # Manually applying patches if specified
@@ -36,6 +21,21 @@ hvpatch()
 
 hvconfig_pre()
 {
+    CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \
+        --target=${CLFS_TARGET} \
+        --disable-multilib \
+        --with-local-prefix=/tools \
+        --libexecdir=/tools/lib \
+        --disable-nls \
+        --disable-libstdcxx-pch \
+        --enable-long-long \
+        --enable-c99 \
+        --enable-shared \
+        --enable-threads=posix \
+        --enable-__cxa_atexit \
+        --enable-languages=c,c++"
+
     cd ${LFS_TMP}/${PACKAGE}
 
     # Change the StartFile Spec to point to the correct library location:
index 7bcd57a..afe372d 100644 (file)
@@ -1,10 +1,11 @@
 #!/bin/bash
 
-CONFIGURE_OPTS="\
-    --prefix=/tools \
-    --build=${CLFS_HOST} \
-    --host=${CLFS_TARGET} \
-    ${CONFIGURE_OPTS}"
+hvconfig_pre()
+{
+    CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \
+        --disable-shared"
+}
 
 # When cross-compiling the Gettext configure script assumes we don't have a
 # working wcwidth when we do. The following will fix possible compilation
@@ -19,12 +20,7 @@ EOF
 hvconfig()
 {
     cd ${LFS_TMP}/${PACKAGE}/gettext-tools
-
-    echo "Running configure with options:"
-    echo "  <${CONFIGURE_OPTS}>"
-
-    CC="${CC} ${CLFS_BUILDFLAGS}" CXX="${CXX} ${CLFS_BUILDFLAGS}" \
-        ./configure ${CONFIGURE_OPTS}
+    ./configure ${CONFIGURE_OPTS}
 }
 
 hvbuild()
index d3ef530..9319388 100644 (file)
@@ -1,5 +1,11 @@
 #!/bin/bash
 
+hvconfig_pre()
+{
+    # Add a missing include statement into one of the source files:
+    sed -e '/"m4.h"/i\#include <sys/stat.h>' -i ${LFS_TMP}/${PACKAGE}/src/path.c
+}
+
 # Configure can not properly determine the results of the following tests:
 hvconfig_cache()
 {
@@ -14,9 +20,3 @@ gl_cv_func_wcrtomb_retval=yes
 gl_cv_func_wctob_works=yes
 EOF
 }
-
-hvconfig_pre()
-{
-    # Add a missing include statement into one of the source files:
-    sed -e '/"m4.h"/i\#include <sys/stat.h>' -i ${LFS_TMP}/${PACKAGE}/src/path.c
-}
index d05c66f..c3fea6a 100644 (file)
@@ -1,13 +1,14 @@
 #!/bin/bash
 
-CC="${CC} ${CLFS_BUILDFLAGS}"
-
-CONFIGURE_OPTS="\
-    --prefix=/ \
-    --bindir=/bin \
-    --sbindir=/sbin \
-    --build=${CLFS_HOST} \
-    --host=${CLFS_TARGET}"
+hvconfig_pre()
+{
+    CONFIGURE_OPTS="\
+        --prefix=/ \
+        --bindir=/bin \
+        --sbindir=/sbin \
+        --build=${CLFS_HOST} \
+        --host=${CLFS_TARGET}"
+}
 
 hvbuild()
 {
index 0716d41..a8a546c 100644 (file)
@@ -11,7 +11,7 @@ hvbuild()
         -i src/Makefile
 
     make -C src clobber
-    make -C src CC="${CC} ${CLFS_BUILDFLAGS}"
+    make -C src CC="${CC} ${BUILD64}"
     make -C src install INSTALL=install ROOT=${LFS}
     
     install -m644 ${SCRDIR}/misc/inittab ${LFS}/etc
index 3dc3776..d120b14 100644 (file)
@@ -1,20 +1,18 @@
 #!/bin/bash
 
-CC="${CC} ${CLFS_BUILDFLAGS}"
-
-CONFIGURE_OPTS="\
-    --prefix=/usr \
-    --build=${CLFS_HOST} \
-    --host=${CLFS_TARGET} \
-    --exec-prefix="" \
-    --sysconfdir=/etc \
-    --libexecdir=/lib/udev \
-    --libdir=/usr/lib \
-    --disable-extras \
-    --disable-introspection"
-
 hvconfig_pre()
 {
+    CONFIGURE_OPTS="\
+        --prefix=/usr \
+        --build=${CLFS_HOST} \
+        --host=${CLFS_TARGET} \
+        --exec-prefix="" \
+        --sysconfdir=/etc \
+        --libexecdir=/lib/udev \
+        --libdir=/usr/lib \
+        --disable-extras \
+        --disable-introspection"
+
     cd ${LFS_TMP}/${PACKAGE}
     install -dv ${LFS}/lib/{firmware,udev/devices/{pts,shm}}
 }
index ad66e53..079a343 100644 (file)
@@ -1,13 +1,13 @@
 #!/bin/bash
 
-CC="${CC} ${CLFS_BUILDFLAGS}"
-CXX="${CXX} ${CLFS_BUILDFLAGS}"
-
-CONFIGURE_OPTS="\
-    --build=${CLFS_HOST} \
-    --host=${CLFS_TARGET} \
-    --enable-login-utils \
-    --disable-makeinstall-chown"
+hvconfig_pre()
+{
+    CONFIGURE_OPTS="\
+        --build=${CLFS_HOST} \
+        --host=${CLFS_TARGET} \
+        --enable-login-utils \
+        --disable-makeinstall-chown"
+}
 
 hvbuild()
 {
index a1da1ca..82e58f5 100644 (file)
@@ -1,6 +1,7 @@
 #!/bin/bash
 
-CC="${CC} ${CLFS_BUILDFLAGS}"
-
-CONFIGURE_OPTS="\
+hvconfig_pre()
+{
+    CONFIGURE_OPTS="\
         --prefix=/tools"
+}
index 7c4ff90..9d0af52 100644 (file)
@@ -1,3 +1,3 @@
 #!/bin/bash
 
-LFS_STAGE=stage1
+export LFS_STAGE=stage1
index b3d9e44..ec32eea 100644 (file)
@@ -30,7 +30,7 @@ Note: In this example, the destination partition is /dev/hda6, and
    under ${LFS}/boot.
 
 8. Launch the installation of stage 2:
-       >$ /mnt/linux/mnt/hvlinux/scripts/stage2/stage2-install
+       >$ /mnt/linux/mnt/hvlinux/scripts/stage2/install-1
 
 9. After that, compile a fresh kernel.
 
index abc1b9b..61b542c 100755 (executable)
@@ -38,7 +38,7 @@ unset CC
 unset CXX
 unset LDFLAGS
 
-ipkg ${ZLIB}
+ipkg -m acnb ${ZLIB}
 ipkg ${BINUTILS}
 ipkg ${GCC}
 rscr mult "Testing toolchain" toolchain-test
diff --git a/stage2/ipkg.def b/stage2/ipkg.def
new file mode 100644 (file)
index 0000000..135c8da
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+# Setting default configure options for all scripts
+CONFIGURE_OPTS="\
+      --prefix=/usr \
+      --sysconfdir=/etc \
+      ${CONFIGURE_OPTS}"
diff --git a/stage2/ipkg.sh b/stage2/ipkg.sh
deleted file mode 100755 (executable)
index 41f028d..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Reading system configuration informations, functions and package versions.
-source ${SCRDIR}/../sysinfos
-source ${SCRDIR}/../functions
-source ${SCRDIR}/../packages-list
-
-# Setting default configure options for all scripts
-CONFIGURE_OPTS="\
-      --prefix=/usr \
-      --sysconfdir=/etc \
-      ${CONFIGURE_OPTS}"
-
-source ${SCRDIR}/../functions-ac
-
-ldconfig
-
-exit $?
index dabcf14..c9522c1 100644 (file)
@@ -1,16 +1,16 @@
 #!/bin/bash
 
-CC="gcc -isystem /usr/include"
-LDFLAGS="-Wl,-rpath-link,/lib"
-
-CONFIGURE_OPTS="\
-    --libdir=/usr/lib \
-    --enable-shared \
-    --disable-multilib \
-    ${CONFIGURE_OPTS}"
-
 hvconfig_pre()
 {
+    export CC="gcc -isystem /usr/include"
+    export LDFLAGS="-Wl,-rpath-link,/lib"
+
+    CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \
+        --libdir=/usr/lib \
+        --enable-shared \
+        --disable-multilib"
+    
     case "${HVL_TARGET}" in
         "x86_64")
             # Libiberty uses gcc -print-multi-os-directory to determine where to
@@ -26,6 +26,12 @@ hvconfig_pre()
     esac
 }
 
+hvconfig_post()
+{
+    unset CC
+    unset LDFLAGS
+}
+
 hvbuild()
 {
     make configure-host
index b60e9e8..80fc9ca 100644 (file)
@@ -1,8 +1,11 @@
 #!/bin/bash
 
-CONFIGURE_OPTS="\
-    --enable-no-install-program=kill,uptime \
-    ${CONFIGURE_OPTS}"
+hvconfig_pre()
+{
+    CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \
+        --enable-no-install-program=kill,uptime"
+}
 
 hvbuild_post()
 {
index 99f7e68..4e6bc37 100644 (file)
@@ -1,15 +1,23 @@
 #!/bin/bash
 
-PKG_CONFIG=true
+hvconfig_pre()
+{
+    export PKG_CONFIG=true
+
+    CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \
+        --with-root-prefix="" \
+        --enable-elf-shlibs \
+        --disable-libblkid \
+        --disable-libuuid \
+        --disable-fsck \
+        --disable-uuidd"
+}
 
-CONFIGURE_OPTS="\
-    --with-root-prefix="" \
-    --enable-elf-shlibs \
-    --disable-libblkid \
-    --disable-libuuid \
-    --disable-fsck \
-    --disable-uuidd \
-    ${CONFIGURE_OPTS}"
+hvconfig_post()
+{
+    unset PKG_CONFIG
+}
 
 hvbuild_post()
 {
index a4ebe94..d53de20 100644 (file)
@@ -2,14 +2,14 @@
 
 hvconfig_pre()
 {
-    CFLAGS="-mtune=generic -g -O2"
+    export CFLAGS="-mtune=generic -g -O2"
 
     CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \
         --disable-profile \
         --enable-add-ons \
         --enable-kernel=$(get_pkg_ver ${KERNEL}) \
-        --libexecdir=/usr/lib/eglibc \
-        ${CONFIGURE_OPTS}"
+        --libexecdir=/usr/lib/eglibc"
 
     case "${HVL_TARGET}" in
         "x86")
@@ -39,6 +39,11 @@ hvconfig_pre()
     esac
 }
 
+hvconfig_post()
+{
+    unset CFLAGS
+}
+
 hvbuild()
 {
     make
index 4bdfba7..fcb4b36 100755 (executable)
@@ -1,9 +1,12 @@
 #!/bin/bash
 
-CONFIGURE_OPTS="\
-    --libexecdir=/usr/lib/findutils \
-    --localstatedir=/var/lib/locate \
-    ${CONFIGURE_OPTS}"
+hvconfig_pre()
+{
+    CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \
+        --libexecdir=/usr/lib/findutils \
+        --localstatedir=/var/lib/locate"
+}
 
 hvbuild_post()
 {
index c73c30d..865f6cd 100644 (file)
@@ -1,20 +1,27 @@
 #!/bin/bash
 
-CC="gcc -Wl,-rpath-link,/lib -isystem /usr/include"
-CXX="g++ -Wl,-rpath-link,/lib -isystem /usr/include"
+hvconfig_pre()
+{
+    export CC="gcc -Wl,-rpath-link,/lib -isystem /usr/include"
+    export CXX="g++ -Wl,-rpath-link,/lib -isystem /usr/include"
 
-CONFIGURE_OPTS="\
-    --libexecdir=/usr/lib \
-    --enable-shared \
-    --enable-threads=posix \
-    --enable-__cxa_atexit \
-    --enable-c99 \
-    --enable-long-long \
-    --enable-clocale=gnu \
-    --enable-languages=c,c++ \
-    --disable-multilib \
-    --disable-libstdcxx-pch \
-    ${CONFIGURE_OPTS}"
+    CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \
+        --libexecdir=/usr/lib \
+        --enable-shared \
+        --enable-threads=posix \
+        --enable-__cxa_atexit \
+        --enable-c99 \
+        --enable-long-long \
+        --enable-clocale=gnu \
+        --enable-languages=c,c++ \
+        --disable-multilib \
+        --disable-libstdcxx-pch"
+
+    # Applying a sed substitution that will suppress the installation of
+    # libiberty.a. We want to use the Binutils version of libiberty.a
+    sed -i 's/install_to_$(INSTALL_DEST) //' ${LFS_TMP}/${PACKAGE}/libiberty/Makefile.in
+}
 
 hvpatch()
 {
@@ -33,11 +40,10 @@ hvpatch()
     esac
 }
 
-hvconfig_pre()
+hvconfig_post()
 {
-    # Applying a sed substitution that will suppress the installation of
-    # libiberty.a. We want to use the Binutils version of libiberty.a
-    sed -i 's/install_to_$(INSTALL_DEST) //' ${LFS_TMP}/${PACKAGE}/libiberty/Makefile.in
+    unset CC
+    unset CXX
 }
 
 hvbuild_post()
index 9c4a6a2..2f052fb 100755 (executable)
@@ -1,12 +1,20 @@
 #!/bin/bash
 
-PAGE=letter
+# Groff does not like to be made in parallel???
 
-CONFIGURE_OPTS="\
-    --enable-multibyte
-    ${CONFIGURE_OPTS}"
+hvconfig_pre()
+{
+    export PAGE=letter
+
+    CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \
+        --enable-multibyte"
+}
 
-# Groff does not like to be made in parallel.
+hvconfig_post()
+{
+    unset PAGE
+}
 
 hvbuild_post()
 {
index fa9a1cf..341a13f 100755 (executable)
@@ -1,8 +1,11 @@
 #!/bin/bash
 
-CONFIGURE_OPTS="\
-    --bindir=/bin
-    ${CONFIGURE_OPTS}"
+hvconfig_pre()
+{
+    CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \
+        --bindir=/bin"
+}
 
 hvbuild_post()
 {
index b1ad3c1..5d9b3f2 100755 (executable)
@@ -1,13 +1,16 @@
 #!/bin/bash
 
-CONFIGURE_OPTS="\
-    --libexecdir=/usr/sbin \
-    --localstatedir=/var \
-    --disable-ifconfig \
-    --disable-logger \
-    --disable-syslogd \
-    --disable-whois \
-    --disable-servers"
+hvconfig_pre()
+{
+    CONFIGURE_OPTS="\
+        --libexecdir=/usr/sbin \
+        --localstatedir=/var \
+        --disable-ifconfig \
+        --disable-logger \
+        --disable-syslogd \
+        --disable-whois \
+        --disable-servers"
+}
 
 hvbuild_post()
 {
index 060a57c..9e4dc22 100755 (executable)
@@ -1,11 +1,11 @@
 #!/bin/bash
 
-# --datadir=/lib/kbd 
-#     This option puts keyboard layout data in a directory that will
-#     always be on the root partition instead of the default /usr/share/kbd
-CONFIGURE_OPTS="\
-    --datadir=/lib/kbd
-    ${CONFIGURE_OPTS}"
+hvconfig_pre()
+{
+    CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \
+        --datadir=/lib/kbd"
+}
 
 hvbuild_post()
 {
index 44a2aa6..08d6a25 100755 (executable)
@@ -1,10 +1,13 @@
 #!/bin/bash
 
-# --enable-zlib-dynamic: To handle compressed kernel modules.
-CONFIGURE_OPTS="\
-    --enable-zlib-dynamic \
-    --mandir=/usr/share/man \
-    ${CONFIGURE_OPTS}"
+hvconfig_pre()
+{
+    # --enable-zlib-dynamic: To handle compressed kernel modules.
+    CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \
+        --enable-zlib-dynamic \
+        --mandir=/usr/share/man"
+}
 
 hvbuild()
 {
@@ -19,7 +22,5 @@ hvbuild()
 
 hvbuild_post()
 {
-    cat > /etc/modprobe.conf << "EOF"
-# modprobe.conf
-EOF
+    install -dv ${LFS}/etc/modprobe.d
 }
index 69433cf..739a4a2 100644 (file)
@@ -1,12 +1,15 @@
 #!/bin/bash
 
-CONFIGURE_OPTS="\
-    --libdir=/lib \
-    --with-shared \
-    --without-debug \
-    --enable-widec \
-    --with-manpage-format=normal \
-    ${CONFIGURE_OPTS}"
+hvconfig_pre()
+{
+    CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \
+        --libdir=/lib \
+        --with-shared \
+        --without-debug \
+        --enable-widec \
+        --with-manpage-format=normal"
+}
 
 hvbuild_post()
 {
index 9097481..03a69d0 100644 (file)
@@ -1,11 +1,11 @@
 #!/bin/bash
 
-CONFIGURE_OPTS="\
-    --libdir=/lib
-    ${CONFIGURE_OPTS}"
-
 hvconfig_pre()
 {
+    CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \    
+        --libdir=/lib"
+    
     cd ${LFS_TMP}/${PACKAGE}
 
     # Reinstalling Readline will cause the old libraries to be moved to
index 5dbd099..723f5e7 100755 (executable)
@@ -1,11 +1,11 @@
 #!/bin/bash
 
-CONFIGURE_OPTS="\
-    --without-selinux
-    ${CONFIGURE_OPTS}"
-
 hvconfig_pre()
 {
+    CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \    
+        --without-selinux"
+    
     cd ${LFS_TMP}/${PACKAGE}
 
     # Disable the installation of the groups program and its man page, as
index e46e5c3..081181e 100644 (file)
@@ -2,6 +2,12 @@
 
 hvconfig_pre()
 {
+    CONFIGURE_OPTS="\
+        --enable-arch \
+        --enable-partx \
+        --enable-write \
+        --disable-wall"
+
     # 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:
@@ -9,17 +15,6 @@ hvconfig_pre()
     mkdir -pv /var/lib/hwclock
 }
 
-hvconfig()
-{
-    cd ${LFS_TMP}/${PACKAGE}
-
-    ./configure \
-        --enable-arch \
-        --enable-partx \
-        --enable-write \
-        --disable-wall
-}
-
 hvbuild_post()
 {
     # Move the logger  binary to /bin as it is needed by the CLFS-Bootscripts package:
index 0106d36..1b4a57b 100644 (file)
@@ -1,17 +1,21 @@
 #!/bin/bash
 
-CC="gcc -isystem /usr/include"
-CXX="g++ -isystem /usr/include"
-LDFLAGS="-Wl,-rpath-link,/lib"
+hvconfig_pre()
+{
+    export CC="gcc -isystem /usr/include"
+    export CXX="g++ -isystem /usr/include"
+    export LDFLAGS="-Wl,-rpath-link,/lib"
 
-CONFIGURE_OPTS="\
-    --shared \
-    ${CONFIGURE_OPTS}"
+    CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \
+        --shared"
+}
 
-hvconfig()
+hvconfig_post()
 {
-    cd ${LFS_TMP}/${PACKAGE}
-    ./configure ${CONFIGURE_OPTS}
+    unset CC
+    unset CXX
+    unset LDFLAGS
 }
 
 hvbuild_post()
index 6f7260f..1664849 100644 (file)
@@ -1,3 +1,3 @@
 #!/bin/bash
 
-LFS_STAGE=stage2
+export LFS_STAGE=stage2