diff --git a/.gitignore b/.gitignore index f2a347215..9595dd32f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ lfs-bootscripts-*.tar.xz +lfs-*.tar.xz conditional.ent version.ent appendices/*.script diff --git a/Makefile b/Makefile index 13d0f52a8..1c23a55f5 100644 --- a/Makefile +++ b/Makefile @@ -209,5 +209,14 @@ dump-commands: validate all: book nochunks pdf dump-commands -.PHONY : all book dump-commands nochunks pdf profile-html tmpdir validate md5sums wget-list version +dist: + $(Q)DIST=/tmp/LFS-RELEASE ./git-version.sh $(REV) + $(Q)rm -f lfs-$$(&dependencies; Bash, Binutils, Coreutils, Diffutils, File, Flex, Gawk, GCC, - Glibc, Grep, Make, Perl, Sed, Texinfo, and Zlib + Glibc, Grep, Make, Perl, Pkgconf, Sed, Texinfo, Zlib, and + Zstd &runtime; - Glibc and Zlib + Glibc, Zlib, and Zstd @@ -437,6 +438,9 @@ libsubunit + and + + patchutils @@ -2515,7 +2519,8 @@ &before; - D-Bus, E2fsprogs, + Binutils, + D-Bus, E2fsprogs, IProute2, Kmod, Man-DB, Procps-ng, Python, &systemd-udev;, and Util-linux @@ -2567,7 +2572,7 @@ None - elogind + elogind @@ -3393,7 +3398,7 @@ &before; - GCC, Libelf, and &systemd-udev; + Binutils, GCC, Libelf, and &systemd-udev; diff --git a/bootscripts/lfs/init.d/checkfs b/bootscripts/lfs/init.d/checkfs index 0903a0111..bbbae8d99 100644 --- a/bootscripts/lfs/init.d/checkfs +++ b/bootscripts/lfs/init.d/checkfs @@ -101,7 +101,7 @@ case "${1}" in if [ "${error_value}" = 2 -o "${error_value}" = 3 ]; then msg="\nWARNING:\n\nFile system errors " - msg="${msg}were found and have been been " + msg="${msg}were found and have been " msg="${msg}corrected, but the nature of the " msg="${msg}errors require this system to be rebooted.\n\n" msg="${msg}After you press enter, " diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index c3e6b7640..ca85137f6 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,6 +40,160 @@ appropriate for the entry or if needed the entire day's listitem. --> + + 2023-09-17 + + + [xry111] - Update to linux-6.5.3. Fixes + #5343. + + + [xry111] - Update to iana-etc-20230912. Addresses + #5006. + + + [xry111] - Update to iproute2-6.5.0. Fixes + #5342. + + + + + + 2023-09-13 + + + [xry111] - Fix CVE-2023-4806 for Glibc-2.38. Fixes + #5347. + + + + + + 2023-09-12 + + + [xry111] - Fix CVE-2023-4527 for Glibc-2.38. Fixes + #5346. + + + + + + 2023-09-07 + + + [xry111] - Fix an issue in pkgconf-2.0.3 causing + BLFS packages fail to build. Fixes + #5341. + + + + + + 2023-09-05 + + + [xry111] - Move pkgconf before binutils for binutils + building system to detect zstd properly. Fixes + #5340. + + + [xry111] - Update to linux-6.5.1. Fixes + #5332. + + + [xry111] - Update to pkgconf-2.0.3. Fixes + #5339. + + + [xry111] - Update to dbus-1.14.10. Fixes + #5337. + + + + + + 2023-09-04 + + + [bdubbs] - Move caution regarding building by mixing + different version of LFS to General Compilation Instructions. Fixes + #5338. + + + + + + 2023-09-02 + + + [xry111] - Add --no-cache-dir option for pip3 wheel + commands. Addresses + BLFS #18466. + + + [bdubbs] - Update to vim-9.0.1837. Addresses + #4500. + + + [bdubbs] - Update to zlib-1.3. Fixes + #5324. + + + [bdubbs] - Update to wheel-0.41.2 (Python Module). Fixes + #5328. + + + [bdubbs] - Update to util-linux-2.39.2. Fixes + #5322. + + + [bdubbs] - Update to sysvinit-3.08. Fixes + #5321. + + + [bdubbs] - Update to shadow-4.14.0. Fixes + #5319. + + + [bdubbs] - Update to Python-3.11.5. Fixes + #5330. + + + [bdubbs] - Update to procps-ng-4.0.4. Fixes + #5335. + + + [bdubbs] - Update to pkgconf-2.0.2. Fixes + #5323. + + + [bdubbs] - Update to mpfr-4.2.1. Fixes + #5326. + + + [bdubbs] - Update to kbd-2.6.2. Fixes + #5318. + + + [bdubbs] - Update to gzip-1.13. Fixes + #5325. + + + [bdubbs] - Update to coreutils-9.4. Fixes + #5334. + + + [bdubbs] - Specify the 'nobody-group' for systemd. Fixes + #5333. + + + [bdubbs] - Remove unused usb group. Fixes + #5331. + + + + 2023-09-01 diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml index 3b9d5fd1e..e1fca225c 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -11,36 +11,9 @@ What's new since the last release - + - + - + - @@ -149,11 +119,11 @@ Perhaps a new page - somthing like 'Upgrading an Existing LFS System'. - + - + @@ -194,9 +164,9 @@ Perhaps a new page - somthing like 'Upgrading an Existing LFS System'. - + @@ -218,9 +188,9 @@ Perhaps a new page - somthing like 'Upgrading an Existing LFS System'. - + @@ -233,39 +203,39 @@ Perhaps a new page - somthing like 'Upgrading an Existing LFS System'. - + - + - + - + - + @@ -278,24 +248,27 @@ Perhaps a new page - somthing like 'Upgrading an Existing LFS System'. - - - - - + @@ -314,35 +287,20 @@ Perhaps a new page - somthing like 'Upgrading an Existing LFS System'. Added: - + + &glibc-upstream-fixes-patch; + - - - Removed: - diff --git a/chapter02/hostreqs.xml b/chapter02/hostreqs.xml index 291eaace4..4de903e3a 100644 --- a/chapter02/hostreqs.xml +++ b/chapter02/hostreqs.xml @@ -184,7 +184,7 @@ To see whether your host system has all the appropriate versions, and the ability to compile programs, run the following commands: -cat > version-check.sh << "EOF" +cat > version-check.sh << "EOF" #!/bin/bash # A script to list version numbers of critical development tools diff --git a/chapter03/patches.xml b/chapter03/patches.xml index e11974335..6d3717fc2 100644 --- a/chapter03/patches.xml +++ b/chapter03/patches.xml @@ -86,10 +86,10 @@ - Glibc Memalign Patch - &glibc-memalign-patch-size;: + Glibc Upstream Fixes Patch - &glibc-upstream-fixes-patch-size;: - Download: - MD5 sum: &glibc-memalign-patch-md5; + Download: + MD5 sum: &glibc-upstream-fixes-patch-md5; diff --git a/chapter05/libstdc++.xml b/chapter05/libstdc++.xml index e0ea2e790..1dc4277ee 100644 --- a/chapter05/libstdc++.xml +++ b/chapter05/libstdc++.xml @@ -124,7 +124,7 @@ cd build Remove the libtool archive files because they are harmful for cross-compilation: -rm -v $LFS/usr/lib/lib{stdc++,stdc++fs,supc++}.la +rm -v $LFS/usr/lib/lib{stdc++{,exp,fs},supc++}.la diff --git a/chapter06/binutils-pass2.xml b/chapter06/binutils-pass2.xml index 7b0f1fc20..983aaee2f 100644 --- a/chapter06/binutils-pass2.xml +++ b/chapter06/binutils-pass2.xml @@ -43,11 +43,17 @@ Installation of Binutils - - Binutils ships an outdated copy of libtool in the tarball. It lacks - sysroot support, so the produced binaries will be mistakenly linked to - libraries from the host distro. Work around this issue: + + Binutils building system relies on an shipped libtool copy to link against + internal static libraries, but the libiberty and zlib copies shipped + in the package do not use libtool. This inconsistency may cause + produced binaries mistakenly linked against libraries from the host + distro. Work around this issue: sed '6009s/$add_dir//' -i ltmain.sh diff --git a/chapter06/coreutils.xml b/chapter06/coreutils.xml index d3afe3918..185f4a0c4 100644 --- a/chapter06/coreutils.xml +++ b/chapter06/coreutils.xml @@ -43,17 +43,13 @@ Installation of Coreutils - Prepare Coreutils for compilation: ./configure --prefix=/usr \ --host=$LFS_TGT \ --build=$(build-aux/config.guess) \ --enable-install-program=hostname \ - --enable-no-install-program=kill,uptime \ - gl_cv_macro_MB_CUR_MAX_good=y + --enable-no-install-program=kill,uptime The meaning of the configure options: diff --git a/chapter07/createfiles.xml b/chapter07/createfiles.xml index 2434a6b17..2b752b944 100644 --- a/chapter07/createfiles.xml +++ b/chapter07/createfiles.xml @@ -107,7 +107,6 @@ dialout:x:10: audio:x:11: video:x:12: utmp:x:13: -usb:x:14: cdrom:x:15: adm:x:16: messagebus:x:18: @@ -135,7 +134,6 @@ dialout:x:10: audio:x:11: video:x:12: utmp:x:13: -usb:x:14: cdrom:x:15: adm:x:16: messagebus:x:18: diff --git a/chapter07/kernfs.xml b/chapter07/kernfs.xml index b5b0762bb..4757b257d 100644 --- a/chapter07/kernfs.xml +++ b/chapter07/kernfs.xml @@ -109,7 +109,7 @@ mount -vt tmpfs tmpfs $LFS/run if [ -h $LFS/dev/shm ]; then mkdir -pv $LFS/$(readlink $LFS/dev/shm) else - mount -t tmpfs -o nosuid,nodev tmpfs $LFS/dev/shm + mount -vt tmpfs -o nosuid,nodev tmpfs $LFS/dev/shm fi diff --git a/chapter07/perl.xml b/chapter07/perl.xml index ac0407087..c8e3d7c98 100644 --- a/chapter07/perl.xml +++ b/chapter07/perl.xml @@ -57,7 +57,8 @@ -Dvendorarch=/usr/lib/perl5/&perl-version-min;/vendor_perl - The meaning of the new Configure options: + The meaning of the Configure options: + -des @@ -67,6 +68,35 @@ + + -Dvendorprefix=/usr + + This ensures perl knows how to + tell packages where they should install their Perl modules. + + + + + -Duseshrplib + + Build libperl + needed by some Perl modules as a shared library, instead of + a static library. + + + + + -Dprivlib,-Darchlib,-Dsitelib,... + + These settings define where Perl looks for installed + modules. The LFS editors chose to put them in a directory structure + based on the MAJOR.MINOR version of Perl (&perl-version-min;) which + allows upgrading Perl to newer patch levels (the patch level is + the last dot separated part in the full version string like + &perl-version;) without reinstalling all of the modules. + + + Compile the package: diff --git a/chapter08/autoconf.xml b/chapter08/autoconf.xml index 7925e44ea..38375665f 100644 --- a/chapter08/autoconf.xml +++ b/chapter08/autoconf.xml @@ -153,7 +153,7 @@ Helps to create a configure.in file for a software package; it examines the source files in a directory tree, searching them for common portability issues, and creates a - configure.scan file that serves as as a + configure.scan file that serves as a preliminary configure.in file for the package diff --git a/chapter08/chapter08.xml b/chapter08/chapter08.xml index 3f356d39e..8ab81d2f8 100644 --- a/chapter08/chapter08.xml +++ b/chapter08/chapter08.xml @@ -29,6 +29,7 @@ + @@ -39,7 +40,6 @@ - diff --git a/chapter08/flit-core.xml b/chapter08/flit-core.xml index 641ff73b7..661a02684 100644 --- a/chapter08/flit-core.xml +++ b/chapter08/flit-core.xml @@ -42,7 +42,7 @@ Build the package: -pip3 wheel -w dist --no-build-isolation --no-deps $PWD +pip3 wheel -w dist --no-cache-dir --no-build-isolation --no-deps $PWD Install the package: @@ -66,6 +66,15 @@ + + --no-cache-dir + + Prevents pip from copying the created wheel into the + /root/.cache/pip + directory. + + + install diff --git a/chapter08/glibc.xml b/chapter08/glibc.xml index 3932a2147..cf1a4bd59 100644 --- a/chapter08/glibc.xml +++ b/chapter08/glibc.xml @@ -50,10 +50,10 @@ patch -Np1 -i ../&glibc-fhs-patch; - Now fix a regression causing the posix_memalign() function - to be very slow in some conditions: + Now fix two security vulnerabilities and a regression causing the + posix_memalign() function very slow in some conditions: -patch -Np1 -i ../&glibc-memalign-patch; +patch -Np1 -i ../&glibc-upstream-fixes-patch; The Glibc documentation recommends building Glibc in a dedicated build directory: @@ -320,7 +320,7 @@ localedef -i ja_JP -f SHIFT_JIS ja_JP.SJIS 2> /dev/null || trueCreate a new file /etc/nsswitch.conf by running the following: -cat > /etc/nsswitch.conf << "EOF" +cat > /etc/nsswitch.conf << "EOF" # Begin /etc/nsswitch.conf passwd: files @@ -335,6 +335,24 @@ services: files ethers: files rpc: files +# End /etc/nsswitch.conf +EOF + +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 diff --git a/chapter08/gmp.xml b/chapter08/gmp.xml index de3f0ee8b..c2fd316f8 100644 --- a/chapter08/gmp.xml +++ b/chapter08/gmp.xml @@ -128,7 +128,7 @@ make install-html Contents of GMP - Installed Libraries + Installed libraries Installed directory diff --git a/chapter08/jinja2.xml b/chapter08/jinja2.xml index ca614ecdc..59a01e26c 100644 --- a/chapter08/jinja2.xml +++ b/chapter08/jinja2.xml @@ -42,7 +42,7 @@ Build the package: -pip3 wheel -w dist --no-build-isolation --no-deps $PWD +pip3 wheel -w dist --no-cache-dir --no-build-isolation --no-deps $PWD Install the package: diff --git a/chapter08/libelf.xml b/chapter08/libelf.xml index dd3642857..6a36be026 100644 --- a/chapter08/libelf.xml +++ b/chapter08/libelf.xml @@ -75,8 +75,8 @@ rm /usr/lib/libelf.a Contents of Libelf - Installed Library - Installed Directory + Installed library + Installed directory diff --git a/chapter08/markupsafe.xml b/chapter08/markupsafe.xml index b4a0cbc58..c09b9a64c 100644 --- a/chapter08/markupsafe.xml +++ b/chapter08/markupsafe.xml @@ -42,7 +42,7 @@ Compile MarkupSafe with the following command: -pip3 wheel -w dist --no-build-isolation --no-deps $PWD +pip3 wheel -w dist --no-cache-dir --no-build-isolation --no-deps $PWD This package does not come with a test suite. diff --git a/chapter08/meson.xml b/chapter08/meson.xml index a53a88c3c..8cf308237 100644 --- a/chapter08/meson.xml +++ b/chapter08/meson.xml @@ -46,7 +46,7 @@ --> Compile Meson with the following command: -pip3 wheel -w dist --no-build-isolation --no-deps $PWD +pip3 wheel -w dist --no-cache-dir --no-build-isolation --no-deps $PWD The test suite requires some packages outside the scope of LFS. diff --git a/chapter08/mpc.xml b/chapter08/mpc.xml index ad46b7e43..941ee041c 100644 --- a/chapter08/mpc.xml +++ b/chapter08/mpc.xml @@ -69,8 +69,8 @@ make install-html Contents of MPC - Installed Libraries - Installed Directory + Installed libraries + Installed directory libmpc.so diff --git a/chapter08/mpfr.xml b/chapter08/mpfr.xml index 2d16053de..cba4a64aa 100644 --- a/chapter08/mpfr.xml +++ b/chapter08/mpfr.xml @@ -41,20 +41,6 @@ Installation of MPFR - - Fix a test case based on a bug of old Glibc releases: - -sed -e 's/+01,234,567/+1,234,567 /' \ - -e 's/13.10Pd/13Pd/' \ - -i tests/tsprintf.c - Prepare MPFR for compilation: ./configure --prefix=/usr \ @@ -72,7 +58,7 @@ make html Do not skip it under any circumstances. - Test the results and ensure that all 197 tests passed: + Test the results and ensure that all 198 tests passed: make check @@ -88,7 +74,7 @@ make install-html Contents of MPFR - Installed Libraries + Installed libraries Installed directory diff --git a/chapter08/openssl.xml b/chapter08/openssl.xml index 704c6dec4..83e54b4fb 100644 --- a/chapter08/openssl.xml +++ b/chapter08/openssl.xml @@ -102,21 +102,6 @@ make MANSUFFIX=ssl install number. - - - If OpenSSH is installed, it will be an - exception of the general rule above. It contains an - over-restrictive OpenSSL version check, so both SSH client and SSH - server will refuse to start if OpenSSL - is updated with MAJOR version number unchanged but MINOR version - number changed. You need to rebuild - OpenSSH after such an upgrade. - If OpenSSH is being - used to access the system, you must rebuild and reinstall it - after upgrading OpenSSL to a new MINOR version number before logout - or you won't be able to login via SSH anymore. - - However, any running programs linked to those libraries need to be stopped and restarted. Read the related entries in diff --git a/chapter08/perl.xml b/chapter08/perl.xml index b56e0e5e2..d3159595c 100644 --- a/chapter08/perl.xml +++ b/chapter08/perl.xml @@ -76,15 +76,7 @@ export BUILD_BZIP2=0 -Dusethreads - The meaning of the configure options: - - - -Dvendorprefix=/usr - - This ensures perl knows how to - tell packages where they should install their Perl modules. - - + The meaning of the new Configure options: -Dpager="/usr/bin/less -isR" @@ -104,13 +96,6 @@ export BUILD_BZIP2=0 - - -Duseshrplib - - Build a shared libperl needed by some Perl modules. - - - -Dusethreads @@ -118,18 +103,6 @@ export BUILD_BZIP2=0 - - -Dprivlib,-Darchlib,-Dsitelib,... - - These settings define where Perl looks for installed - modules. The LFS editors chose to put them in a directory structure - based on the MAJOR.MINOR version of Perl (&perl-version-min;) which - allows upgrading Perl to newer patch levels (the patch level is - the last dot separated part in the full version string like - &perl-version;) without reinstalling all of the modules. - - - Compile the package: diff --git a/chapter08/pkgconf.xml b/chapter08/pkgconf.xml index fd61b4d40..b95d7ab2c 100644 --- a/chapter08/pkgconf.xml +++ b/chapter08/pkgconf.xml @@ -43,15 +43,12 @@ Installation of Pkgconf - + + Fix a regression in pkgconf-2.0.3 breaking BLFS packages: + + sed -i 's/str\(cmp.*package\)/strn\1, strlen(pkg->why)/' cli/main.c + Prepare Pkgconf for compilation: ./configure --prefix=/usr \ diff --git a/chapter08/procps.xml b/chapter08/procps.xml index 20a6be096..7fc74f587 100644 --- a/chapter08/procps.xml +++ b/chapter08/procps.xml @@ -67,18 +67,9 @@ Compile the package: -make - To run the test suite, run: make check diff --git a/chapter08/python.xml b/chapter08/python.xml index 1ac1b538a..a4bfeaf91 100644 --- a/chapter08/python.xml +++ b/chapter08/python.xml @@ -191,9 +191,9 @@ tar --strip-components=1 \ Contents of Python 3 - Installed Programs - Installed Library - Installed Directories + Installed programs + Installed library + Installed directories diff --git a/chapter08/shadow.xml b/chapter08/shadow.xml index 0f34d70ac..f88216a5b 100644 --- a/chapter08/shadow.xml +++ b/chapter08/shadow.xml @@ -107,6 +107,7 @@ find man -name Makefile.in -exec sed -i 's/passwd\.5 / /' {} \; @@ -144,6 +145,14 @@ find man -name Makefile.in -exec sed -i 's/passwd\.5 / /' {} \; + + --without-libbsd + + Do not use the readpassphrase function from libbsd which + is not in LFS. Use the internal copy instead. + + + Compile the package: diff --git a/chapter08/stripping.xml b/chapter08/stripping.xml index effbe3724..e067318fd 100644 --- a/chapter08/stripping.xml +++ b/chapter08/stripping.xml @@ -29,9 +29,12 @@ needed by the linker (for static libraries) or dynamic linker (for dynamically linked binaries and shared libraries). - The debugging symbols from selected libraries are preserved - in separate files. That debugging information is needed to run - regression tests with + The debugging symbols from selected libraries are compressed with + Zlib and preserved in separate files. That + debugging information is needed to run regression tests with valgrind or gdb later, in BLFS. @@ -78,7 +81,7 @@ cd /usr/lib for LIB in $save_usrlib; do - objcopy --only-keep-debug $LIB $LIB.dbg + objcopy --only-keep-debug --compress-debug-sections=zlib $LIB $LIB.dbg cp $LIB /tmp/$LIB strip --strip-unneeded /tmp/$LIB objcopy --add-gnu-debuglink=$LIB.dbg /tmp/$LIB @@ -94,6 +97,7 @@ online_usrlib="libbfd-&binutils-version;.so libm.so.6 libreadline.so.&readline-soversion; libz.so.&zlib-version; + libzstd.so.&zstd-version; $(cd /usr/lib; find libnss*.so* -type f)" for BIN in $online_usrbin; do diff --git a/chapter08/systemd.xml b/chapter08/systemd.xml index d0eea82dc..f14bc6c72 100644 --- a/chapter08/systemd.xml +++ b/chapter08/systemd.xml @@ -69,6 +69,7 @@ meson setup \ -Dmode=release \ -Dpamconfdir=no \ -Ddev-kvm-mode=0660 \ + -Dnobody-group=nogroup \ -Ddocdir=/usr/share/doc/systemd-&systemd-version; \ .. @@ -179,6 +180,14 @@ meson setup \ consider it dangerous. This option overrides it. + + + -Dnobody-group=nogroup + + Tell the package the group name with GID 65534 is + nogroup. + + Compile the package: diff --git a/chapter08/util-linux.xml b/chapter08/util-linux.xml index fac66fe06..49e195b3f 100644 --- a/chapter08/util-linux.xml +++ b/chapter08/util-linux.xml @@ -42,7 +42,7 @@ Installation of Util-linux - First, disable a problem test: + First, disable a problematic test: sed -i '/test_mkfds/s/^/#/' tests/helpers/Makemodule.am @@ -1224,7 +1224,8 @@ su tester -c "make -k check" Creates new UUIDs. Each new UUID is a random number likely to be unique among all UUIDs created, on the local system and on other systems, in the past and in the future, with extremely high - probability (~340 trillion trillion trillion unique UUIDs are possible) + probability (2128 UUIDs are + possible) uuidgen diff --git a/chapter08/wheel.xml b/chapter08/wheel.xml index 88e47d556..0f3a1c99e 100644 --- a/chapter08/wheel.xml +++ b/chapter08/wheel.xml @@ -42,7 +42,7 @@ Compile Wheel with the following command: -pip3 wheel -w dist --no-build-isolation --no-deps $PWD +pip3 wheel -w dist --no-cache-dir --no-build-isolation --no-deps $PWD Install Wheel with the following command: diff --git a/chapter09/network.xml b/chapter09/network.xml index c86edf56a..541ece699 100644 --- a/chapter09/network.xml +++ b/chapter09/network.xml @@ -178,9 +178,10 @@ EOF /etc/hosts - Decide on the IP address, fully-qualified domain name (FQDN), and - possible aliases for use in the /etc/hosts file. The - syntax is: + Decide on a fully-qualified domain name (FQDN), and possible aliases + for use in the /etc/hosts file. If using static IP + addresses, you'll also need to decide on an IP address. The syntax + for a hosts file entry is: IP_address myhost.example.org aliases @@ -197,11 +198,18 @@ EOF x can be any number in the range 16-31. y can be any number in the range 0-255. - A valid private IP address could be 192.168.1.1. A valid FQDN for - this IP could be lfs.example.org. + A valid private IP address could be 192.168.1.1. - Even if not using a network card, a valid FQDN is still required. - This is necessary for certain programs to operate correctly. + If the computer is to be visible to the Internet, a valid FQDN + can be the domain name itself, or a string resulted by concatenating a + prefix (often the hostname) and the domain name with a . + character. And, you need to contact the domain provider to resolve the + FQDN to your public IP address. + + Even if the computer is not visible to the Internet, a FQDN is + still needed for certain programs, such as MTAs, to operate properly. + A special FQDN, localhost.localdomain, can be used + for this purpose. Create the /etc/hosts file by running: diff --git a/chapter09/networkd.xml b/chapter09/networkd.xml index 43b7e7172..27f15e815 100644 --- a/chapter09/networkd.xml +++ b/chapter09/networkd.xml @@ -316,27 +316,18 @@ EOF x can be any number in the range 16-31. y can be any number in the range 0-255. - A valid private IP address could be 192.168.1.1. A valid FQDN for - this IP could be lfs.example.org. + A valid private IP address could be 192.168.1.1. - Even if not using a network card, a valid FQDN is still required. - This is necessary for certain programs, such as MTAs, to operate properly. + If the computer is to be visible to the Internet, a valid FQDN + can be the domain name itself, or a string resulted by concatenating a + prefix (often the hostname) and the domain name with a . + character. And, you need to contact the domain provider to resolve the + FQDN to your public IP address. - + Even if the computer is not visible to the Internet, a FQDN is + still needed for certain programs, such as MTAs, to operate properly. + A special FQDN, localhost.localdomain, can be used + for this purpose. Create the /etc/hosts file using the following command: @@ -344,28 +335,32 @@ EOF cat > /etc/hosts << "EOF" # Begin /etc/hosts -127.0.0.1 localhost.localdomain localhost -127.0.1.1 <FQDN> <HOSTNAME> -<192.168.0.2> <FQDN> <HOSTNAME> [alias1] [alias2] ... -::1 localhost ip6-localhost ip6-loopback +<192.168.0.2> <FQDN> [alias1] [alias2] ... +::1 ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters # End /etc/hosts EOF - The <192.168.0.2>, - <FQDN>, and - <HOSTNAME> values need to be + The <192.168.0.2> and + <FQDN> values need to be changed for specific uses or requirements (if assigned an IP address by a network/system administrator and the machine will be connected to an existing network). The optional alias name(s) can be omitted, and the <192.168.0.2> line can be omitted if you - are using a connection configured with DHCP or IPv6 Autoconfiguration. + are using a connection configured with DHCP or IPv6 Autoconfiguration, + or using localhost.localdomain as the FQDN. + + The /etc/hostname does not contain entries + for localhost, + localhost.localdomain, or the hostname (without a + domain) because they are handled by the + myhostname NSS module, read + the man page nss-myhostname(8) for details. The ::1 entry is the IPv6 counterpart of 127.0.0.1 and represents - the IPv6 loopback interface. 127.0.1.1 is a loopback entry reserved - specifically for the FQDN. + the IPv6 loopback interface. diff --git a/chapter10/kernel.xml b/chapter10/kernel.xml index 51c1d2cce..d326bd849 100644 --- a/chapter10/kernel.xml +++ b/chapter10/kernel.xml @@ -122,6 +122,7 @@ + A good starting place for setting up the kernel configuration is to run make defconfig. This will set the base configuration to a good state that takes your current system architecture diff --git a/chapter11/reboot.xml b/chapter11/reboot.xml index 6b2680ad0..90f7839b8 100644 --- a/chapter11/reboot.xml +++ b/chapter11/reboot.xml @@ -113,7 +113,7 @@ Then unmount the virtual file systems: umount -v $LFS/dev/pts -mountpoint -q $LFS/dev/shm && umount $LFS/dev/shm +mountpoint -q $LFS/dev/shm && umount -v $LFS/dev/shm umount -v $LFS/dev umount -v $LFS/run umount -v $LFS/proc diff --git a/chapter11/theend.xml b/chapter11/theend.xml index 6f5e7e401..e7bfc6ef8 100644 --- a/chapter11/theend.xml +++ b/chapter11/theend.xml @@ -58,6 +58,7 @@ VERSION="&version;" ID=lfs PRETTY_NAME="Linux From Scratch &version;" VERSION_CODENAME="<your name here>" +HOME_URL="&lfs-root;lfs/" EOF Be sure to customize the fields 'DISTRIB_CODENAME' and diff --git a/general.ent b/general.ent index 53f3c4ee7..945219bf6 100644 --- a/general.ent +++ b/general.ent @@ -101,6 +101,7 @@ --> + diff --git a/git-version.sh b/git-version.sh index 396add872..a9a87737a 100755 --- a/git-version.sh +++ b/git-version.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash if [ "$1" = sysv ]; then SYSV="INCLUDE" @@ -14,6 +14,10 @@ fi echo "" > conditional.ent echo "" >> conditional.ent +if [ -e LFS-RELEASE ]; then + exit 0 +fi + if ! git status > /dev/null; then # Either it's not a git repository, or git is unavaliable. # Just workaround. @@ -24,7 +28,7 @@ if ! git status > /dev/null; then echo "" >> version.ent echo "]]>" >> version.ent echo "" >> version.ent - echo "" >> version.ent + echo "" >> version.ent exit 0 fi @@ -65,3 +69,5 @@ echo "" >> version.ent echo "]]>" >> version.ent echo "" >> version.ent echo "" >> version.ent + +[ -z "$DIST" ] || echo $version > "$DIST" diff --git a/lfs-latest.php b/lfs-latest.php deleted file mode 100644 index 3a4df9243..000000000 --- a/lfs-latest.php +++ /dev/null @@ -1,481 +0,0 @@ -#! /usr/bin/php - 80 - list( $major, $minor, $rest ) = explode( ".", $slice . ".0" ); - if ( $minor % 2 == 1 ) continue; - if ( $minor > 80 ) continue; - array_push( $a, $slice ); - } - - rsort( $a, SORT_NATURAL ); // Max version is at the top - return ( isset( $a[0] ) ) ? $a[0] : -2; -} - -function http_get_file( $url ) -{ - if ( ! preg_match( "/sourceforge/", $url ) && - ! preg_match( "/psmisc/", $url ) ) - { - exec( "curl --location --silent --max-time 30 $url", $dir ); - - $s = implode( "\n", $dir ); - $dir = strip_tags( $s ); - return explode( "\n", $dir ); - } - else - { - exec( "links -dump $url 2>/dev/null", $lines ); - return $lines; - } -} - -function max_parent( $dirpath, $prefix ) -{ - // First, remove a directory - $dirpath = rtrim ( $dirpath, "/" ); // Trim any trailing slash - $position = strrpos( $dirpath, "/" ); - $dirpath = substr ( $dirpath, 0, $position ); - - $lines = http_get_file( $dirpath ); - - $regex_match = "#${prefix}[\d\.]+/#"; - $regex_replace = "#^.*(${prefix}[\d\.]+)/.*$#"; - $max = find_max( $lines, $regex_match, $regex_replace ); - - return "$dirpath/$max"; -} - -function get_packages( $package, $dirpath ) -{ - global $exceptions; - global $regex; - -//if ( $package != "psmisc" ) return 0; // Debug - -if ( $package == "bc" ) $dirpath = "https://github.com/gavinhoward/bc/releases"; -if ( $package == "check" ) $dirpath = "https://github.com/libcheck/check/releases"; -if ( $package == "e2fsprogs" ) $dirpath = "http://sourceforge.net/projects/e2fsprogs/files/e2fsprogs"; -if ( $package == "expat" ) $dirpath = "http://sourceforge.net/projects/expat/files"; -if ( $package == "elfutils" ) $dirpath = "https://sourceware.org/ftp/elfutils"; -if ( $package == "expect" ) $dirpath = "http://sourceforge.net/projects/expect/files"; -if ( $package == "file" ) $dirpath = "https://github.com/file/file/releases"; -if ( $package == "flex" ) $dirpath = "https://github.com/westes/flex/releases"; -if ( $package == "gcc" ) $dirpath = max_parent( $dirpath, "gcc-" ); -if ( $package == "iana-etc" ) $dirpath = "https://github.com/Mic92/iana-etc/releases"; -if ( $package == "intltool" ) $dirpath = "https://launchpad.net/intltool/trunk"; -if ( $package == "meson" ) $dirpath = "https://github.com/mesonbuild/meson/releases"; -if ( $package == "mpc" ) $dirpath = "https://ftp.gnu.org/gnu/mpc"; -if ( $package == "mpfr" ) $dirpath = "http://mpfr.loria.fr/mpfr-current"; -if ( $package == "ninja" ) $dirpath = "https://github.com/ninja-build/ninja/releases"; -if ( $package == "procps-ng" ) $dirpath = "https://gitlab.com/procps-ng/procps/-/tags"; -if ( $package == "psmisc" ) $dirpath = "https://gitlab.com/psmisc/psmisc/-/tags"; -if ( $package == "Python" ) $dirpath = "https://www.python.org/downloads/source/"; -if ( $package == "shadow" ) $dirpath = "https://github.com/shadow-maint/shadow/releases"; -if ( $package == "systemd" ) $dirpath = "https://github.com/systemd/systemd/releases"; -if ( $package == "tcl" ) $dirpath = "http://sourceforge.net/projects/tcl/files"; -if ( $package == "util-linux" ) $dirpath = max_parent( $dirpath, "v." ); -if ( $package == "vim" ) $dirpath = "https://github.com/vim/vim/releases"; -if ( $package == "zstd" ) $dirpath = "https://github.com/facebook/zstd/releases"; -//if ( $package == "vim" ) $dirpath = "ftp://ftp.vim.org/pub/vim/unix"; - - // Check for ftp - if ( preg_match( "/^ftp/", $dirpath ) ) - { - $dirpath = substr( $dirpath, 6 ); // Remove ftp:// - $dirpath = rtrim ( $dirpath, "/" ); // Trim any trailing slash - $position = strpos( $dirpath, "/" ); // Divide at first slash - $server = substr( $dirpath, 0, $position ); - $path = substr( $dirpath, $position ); - - $conn = ftp_connect( $server ); - ftp_login( $conn, "anonymous", "" ); - - // See if we need special handling - if ( isset( $exceptions[ $package ] ) ) - { - $specials = explode( ":", $exceptions[ $package ] ); - - foreach ( $specials as $i ) - { - list( $op, $regexp ) = explode( "=", $i ); - - switch ($op) - { - case "UPDIR": - // Remove last dir from $path - $position = strrpos( $path, "/" ); - $path = substr( $path, 0, $position ); - - // Get dir listing - $lines = ftp_rawlist ($conn, $path); - $max = find_max( $lines, $regexp, $regexp ); - break; - - case "DOWNDIR": - // Append found directory - $path .= "/$max"; - break; - - default: - echo "Error in specials array for $package\n"; - return -5; - break; - } - } - } - - $lines = ftp_rawlist ($conn, $path); - ftp_close( $conn ); - } - else // http - { - // Customize http directories as needed - if ( $package == "tzdata" ) - { - // Remove two directories - $dirpath = rtrim ( $dirpath, "/" ); // Trim any trailing slash - $position = strrpos( $dirpath, "/" ); - $dirpath = substr ( $dirpath, 0, $position ); - $position = strrpos( $dirpath, "/" ); - $dirpath = substr ( $dirpath, 0, $position ); - } - - //if ( $package == "bzip2" ) - //{ - // // Remove one directory - // $dirpath = rtrim ( $dirpath, "/" ); // Trim any trailing slash - // $position = strrpos( $dirpath, "/" ); - // $dirpath = substr ( $dirpath, 0, $position ); - //} - - $lines = http_get_file( $dirpath ); - if ( ! is_array( $lines ) ) return -6; - } // End fetch -//print_r($lines); - if ( isset( $regex[ $package ] ) ) - { - // Custom search for latest package name - foreach ( $lines as $l ) - { - $ver = preg_replace( $regex[ $package ], "$1", $l ); - if ( $ver == $l ) continue; - return $ver; // Return first match of regex - } - - return -7; // This is an error - } - - if ( $package == "perl" ) // Custom for perl - { - $tmp = array(); - - foreach ( $lines as $l ) - { - if ( preg_match( "/sperl/", $l ) ) continue; // Don't want this - $ver = preg_replace( "/^.*perl-([\d\.]+\d)\.tar.*$/", "$1", $l ); - if ( $ver == $l ) continue; - list( $s1, $s2, $rest ) = explode( ".", $ver ); - if ( $s2 % 2 == 1 ) continue; // Remove odd minor versions - array_push( $tmp, $l ); - } - - $lines = $tmp; - } - - if ( $package == "attr" || - $package == "acl" ) - { - return find_max( $lines, "/$package/", "/^.*$package-([\d\.-]*\d).tar.*$/" ); - } - - if ( $package == "e2fsprogs" ) - return find_max( $lines, "/v\d/", "/^.*v(\d[\d\.]+\d).*$/" ); - - if ( $package == "expect" ) - return find_max( $lines, "/expect/", "/^.*expect(\d[\d\.]+\d).tar.*$/" ); - - if ( $package == "elfutils" ) - return find_max( $lines, "/^\d/", "/^(\d[\d\.]+\d)\/.*$/" ); - - if ( $package == "XML-Parser" ) - { - $max = find_max( $lines, "/$package/", "/^.*$package-([\d\._]*\d).tar.*$/" ); - # 2.44_01 is a developer release - if ( $max == "2.44_01" ) { return "2.44"; } - return $max; - } - - if ( $package == "tcl" ) - return find_max( $lines, "/tcl/", "/^.*tcl(\d[\d\.]*\d)-src.*$/" ); - - if ( $package == "ninja" ) - return find_max( $lines, "/v\d/", "/^.*v(\d[\d\.]*\d).*$/" ); - - if ( $package == "gmp" ) - return find_max( $lines, "/$package/", "/^.*$package-([\d\._]*\d[a-z]?).tar.*$/" ); - - if ( $package == "dbus" ) - return find_even_max( $lines, "/$package/", "/^.*$package-([\d\.]+).tar.*$/" ); - - if ( $package == "file" ) - { - $max = find_max( $lines, "/FILE5/", "/^.*FILE(5_\d+)*$/" ); - return str_replace( "_", ".", $max ); - } - - if ( $package == "procps-ng" ) - return find_max( $lines, "/v\d/", "/^.*v([\d\.]+)$/" ); - - if ( $package == "psmisc" ) - return find_max( $lines, "/v\d/", "/^.*v([\d\.]+) .*$/" ); - - if ( $package == "grub" ) - return find_max( $lines, "/grub/", "/^.*grub-(\d\..*).tar.xz.*$/" ); - - if ( $package == "openssl" ) - return find_max( $lines, "/openssl/", "/^.*openssl-([\d\.p]*\d.?).tar.*$/" ); - - if ( $package == "vim" ) - return find_max( $lines, "/v\d\./", "/^.*v([\d\.]+).*$/" ); - - if ( $package == "zstd" ) - return find_max( $lines, "/Zstandard v/", "/^.*v([\d\.]+).*$/" ); - - // Most packages are in the form $package-n.n.n - // Occasionally there are dashes (e.g. 201-1) - return find_max( $lines, "/$package/", "/^.*$package-([\d\.-]*\d)\.tar.*$/" ); -} - -function get_current() -{ - global $dirs; - global $vers; - - // Fetech from svn and get wget-list - $current = array(); - $lfssvn = "svn://svn.linuxfromscratch.org/LFS/trunk"; - - $tmpdir = exec( "mktemp -d /tmp/lfscheck.XXXXXX" ); - $cdir = getcwd(); - chdir( $tmpdir ); - exec ( "svn --quiet export $lfssvn LFS" ); - chdir( $cdir ); - - $PAGE = "$tmpdir/LFS/BOOK/chapter03/chapter03.xml"; - $STYLESHEET = "$tmpdir/LFS/BOOK/stylesheets/wget-list.xsl"; - - exec( "xsltproc --xinclude --nonet $STYLESHEET $PAGE", $current ); - exec( "rm -rf $tmpdir" ); - - foreach ( $current as $line ) - { - $file = basename( $line ) . "\n"; - if ( preg_match( "/patch$/", $file ) ) { continue; } // Skip patches - - $file = preg_replace( "/bz2/", '', $file ); // The 2 confusses the regex - - $file = rtrim( $file ); - $pkg_pattern = "/(\D*).*/"; - //$pattern = "/\D*(\d.*\d)\D*/"; - $pattern = "/\D*(\d.*\d)\D*/"; - - if ( preg_match( "/e2fsprogs/", $file ) ) - { - $pattern = "/e2\D*(\d.*\d)\D*/"; - $pkg_pattern = "/(e2\D*).*/"; - } - - else if ( preg_match( "/tzdata/", $file ) ) - { - $pattern = "/\D*(\d.*[a-z])\.tar\D*/"; - } - - else if ( preg_match( "/openssl/", $file ) ) - { - $pattern = "/\D*(\d.*\d.*).tar.*$/"; - } - - else if ( preg_match( "/gmp/", $file ) ) - { - $pattern = "/\D*(\d.*[a-z]*)\.tar\D*/"; - } - - else if ( preg_match( "/systemd-man-pages/", $file ) ) continue; - else if ( preg_match( "/python/" , $file ) ) continue; - - $version = preg_replace( $pattern, "$1", $file ); // Isolate version - $version = preg_replace( "/^\d-/", "", $version ); // Remove leading #- - - // Touch up package names - $pkg_name = preg_replace( $pkg_pattern, "$1", $file ); - $pkg_name = trim( $pkg_name, "-" ); - - if ( preg_match( "/bzip|iproute/", $pkg_name ) ) { $pkg_name .= "2"; } - if ( preg_match( "/^m$/" , $pkg_name ) ) { $pkg_name .= "4"; } - if ( preg_match( "/shadow/" , $pkg_name ) ) { $pkg_name = "shadow"; } - - $dirs[ $pkg_name ] = dirname( $line ); - $vers[ $pkg_name ] = $version; - } -} - -function mail_to_lfs() -{ - global $date; - global $vers; - global $dirs; - - //$to = "bruce.dubbs@gmail.com"; - $to = "lfs-book@lists.linuxfromscratch.org"; - $from = "bdubbs@linuxfromscratch.org"; - $subject = "LFS Package Currency Check - $date GMT"; - $headers = "From: bdubbs@anduin.linuxfromscratch.org"; - - $message = "Package LFS Upstream Flag\n\n"; - - foreach ( $dirs as $pkg => $dir ) - { - //if ( $pkg != "gmp" ) continue; //debug - $v = get_packages( $pkg, $dir ); - - $flag = ( $vers[ $pkg ] != $v ) ? "*" : ""; - - // Pad for output - $pad = " "; - $p = substr( $pkg . $pad, 0, 15 ); - $l = substr( $vers[ $pkg ] . $pad, 0, 10 ); - $c = substr( $v . $pad, 0, 10 ); - - $message .= "$p $l $c $flag\n"; - } - - exec ( "echo '$message' | mailx -r $from -s '$subject' $to" ); - //echo $message; -} - -function html() -{ - - global $date; - global $vers; - global $dirs; - - echo " - - -LFS Package Currency Check - $date - - - - -

