From 1eb363044c6ee3115e62736aed4403b750082b44 Mon Sep 17 00:00:00 2001 From: gobo72 Date: Tue, 9 Nov 2010 06:45:46 +0000 Subject: [PATCH] =?utf8?q?Stage2=20semble=20compl=C3=A9ter=20ok?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- functions | 36 ++++++++++++++++++++++++++++++++++++ packages-list | 4 ++-- stage0/packages-update | 1 - stage1/create-config-files | 1 - stage1/create-directories | 1 - stage1/create-groups | 1 - stage1/create-logfiles | 1 - stage1/create-symlinks | 1 - stage1/create-users | 1 - stage1/install-1 | 1 - stage1/install-2 | 1 - stage1/install-bootscripts | 1 - stage1/packages-update | 1 - stage1/post-install | 1 - stage1/pre-install | 1 - stage2/compressdoc | 1 - stage2/create-config-files | 1 - stage2/install-1 | 3 +-- stage2/install-2 | 21 +++++++-------------- stage2/install-bootscripts | 1 - stage2/install-hv-utilities | 1 - stage2/packages-update | 1 - stage2/pkg/e2fsprogs | 11 +++++++++-- stage2/pkg/inetutils | 1 + stage2/pkg/iproute2 | 22 +++++++++++++++++----- stage2/pkg/module-init-tools | 2 +- stage2/pkg/perl | 13 +++++++------ stage2/pkg/readline | 2 +- stage2/pkg/shadow | 4 ++-- stage2/pkg/sysklogd | 8 ++++++++ stage2/pkg/udev | 33 ++++++++++++--------------------- stage2/post-install | 3 ++- stage2/toolchain-adjust | 1 - stage2/toolchain-test | 1 - stage3/packages-update | 1 - stage4/packages-update | 1 - stage5/packages-update | 3 +-- stage6/packages-update | 9 ++------- sysinfos | 1 + 39 files changed, 110 insertions(+), 88 deletions(-) diff --git a/functions b/functions index 2ccd965..ecd34f0 100644 --- a/functions +++ b/functions @@ -962,6 +962,29 @@ rscr() return $EXIT_SUCCESS } +rcmd_trap_setup() +{ + exec 6>&1 # Save current "value" of stdout. + trap rcmd_trap_handler INT TERM EXIT ERR +} + +rcmd_trap_end() +{ + trap - INT TERM EXIT ERR + + # Restore global trap + #####hvtrap_setup +} + +rcmd_trap_handler() +{ + exec 1>&6 6>&- # Restore stdout and close file descriptor #6. + print_status failure + + ###rcmd_trap_end + ###exit 1 +} + # Run command, no log # First argument: Message to display during script # Second argument: command + arguments @@ -982,10 +1005,21 @@ rcmd() display_checkbox_msg ${MSGSTRING} + rcmd_trap_setup + echo ${CMD_WITH_ARGS} 1>> ${LFS_LOG_FILE} + if [ -n "${RCMD_NO_EXIT}" ]; then + set +e + fi + # Executing command ${CMD_WITH_ARGS} 1>> ${LFS_LOG_FILE} 2>&1 + + if [ -n "${RCMD_NO_EXIT}" ]; then + set -e + fi + if [ $? -ne 0 ]; then print_status failure if [ -n "${RCMD_NO_EXIT}" ]; then @@ -998,6 +1032,8 @@ rcmd() # Displaying build time after the package name print_status success + rcmd_trap_end + return $EXIT_SUCCESS } diff --git a/packages-list b/packages-list index 6db4ef0..72281f4 100644 --- a/packages-list +++ b/packages-list @@ -194,7 +194,7 @@ GNUPG="gnupg-1.4.9" GREP="grep-2.6.3" GRIP="grip-3.3.1" GROFF="groff-1.20.1" -GRUB="grub-0.97" +GRUB="grub-1.98" GSL="gsl-1.13" GSTREAMER="gstreamer-0.10.20" GST_PLUGINS_BASE="gst-plugins-base-0.10.20" @@ -297,7 +297,7 @@ MAKE_PACKAGE="make-3.82" MAN_DB="man-db-2.5.6" MANPAGES="man-pages-3.30" METACITY="metacity-2.18.5" -MFOUR="m4-1.4.14" +MFOUR="m4-1.4.15" MILTER_GREYLIST="milter-greylist-4.0" MILTER_SPF="smf-spf-2.0.1" MODULE_INIT_TOOLS="module-init-tools-3.12" diff --git a/stage0/packages-update b/stage0/packages-update index 2345293..a719bb4 100755 --- a/stage0/packages-update +++ b/stage0/packages-update @@ -1,6 +1,5 @@ #!/bin/bash -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 diff --git a/stage1/create-config-files b/stage1/create-config-files index 0bc590c..2c782fa 100755 --- a/stage1/create-config-files +++ b/stage1/create-config-files @@ -1,5 +1,4 @@ #!/bin/bash -set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos diff --git a/stage1/create-directories b/stage1/create-directories index f73edad..d2b719b 100755 --- a/stage1/create-directories +++ b/stage1/create-directories @@ -1,5 +1,4 @@ #!/bin/bash -set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos diff --git a/stage1/create-groups b/stage1/create-groups index 981daef..881ae53 100755 --- a/stage1/create-groups +++ b/stage1/create-groups @@ -1,5 +1,4 @@ #!/bin/bash -set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos diff --git a/stage1/create-logfiles b/stage1/create-logfiles index c0fb885..990c054 100755 --- a/stage1/create-logfiles +++ b/stage1/create-logfiles @@ -1,5 +1,4 @@ #!/bin/bash -set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos diff --git a/stage1/create-symlinks b/stage1/create-symlinks index bd44b95..b61685a 100755 --- a/stage1/create-symlinks +++ b/stage1/create-symlinks @@ -1,5 +1,4 @@ #!/bin/bash -set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos diff --git a/stage1/create-users b/stage1/create-users index f405574..7529f45 100755 --- a/stage1/create-users +++ b/stage1/create-users @@ -1,5 +1,4 @@ #!/bin/bash -set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos diff --git a/stage1/install-1 b/stage1/install-1 index 50fbe55..a7bd542 100755 --- a/stage1/install-1 +++ b/stage1/install-1 @@ -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 diff --git a/stage1/install-2 b/stage1/install-2 index d2d11c7..a063fb4 100755 --- a/stage1/install-2 +++ b/stage1/install-2 @@ -1,5 +1,4 @@ #!/bin/bash -set -o errexit source ~/.bashrc diff --git a/stage1/install-bootscripts b/stage1/install-bootscripts index 5c0def2..8874b63 100755 --- a/stage1/install-bootscripts +++ b/stage1/install-bootscripts @@ -1,5 +1,4 @@ #!/bin/bash -set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos diff --git a/stage1/packages-update b/stage1/packages-update index 3fc5ac0..7add361 100755 --- a/stage1/packages-update +++ b/stage1/packages-update @@ -1,6 +1,5 @@ #!/bin/bash -LFS_STAGE="stage1" USE_CLFS_PATCHES=1 USE_HV_PATCHES=1 diff --git a/stage1/post-install b/stage1/post-install index 6f3fb4d..72addc2 100755 --- a/stage1/post-install +++ b/stage1/post-install @@ -1,5 +1,4 @@ #!/bin/bash -set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos diff --git a/stage1/pre-install b/stage1/pre-install index 13815b4..b9e314c 100755 --- a/stage1/pre-install +++ b/stage1/pre-install @@ -1,5 +1,4 @@ #!/bin/bash -set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos diff --git a/stage2/compressdoc b/stage2/compressdoc index 19ac7e5..c705f49 100755 --- a/stage2/compressdoc +++ b/stage2/compressdoc @@ -1,5 +1,4 @@ #!/bin/bash -set -o errexit # First argument of this script is the package name. diff --git a/stage2/create-config-files b/stage2/create-config-files index ab74281..686af78 100755 --- a/stage2/create-config-files +++ b/stage2/create-config-files @@ -1,5 +1,4 @@ #!/bin/bash -set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos diff --git a/stage2/install-1 b/stage2/install-1 index 61b542c..dafcad6 100755 --- a/stage2/install-1 +++ b/stage2/install-1 @@ -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 @@ -51,7 +50,7 @@ ipkg ${COREUTILS} ipkg -m noac ${IANA} ipkg ${MFOUR} ipkg ${BISON} -ipkg ${PROCPS} +ipkg -m noac ${PROCPS} ipkg ${LIBTOOL} ipkg ${FLEX} ipkg -m noac ${IPROUTE2} diff --git a/stage2/install-2 b/stage2/install-2 index da231bb..ec1c196 100755 --- a/stage2/install-2 +++ b/stage2/install-2 @@ -30,9 +30,9 @@ ipkg ${MAN_DB} "\ ipkg ${MODULE_INIT_TOOLS} ipkg ${PATCH_PACKAGE} ipkg ${PSMISC} -ipkg -m noac ${SHADOW} -ipkg ${SYSKLOGD} -ipkg ${SYSVINIT} +ipkg ${SHADOW} +ipkg -m noac ${SYSKLOGD} +ipkg -m noac ${SYSVINIT} ipkg ${TAR_PACKAGE} "--bindir=/bin --libexecdir=/usr/sbin" ipkg ${TEXINFO} ipkg ${UDEV} @@ -47,20 +47,13 @@ rscr once "Installing bootscripts" install-bootscripts echo "Total build time: $(get_total_build_time ${LFS_LOG_FILE})h" # Creating root password -passwd root || exit 1 +passwd root rscr mult "Performing post-install" post-install ldconfig -lasterror=$? - -if [ ${lasterror} -eq 0 ]; then - echo "Stage2 successfully completed." - echo "You must now compile a new kernel (go to /usr/src/linux)." - echo "After that, you can reboot and try your new system." -else - echo "Error in script 'install-2'" - exit ${lasterror} -fi +echo "Stage2 successfully completed." +echo "You must now compile a new kernel (go to /usr/src/linux)." +echo "After that, you can reboot and try your new system." exec /bin/bash --login diff --git a/stage2/install-bootscripts b/stage2/install-bootscripts index 50717e6..c1b60fb 100755 --- a/stage2/install-bootscripts +++ b/stage2/install-bootscripts @@ -1,5 +1,4 @@ #!/bin/bash -set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos diff --git a/stage2/install-hv-utilities b/stage2/install-hv-utilities index 7fa350c..da17a9b 100755 --- a/stage2/install-hv-utilities +++ b/stage2/install-hv-utilities @@ -1,5 +1,4 @@ #!/bin/bash -set -o errexit # First argument of this script is the package name diff --git a/stage2/packages-update b/stage2/packages-update index 5c1f588..fd191a2 100755 --- a/stage2/packages-update +++ b/stage2/packages-update @@ -1,6 +1,5 @@ #!/bin/bash -LFS_STAGE="stage2" USE_LFS_PATCHES=1 USE_BLFS_PATCHES=1 USE_CLFS_PATCHES=1 diff --git a/stage2/pkg/e2fsprogs b/stage2/pkg/e2fsprogs index 4e6bc37..1098c95 100644 --- a/stage2/pkg/e2fsprogs +++ b/stage2/pkg/e2fsprogs @@ -6,7 +6,7 @@ hvconfig_pre() CONFIGURE_OPTS="\ ${CONFIGURE_OPTS} \ - --with-root-prefix="" \ + --with-root-prefix=\"\" \ --enable-elf-shlibs \ --disable-libblkid \ --disable-libuuid \ @@ -19,10 +19,17 @@ hvconfig_post() unset PKG_CONFIG } +hvbuild() +{ + ${HVMAKE} LIBUUID="-luuid" STATIC_LIBUUID="-luuid" \ + LIBBLKID="-lblkid" STATIC_LIBBLKID="-lblkid" + ${HVMAKE} install +} + hvbuild_post() { # Install the static libraries and headers: - make install-libs + ${HVMAKE} install-libs # Make the installed static libraries writable so debugging symbols can be removed later: chmod -v u+w /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a diff --git a/stage2/pkg/inetutils b/stage2/pkg/inetutils index 5d9b3f2..82d277f 100644 --- a/stage2/pkg/inetutils +++ b/stage2/pkg/inetutils @@ -3,6 +3,7 @@ hvconfig_pre() { CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ --libexecdir=/usr/sbin \ --localstatedir=/var \ --disable-ifconfig \ diff --git a/stage2/pkg/iproute2 b/stage2/pkg/iproute2 index 990869c..461289b 100644 --- a/stage2/pkg/iproute2 +++ b/stage2/pkg/iproute2 @@ -1,15 +1,27 @@ #!/bin/bash -hvbuild() +hvconfig_pre() { # The arpd binary included in this package is dependent on Berkeley DB. # Because arpd is not a very common requirement on a base Linux system, # remove the dependency on Berkeley DB by applying the sed command below sed -i '/^TARGETS/s@arpd@@g' ${LFS_TMP}/${PACKAGE}/misc/Makefile +} - make DESTDIR= DOCDIR=/usr/share/doc/iproute2 \ - MANDIR=/usr/share/man +hvbuild() +{ + cd ${LFS_TMP}/${PACKAGE} + + make DESTDIR= + make DESTDIR= SBINDIR=/sbin DOCDIR=/usr/share/doc/iproute2 MANDIR=/usr/share/man install +} + +hvbuild_post() +{ + unset DESTDIR + unset SBINDIR + unset DOCDIR + unset MANDIR - make DESTDIR= DOCDIR=/usr/share/doc/iproute2 \ - MANDIR=/usr/share/man install + cd bozo } diff --git a/stage2/pkg/module-init-tools b/stage2/pkg/module-init-tools index 08d6a25..a7d9c13 100644 --- a/stage2/pkg/module-init-tools +++ b/stage2/pkg/module-init-tools @@ -11,7 +11,7 @@ hvconfig_pre() hvbuild() { - make -j ${MAKEJOBS} + make -j ${MAKEJOBS} DOCBOOKTOMAN="" # INSTALL=install # Normally, make install will not install the binaries if they already diff --git a/stage2/pkg/perl b/stage2/pkg/perl index 79c19a8..69cf777 100644 --- a/stage2/pkg/perl +++ b/stage2/pkg/perl @@ -4,8 +4,8 @@ hvconfig_pre() { if [ "x${HVLABEL}" = "x${PERL}-pass1" ]; then # Change a hardcoded path from /usr/include to /tools/include: - sed -i 's@/usr/include@/tools/include@g' \ - ${LFS_TMP}/${PACKAGE}/ext/Errno/Errno_pm.PL + sed 's@/usr/include@/tools/include@g' \ + -i ${LFS_TMP}/${PACKAGE}/ext/Errno/Errno_pm.PL CONFIGURE_OPTS="\ --prefix=/tools \ @@ -14,18 +14,19 @@ hvconfig_pre() # By default, Perl's Compress::Raw::Zlib module builds and links against # its own internal copy of Zlib. The following command will tell it to # use the system-installed Zlib: - sed -i -e '/^BUILD_ZLIB/s/True/False/' \ + sed -e '/^BUILD_ZLIB/s/True/False/' \ -e '/^INCLUDE/s,\./zlib-src,/usr/include,' \ -e '/^LIB/s,\./zlib-src,/usr/lib,' \ - ${LFS_TMP}/${PACKAGE}/cpan/Compress-Raw-Zlib/config.in + -i ${LFS_TMP}/${PACKAGE}/cpan/Compress-Raw-Zlib/config.in CONFIGURE_OPTS="\ --prefix=/usr \ -Dvendorprefix=/usr \ -Dman1dir=/usr/share/man/man1 \ -Dman3dir=/usr/share/man/man3 \ - -Dpager=\"/bin/less -isR\" \ - -Dusethreads -Duseshrplib" + -Dpager='/bin/less -isR' \ + -Dusethreads \ + -Duseshrplib" fi } diff --git a/stage2/pkg/readline b/stage2/pkg/readline index 03a69d0..f3bd317 100644 --- a/stage2/pkg/readline +++ b/stage2/pkg/readline @@ -3,7 +3,7 @@ hvconfig_pre() { CONFIGURE_OPTS="\ - ${CONFIGURE_OPTS} \ + ${CONFIGURE_OPTS} \ --libdir=/lib" cd ${LFS_TMP}/${PACKAGE} diff --git a/stage2/pkg/shadow b/stage2/pkg/shadow index 723f5e7..ec70165 100644 --- a/stage2/pkg/shadow +++ b/stage2/pkg/shadow @@ -3,7 +3,7 @@ hvconfig_pre() { CONFIGURE_OPTS="\ - ${CONFIGURE_OPTS} \ + ${CONFIGURE_OPTS} \ --without-selinux" cd ${LFS_TMP}/${PACKAGE} @@ -17,7 +17,7 @@ hvconfig_pre() # 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 + # 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: diff --git a/stage2/pkg/sysklogd b/stage2/pkg/sysklogd index 2e84881..dcd22d9 100644 --- a/stage2/pkg/sysklogd +++ b/stage2/pkg/sysklogd @@ -1,5 +1,13 @@ #!/bin/bash +hvbuild() +{ + cd ${LFS_TMP}/${PACKAGE} + + make + make BINDIR=/sbin install +} + hvbuild_post() { cat > /etc/syslog.conf << "EOF" diff --git a/stage2/pkg/udev b/stage2/pkg/udev index ba93614..92d6e67 100644 --- a/stage2/pkg/udev +++ b/stage2/pkg/udev @@ -1,29 +1,20 @@ #!/bin/bash -CONFIGURE_OPTS="\ - --sbindir=/sbin \ - --with-rootlibdir=/lib \ - --libexecdir=/lib/udev \ - --docdir=/usr/share/doc/${PACKAGE} \ - --disable-extras \ - --disable-introspection \ - ${CONFIGURE_OPTS}" +hvconfig_pre() +{ + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --sbindir=/sbin \ + --with-rootlibdir=/lib \ + --libexecdir=/lib/udev \ + --docdir=/usr/share/doc/${PACKAGE} \ + --disable-extras \ + --disable-introspection" +} hvbuild_post() { - # Udev has to be configured in order to work properly, as its default - # configuration does not cover all devices. First install two extra - # rules files from Udev to help support device-mapper and RAID setups: - install -m644 -v rules/packages/64-*.rules \ - /lib/udev/rules.d/ - - # Now install a file to create symlinks for certain hand-held devices: - install -m644 -v rules/packages/40-pilot-links.rules \ - /lib/udev/rules.d/ - - # Now install a file to handle ISDN devices: - install -m644 -v rules/packages/40-isdn.rules \ - /lib/udev/rules.d/ + cd ${LFS_TMP}/${PACKAGE} install -m755 ${SCRDIR}/misc/udev-create-persistent-net.sh /usr/local/bin } diff --git a/stage2/post-install b/stage2/post-install index 3e65624..cee7e86 100755 --- a/stage2/post-install +++ b/stage2/post-install @@ -1,5 +1,4 @@ #!/bin/bash -set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos @@ -32,4 +31,6 @@ chown -v root:root /tmp chown -v root:root /var chown -v root:root /var/log +ldconfig + exit $? diff --git a/stage2/toolchain-adjust b/stage2/toolchain-adjust index af99d6b..4b11cfc 100755 --- a/stage2/toolchain-adjust +++ b/stage2/toolchain-adjust @@ -1,5 +1,4 @@ #!/bin/bash -set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos diff --git a/stage2/toolchain-test b/stage2/toolchain-test index e169c69..9881dc1 100755 --- a/stage2/toolchain-test +++ b/stage2/toolchain-test @@ -1,5 +1,4 @@ #!/bin/bash -set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos diff --git a/stage3/packages-update b/stage3/packages-update index b2c6ba3..1f1f272 100755 --- a/stage3/packages-update +++ b/stage3/packages-update @@ -1,6 +1,5 @@ #!/bin/bash -LFS_STAGE="stage3" USE_LFS_PATCHES=1 USE_BLFS_PATCHES=1 USE_HV_PATCHES=1 diff --git a/stage4/packages-update b/stage4/packages-update index 475957f..5d0f82a 100755 --- a/stage4/packages-update +++ b/stage4/packages-update @@ -1,6 +1,5 @@ #!/bin/bash -LFS_STAGE="stage4" USE_LFS_PATCHES=1 USE_BLFS_PATCHES=1 USE_HV_PATCHES=1 diff --git a/stage5/packages-update b/stage5/packages-update index b6199d5..247ef96 100755 --- a/stage5/packages-update +++ b/stage5/packages-update @@ -1,6 +1,5 @@ -#!/bin/sh +#!/bin/bash -LFS_STAGE="stage5" USE_LFS_PATCHES=1 USE_BLFS_PATCHES=1 USE_HV_PATCHES=1 diff --git a/stage6/packages-update b/stage6/packages-update index ed15912..3213409 100644 --- a/stage6/packages-update +++ b/stage6/packages-update @@ -1,17 +1,13 @@ -#!/bin/sh - -# Must be defined before sourcing other files. -LFS_STAGE="stage4" +#!/bin/bash # Reading system configuration informations, functions and package versions. +source ../sysinfos source ../functions source ../functions-update source ../packages-list update_packages_init -# Begin - # Gnome 2 core packages fpkg_gnome ${ORBIT2} fpkg_gnome ${LIBBONOBO} @@ -98,5 +94,4 @@ fpkg ${ABIWORD} "http://www.abisource.com/downloads/abiword/$(get_pkg_ver fpkg_gnome ${EVOLUTION_EXCHANGE} fpkg_gnome ${EVOLUTION} -# Return last error exit $? diff --git a/sysinfos b/sysinfos index 7cd21be..1b6c06a 100644 --- a/sysinfos +++ b/sysinfos @@ -16,6 +16,7 @@ REGUSER="hugo" # Destination path where to install new Linux-HV system. This is usually where # you have mounted your new LFS partition, but it can also be any directory. +# This is relevant only for stage 0 and 1. LFS="/mnt/hvlinux" # Destination partition where to install new Linux-HV system -- 2.20.1