#!/bin/bash set -e source vars.sh CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.3 ""$LFS_MANPAGES""" >> build.log tar xf "$LFS_MANPAGES".tar.* cd "$LFS_MANPAGES" || exit rm -v man3/crypt* make prefix=/usr install cd .. rm -rf "$LFS_MANPAGES" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.3 ""$LFS_MANPAGES""" >> build.log echo "$LFS_MANPAGES" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.4 ""$LFS_IANAETC""" >> build.log tar xf "$LFS_IANAETC".tar.* cd "$LFS_IANAETC" || exit cp services protocols /etc cd .. rm -rf "$LFS_IANAETC" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.4 ""$LFS_IANAETC""" >> build.log echo "$LFS_IANAETC" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.5 ""$LFS_GLIBC""" >> build.log tar xf "$LFS_GLIBC".tar.* cd "$LFS_GLIBC" || exit patch -Np1 -i ../"$LFS_GLIBC"-fhs-1.patch mkdir -v build cd build || exit echo "rootsbindir=/usr/sbin" > configparms ../configure --prefix=/usr \ --disable-werror \ --enable-kernel=4.19 \ --enable-stack-protector=strong \ --disable-nscd \ libc_cv_slibdir=/usr/lib make if [ "$MAKECHECK" = TRUE ]; then make check | tee ../../check-log_"$LFS_GLIBC".log; fi touch /etc/ld.so.conf sed '/test-installation/s@$(LFS_PERL)@echo not running@' -i ../Makefile make install sed '/RTLDLIST=/s@/usr@@g' -i /usr/bin/ldd make localedata/install-locales localedef -i POSIX -f UTF-8 C.UTF-8 2> /dev/null || true localedef -i ja_JP -f SHIFT_JIS ja_JP.SJIS 2> /dev/null || true cat > /etc/nsswitch.conf << "EOF" # Begin /etc/nsswitch.conf passwd: files systemd group: files systemd shadow: files systemd hosts: mymachines resolve [!UNAVAIL=return] files myhostname dns networks: files protocols: files services: files ethers: files rpc: files # End /etc/nsswitch.conf EOF tar -xf ../../tzdata2024a.tar.* ZONEINFO=/usr/share/zoneinfo mkdir -pv $ZONEINFO/{posix,right} for tz in etcetera southamerica northamerica europe africa antarctica \ asia australasia backward; do zic -L /dev/null -d $ZONEINFO ${tz} zic -L /dev/null -d $ZONEINFO/posix ${tz} zic -L leapseconds -d $ZONEINFO/right ${tz} done cp -v zone.tab zone1970.tab iso3166.tab $ZONEINFO zic -d $ZONEINFO -p America/New_York unset ZONEINFO ln -sfv /usr/share/zoneinfo/UTC /etc/localtime cat > /etc/ld.so.conf << "EOF" # Begin /etc/ld.so.conf /usr/local/lib /opt/lib EOF cat >> /etc/ld.so.conf << "EOF" # Add an include directory include /etc/ld.so.conf.d/*.conf EOF mkdir -pv /etc/ld.so.conf.d cd ../.. rm -rf "$LFS_GLIBC" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.5 ""$LFS_GLIBC""" >> build.log echo "$LFS_GLIBC" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.6 ""$LFS_ZLIB""" >> build.log tar xf "$LFS_ZLIB".tar.* cd "$LFS_ZLIB" || exit ./configure --prefix=/usr make if [ "$MAKECHECK" = TRUE ]; then make check | tee ../check-log_"$LFS_ZLIB".log; fi make install rm -fv /usr/lib/libz.a cd .. rm -rf "$LFS_ZLIB" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.6 ""$LFS_ZLIB""" >> build.log echo "$LFS_ZLIB" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.7 ""$LFS_BZIP2""" >> build.log tar xf "$LFS_BZIP2".tar.* cd "$LFS_BZIP2" || exit patch -Np1 -i ../bzip2-1.0.8-install_docs-1.patch sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile make -f Makefile-libbz2_so make clean make make PREFIX=/usr install cp -av libbz2.so.* /usr/lib ln -sv libbz2.so.1.0.8 /usr/lib/libbz2.so cp -v bzip2-shared /usr/bin/bzip2 for i in /usr/bin/{bzcat,bunzip2}; do ln -sfv bzip2 $i done rm -fv /usr/lib/libbz2.a cd .. rm -rf "$LFS_BZIP2" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.7 ""$LFS_BZIP2""" >> build.log echo "$LFS_BZIP2" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.8 ""$LFS_XZ""" >> build.log tar xf "$LFS_XZ".tar.* cd "$LFS_XZ" || exit ./configure --prefix=/usr \ --disable-static \ --docdir=/usr/share/doc/xz-5.6.2 make if [ "$MAKECHECK" = TRUE ]; then make check | tee ../check-log_"$LFS_XZ".log; fi make install cd .. rm -rf "$LFS_XZ" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.8 ""$LFS_XZ""" >> build.log echo "$LFS_XZ" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.9 ""$LFS_LZ4""" >> build.log tar xf "$LFS_LZ4".tar.* cd "$LFS_LZ4" || exit make BUILD_STATIC=no PREFIX=/usr if [ "$MAKECHECK" = TRUE ]; then make -j1 check | tee ../check-log_"$LFS_LZ4".log; fi make BUILD_STATIC=no PREFIX=/usr install cd .. rm -rf "$LFS_LZ4" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.9 ""$LFS_LZ4""" >> build.log echo "$LFS_LZ4" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.10 ""$LFS_ZSTD""" >> build.log tar xf "$LFS_ZSTD".tar.* cd "$LFS_ZSTD" || exit make prefix=/usr if [ "$MAKECHECK" = TRUE ]; then make check | tee ../check-log_"$LFS_ZSTD".log; fi make prefix=/usr install rm -v /usr/lib/libzstd.a cd .. rm -rf "$LFS_ZSTD" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.10 ""$LFS_ZSTD""" >> build.log echo "$LFS_ZSTD" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.11 ""$LFS_FILE""" >> build.log tar xf "$LFS_FILE".tar.* cd "$LFS_FILE" || exit ./configure --prefix=/usr make if [ "$MAKECHECK" = TRUE ]; then make check | tee ../check-log_"$LFS_FILE".log; fi make install cd .. rm -rf "$LFS_FILE" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.11 ""$LFS_FILE""" >> build.log echo "$LFS_FILE" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.12 ""$LFS_READLINE""" >> build.log tar xf "$LFS_READLINE".tar.* cd "$LFS_READLINE" || exit sed -i '/MV.*old/d' Makefile.in sed -i '/{OLDSUFF}/c:' support/shlib-install ./configure --prefix=/usr \ --disable-static \ --with-curses \ --docdir=/usr/share/doc/readline-8.2.13 make SHLIB_LIBS="-lncursesw" make SHLIB_LIBS="-lncursesw" install install -v -m644 doc/*.{ps,pdf,html,dvi} /usr/share/doc/readline-8.2.13 cd .. rm -rf "$LFS_READLINE" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.12 ""$LFS_READLINE""" >> build.log echo "$LFS_READLINE" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.13 ""$LFS_M4""" >> build.log tar xf "$LFS_M4".tar.* cd "$LFS_M4" || exit ./configure --prefix=/usr make if [ "$MAKECHECK" = TRUE ]; then make check | tee ../check-log_"$LFS_M4".log; fi make install cd .. rm -rf "$LFS_M4" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.13 ""$LFS_M4""" >> build.log echo "$LFS_M4" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.14 ""$LFS_BC""" >> build.log tar xf "$LFS_BC".tar.* cd "$LFS_BC" || exit CC=gcc ./configure --prefix=/usr -G -O3 -r make if [ "$MAKECHECK" = TRUE ]; then make test | tee ../check-log_"$LFS_BC".log; fi make install cd .. rm -rf "$LFS_BC" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.14 ""$LFS_BC""" >> build.log echo "$LFS_BC" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.15 ""$LFS_FLEX""" >> build.log tar xf "$LFS_FLEX".tar.* cd "$LFS_FLEX" || exit ./configure --prefix=/usr \ --docdir=/usr/share/doc/flex-2.6.4 \ --disable-static make if [ "$MAKECHECK" = TRUE ]; then make check | tee ../check-log_"$LFS_FLEX".log; fi make install ln -sv flex /usr/bin/lex ln -sv flex.1 /usr/share/man/man1/lex.1 cd .. rm -rf "$LFS_FLEX" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.15 ""$LFS_FLEX""" >> build.log echo "$LFS_FLEX" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.16 ""$LFS_TCL""" >> build.log tar xf "$LFS_TCL"-src.tar.* cd "$LFS_TCL" || exit SRCDIR=$(pwd) cd unix || exit ./configure --prefix=/usr \ --mandir=/usr/share/man \ --disable-rpath make sed -e "s|$SRCDIR/unix|/usr/lib|" \ -e "s|$SRCDIR|/usr/include|" \ -i tclConfig.sh sed -e "s|$SRCDIR/unix/pkgs/tdbc1.1.7|/usr/lib/tdbc1.1.7|" \ -e "s|$SRCDIR/pkgs/tdbc1.1.7/generic|/usr/include|" \ -e "s|$SRCDIR/pkgs/tdbc1.1.7/library|/usr/lib/tcl8.6|" \ -e "s|$SRCDIR/pkgs/tdbc1.1.7|/usr/include|" \ -i pkgs/tdbc1.1.7/tdbcConfig.sh sed -e "s|$SRCDIR/unix/pkgs/itcl4.2.4|/usr/lib/itcl4.2.4|" \ -e "s|$SRCDIR/pkgs/itcl4.2.4/generic|/usr/include|" \ -e "s|$SRCDIR/pkgs/itcl4.2.4|/usr/include|" \ -i pkgs/itcl4.2.4/itclConfig.sh unset SRCDIR if [ "$MAKECHECK" = TRUE ]; then make test | tee ../../check-log_"$LFS_TCL".log; fi make install chmod -v u+w /usr/lib/libtcl8.6.so make install-private-headers ln -sfv tclsh8.6 /usr/bin/tclsh mv /usr/share/man/man3/{Thread,Tcl_Thread}.3 cd .. tar -xf ../tcl8.6.14-html.tar.* --strip-components=1 mkdir -v -p /usr/share/doc/tcl-8.6.14 cp -v -r ./html/* /usr/share/doc/tcl-8.6.14 cd .. rm -rf "$LFS_TCL" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.16 ""$LFS_TCL""" >> build.log echo "$LFS_TCL" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.17 ""$LFS_EXPECT""" >> build.log tar xf "$LFS_EXPECT".tar.* cd "$LFS_EXPECT" || exit patch -Np1 -i ../expect-5.45.4-gcc14-1.patch ./configure --prefix=/usr \ --with-tcl=/usr/lib \ --enable-shared \ --disable-rpath \ --mandir=/usr/share/man \ --with-tclinclude=/usr/include make if [ "$MAKECHECK" = TRUE ]; then make test | tee ../check-log_"$LFS_EXPECT".log; fi make install ln -svf expect5.45.4/libexpect5.45.4.so /usr/lib cd .. rm -rf "$LFS_EXPECT" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.17 ""$LFS_EXPECT""" >> build.log echo "$LFS_EXPECT" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.18 ""$LFS_DEJAGNU""" >> build.log tar xf "$LFS_DEJAGNU".tar.* cd "$LFS_DEJAGNU" || exit mkdir -v build cd build || exit ../configure --prefix=/usr makeinfo --html --no-split -o doc/dejagnu.html ../doc/dejagnu.texi makeinfo --plaintext -o doc/dejagnu.txt ../doc/dejagnu.texi if [ "$MAKECHECK" = TRUE ]; then make check | tee ../../check-log_"$LFS_DEJAGNU".log; fi make install install -v -dm755 /usr/share/doc/dejagnu-1.6.3 install -v -m644 doc/dejagnu.{html,txt} /usr/share/doc/dejagnu-1.6.3 cd ../.. rm -rf "$LFS_DEJAGNU" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.18 ""$LFS_DEJAGNU""" >> build.log echo "$LFS_DEJAGNU" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.19 ""$LFS_PKGCONF""" >> build.log tar xf "$LFS_PKGCONF".tar.* cd "$LFS_PKGCONF" || exit ./configure --prefix=/usr \ --disable-static \ --docdir=/usr/share/doc/pkgconf-2.3.0 make make install ln -sv pkgconf /usr/bin/pkg-config ln -sv pkgconf.1 /usr/share/man/man1/pkg-config.1 cd .. rm -rf "$LFS_PKGCONF" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.19 ""$LFS_PKGCONF""" >> build.log echo "$LFS_PKGCONF" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.20 ""$LFS_BINUTILS""" >> build.log tar xf "$LFS_BINUTILS".tar.* cd "$LFS_BINUTILS" || exit mkdir -v build cd build || exit ../configure --prefix=/usr \ --sysconfdir=/etc \ --enable-gold \ --enable-ld=default \ --enable-plugins \ --enable-shared \ --disable-werror \ --enable-64-bit-bfd \ --enable-new-dtags \ --with-system-zlib \ --enable-default-hash-style=gnu make tooldir=/usr if [ "$MAKECHECK" = TRUE ]; then make -k check | tee ../../check-log_"$LFS_BINUTILS".log; grep '^FAIL:' $(find -name '*.log') fi make tooldir=/usr install rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,gprofng,opcodes,sframe}.a cd ../.. rm -rf "$LFS_BINUTILS" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.20 ""$LFS_BINUTILS""" >> build.log echo "$LFS_BINUTILS" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.21 ""$LFS_GMP""" >> build.log tar xf "$LFS_GMP".tar.* cd "$LFS_GMP" || exit ./configure --prefix=/usr \ --enable-cxx \ --disable-static \ --docdir=/usr/share/doc/gmp-6.3.0 make make html if [ "$MAKECHECK" = TRUE ]; then make check 2>&1 | tee gmp-check-log; awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log cp gmp-check-log ../check-log_"$LFS_GMP".log fi make install make install-html cd .. rm -rf "$LFS_GMP" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.21 ""$LFS_GMP""" >> build.log echo "$LFS_GMP" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.22 ""$LFS_MPFR""" >> build.log tar xf "$LFS_MPFR".tar.* cd "$LFS_MPFR" || exit ./configure --prefix=/usr \ --disable-static \ --enable-thread-safe \ --docdir=/usr/share/doc/mpfr-4.2.1 make make html if [ "$MAKECHECK" = TRUE ]; then make check | tee ../check-log_"$LFS_MPFR".log; fi make install make install-html cd .. rm -rf "$LFS_MPFR" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.22 ""$LFS_MPFR""" >> build.log echo "$LFS_MPFR" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.23 ""$LFS_MPC""" >> build.log tar xf "$LFS_MPC".tar.* cd "$LFS_MPC" || exit ./configure --prefix=/usr \ --disable-static \ --docdir=/usr/share/doc/mpc-1.3.1 make make html if [ "$MAKECHECK" = TRUE ]; then make check | tee ../check-log_"$LFS_MPC".log; fi make install make install-html cd .. rm -rf "$LFS_MPC" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.23 ""$LFS_MPC""" >> build.log echo "$LFS_MPC" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.24 ""$LFS_ATTR""" >> build.log tar xf "$LFS_ATTR".tar.* cd "$LFS_ATTR" || exit ./configure --prefix=/usr \ --disable-static \ --sysconfdir=/etc \ --docdir=/usr/share/doc/attr-2.5.2 make if [ "$MAKECHECK" = TRUE ]; then make check | tee ../check-log_"$LFS_ATTR".log; fi make install cd .. rm -rf "$LFS_ATTR" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.24 ""$LFS_ATTR""" >> build.log echo "$LFS_ATTR" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.25 ""$LFS_ACL""" >> build.log tar xf "$LFS_ACL".tar.* cd "$LFS_ACL" || exit ./configure --prefix=/usr \ --disable-static \ --docdir=/usr/share/doc/acl-2.3.2 make make install cd .. rm -rf "$LFS_ACL" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.25 ""$LFS_ACL""" >> build.log echo "$LFS_ACL" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.26 ""$LFS_LIBCAP""" >> build.log tar xf "$LFS_LIBCAP".tar.* cd "$LFS_LIBCAP" || exit sed -i '/install -m.*STA/d' libcap/Makefile make prefix=/usr lib=lib if [ "$MAKECHECK" = TRUE ]; then make test | tee ../check-log_"$LFS_LIBCAP".log; fi make prefix=/usr lib=lib install cd .. rm -rf "$LFS_LIBCAP" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.26 ""$LFS_LIBCAP""" >> build.log echo "$LFS_LIBCAP" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.27 ""$LFS_LIBXCRYPT""" >> build.log tar xf "$LFS_LIBXCRYPT".tar.* cd "$LFS_LIBXCRYPT" || exit ./configure --prefix=/usr \ --enable-hashes=strong,glibc \ --enable-obsolete-api=no \ --disable-static \ --disable-failure-tokens make if [ "$MAKECHECK" = TRUE ]; then make check | tee ../check-log_"$LFS_LIBXCRYPT".log; fi make install cd .. rm -rf "$LFS_LIBXCRYPT" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.27 ""$LFS_LIBXCRYPT""" >> build.log echo "$LFS_LIBXCRYPT" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.28 ""$LFS_SHADOW""" >> build.log tar xf "$LFS_SHADOW".tar.* cd "$LFS_SHADOW" || exit sed -i 's/groups$(EXEEXT) //' src/Makefile.in find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \; find man -name Makefile.in -exec sed -i 's/getspnam\.3 / /' {} \; find man -name Makefile.in -exec sed -i 's/passwd\.5 / /' {} \; sed -e 's:#ENCRYPT_METHOD DES:ENCRYPT_METHOD YESCRYPT:' \ -e 's:/var/spool/mail:/var/mail:' \ -e '/PATH=/{s@/sbin:@@;s@/bin:@@}' \ -i etc/login.defs touch /usr/bin/passwd ./configure --sysconfdir=/etc \ --disable-static \ --with-{b,yes}crypt \ --without-libbsd \ --with-group-name-max-length=32 make make exec_prefix=/usr install make -C man install-man pwconv grpconv mkdir -p /etc/default useradd -D --gid 999 # sed -i '/MAIL/s/yes/no/' /etc/default/useradd echo root:root | chpasswd # Set the root password echo "The password for the user root has been set to 'root'" sleep 5 cd .. rm -rf "$LFS_SHADOW" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.28 ""$LFS_SHADOW""" >> build.log echo "$LFS_SHADOW" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.29 ""$LFS_GCC""" >> build.log tar xf "$LFS_GCC".tar.* cd "$LFS_GCC" || exit case $(uname -m) in x86_64) sed -e '/m64=/s/lib64/lib/' \ -i.orig gcc/config/i386/t-linux64 ;; esac mkdir -v build cd build || exit ../configure --prefix=/usr \ LD=ld \ --enable-languages=c,c++ \ --enable-default-pie \ --enable-default-ssp \ --enable-host-pie \ --disable-multilib \ --disable-bootstrap \ --disable-fixincludes \ --with-system-zlib make ulimit -s -H unlimited sed -e '/cpython/d' -i ../gcc/testsuite/gcc.dg/plugin/plugin.exp sed -e 's/no-pic /&-no-pie /' -i ../gcc/testsuite/gcc.target/i386/pr113689-1.c sed -e 's/300000/(1|300000)/' -i ../libgomp/testsuite/libgomp.c-c++-common/pr109062.c sed -e 's/{ target nonpic } //' \ -e '/GOTPCREL/d' -i ../gcc/testsuite/gcc.target/i386/fentryname3.c if [ "$MAKECHECK" = TRUE ]; then chown -Rv tester . su tester -c "PATH=$PATH make -k -j""$JOBS"" check"; ../contrib/test_summary | tee ../../check-log_"$LFS_GCC".log ../contrib/test_summary | grep -A7 Summ fi make install chown -v -R root:root \ /usr/lib/gcc/$(gcc -dumpmachine)/14.2.0/include{,-fixed} ln -svr /usr/bin/cpp /usr/lib ln -sv gcc.1 /usr/share/man/man1/cc.1 ln -sfv ../../libexec/gcc/$(gcc -dumpmachine)/14.2.0/liblto_plugin.so \ /usr/lib/bfd-plugins/ echo "Now that our final toolchain is in place, it is important to again ensure that compiling and linking will work as expected. We do this by performing some sanity checks" echo "There should be no errors, and the output of the last command will be (allowing for platform-specific differences in the dynamic linker name):" echo "[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]" echo 'int main(){}' > dummy.c cc dummy.c -v -Wl,--verbose &> dummy.log readelf -l a.out | grep ': /lib' echo "Now make sure that we're set up to use the correct start files" echo "The output should be:" echo "/usr/lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../lib/Scrt1.o succeeded" echo "/usr/lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../lib/crti.o succeeded" echo "/usr/lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../lib/crtn.o succeeded" grep -E -o '/usr/lib.*/S?crt[1in].*succeeded' dummy.log echo "Verify that the compiler is searching for the correct header files" echo "The output should be:" echo "#include <...> search starts here:" echo "/usr/lib/gcc/x86_64-pc-linux-gnu/14.2.0/include" echo "/usr/local/include" echo "/usr/lib/gcc/x86_64-pc-linux-gnu/14.2.0/include-fixed" echo "/usr/include" grep -B4 '^ /usr/include' dummy.log echo "Verify that the new linker is being used with the correct search paths" echo "References to paths that have components with '-linux-gnu' should be ignored, but otherwise the output should be:" echo 'SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib64")' echo 'SEARCH_DIR("/usr/local/lib64")' echo 'SEARCH_DIR("/lib64")' echo 'SEARCH_DIR("/usr/lib64")' echo 'SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib")' echo 'SEARCH_DIR("/usr/local/lib")' echo 'SEARCH_DIR("/lib")"' echo 'SEARCH_DIR("/usr/lib");' grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g' echo "Next make sure that we're using the correct libc" echo "The output should be:" echo "attempt to open /usr/lib/libc.so.6 succeeded" grep "/lib.*/libc.so.6 " dummy.log echo "Make sure LFS_GCC is using the correct dynamic linker" echo "The output should be (allowing for platform-specific differences in dynamic linker name):" echo "found ld-linux-x86-64.so.2 at /usr/lib/ld-linux-x86-64.so.2" grep found dummy.log sleep 5 rm -v dummy.c a.out dummy.log mkdir -pv /usr/share/gdb/auto-load/usr/lib mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib cd ../.. rm -rf "$LFS_GCC" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.29 ""$LFS_GCC""" >> build.log echo "$LFS_GCC" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.30 ""$LFS_NCURSES""" >> build.log tar xf "$LFS_NCURSES".tar.* cd "$LFS_NCURSES" || exit ./configure --prefix=/usr \ --mandir=/usr/share/man \ --with-shared \ --without-debug \ --without-normal \ --with-cxx-shared \ --enable-pc-files \ --with-pkg-config-libdir=/usr/lib/pkgconfig make make DESTDIR=$PWD/dest install install -vm755 dest/usr/lib/libncursesw.so.6.5 /usr/lib rm -v dest/usr/lib/libncursesw.so.6.5 sed -e 's/^#if.*XOPEN.*$/#if 1/' \ -i dest/usr/include/curses.h cp -av dest/* / for lib in ncurses form panel menu ; do ln -sfv lib${lib}w.so /usr/lib/lib${lib}.so ln -sfv ${lib}w.pc /usr/lib/pkgconfig/${lib}.pc done ln -sfv libncursesw.so /usr/lib/libcurses.so cp -v -R doc -T /usr/share/doc/ncurses-6.5 cd .. rm -rf "$LFS_NCURSES" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.30 ""$LFS_NCURSES""" >> build.log echo "$LFS_NCURSES" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.31 ""$LFS_SED""" >> build.log tar xf "$LFS_SED".tar.* cd "$LFS_SED" || exit ./configure --prefix=/usr make make html if [ "$MAKECHECK" = TRUE ]; then chown -Rv tester . su tester -c "PATH=$PATH make check" | tee ../check-log_"$LFS_SED".log; fi make install install -d -m755 /usr/share/doc/sed-4.9 install -m644 doc/sed.html /usr/share/doc/sed-4.9 cd .. rm -rf "$LFS_SED" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.31 ""$LFS_SED""" >> build.log echo "$LFS_SED" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.32 ""$LFS_PSMISC""" >> build.log tar xf "$LFS_PSMISC".tar.* cd "$LFS_PSMISC" || exit ./configure --prefix=/usr make if [ "$MAKECHECK" = TRUE ]; then make check | tee ../check-log_"$LFS_PSMISC".log; fi make install cd .. rm -rf "$LFS_PSMISC" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.32 ""$LFS_PSMISC""" >> build.log echo "$LFS_PSMISC" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.33 ""$LFS_GETTEXT""" >> build.log tar xf "$LFS_GETTEXT".tar.* cd "$LFS_GETTEXT" || exit ./configure --prefix=/usr \ --disable-static \ --docdir=/usr/share/doc/gettext-0.22.5 make if [ "$MAKECHECK" = TRUE ]; then make check | tee ../check-log_"$LFS_GETTEXT".log; fi make install chmod -v 0755 /usr/lib/preloadable_libintl.so cd .. rm -rf "$LFS_GETTEXT" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.33 ""$LFS_GETTEXT""" >> build.log echo "$LFS_GETTEXT" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.34 ""$LFS_BISON""" >> build.log tar xf "$LFS_BISON".tar.* cd "$LFS_BISON" || exit ./configure --prefix=/usr --docdir=/usr/share/doc/bison-3.8.2 make if [ "$MAKECHECK" = TRUE ]; then make check | tee ../check-log_"$LFS_BISON".log; fi make install cd .. rm -rf "$LFS_BISON" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.34 ""$LFS_BISON""" >> build.log echo "$LFS_BISON" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.35 ""$LFS_GREP""" >> build.log tar xf "$LFS_GREP".tar.* cd "$LFS_GREP" || exit sed -i "s/echo/#echo/" src/egrep.sh ./configure --prefix=/usr make if [ "$MAKECHECK" = TRUE ]; then make check | tee ../check-log_"$LFS_GREP".log; fi make install cd .. rm -rf "$LFS_GREP" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.35 ""$LFS_GREP""" >> build.log echo "$LFS_GREP" >> /installed.txt CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Starting 8.36 ""$LFS_BASH""" >> build.log tar xf "$LFS_BASH".tar.* cd "$LFS_BASH" || exit ./configure --prefix=/usr \ --without-bash-malloc \ --with-installed-readline \ bash_cv_strtold_broken=no \ --docdir=/usr/share/doc/bash-5.2.32 make if [ "$MAKECHECK" = TRUE ]; then chown -Rv tester . su -s /usr/bin/expect tester << EOF | tee ../check-log_"$LFS_BASH".log; set timeout -1 spawn make tests expect eof lassign [wait] _ _ _ value exit $value EOF fi make install cd .. rm -rf "$LFS_BASH" CURRENT_DATE_TIME=$(date +"%Y-%m-%d %T") echo "$CURRENT_DATE_TIME: Finished 8.36 ""$LFS_BASH""" >> build.log echo "$LFS_BASH" >> /installed.txt echo "Executing new bash, continue with chapter 8 p2:" echo "bash chap8p2.sh" exec /usr/bin/bash --login