LFS Package Currency Check

-

As of $date GMT

- - -\n"; - - // Get the latest version of each package - foreach ( $dirs as $pkg => $dir ) - { - $v = get_packages( $pkg, $dir ); - $flag = ( $vers[ $pkg ] != $v ) ? "*" : ""; - echo "\n"; - } - - echo "
LFS Package LFS Version Latest Flag
$pkg ${vers[ $pkg ]} $v $flag
- -\n"; - -} - -get_current(); // Get what is in the book -mail_to_lfs(); -//html(); // Write html output -?> diff --git a/lfs-latest.php b/lfs-latest.php new file mode 120000 index 000000000..f41b1b2b9 --- /dev/null +++ b/lfs-latest.php @@ -0,0 +1 @@ +lfs-latest-git.php \ No newline at end of file diff --git a/packages.ent b/packages.ent index 67f5bef38..6222f1615 100644 --- a/packages.ent +++ b/packages.ent @@ -104,20 +104,20 @@ - - + + - + - - + + - + @@ -308,20 +308,20 @@ - - + + - + - + - + @@ -343,10 +343,10 @@ - - + + - + @@ -359,10 +359,10 @@ - - + + - + @@ -371,7 +371,7 @@ - + @@ -432,19 +432,22 @@ - - + + - + - + - - - + + + @@ -509,10 +512,10 @@ - - + + - + @@ -567,18 +570,18 @@ - + - + - - + + - + @@ -594,19 +597,19 @@ - + - + - + - - + + @@ -627,10 +630,10 @@ - - + + - + @@ -660,10 +663,10 @@ - - + + - + @@ -716,31 +719,31 @@ - - + + - + - + - + - + - + - + @@ -763,11 +766,15 @@ - - - - - + + + + + + diff --git a/part3intro/generalinstructions.xml b/part3intro/generalinstructions.xml index f3285bc17..fe368d8d8 100644 --- a/part3intro/generalinstructions.xml +++ b/part3intro/generalinstructions.xml @@ -11,6 +11,20 @@ General Compilation Instructions + + + During a development cycle of LFS, the instructions in the book are + often modified to adapt for a package update or take the advantage of + new features from updated packages. Mixing up the instructions of + different versions of the LFS book can cause subtle breakages. This + kind of issue is generally a result from reusing some script created + for a prior LFS release. Such a reuse is strongly discouraged. If + you are reusing scripts for a prior LFS release for any reason, you'll + need to be very careful to update the scripts to match current version + of the LFS book. + + + Here are some things you should know about building each package: diff --git a/patches.ent b/patches.ent index 92d20d1a9..0f5874b83 100644 --- a/patches.ent +++ b/patches.ent @@ -2,60 +2,25 @@ - - - - - + - + - - - - - - + + + @@ -65,49 +30,11 @@ - - - - - -