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..71b82d0c6 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,6 @@ book: validate profile-html true; \ /bin/bash obfuscate.sh $$filename; \ sed -e "s@text/html@application/xhtml+xml@g" \ - -e "s/\xa9/\©/ " \ -i $$filename; \ done; @@ -209,5 +208,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-$$( Systemd Udev"> + Berkeley DB"> ]> @@ -29,10 +30,7 @@ in addition to those on the first list, need to be available in order to run the test suites. The fourth list of dependencies are packages that require this package to be built and installed in its final location before they are - built and installed. In most cases, this is because these packages will hard - code paths to binaries within their scripts. If not built in a certain order, - this could result in paths of /tools/bin/[binary] being placed inside scripts - installed to the final system. This is obviously not desirable. + built and installed. The last list of dependencies are optional packages that are not addressed in LFS, but could be useful to the user. These packages may have @@ -294,7 +292,7 @@ &runtime; - Glibc and Zlib + Glibc, Zlib, and Zstd @@ -1486,7 +1484,7 @@ &external; - Berkeley DB, + &bdb;, iptables, libbpf, libmnl, and @@ -1496,37 +1494,37 @@ - Jinja2 + Jinja2 - + &dependencies; - MarkupSafe and Python + MarkupSafe, Python, Setuptools, and Wheel - + &runtime; MarkupSafe and Python - + &testsuites; No test suite available - + &before; &systemd-udev; - + &external; None @@ -2136,37 +2134,37 @@ - MarkupSafe + MarkupSafe - + &dependencies; - Python + Python, Setuptools, and Wheel - + &runtime; Python - + &testsuites; No test suite available - + &before; Jinja2 - + &external; None @@ -2179,7 +2177,7 @@ &dependencies; - Ninja and Python + Ninja, Python, Setuptools, and Wheel @@ -2486,7 +2484,7 @@ &external; - Berkeley DB + &bdb; @@ -2655,7 +2653,7 @@ &external; - Berkeley DB, + &bdb;, libnsl, SQLite, and Tk @@ -2741,6 +2739,44 @@ + + Setuptools + + + &dependencies; + + Python and Wheel + + + + + &runtime; + + Python + + + + + &testsuites; + + No test suite available + + + + + &before; + + Jinja2, MarkupSafe, and Meson + + + + + &external; + + None + + + Shadow @@ -3216,7 +3252,7 @@ - wheel + Wheel &dependencies; @@ -3243,8 +3279,7 @@ &before; - None - Jinja2 + Jinja2, MarkupSafe, Meson, and Setuptools diff --git a/bootscripts/ChangeLog b/bootscripts/ChangeLog index aff30cb41..3853ff83a 100644 --- a/bootscripts/ChangeLog +++ b/bootscripts/ChangeLog @@ -1,3 +1,8 @@ +2023-10-04 Pierre Labastie + * After the changes done on 2022-03-24, several "halt stop" should + have been changed to "halt start". Done now. Fortunately, those + occur only when something wrong happens with disks or devices. + 2023-07-28 Xi Ruoyao * In mountvirtfs, mount /sys/fs/cgroup for udev from systemd-254. @@ -24,7 +29,7 @@ * New semantics for K and S scripts: - S scripts only started if not already marked S in the previous runlevel - K scripts only started if not already marked K in the previous runlevel - - remove the convention of running S scripts ith "stop" in rl 0/6 + - remove the convention of running S scripts with "stop" in rl 0/6 2021-06-08 Bruce Dubbs * When shutting down the network, ignore invalid interfaces or interfaces that are not UP. diff --git a/bootscripts/lfs/init.d/checkfs b/bootscripts/lfs/init.d/checkfs index bbbae8d99..b7f6e3ff2 100644 --- a/bootscripts/lfs/init.d/checkfs +++ b/bootscripts/lfs/init.d/checkfs @@ -63,7 +63,7 @@ case "${1}" in log_info_msg "Press Enter to continue..." wait_for_user - /etc/rc.d/init.d/halt stop + /etc/rc.d/init.d/halt start else log_success_msg2 fi @@ -127,7 +127,7 @@ case "${1}" in log_info_msg "Press Enter to continue..." wait_for_user - /etc/rc.d/init.d/halt stop + /etc/rc.d/init.d/halt start fi if [ "${error_value}" -ge 16 ]; then diff --git a/bootscripts/lfs/init.d/udev b/bootscripts/lfs/init.d/udev index f3b07b022..a843e0c39 100644 --- a/bootscripts/lfs/init.d/udev +++ b/bootscripts/lfs/init.d/udev @@ -41,7 +41,7 @@ case "${1}" in log_info_msg "$msg" log_info_msg "Press Enter to continue..." wait_for_user - /etc/rc.d/init.d/halt stop + /etc/rc.d/init.d/halt start fi # Start the udev daemon to continually watch for, and act on, diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 2debc0c0a..11df22160 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,12 +40,308 @@ appropriate for the entry or if needed the entire day's listitem. --> + + 2023-12-04 + + + [thomas] - Modify commands for install Python docs to avoid + too restrictive permissions on the files and dirs. + + + + + + 2023-12-01 + + + [xry111] - Restore NIC naming based on physical system + characteristics. Fixes + #5386. + + + + + + 2023-11-30 + + + [bdubbs] - Update to vim-9.0.2136. Addresses + #4500. + + + [bdubbs] - Update to iana-etc-20231117. Addresses + #5006. + + + [bdubbs] - Update to bc-6.7.3. Fixes + #5385. + + + [bdubbs] - Update to wheel-0.42.0 (Python Module). Fixes + #5384. + + + [bdubbs] - Update to perl-5.38.2. Fixes + #5383. + + + [bdubbs] - Update to pkgconf-2.1.0. Fixes + #5382. + + + [bdubbs] - Update to readline patches 002 through 007. Fixes + #5381. + + + [bdubbs] - Update to openssl-3.2.0. Fixes + #5380. + + + [bdubbs] - Update to setuptools-69.0.2. Fixes + #5379. + + + [bdubbs] - Update to linux-6.6.3. Fixes + #5378. + + + [bdubbs] - Update to meson-1.3.0. Fixes + #5377. + + + [bdubbs] - Update to gettext-0.22.4. Fixes + #5376. + + + + + + 2023-11-13 + + + [xry111] - Update to elfutils-0.190. Fixes + #5373. + + + [xry111] - Update to vim-9.0.2103. Addresses + #4500. + + + [xry111] - Update to linux-6.6.1. Fixes + #5369. + + + [xry111] - Update to xz-5.4.5. Fixes + #5371. + + + [xry111] - Update to iana-etc-20231107. Addresses + #5006. + + + [xry111] - Update to gawk-5.3.0. Fixes + #5372. + + + [xry111] - Update to bash-5.2.21. Fixes + #5375. + + + [xry111] - Update to iproute2-6.6.0. Fixes + #5374. + + + + + + 2023-11-01 + + + [bdubbs] - Update to iana-etc-20231019. Addresses + #5006. + + + [bdubbs] - Update to wheel-0.41.3. Fixes + #5370. + + + [bdubbs] - Update to shadow-4.14.2. Fixes + #5368. + + + [bdubbs] - Update to openssl-3.1.4. Fixes + #5367. + + + [bdubbs] - Update to texinfo-7.1. Fixes + #5364. + + + [bdubbs] - Update to meson-1.2.3. Fixes + #5366. + + + [bdubbs] - Update to bc-6.7.2. Fixes + #5363. + + + [bdubbs] - Update to linux-6.5.9. Fixes + #5365. + + + [bdubbs] - Update to Python-3.12.0. Fixes + #5357. + + + [bdubbs] - Add setuptools-68.2.2. Fixes + #5358. + + + + + + 2023-10-15 + + + [bdubbs] - Update to linux-6.5.7. Fixes + #5362. + + + [bdubbs] - Update to shadow-4.14.1. Fixes + #5361. + + + [bdubbs] - Update to gettext-0.22.3. Fixes + #5359. + + + + + + 2023-10-03 + + + [xry111] - Update Glibc upstream fixes patch to fix + CVE-2023-4911. + + + + + + 2023-10-01 + + + [bdubbs] - Disable building nscd in glibc. Fixes + #5349. + + + [bdubbs] - Update to iana-etc-20230929. Addresses + #5006. + + + [bdubbs] - Update to vim-9.0.1968. Addresses + #4500. + + + [bdubbs] - Update to openssl-3.1.3. Fixes + #5350. + + + [bdubbs] - Update to meson-1.2.2. Fixes + #5356. + + + [bdubbs] - Update to man-db-2.12.0. Fixes + #5354. + + + [bdubbs] - Update to linux-6.5.5. Fixes + #5352. + + + [bdubbs] - Update to kmod-31. Fixes + #5355. + + + [bdubbs] - Update to kbd-2.6.3. Fixes + #5361. + + + [bdubbs] - Update to gettext-0.22.2. Fixes + #5348. + + + [bdubbs] - Update to bc-6.7.0. Fixes + #5353. + + + + + + 2023-09-24 + + + [xry111] - Update Glibc upstream fixes patch to plug a + memory leak introduced by the security fix. + + + + + + 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. + building system to detect zstd properly. Fixes #5340. diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml index d7c391796..bd97a81f0 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -38,12 +38,12 @@ - - + + Bash-&bash-version; + + + Bc-&bc-version; + @@ -62,18 +62,15 @@ - + - @@ -92,18 +89,18 @@ - + - + @@ -125,27 +122,27 @@ Gzip-&gzip-version; - + + Iana-Etc-&iana-etc-version; + - + Kbd-&kbd-version; - + @@ -155,9 +152,9 @@ - + + Libelf from Elfutils-&elfutils-version; + @@ -167,27 +164,27 @@ - + - + - + @@ -200,18 +197,18 @@ - + + OpenSSL-&openssl-version; + + + Perl-&perl-version; + Pkgconf-&pkgconf-version; - Procps-ng-&procps-ng-version; @@ -227,6 +224,9 @@ + Shadow-&shadow-version; @@ -245,27 +245,30 @@ - + + - Util-Linux-&util-linux-version; + Util-linux-&util-linux-version; Vim-&vim-version; - wheel-&wheel-version; + Wheel-&wheel-version; - + + Xz-&xz-version; + Zlib-&zlib-version; @@ -287,35 +290,32 @@ Added: - + + setuptools-&setuptools-version; + - + - Removed: - diff --git a/chapter02/hostreqs.xml b/chapter02/hostreqs.xml index 10c1bf16e..63dcd943f 100644 --- a/chapter02/hostreqs.xml +++ b/chapter02/hostreqs.xml @@ -54,8 +54,9 @@ should be a link to bison or a small script that executes bison) + - Coreutils-7.0 + Coreutils-8.1 @@ -72,7 +73,9 @@ - GCC-5.1 including the C++ + + GCC-5.2 including the C++ compiler, g++ (Versions greater than &gcc-version; are not recommended as they have not been tested). C and C++ standard libraries (with headers) must also be present so the C++ compiler can @@ -216,16 +219,16 @@ ver_kernel() fi } -# Coreutils first because-sort needs Coreutils >= 7.0 -ver_check Coreutils sort 7.0 || bail "--version-sort unsupported" +# Coreutils first because --version-sort needs Coreutils >= 7.0 +ver_check Coreutils sort 8.1 || bail "Coreutils too old, stop" ver_check Bash bash 3.2 ver_check Binutils ld 2.13.1 ver_check Bison bison 2.7 ver_check Diffutils diff 2.8.1 ver_check Findutils find 4.2.31 ver_check Gawk gawk 4.0.1 -ver_check GCC gcc 5.1 -ver_check "GCC (C++)" g++ 5.1 +ver_check GCC gcc 5.2 +ver_check "GCC (C++)" g++ 5.2 ver_check Grep grep 2.5.1a ver_check Gzip gzip 1.3.12 ver_check M4 m4 1.4.10 @@ -257,7 +260,13 @@ echo "Compiler check:" if printf "int main(){}" | g++ -x c++ - then echo "OK: g++ works"; else echo "ERROR: g++ does NOT work"; fi -rm -f a.out +rm -f a.out + +if [ "$(nproc)" = "" ]; then + echo "ERROR: nproc is not available or it produces empty output" +else + echo "OK: nproc reports $(nproc) logical cores are available" +fi EOF bash version-check.sh diff --git a/chapter03/packages.xml b/chapter03/packages.xml index dba151cac..deae31301 100644 --- a/chapter03/packages.xml +++ b/chapter03/packages.xml @@ -242,7 +242,6 @@ Home page: Download: MD5 sum: &gcc-md5; - SHA256 sum: &gcc-sha256; @@ -356,7 +355,6 @@ Home page: Download: MD5 sum: &inetutils-md5; - SHA256 sum: &inetutils-sha256; @@ -670,6 +668,15 @@ + + Setuptools (&setuptools-version;) - &setuptools-size;: + + Home page: + Download: + MD5 sum: &setuptools-md5; + + + Shadow (&shadow-version;) - &shadow-size;: diff --git a/chapter03/patches.xml b/chapter03/patches.xml index bbf09ae27..00628bda7 100644 --- a/chapter03/patches.xml +++ b/chapter03/patches.xml @@ -78,10 +78,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/chapter04/aboutsbus.xml b/chapter04/aboutsbus.xml index f88db24f6..42a523fa1 100644 --- a/chapter04/aboutsbus.xml +++ b/chapter04/aboutsbus.xml @@ -37,18 +37,6 @@ numbers can vary by as much as dozens of minutes in some cases. - For many modern systems with multiple processors (or cores) the - compilation time for a package can be reduced by performing a "parallel - make" by either setting an environment variable or telling the - make program how many processors are available. For - instance, an Intel i5-6500 CPU can support four simultaneous processes with: - - export MAKEFLAGS='-j4' - - or by building with: - - make -j4 - When multiple processors are used in this way, the SBU units in the book will vary even more than they normally would. In some cases, the make step will simply fail. Analyzing the output of the build process will also diff --git a/chapter04/settingenviron.xml b/chapter04/settingenviron.xml index b255a4b45..61a655655 100644 --- a/chapter04/settingenviron.xml +++ b/chapter04/settingenviron.xml @@ -195,6 +195,55 @@ EOF completed LFS system. + + For many modern systems with multiple processors (or cores) the + compilation time for a package can be reduced by performing a "parallel + make" by telling the make program how many processors are available via + a command line option or an environment variable. For instance, an Intel + Core i9-13900K processor has 8 P (performance) cores and + 16 E (efficiency) cores, and a P core can simultaneously run two threads + so each P core are modeled as two logical cores by the Linux kernel. + As the result there are 32 logical cores in total. One obvious way to + use all these logical cores is allowing make to spawn + up to 32 build jobs. This can be done by passing the + -j32 option to make: + + + make -j32 + + + Or set the MAKEFLAGS environment variable and its + content will be automatically used by make as + command line options: + + + export MAKEFLAGS=-j32 + + + + Never pass a -j option without a number to + make or set such an option in + MAKEFLAGS. Doing so will allow make + to spawn infinite build jobs and cause system stability problems. + + + + + To use all logical cores available for building packages in + and + , set MAKEFLAGS + now in .bashrc: + + +cat >> ~/.bashrc << "EOF" +export MAKEFLAGS=-j$(nproc) +EOF + + + Replace $(nproc) with the number of logical + cores you want to use if you don't want to use all the logical cores. + + Finally, to ensure the environment is fully prepared for building the temporary tools, force the bash shell to read the new user profile: diff --git a/chapter05/glibc.xml b/chapter05/glibc.xml index 7cbdccfde..e1561b096 100644 --- a/chapter05/glibc.xml +++ b/chapter05/glibc.xml @@ -70,6 +70,7 @@ cd build --build=$(../scripts/config.guess) \ --enable-kernel=&min-kernel; \ --with-headers=$LFS/usr/include \ + --disable-nscd \ libc_cv_slibdir=/usr/lib @@ -111,6 +112,14 @@ cd build + + --disable-nscd + + Do not build the name service cache daemon which is no + longer used. + + + During this stage the following warning might appear: 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..f6b6c6310 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: @@ -67,13 +63,6 @@ - - gl_cv_macro_MB_CUR_MAX_good=y - - This is needed to work around an issue in the gnulib copy - shipped by the package which would break cross compilation. - - Compile the package: diff --git a/chapter06/ncurses.xml b/chapter06/ncurses.xml index 9e7764ecf..8d7c8b1fe 100644 --- a/chapter06/ncurses.xml +++ b/chapter06/ncurses.xml @@ -78,7 +78,7 @@ popd --with-manpage-format=normal - This prevents Ncurses installing compressed manual + This prevents Ncurses from installing compressed manual pages, which may happen if the host distribution itself has compressed manual pages. @@ -94,7 +94,7 @@ popd --without-normal - This prevents Ncurses building and installing static C + This prevents Ncurses from building and installing static C libraries. @@ -102,7 +102,7 @@ popd --without-debug - This prevents Ncurses building and installing debug + This prevents Ncurses from building and installing debug libraries. diff --git a/chapter07/chroot.xml b/chapter07/chroot.xml index b8de03dc2..70f5717dd 100644 --- a/chapter07/chroot.xml +++ b/chapter07/chroot.xml @@ -23,8 +23,20 @@ TERM="$TERM" \ PS1='(lfs chroot) \u:\w\$ ' \ PATH=/usr/bin:/usr/sbin \ + MAKEFLAGS="-j$(nproc)" \ + TESTSUITEFLAGS="-j$(nproc)" \ /bin/bash --login + + If you don't want to use all available logical cores, replace + $(nproc) with the number of logical cores you + want to use for building packages in this chapter and the following + chapters. The test suites of some packages (notably Autoconf, Libtool, + and Tar) in &ch-final; are not affected by MAKEFLAGS, they + use a TESTSUITEFLAGS environment variable instead. We + set that here as well for running these test suites with multiple cores. + + The -i option given to the env command will clear all the variables in the chroot environment. After that, only the HOME, TERM, PS1, and @@ -47,7 +59,7 @@ in the PATH. This means that the cross toolchain will no longer be used. - Note that the bash prompt will say + Also note that the bash prompt will say I have no name! This is normal because the /etc/passwd file has not been created yet. diff --git a/chapter07/createfiles.xml b/chapter07/createfiles.xml index 2b752b944..9047fa744 100644 --- a/chapter07/createfiles.xml +++ b/chapter07/createfiles.xml @@ -215,8 +215,23 @@ chmod -v 600 /var/log/btmp failed login attempts. The /var/log/btmp file records the bad login attempts. - The /run/utmp file records the users that - are currently logged in. This file is created dynamically in the boot - scripts. + + The /run/utmp file + records the users that are currently logged in. This file is created + dynamically in the boot scripts. + + + + + The utmp, + wtmp, btmp, and + lastlog files use 32-bit integers for timestamps + and they'll be fundamentally broken after year 2038. Many packages + have stopped using them and other packages are going to stop using + them. It is probably best to consider them deprecated. + + diff --git a/chapter07/kernfs.xml b/chapter07/kernfs.xml index b5b0762bb..049f6e804 100644 --- a/chapter07/kernfs.xml +++ b/chapter07/kernfs.xml @@ -107,9 +107,9 @@ mount -vt tmpfs tmpfs $LFS/run we must explicitly mount a tmpfs: if [ -h $LFS/dev/shm ]; then - mkdir -pv $LFS/$(readlink $LFS/dev/shm) + (cd $LFS/dev; mkdir $(readlink 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/automake.xml b/chapter08/automake.xml index 4fc1bd277..5d7541049 100644 --- a/chapter08/automake.xml +++ b/chapter08/automake.xml @@ -53,11 +53,14 @@ make - Using the -j4 make option speeds up the tests, even on systems with - only one processor, due to internal delays in individual tests. To test + Using four parallel jobs speeds up the tests, even on systems with + less logical cores, due to internal delays in individual tests. To test the results, issue: -make -j4 check +make -j$(($(nproc)>4?$(nproc):4)) check + + Replace $((...)) with the number of + logical cores you want to use if you don't want to use all. The test t/subobj.sh is known to fail. diff --git a/chapter08/chapter08.xml b/chapter08/chapter08.xml index 8ab81d2f8..2fccb6139 100644 --- a/chapter08/chapter08.xml +++ b/chapter08/chapter08.xml @@ -65,6 +65,7 @@ + diff --git a/chapter08/dbus.xml b/chapter08/dbus.xml index 8ab4744ad..309e5b2e9 100644 --- a/chapter08/dbus.xml +++ b/chapter08/dbus.xml @@ -56,7 +56,7 @@ --disable-static \ --disable-doxygen-docs \ --disable-xml-docs \ - --docdir=/usr/share/doc/dbus-&dbus-version; \ + --docdir=/usr/share/doc/dbus-&dbus-version; \ --with-system-socket=/run/dbus/system_bus_socket diff --git a/chapter08/gawk.xml b/chapter08/gawk.xml index cc9348d90..d8984b58e 100644 --- a/chapter08/gawk.xml +++ b/chapter08/gawk.xml @@ -59,15 +59,18 @@ su tester -c "PATH=$PATH make check" Install the package: -make LN='ln -f' install +rm -f /usr/bin/gawk-&gawk-version; +make install - The meaning of the overridden make variable: + The meaning of the command: - LN='ln -f' + rm -f /usr/bin/gawk-&gawk-version; - This variable ensures that the previous hard link installed + The building system will not recreate the hard link + gawk-&gawk-version; if it already exists. + Remove it to ensure that the previous hard link installed in is updated here. diff --git a/chapter08/glibc.xml b/chapter08/glibc.xml index 7eac93dbb..06cda8a71 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: @@ -74,6 +74,7 @@ cd build --enable-kernel=&min-kernel; \ --enable-stack-protector=strong \ --with-headers=/usr/include \ + --disable-nscd \ libc_cv_slibdir=/usr/lib @@ -114,6 +115,14 @@ cd build + + --disable-nscd + + Do not build the name service cache daemon which is no + longer used. + + + libc_cv_slibdir=/usr/lib @@ -206,7 +215,7 @@ esac ldd script: sed '/RTLDLIST=/s@/usr@@g' -i /usr/bin/ldd - + Next, install the locales that can make the system respond in a different language. None of these locales are required, but if some of them are missing, the test suites of some packages will skip important @@ -320,7 +329,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 +344,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 @@ -480,7 +507,7 @@ mkdir -pv /etc/ld.so.conf.d gencat, getconf, getent, iconv, iconvconfig, ldconfig, ldd, lddlibc4, ld.so (symlink to ld-linux-aarch64[_be].so.1), - locale, localedef, makedb, mtrace, nscd, + locale, localedef, makedb, mtrace, pcprofiledump, pldd, sln, sotruss, sprof, tzselect, xtrace, zdump, and zic ld-linux-aarch64[_be].so.1, @@ -500,7 +527,7 @@ mkdir -pv /etc/ld.so.conf.d /usr/include/protocols, /usr/include/rpc, /usr/include/sys, /usr/lib/audit, /usr/lib/gconv, /usr/lib/locale, /usr/libexec/getconf, /usr/share/i18n, /usr/share/zoneinfo, - /var/cache/nscd, and /var/lib/nss_db + and /var/lib/nss_db @@ -634,17 +661,6 @@ mkdir -pv /etc/ld.so.conf.d - - nscd - - A daemon that provides a cache for the most common name - service requests - - nscd - - - - pcprofiledump diff --git a/chapter08/gmp.xml b/chapter08/gmp.xml index bfd030e1d..c178d2b13 100644 --- a/chapter08/gmp.xml +++ b/chapter08/gmp.xml @@ -119,7 +119,7 @@ make install-html Contents of GMP - Installed Libraries + Installed libraries Installed directory diff --git a/chapter08/iproute2.xml b/chapter08/iproute2.xml index bfc25331a..cd3e5a658 100644 --- a/chapter08/iproute2.xml +++ b/chapter08/iproute2.xml @@ -45,9 +45,6 @@ be built since it depends on Berkeley DB, which is not installed in LFS. However, a directory and a man page for arpd will still be installed. Prevent this by running the commands shown below. - (If the arpd program is needed, - instructions for compiling Berkeley DB can be found in the BLFS book at - .) sed -i /ARPD/d Makefile diff --git a/chapter08/libelf.xml b/chapter08/libelf.xml index 23b66222a..a17818274 100644 --- a/chapter08/libelf.xml +++ b/chapter08/libelf.xml @@ -70,8 +70,8 @@ rm /usr/lib/libelf.a Contents of Libelf - Installed Library - Installed Directory + Installed library + Installed directory diff --git a/chapter08/man-db.xml b/chapter08/man-db.xml index 88c811d33..229111131 100644 --- a/chapter08/man-db.xml +++ b/chapter08/man-db.xml @@ -113,11 +113,7 @@ To test the results, issue: -make -k check - - - One test named man1/lexgrog.1 is known - to fail. +make check Install the package: 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 c9e7c1a7d..cba4a64aa 100644 --- a/chapter08/mpfr.xml +++ b/chapter08/mpfr.xml @@ -58,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 @@ -74,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 6a4441552..25295f056 100644 --- a/chapter08/openssl.xml +++ b/chapter08/openssl.xml @@ -63,7 +63,7 @@ To test the results, issue: -make test +HARNESS_JOBS=$(nproc) make test One test, 30-test_afalg.t, is known to fail if the host kernel does not have enabled, diff --git a/chapter08/perl.xml b/chapter08/perl.xml index b56e0e5e2..2bb849645 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: @@ -138,7 +111,7 @@ export BUILD_BZIP2=0 To test the results (approximately 11 SBU), issue: -make test +TEST_JOBS=$(nproc) make test_harness Install the package and clean up: 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/pkgmgt.xml b/chapter08/pkgmgt.xml index 7104d9cba..185538796 100644 --- a/chapter08/pkgmgt.xml +++ b/chapter08/pkgmgt.xml @@ -69,6 +69,17 @@ it. + + Reinstalling the same version of Glibc (&glibc-version; for + this release of LFS) with patches should be safe when these patches + do not change ABI and API. When a security vulnerability is found + in Glibc, we often need to apply such a patch to fix the + vulnerability and reinstall Glibc. Consult + LFS security + advisories if you are alerted for a published Glibc security + vulnerability but unsure about the action to take. + + If a package containing a shared library is updated, and if the name of the library changes, then any packages dynamically linked to the library must be recompiled, to link against the @@ -152,7 +163,7 @@ provided by coreutils has already implemented this, and most packages use that command to install binary files and libraries. This means that you won't be troubled by this issue most of the time. - However, the install process of some packages (notably Mozilla JS + However, the install process of some packages (notably SpiderMonkey in BLFS) just overwrites the file if it exists; this causes a crash. So it's safer to save your work and close unneeded running processes before updating a package. @@ -185,19 +196,29 @@ This is a simplistic package management technique that does not need a special program to manage the packages. Each package is installed in a separate directory. For example, package foo-1.1 is installed in - /usr/pkg/foo-1.1 - and a symlink is made from /usr/pkg/foo to - /usr/pkg/foo-1.1. When + /opt/foo-1.1 + and a symlink is made from /opt/foo to + /opt/foo-1.1. When a new version foo-1.2 comes along, it is installed in - /usr/pkg/foo-1.2 and the previous + /opt/foo-1.2 and the previous symlink is replaced by a symlink to the new version. Environment variables such as PATH, - LD_LIBRARY_PATH, MANPATH, - INFOPATH and CPPFLAGS need to be expanded to - include /usr/pkg/foo. If you install more than a few packages, - this scheme becomes unmanageable. + MANPATH, INFOPATH, + PKG_CONFIG_PATH, CPPFLAGS, + LDFLAGS, and the configuration file + /etc/ld.so.conf may need to be expanded to + include the corresponding subdirectories in + /opt/foo-x.y. + + This scheme is used by the BLFS book to install some very large + packages to make it easier to upgrade them. If you install more + than a few packages, this scheme becomes unmanageable. And some + packages (for example Linux API headers and Glibc) may not work well + with this scheme. + Never use this scheme system-wide. + diff --git a/chapter08/python.xml b/chapter08/python.xml index 1ac1b538a..62279880d 100644 --- a/chapter08/python.xml +++ b/chapter08/python.xml @@ -48,7 +48,6 @@ ./configure --prefix=/usr \ --enable-shared \ --with-system-expat \ - --with-system-ffi \ --enable-optimizations @@ -62,14 +61,6 @@ - - --with-system-ffi - - This switch enables linking against the system version of - libffi.so. - - - --enable-optimizations @@ -164,21 +155,21 @@ EOF install -v -dm755 /usr/share/doc/python-&python-version;/html -tar --strip-components=1 \ - --no-same-owner \ - --no-same-permissions \ - -C /usr/share/doc/python-&python-version;/html \ - -xvf ../python-&python-version;-docs-html.tar.bz2 +tar --no-same-owner \ + -xvf ../python-&python-version;-docs-html.tar.bz2 +cp -R --no-preserve=mode python-&python-version;-docs-html/* \ + /usr/share/doc/python-&python-version;/html The meaning of the documentation install commands: - and + (tar) and (cp) Ensure the installed files have the correct ownership and permissions. Without these options, tar - will install the package files with the upstream creator's values. + will install the package files with the upstream creator's values + and files would have restrictive permissions. @@ -191,9 +182,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/setuptools.xml b/chapter08/setuptools.xml new file mode 100644 index 000000000..257a50328 --- /dev/null +++ b/chapter08/setuptools.xml @@ -0,0 +1,71 @@ + + + %general-entities; +]> + + + + + + setuptools + &setuptools-version; +
&setuptools-url;
+
+ + Setuptools-&setuptools-version; + + + Setuptools + + + + + + <para>Setuptools is a tool used to download, build, install, upgrade, + and uninstall Python packages.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + <seglistitem> + <seg>&setuptools-fin-sbu;</seg> + <seg>&setuptools-fin-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Setuptools + + Build the package: + +pip3 wheel -w dist --no-cache-dir --no-build-isolation --no-deps $PWD + + Install the package: + +pip3 install --no-index --find-links dist setuptools + + + + Contents of Setuptools + + + Installed directory + + + + /usr/lib/python&python-minor;/site-packages/_distutils_hack, + /usr/lib/python&python-minor;/site-packages/pkg_resources, + /usr/lib/python&python-minor;/site-packages/setuptools, and + /usr/lib/python&python-minor;/site-packages/setuptools-&setuptools-version;.dist-info + + + + + + +
+ diff --git a/chapter08/shadow.xml b/chapter08/shadow.xml index f88216a5b..315234c7f 100644 --- a/chapter08/shadow.xml +++ b/chapter08/shadow.xml @@ -276,7 +276,7 @@ useradd -D --gid 999 chage, chfn, chgpasswd, chpasswd, chsh, expiry, faillog, getsubids, gpasswd, groupadd, groupdel, groupmems, groupmod, grpck, - grpconv, grpunconv, lastlog, login, logoutd, newgidmap, newgrp, + grpconv, grpunconv, login, logoutd, newgidmap, newgrp, newuidmap, newusers, nologin, passwd, pwck, pwconv, pwunconv, sg (link to newgrp), su, useradd, userdel, usermod, vigr (link to vipw), and vipw @@ -459,17 +459,6 @@ useradd -D --gid 999 - - lastlog - - Reports the most recent login of all users or of a - given user - - lastlog - - - - login diff --git a/chapter08/stripping.xml b/chapter08/stripping.xml index 92ecfe310..83f7545fd 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. @@ -79,7 +82,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 diff --git a/chapter08/udev.xml b/chapter08/udev.xml index 35bb12f46..dd686f489 100644 --- a/chapter08/udev.xml +++ b/chapter08/udev.xml @@ -55,6 +55,11 @@ sed '/systemd-sysctl/s/^/#/' -i rules.d/99-systemd.rules.in + Adjust the hardcoded paths to network configuration files for the + standalone udev installation: + + sed '/NETWORK_DIRS/s/systemd/udev/' -i src/basic/path-lookup.h + Prepare Udev for compilation: mkdir -p build @@ -66,6 +71,8 @@ meson setup \ -Dmode=release \ -Ddev-kvm-mode=0660 \ -Dlink-udev-shared=false \ + -Dlogind=false \ + -Dvconsole=false \ .. @@ -107,35 +114,42 @@ meson setup \ and it's too overkill for a udev-only installation. + + + -Dlogind=false -Dvconsole=false + + These options prevent the generation of several udev rule + files belonging to the other Systemd components that we won't + install. + +
Only build the components needed for udev: - ninja udevadm systemd-hwdb \ - $(grep -o -E "^build (src/libudev|src/udev|rules.d|hwdb.d)[^:]*" \ - build.ninja | awk '{ print $2 }') \ + ninja udevadm systemd-hwdb \ + $(ninja -n | grep -Eo '(src/(lib)?udev|rules.d|hwdb.d)/[^ ]*') \ $(realpath libudev.so --relative-to .) - Remove one udev rule file requiring a full Systemd - installation: - -rm rules.d/90-vconsole.rules - Install the package: - install -vm755 -d {/usr/lib,/etc}/udev/{hwdb,rules}.d + install -vm755 -d {/usr/lib,/etc}/udev/{hwdb.d,rules.d,network} install -vm755 -d /usr/{lib,share}/pkgconfig -install -vm755 udevadm /usr/bin/ -install -vm755 systemd-hwdb /usr/bin/udev-hwdb -ln -svfn ../bin/udevadm /usr/sbin/udevd -cp -av libudev.so{,*[0-9]} /usr/lib/ -install -vm644 ../src/libudev/libudev.h /usr/include/ -install -vm644 src/libudev/*.pc /usr/lib/pkgconfig/ -install -vm644 src/udev/*.pc /usr/share/pkgconfig/ -install -vm644 ../src/udev/udev.conf /etc/udev/ -install -vm644 rules.d/* ../rules.d/{*.rules,README} /usr/lib/udev/rules.d/ -install -vm644 hwdb.d/* ../hwdb.d/{*.hwdb,README} /usr/lib/udev/hwdb.d/ -install -vm755 $(find src/udev -type f | grep -F -v ".") /usr/lib/udev +install -vm755 udevadm /usr/bin/ +install -vm755 systemd-hwdb /usr/bin/udev-hwdb +ln -svfn ../bin/udevadm /usr/sbin/udevd +cp -av libudev.so{,*[0-9]} /usr/lib/ +install -vm644 ../src/libudev/libudev.h /usr/include/ +install -vm644 src/libudev/*.pc /usr/lib/pkgconfig/ +install -vm644 src/udev/*.pc /usr/share/pkgconfig/ +install -vm644 ../src/udev/udev.conf /etc/udev/ +install -vm644 rules.d/* ../rules.d/README /usr/lib/udev/rules.d/ +install -vm644 $(find ../rules.d/*.rules \ + -not -name '*power-switch*') /usr/lib/udev/rules.d/ +install -vm644 hwdb.d/* ../hwdb.d/{*.hwdb,README} /usr/lib/udev/hwdb.d/ +install -vm755 $(find src/udev \ + -type f -not -name '*.*') /usr/lib/udev +install -vm644 ../network/99-default.link /usr/lib/udev/network Install some custom rules and support files useful in an LFS environment: @@ -150,13 +164,21 @@ make -f &udev-lfs-version;/Makefile.lfs install tar -xf ../../systemd-man-pages-&systemd-man-version;.tar.xz \ --no-same-owner --strip-components=1 \ -C /usr/share/man --wildcards '*/udev*' '*/libudev*' \ + '*/systemd.link.5' \ '*/systemd-'{hwdb,udevd.service}.8 + +sed 's|systemd/network|udev/network|' \ + /usr/share/man/man5/systemd.link.5 \ + > /usr/share/man/man5/udev.link.5 + sed 's/systemd\(\\\?-\)/udev\1/' /usr/share/man/man8/systemd-hwdb.8 \ > /usr/share/man/man8/udev-hwdb.8 + sed 's|lib.*udevd|sbin/udevd|' \ /usr/share/man/man8/systemd-udevd.service.8 \ > /usr/share/man/man8/udevd.8 -rm /usr/share/man/man8/systemd-*.8 + +rm /usr/share/man/man*/systemd*
diff --git a/chapter08/util-linux.xml b/chapter08/util-linux.xml index 0ec5c1c8e..00f804842 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 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/chapter11/afterlfs.xml b/chapter11/afterlfs.xml index dcd14fed5..c866903b5 100644 --- a/chapter11/afterlfs.xml +++ b/chapter11/afterlfs.xml @@ -184,8 +184,7 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin /bin/bash --login' This method also provides a full graphical environment, but first requires installing - sshd and - wget + sshd on the LFS system, usually in chroot. It also requires a second computer. This method has the advantage of being simple by not requiring the complexity of the chroot environment. It also uses your LFS built @@ -193,6 +192,17 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin /bin/bash --login' for installing packages. + + You may use the scp command to upload the package + sources to be built onto the LFS system. If you want to download + the sources onto the LFS system directly instead, install + libtasn1, + p11-kit, + make-ca, and + wget + in chroot (or upload their sources using scp + after booting the LFS system). + 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/git-version.sh b/git-version.sh index 6a242e7ed..0e5d94da3 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-git.php b/lfs-latest-git.php index c0c7aaea3..162d8d6c8 100644 --- a/lfs-latest-git.php +++ b/lfs-latest-git.php @@ -85,8 +85,9 @@ function http_get_file( $url ) exec( "curl --location --silent --max-time 30 $url", $dir ); - $s = implode( "\n", $dir ); - $dir = strip_tags( $s ); + $dir = implode( "\n", $dir ); + if ( !preg_match( "/api.github.com/", $url) ) + $dir = strip_tags( $dir ); return explode( "\n", $dir ); } @@ -127,6 +128,7 @@ if ( $package == "expect" ) $dirpath = "https://sourceforge.net/projects/exp if ( $package == "file" ) $dirpath = "https://github.com/file/file/tags"; if ( $package == "flex" ) $dirpath = github("westes/flex"); if ( $package == "flit_core" ) $dirpath = "https://pypi.org/project/flit-core/"; +if ( $package == "setuptools" ) $dirpath = "https://pypi.org/project/setuptools/"; if ( $package == "gcc" ) $dirpath = max_parent( $dirpath, "gcc-" ); if ( $package == "iana-etc" ) $dirpath = github("Mic92/iana-etc"); if ( $package == "intltool" ) $dirpath = "https://launchpad.net/intltool/trunk"; @@ -293,6 +295,9 @@ if ( $package == "zstd" ) $dirpath = github("facebook/zstd"); if ( $package == "flit_core" ) return find_max( $lines, "/flit-core /", "/^.*flit-core ([\d\.]+)$/" ); + if ( $package == "setuptools" ) + return find_max( $lines, "/setuptools /", "/^.*setuptools ([\d\.]+)$/" ); + if ( $package == "procps-ng" ) return find_max( $lines, "/v\d/", "/^.*v([\d\.]+)$/" ); diff --git a/packages.ent b/packages.ent index 7827212da..50b140bf2 100644 --- a/packages.ent +++ b/packages.ent @@ -47,20 +47,20 @@ - - + + - + - - + + - + @@ -148,10 +148,10 @@ - - + + - + @@ -208,10 +208,10 @@ - - + + - + @@ -222,7 +222,6 @@ - @@ -246,10 +245,10 @@ - - + + - + @@ -318,10 +317,10 @@ - + - + @@ -330,7 +329,6 @@ - @@ -343,10 +341,10 @@ - - + + - + @@ -359,19 +357,19 @@ - - + + - + - - + + - - + + @@ -432,19 +430,22 @@ - - + + - + - + - - - + + + @@ -469,10 +470,10 @@ - - + + - + @@ -493,10 +494,10 @@ - - + + - + @@ -535,10 +536,10 @@ - - + + - + @@ -555,22 +556,22 @@ - + - + - + - - + + - + @@ -594,19 +595,19 @@ - - - + + + - + - - + + @@ -627,11 +628,19 @@ - - + + + + + + + + + + - - + + @@ -690,10 +699,10 @@ - - + + - + @@ -726,21 +735,21 @@ - + - - - - + + + + - - + + - + @@ -753,10 +762,10 @@ - - + + - + diff --git a/patches.ent b/patches.ent index 7bb34e656..13f291e0f 100644 --- a/patches.ent +++ b/patches.ent @@ -14,9 +14,9 @@ - - - + + + @@ -26,9 +26,9 @@ - - - + + + diff --git a/stylesheets/lfs-xsl/chunk-slave.xsl b/stylesheets/lfs-xsl/chunk-slave.xsl index dab359d1d..1482ae351 100644 --- a/stylesheets/lfs-xsl/chunk-slave.xsl +++ b/stylesheets/lfs-xsl/chunk-slave.xsl @@ -10,9 +10,6 @@ - - - diff --git a/stylesheets/lfs-xsl/pdf/lfs-pagesetup.xsl b/stylesheets/lfs-xsl/pdf/lfs-pagesetup.xsl index 49337d0ef..787a0e8c1 100644 --- a/stylesheets/lfs-xsl/pdf/lfs-pagesetup.xsl +++ b/stylesheets/lfs-xsl/pdf/lfs-pagesetup.xsl @@ -241,4 +241,22 @@ + + + + + + + i + i + i + i + i + i + 1 + + + diff --git a/tidy.conf b/tidy.conf index 9db8e5f92..fc3672899 100644 --- a/tidy.conf +++ b/tidy.conf @@ -1,8 +1,6 @@ indent-spaces: 2 wrap: 78 tab-size: 8 -input-encoding: latin1 -output-encoding: latin1 write-back: yes markup: yes indent: yes