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-$$( &before; - Automake + Automake and Coreutils @@ -189,7 +189,7 @@ &before; - None + Coreutils @@ -286,14 +286,15 @@ &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 @@ -447,8 +451,9 @@ &dependencies; - Bash, Binutils, Coreutils, GCC, Gettext, Glibc, GMP, Grep, - Libcap, Make, OpenSSL, Patch, Perl, Sed, and Texinfo + Autoconf, Automake, Bash, Binutils, Coreutils, GCC, Gettext, + Glibc, GMP, Grep, Libcap, Make, OpenSSL, Patch, Perl, Sed, and + Texinfo @@ -2514,9 +2519,10 @@ &before; - D-Bus, E2fsprogs, + Binutils, + D-Bus, E2fsprogs, IProute2, Kmod, Man-DB, Procps-ng, Python, - &systemd-udev;, and Util-linux + &systemd-udev;, and Util-linux @@ -2566,7 +2572,7 @@ None - elogind + elogind @@ -2854,6 +2860,11 @@ &external; + AppArmor, + + audit-userspace, + + bash-completion, btrfs-progs, cURL, @@ -2861,20 +2872,20 @@ docbook-xml, docbook-xsl-nons, - elfutils, Git, - gnu-efi, GnuTLS, iptables, + jekyll, kexec-tools, + libbpf, + libdw, libfido2, libgcrypt, libidn2, - Libmicrohttpd, + libmicrohttpd, libpwquality, libseccomp, @@ -2889,16 +2900,23 @@ p11-kit, PCRE2, Polkit, + pyelftools, qemu, qrencode, - - quota-tools, + quota-tools, + rpm, rsync, + + SELinux, Sphinx, + + systemtap, tpm2-tss, Valgrind, + Xen, and zsh @@ -3380,7 +3398,7 @@ &before; - GCC, Libelf, and &systemd-udev; + Binutils, GCC, Libelf, and &systemd-udev; diff --git a/bootscripts/ChangeLog b/bootscripts/ChangeLog index d255411b1..aff30cb41 100644 --- a/bootscripts/ChangeLog +++ b/bootscripts/ChangeLog @@ -1,3 +1,6 @@ +2023-07-28 Xi Ruoyao + * In mountvirtfs, mount /sys/fs/cgroup for udev from systemd-254. + 2023-07-22 Xi Ruoyao * In mountvirtfs, create symlinks /dev/{fd,std{in,out,err}} and /dev/core (optional). 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/bootscripts/lfs/init.d/mountvirtfs b/bootscripts/lfs/init.d/mountvirtfs index bbf30cf90..fd797787a 100644 --- a/bootscripts/lfs/init.d/mountvirtfs +++ b/bootscripts/lfs/init.d/mountvirtfs @@ -63,6 +63,10 @@ case "${1}" in log_info_msg2 " ${INFO}/dev/shm" mount -o nosuid,nodev /dev/shm || failed=1 + mkdir -p /sys/fs/cgroup + log_info_msg2 " ${INFO}/sys/fs/cgroup" + mount -o nosuid,noexec,nodev /sys/fs/cgroup || failed=1 + (exit ${failed}) evaluate_retval if [ "${failed}" = 1 ]; then diff --git a/chapter01/askforhelp.xml b/chapter01/askforhelp.xml index 367e880c0..5eb1d939f 100644 --- a/chapter01/askforhelp.xml +++ b/chapter01/askforhelp.xml @@ -10,6 +10,28 @@ Help + + + In case you've hit an issue building one package with the LFS + instruction, we strongly discourage posting the issue directly onto + the upstream support channel before discussing via a LFS support + channel listed in . + Doing so is often quite inefficient because the upstream + maintainers are rarely familiar with LFS building procedure. Even if + you've really hit an upstream issue, the LFS community can still help + to isolate the information wanted by the upstream maintainers and make + a proper report. + + + + If you must ask a question directly via an upstream support channel, + you shall at least note that many upstream projects have the support + channels separated from the bug tracker. The bug + reports for asking questions are considered invalid and may annoy + upstream developers for these projects. + + + If an issue or a question is encountered while working through this book, please check the FAQ page at . Questions are often already answered there. If your question is not diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index cfb845733..5f2d4860f 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,419 +40,147 @@ appropriate for the entry or if needed the entire day's listitem. --> - - 2023-07-22 + + 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. + - [xry111] - Make the mountvirtfs bootscript create essential - symlinks in /dev. Fixes - #5289. - - - - - - 2023-07-15 - - - [xry111] - Replace eudev-3.2.12 with udev from systemd-253. - Fixes #5085. + [bdubbs] - Update to sysvinit-3.08. Fixes + #5321. - [bdubbs] - Update to iana-etc-20230629. Addresses - #5006. + [bdubbs] - Update to shadow-4.14.0. Fixes + #5319. - [bdubbs] - Update to linux-6.4.3. Fixes - #5284. + [bdubbs] - Update to Python-3.11.5. Fixes + #5330. - [bdubbs] - Update to libxcrypt-4.4.36. Fixes - #5283. + [bdubbs] - Update to procps-ng-4.0.4. Fixes + #5335. - [bdubbs] - Update to groff-1.23.0. Fixes - #5282. + [bdubbs] - Update to pkgconf-2.0.2. Fixes + #5323. - [bdubbs] - Update to perl-5.38.0. Fixes - #5281. - - - - - - 2023-07-02 - - - [xry111] - Add libxcrypt-4.4.35. Fixes - #5280. + [bdubbs] - Update to mpfr-4.2.1. Fixes + #5326. - [xry111] - Update to iproute2-6.4.0. Fixes - #5277. + [bdubbs] - Update to kbd-2.6.2. Fixes + #5318. - [xry111] - Update to linux-6.4.1. Fixes - #5276. - - - - - - 2023-07-01 - - - [bdubbs] - Update to iana-etc-20230615. Addresses - #5006. + [bdubbs] - Update to gzip-1.13. Fixes + #5325. - [bdubbs] - Update to vim-9.0.1671. Addresses - #4500. - - - [bdubbs] - Update to util-linux-2.39.1. Addresses - #5278. - - - [bdubbs] - Update to linux-6.3.10. Addresses - #5276. - - - [rahul] - Update to kbd-2.6.1. Fixes - #5279. - - - [bdubbs] - Update to gettext-0.22. Fixes - #5275. - - - - - - 2023-06-17 - - - [xry111] - Update to linux-6.3.8. Fixes - #5272. - - - [xry111] - Update to kbd-2.6.0. Fixes - #5273. - - - [rahul] - Changed from pkg-config to pkgconf 1.9.5. Fixes - #5274. - - - - - - 2023-06-09 - - - [bdubbs] - Update to dbus-1.14.8. Fixes - #5271. - - - [bdubbs] - Update to linux-6.3.6. Fixes - #5269. - - - [bdubbs] - Update to Python-3.11.4. Fixes - #5271. - - - - - - 2023-06-03 - - - [bdubbs] - Update to iana-etc-20230524. Addresses - #5006. + [bdubbs] - Update to coreutils-9.4. Fixes + #5334. - [bdubbs] - Update to MarkupSafe-2.1.3 (Python Module). Fixes - #5268. + [bdubbs] - Specify the 'nobody-group' for systemd. Fixes + #5333. - [bdubbs] - Update to linux-6.3.5. Fixes - #5264. - - - [bdubbs] - Update to openssl-3.1.1. Fixes - #5267. - - - [bdubbs] - Update to meson-1.1.1. Fixes - #5266. - - - [bdubbs] - Update to diffutils-3.10. Fixes - #5262. - - - [bdubbs] - Update to bc-6.6.0. Fixes - #5263. - - - - - - 2023-05-25 - - - [ken] - Remove unneeded group sgx from eudev rules. Fixes - #5265. + [bdubbs] - Remove unused usb group. Fixes + #5331. - 2023-05-18 + 2023-09-01 - [bdubbs] - Update to util-linux-2.39. Fixes - #5259. - - - [bdubbs] - Update to linux-6.3.3. Fixes - #5261. - - - [bdubbs] - Update to libcap-2.69. Fixes - #5258. - - - [bdubbs] - Update to grep-3.11. Fixes - #5256. - - - [bdubbs] - Update to flit_core-3.9.0. Fixes - #5257. - - - [bdubbs] - Update to eudev-3.2.12. Fixes - #5260. - - - - - - 2023-05-13 - - - [xry111] - Update to less-633. Fixes - #5251. - - - [xry111] - Update to linux-6.3.2. Fixes - #5255. - - - [xry111] - Update to xz-5.4.3. Fixes - #5252. - - - [xry111] - Update to gawk-5.2.2. Fixes - #5253. - - - [xry111] - Fix systemd runtime issue exploited by GCC 13. - Fixes #5254. - - - - - - 2023-05-01 - - - [bdubbs] - Update to vim-9.0.1503. Addresses - #4500. - - - [bdubbs] - Update to iana-etc-20230418. Addresses - #5006. - - - [bdubbs] - Update to sysvinit-3.07. Fixes - #5250. - - - [bdubbs] - Update to iproute2-6.3.0. Fixes - #5248. - - - [bdubbs] - Update to gcc-13.1.0. Fixes - #5247. - - - [bdubbs] - Update to perl-5.36.1. Fixes - #5246. - - - [bdubbs] - Update to linux-6.3.1. Fixes - #5245. - - - [bdubbs] - Update to coreutils-9.3. Fixes - #5244. - - - - - - 2023-04-15 - - - [bdubbs] - Update to vim-9.0.1452. Addresses - #4500. - - - [bdubbs] - Update to iana-etc-20230405. Addresses - #5006. - - - [bdubbs] - Update to zstd-1.5.5. Fixes - #5239. - - - [bdubbs] - Update to Python-3.11.3. Fixes - #5240. - - - [bdubbs] - Update to meson-1.1.0. Fixes - #5242. - - - [bdubbs] - Update to man-pages-6.04. Fixes - #5238. - - - [bdubbs] - Update to linux-6.2.11. Fixes - #5241. - - - - - - 2023-03-31 - - - [xry111] - Update to linux-6.2.9 (security fix). Fixes - #5230. - - - [xry111] - Update to grep-3.10. Fixes - #5234. - - - [xry111] - Update to wheel-0.40.0. Fixes - #5229. - - - [xry111] - Update to bc-6.5.0. Fixes - #5228. - - - [xry111] - Update to texinfo-7.0.3. Fixes - #5235. - - - [xry111] - Update to coreutils-9.2. Fixes - #5232. - - - [xry111] - Update to libcap-2.68. Fixes - #5236. - - - [xry111] - Update to tzdata-2023c. Fixes - #5237. - - - [xry111] - Update to xz-5.4.2. Fixes - #5233. - - - [xry111] - Update to openssl-3.1.0. Fixes - #5227. - - - [xry111] - Add flit-core-3.8.0. - - - - - - 2023-03-15 - - - [bdubbs] - Update to bc-6.4.0. Fixes - #5217. - - - [bdubbs] - Update to grep-3.9. Fixes - #5225. - - - [bdubbs] - Update to linux-6.2.6. Fixes - #5226. - - - [bdubbs] - Update to iana-etc-20230306. Addresses - #5006. - - - - - 2023-03-04 - - - [xry111] - Update to systemd-253. Fixes - #5206. - - - [xry111] - Update to bc-6.3.1. Fixes - #5217. - - - [xry111] - Update to linux-6.2.2 (security fixes). Fixes - #5218. - - - [xry111] - Update to procps-ng-4.0.3. Fixes - #5220. - - - [xry111] - Update to iproute2-6.2.0. Fixes - #5221. - - - [xry111] - Update to meson-1.0.1. Fixes - #5222. - - - [xry111] - Update to make-4.4.1. Fixes - #5223. - - - [xry111] - Update to libelf-0.189. Fixes - #5224. - - - [bdubbs] - Change to a better host requirements script in Chapter 2. - - - - - - 2023-03-01 - - - [bdubbs] - LFS-11.3 released. + [bdubbs] - LFS-12.0 released. diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml index 42d10c0aa..e1fca225c 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -11,26 +11,6 @@ What's new since the last release - - - During a development cycle of LFS, the instructions in the book is - 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. - - - - In the 11.4 release, --disable-fixincludes - is set for GCC. It's a configure switch newly added in GCC 13.1 to - prevent GCC from fixing the system headers. Such a - fix is unnecessary for a modern Linux system and may cause - issues if a package is updated after installing GCC. - Here is a list of the packages updated since the previous release of LFS. @@ -59,11 +39,11 @@ Automake-&automake-version; --> + - - Bc &bc-version; - @@ -85,15 +65,12 @@ D-Bus-&dbus-version; - + - @@ -109,21 +86,21 @@ - + - + - + @@ -133,30 +110,30 @@ - + + - - IANA-Etc-&iana-etc-version; + Gzip-&gzip-version; + - + @@ -166,18 +143,18 @@ - + - + + @@ -193,42 +170,45 @@ - + - + + + - + - + - Perl-&perl-version; + Pkgconf-&pkgconf-version; + Procps-ng-&procps-ng-version; @@ -244,51 +224,54 @@ - - - Sysklogd-&sysklogd-version; - - - Systemd-&systemd-version; + + + SysVinit-&sysvinit-version; + - + - Util-Linux-&util-linux-version; + Util-linux-&util-linux-version; Vim-&vim-version; + + Wheel-&wheel-version; + - - - Zstd-&zstd-version; + Zlib-&zlib-version; + - - Udev-&systemd-version; (from systemd) - - - - Jinja2-&jinja2-version; - - - - MarkupSafe-&markupsafe-version; - - - Libxcrypt-&libxcrypt-version; + &glibc-upstream-fixes-patch; - - Pkgconf-&flit-core-version; - - - - Flit-core-&flit-core-version; - - - - - - - Removed: - - eudev-3.2.12 - - - Pkg-config-0.29.2 + glibc-2.38-memalign_fix-1.patch - - systemd-252-security_fix-1.patch - diff --git a/chapter02/hostreqs.xml b/chapter02/hostreqs.xml index f72a8081f..7b4a037eb 100644 --- a/chapter02/hostreqs.xml +++ b/chapter02/hostreqs.xml @@ -126,7 +126,7 @@ - Texinfo-4.7 + Texinfo-5.0 @@ -154,7 +154,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 @@ -205,7 +205,7 @@ ver_check Perl perl 5.8.8 ver_check Python python3 3.4 ver_check Sed sed 4.1.5 ver_check Tar tar 1.22 -ver_check Texinfo texi2any 4.7 +ver_check Texinfo texi2any 5.0 ver_check Xz xz 5.0.0 alias_check() { diff --git a/chapter03/packages.xml b/chapter03/packages.xml index 4db7bb5a1..dba151cac 100644 --- a/chapter03/packages.xml +++ b/chapter03/packages.xml @@ -62,7 +62,6 @@ Home page: Download: MD5 sum: &automake-md5; - SHA256 sum: &automake-sha256; diff --git a/chapter03/patches.xml b/chapter03/patches.xml index 5f1bbf0c2..00628bda7 100644 --- a/chapter03/patches.xml +++ b/chapter03/patches.xml @@ -77,6 +77,14 @@ --> + + Glibc Upstream Fixes Patch - &glibc-upstream-fixes-patch-size;: + + Download: + MD5 sum: &glibc-upstream-fixes-patch-md5; + + + Glibc FHS Patch - &glibc-fhs-patch-size;: diff --git a/chapter05/glibc.xml b/chapter05/glibc.xml index a878f1c6c..3772ef075 100644 --- a/chapter05/glibc.xml +++ b/chapter05/glibc.xml @@ -93,7 +93,6 @@ cd build --build=$(../scripts/config.guess) \ --enable-kernel=&linux-major-version;.&linux-minor-version; \ --with-headers=$LFS/usr/include \ - --disable-crypt \ libc_cv_slibdir=/usr/lib diff --git a/chapter06/binutils-pass2.xml b/chapter06/binutils-pass2.xml index ef5c18433..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 @@ -101,7 +107,7 @@ cd build Remove the libtool archive files because they are harmful for cross compilation, and remove unnecessary static libraries: -rm -v $LFS/usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes}.{a,la} +rm -v $LFS/usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes,sframe}.{a,la} 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/chapter06/diffutils.xml b/chapter06/diffutils.xml index af4d95429..d2b875a9d 100644 --- a/chapter06/diffutils.xml +++ b/chapter06/diffutils.xml @@ -45,7 +45,9 @@ Prepare Diffutils for compilation: -./configure --prefix=/usr --host=$LFS_TGT + ./configure --prefix=/usr \ + --host=$LFS_TGT \ + --build=$(./build-aux/config.guess) Compile the package: diff --git a/chapter06/grep.xml b/chapter06/grep.xml index 1bccd7486..dd942c712 100644 --- a/chapter06/grep.xml +++ b/chapter06/grep.xml @@ -45,8 +45,9 @@ Prepare Grep for compilation: -./configure --prefix=/usr \ - --host=$LFS_TGT + ./configure --prefix=/usr \ + --host=$LFS_TGT \ + --build=$(./build-aux/config.guess) Compile the package: diff --git a/chapter06/sed.xml b/chapter06/sed.xml index b3e39c215..b297afedd 100644 --- a/chapter06/sed.xml +++ b/chapter06/sed.xml @@ -45,8 +45,9 @@ Prepare Sed for compilation: -./configure --prefix=/usr \ - --host=$LFS_TGT + ./configure --prefix=/usr \ + --host=$LFS_TGT \ + --build=$(./build-aux/config.guess) Compile the package: 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/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/binutils.xml b/chapter08/binutils.xml index cf1c4f895..1fd436bd1 100644 --- a/chapter08/binutils.xml +++ b/chapter08/binutils.xml @@ -145,14 +145,15 @@ cd build and options are passed to GCC. + Three tests in the gprofng suite are also known to fail. + Install the package: make tooldir=/usr install - Remove useless static libraries and an empty man page: + Remove useless static libraries: -rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,sframe,opcodes}.a -rm -fv /usr/share/man/man1/{gprofng,gp-*}.1 +rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,gprofng,opcodes,sframe}.a @@ -167,7 +168,8 @@ rm -fv /usr/share/man/man1/{gprofng,gp-*}.1 addr2line, ar, as, c++filt, dwp, elfedit, gprof, gprofng, ld, ld.bfd, ld.gold, nm, objcopy, objdump, ranlib, readelf, size, strings, and strip - libbfd.so, libctf.so, libctf-nobfd.so, libopcodes.so, and libsframe.so + libbfd.so, libctf.so, libctf-nobfd.so, libgprofng.so, + libopcodes.so, and libsframe.so /usr/lib/ldscripts @@ -415,6 +417,17 @@ rm -fv /usr/share/man/man1/{gprofng,gp-*}.1 + + libgprofng + + A library containing most routines used by + gprofng + + libgprofng + + + + libopcodes 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/coreutils.xml b/chapter08/coreutils.xml index 1ff3101e9..afd6672f9 100644 --- a/chapter08/coreutils.xml +++ b/chapter08/coreutils.xml @@ -121,7 +121,7 @@ FORCE_UNSAFE_CONFIGURE=1 ./configure \ these tests are not skipped, add a temporary group and make the user tester a part of it: -echo "dummy:x:102:tester" >> /etc/group +groupadd -g 102 dummy -U tester Fix some of the permissions so that the non-&root; user can compile and run the tests: @@ -139,7 +139,8 @@ FORCE_UNSAFE_CONFIGURE=1 ./configure \ Remove the temporary group: -sed -i '/dummy/d' /etc/group +groupdel dummy + Install the package: make install diff --git a/chapter08/dbus.xml b/chapter08/dbus.xml index f59dd122b..8ab4744ad 100644 --- a/chapter08/dbus.xml +++ b/chapter08/dbus.xml @@ -52,6 +52,7 @@ --sysconfdir=/etc \ --localstatedir=/var \ --runstatedir=/run \ + --enable-user-session \ --disable-static \ --disable-doxygen-docs \ --disable-xml-docs \ @@ -73,6 +74,18 @@ + + + --enable-user-session + + + This ensures the D-Bus per-user service and socket unit + files are installed for Systemd. They are not useful (but + harmless) in a base LFS installation, however they can be used + once systemd is rebuilt with PAM support in BLFS. + + + Compile the package: 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/gawk.xml b/chapter08/gawk.xml index a6b74460b..cc9348d90 100644 --- a/chapter08/gawk.xml +++ b/chapter08/gawk.xml @@ -61,12 +61,6 @@ su tester -c "PATH=$PATH make check" make LN='ln -f' install - The installation process already created awk - as a symlink to gawk, create its man page as a - symlink as well: - -ln -sv gawk.1 /usr/share/man/man1/awk.1 - The meaning of the overridden make variable: @@ -79,6 +73,12 @@ su tester -c "PATH=$PATH make check" + The installation process already created awk + as a symlink to gawk, create its man page as a + symlink as well: + +ln -sv gawk.1 /usr/share/man/man1/awk.1 + If desired, install the documentation: mkdir -pv /usr/share/doc/gawk-&gawk-version; diff --git a/chapter08/gcc.xml b/chapter08/gcc.xml index 1357f9527..97d5fe1a0 100644 --- a/chapter08/gcc.xml +++ b/chapter08/gcc.xml @@ -171,10 +171,10 @@ su tester -c "PATH=$PATH make -k check" url="&test-results;"/> and . - Two tests named pr104610.c and + Two tests named copy.cc and pr56837.c are known to fail. @@ -183,6 +183,17 @@ su tester -c "PATH=$PATH make -k check" vect directory are known to fail if the hardware does not support AVX. + + With Glibc-2.38, the analyzer tests named + data-model-4.c and + conftest-1.c + are known to fail. + In the asan tests, several tests in asan_test.C + are known to fail. + The test named interception-malloc-test-1.C + is known to fail. + + A few unexpected failures cannot always be avoided. The GCC developers are usually aware of these issues, but have not resolved them yet. Unless the test results are vastly different from those at the above URL, diff --git a/chapter08/glibc.xml b/chapter08/glibc.xml index 5e9969064..179357c00 100644 --- a/chapter08/glibc.xml +++ b/chapter08/glibc.xml @@ -50,15 +50,10 @@ patch -Np1 -i ../&glibc-fhs-patch; - - Fix a security issue identified upstream: + Now fix two security vulnerabilities and a regression causing the + posix_memalign() function very slow in some conditions: -sed '/width -=/s/workend - string/number_length/' \ - -i stdio-common/vfprintf-process-arg.c +patch -Np1 -i ../&glibc-upstream-fixes-patch; The Glibc documentation recommends building Glibc in a dedicated build directory: @@ -79,7 +74,6 @@ cd build --enable-kernel=&linux-major-version;.&linux-minor-version; \ --enable-stack-protector=strong \ --with-headers=/usr/include \ - --disable-crypt \ libc_cv_slibdir=/usr/lib @@ -167,10 +161,12 @@ esac is known to fail in the LFS chroot environment. + @@ -325,7 +321,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 @@ -340,6 +336,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 0820f726c..c2fd316f8 100644 --- a/chapter08/gmp.xml +++ b/chapter08/gmp.xml @@ -54,10 +54,12 @@ The default settings of GMP produce libraries optimized for the host processor. If libraries suitable for processors less capable than the host's CPU are desired, generic libraries can be - created by running the following: + created by appending the option + to the configure command. -cp -v configfsf.guess config.guess -cp -v configfsf.sub config.sub + Prepare GMP for compilation: @@ -106,9 +108,11 @@ make html the system capabilities and there will be errors in the tests or other applications using the gmp libraries with the message "Illegal instruction". In this case, gmp should be reconfigured with the option - --build=x86_64-pc-linux-gnu and rebuilt. + and rebuilt. - Ensure that all 197 tests in the test suite passed. + + Ensure that at least 199 tests in the test suite passed. Check the results by issuing the following command: awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log @@ -124,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/less.xml b/chapter08/less.xml index 237cf1e15..99f4e62ee 100644 --- a/chapter08/less.xml +++ b/chapter08/less.xml @@ -62,7 +62,9 @@ make - This package does not come with a test suite. + To test the results, issue: + +make check Install the package: 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/libxcrypt.xml b/chapter08/libxcrypt.xml index 3fb59941d..1838a55b6 100644 --- a/chapter08/libxcrypt.xml +++ b/chapter08/libxcrypt.xml @@ -100,10 +100,10 @@ them at runtime. However, the only known binary-only applications that link against these functions require ABI version 1. If you must have such functions because of some binary-only application or to be - to be compliant with LSB, build the package again with the following + compliant with LSB, build the package again with the following commands: -make distclean +make distclean ./configure --prefix=/usr \ --enable-hashes=strong,glibc \ --enable-obsolete-api=glibc \ 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/ncurses.xml b/chapter08/ncurses.xml index 58221d144..b51099001 100644 --- a/chapter08/ncurses.xml +++ b/chapter08/ncurses.xml @@ -158,8 +158,7 @@ ln -sfv libncurses.so /usr/lib/libcurses.so If desired, install the Ncurses documentation: -mkdir -pv /usr/share/doc/ncurses-&ncurses-version; -cp -v -R doc/* /usr/share/doc/ncurses-&ncurses-version; +cp -v -R doc -T /usr/share/doc/ncurses-&ncurses-version; diff --git a/chapter08/openssl.xml b/chapter08/openssl.xml index 40a769311..6a4441552 100644 --- a/chapter08/openssl.xml +++ b/chapter08/openssl.xml @@ -101,21 +101,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 724a1ff24..b95d7ab2c 100644 --- a/chapter08/pkgconf.xml +++ b/chapter08/pkgconf.xml @@ -41,8 +41,14 @@ + 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 e17d199ca..7fc74f587 100644 --- a/chapter08/procps.xml +++ b/chapter08/procps.xml @@ -67,32 +67,13 @@ Compile the package: -make - To run the test suite, run: make check - - One test named free with commit - may fail if some applications with a custom memory allocator (for - example, JVM and Web browsers) are running on the host distro. - Install the package: make install 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 70e0d6ebb..b7b983d73 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 @@ -88,12 +91,13 @@ done online_usrbin="bash find strip" online_usrlib="libbfd-&binutils-version;.so - libsframe.so.0.0.0 + libsframe.so.&libsframe-version; libhistory.so.&readline-soversion; libncursesw.so.&ncurses-version; 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 e99167d07..761467acd 100644 --- a/chapter08/systemd.xml +++ b/chapter08/systemd.xml @@ -40,19 +40,6 @@ Installation of systemd - - Remove several inappropriate uses of the pure - attribute that cause runtime issues when the package is built - with gcc-13 or later: - - -sed '/bus_message_type_from_string/s/_pure_//' \ - -i src/libsystemd/sd-bus/bus-internal.h && -sed '/devt_hash_func/s/_pure_//' \ - -i src/basic/hash-funcs.h && -sed '/job_get_timeout/s/_pure_//' \ - -i src/core/job.h - Remove two unneeded groups, render and sgx, from the default udev @@ -81,6 +68,7 @@ meson setup \ -Dmode=release \ -Dpamconfdir=no \ -Ddev-kvm-mode=0660 \ + -Dnobody-group=nogroup \ -Ddocdir=/usr/share/doc/systemd-&systemd-version; \ .. @@ -191,6 +179,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: @@ -205,7 +201,9 @@ meson setup \ -tar -xf ../../systemd-man-pages-&systemd-man-version;.tar.xz --strip-components=1 -C /usr/share/man +tar -xf ../../systemd-man-pages-&systemd-version;.tar.xz \ + --no-same-owner --strip-components=1 \ + -C /usr/share/man Create the /etc/machine-id file needed by systemd-journald: @@ -244,12 +242,14 @@ meson setup \ busctl, coredumpctl, halt (symlink to systemctl), hostnamectl, init, journalctl, kernel-install, localectl, loginctl, - machinectl, networkctl, oomctl, portablectl, poweroff (symlink to + machinectl, mount.ddi (symlink to systemd-dissect), networkctl, + oomctl, portablectl, poweroff (symlink to systemctl), reboot (symlink to systemctl), resolvconf (symlink to resolvectl), resolvectl, runlevel (symlink to systemctl), shutdown (symlink to systemctl), systemctl, systemd-ac-power, systemd-analyze, systemd-ask-password, systemd-cat, systemd-cgls, systemd-cgtop, - systemd-creds, systemd-delta, systemd-detect-virt, + systemd-confext (symlink to systemd-sysext), systemd-creds, + systemd-delta, systemd-detect-virt, systemd-dissect, systemd-escape, systemd-hwdb, systemd-id128, systemd-inhibit, systemd-machine-id-setup, systemd-mount, systemd-notify, systemd-nspawn, systemd-path, diff --git a/chapter08/tar.xml b/chapter08/tar.xml index bfb1cf469..ea5f44ebb 100644 --- a/chapter08/tar.xml +++ b/chapter08/tar.xml @@ -72,9 +72,17 @@ make check + + The test time for Tar can be reduced significantly on a + system with multiple cores. To do this, append + TESTSUITEFLAGS=-j<N> to the line above. For + instance, using -j4 can reduce the test time by over 70 + percent. + One test, capabilities: binary store/restore, is known to fail if it is run because LFS lacks selinux, but will be skipped if the host kernel does - not support extended attributes on the filesystem used for building LFS. + not support extended attributes or security labels on the filesystem + used for building LFS. Install the package: diff --git a/chapter08/udev.xml b/chapter08/udev.xml index 2d3792511..35bb12f46 100644 --- a/chapter08/udev.xml +++ b/chapter08/udev.xml @@ -127,7 +127,7 @@ meson setup \ install -vm755 -d /usr/{lib,share}/pkgconfig install -vm755 udevadm /usr/bin/ install -vm755 systemd-hwdb /usr/bin/udev-hwdb -ln -sv ../bin/udevadm /usr/sbin/udevd +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/ @@ -147,11 +147,12 @@ make -f &udev-lfs-version;/Makefile.lfs install -tar -xf ../../systemd-man-pages-253.tar.xz --strip-components=1 \ +tar -xf ../../systemd-man-pages-&systemd-man-version;.tar.xz \ + --no-same-owner --strip-components=1 \ -C /usr/share/man --wildcards '*/udev*' '*/libudev*' \ '*/systemd-'{hwdb,udevd.service}.8 -sed 's/systemd\(\\\?-\)/udev-/' /usr/share/man/man8/systemd-hwdb.8 \ - > /usr/share/man/man8/udev-hwdb.8 +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 diff --git a/chapter08/util-linux.xml b/chapter08/util-linux.xml index 6c37af728..a6d058aff 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 @@ -1230,7 +1230,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/chapter09/usage.xml b/chapter09/usage.xml index 2e9843988..b14f3635c 100644 --- a/chapter09/usage.xml +++ b/chapter09/usage.xml @@ -146,7 +146,7 @@ EOF an S, and all of them have two numbers following the initial letter. The K means to stop (kill) a service and the S means to start a service. The numbers determine the order in which the scripts are run, from 00 - to 99—the smaller the number, the sooner tht script runs. When + to 99—the smaller the number, the sooner the script runs. When init switches to another run level, the appropriate services are either started or stopped, depending on the run level chosen. diff --git a/chapter10/fstab.xml b/chapter10/fstab.xml index 5cb719d00..63758a71d 100644 --- a/chapter10/fstab.xml +++ b/chapter10/fstab.xml @@ -22,17 +22,18 @@ cat > /etc/fstab << "EOF" # Begin /etc/fstab -# file system mount-point type options dump fsck -# order +# file system mount-point type options dump fsck +# order -/dev/sda3 / ext4 defaults 1 1 -/dev/sda2 /boot ext4 defaults 0 2 -proc /proc proc nosuid,noexec,nodev 0 0 -sysfs /sys sysfs nosuid,noexec,nodev 0 0 -devpts /dev/pts devpts gid=5,mode=620 0 0 -tmpfs /run tmpfs defaults 0 0 -devtmpfs /dev devtmpfs mode=0755,nosuid 0 0 -tmpfs /dev/shm tmpfs nosuid,nodev 0 0 +/dev/sda2 / <fff> defaults 1 1 +/dev/sda3 swap swap pri=1 0 0 +proc /proc proc nosuid,noexec,nodev 0 0 +sysfs /sys sysfs nosuid,noexec,nodev 0 0 +devpts /dev/pts devpts gid=5,mode=620 0 0 +tmpfs /run tmpfs defaults 0 0 +devtmpfs /dev devtmpfs mode=0755,nosuid 0 0 +tmpfs /dev/shm tmpfs nosuid,nodev 0 0 +cgroup2 /sys/fs/cgroup cgroup2 nosuid,noexec,nodev 0 0 # End /etc/fstab EOF diff --git a/chapter10/grub.xml b/chapter10/grub.xml index 85bccb9c8..2433777f7 100644 --- a/chapter10/grub.xml +++ b/chapter10/grub.xml @@ -19,8 +19,10 @@ If your system has UEFI support and you wish to boot LFS with UEFI, - you should skip this page, and configure GRUB with UEFI support - using the instructions provided in + you should skip the instructions in this page but still learn the + syntax of grub.cfg and the method to specify + a partition in the file from this page, and configure GRUB with UEFI + support using the instructions provided in the BLFS page. @@ -126,6 +128,7 @@ xorriso -as cdrecord -v dev=/dev/cdrw blank=as_needed grub-img.iso EOF + + The insmod commands load the + GRUB modules named + part_gpt and ext2. + Despite the naming, ext2 actually supports + ext2, + ext3, and + ext4 filesystems. + The grub-install command has embedded some modules + into the main GRUB image (installed into + the MBR or the GRUB BIOS partition) to access the other modules + (in /boot/grub/i386-pc) without + a chicken-or-egg issue, so with a typical configuration these two + modules are already embedded and those two insmod + commands will do nothing. But they do no harm anyway, and they may + be needed with some rare configurations. + + From GRUB's perspective, the kernel files are relative to the partition used. If you used a separate /boot partition, remove /boot from the above diff --git a/chapter10/kernel.xml b/chapter10/kernel.xml index 00055803c..851962a87 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 @@ -130,67 +131,16 @@ Be sure to enable/disable/set the following features or the system might not work correctly or boot at all: - Processor type and features ---> - [*] Build a relocatable kernel [CONFIG_RELOCATABLE] - [*] Randomize the address of the kernel image (KASLR) [CONFIG_RANDOMIZE_BASE] -General setup ---> - [ ] Compile the kernel with warnings as errors [CONFIG_WERROR] - < > Enable kernel headers through /sys/kernel/kheaders.tar.xz [CONFIG_IKHEADERS] - [ ] Configure standard kernel features (expert users) [CONFIG_EXPERT] -General architecture-dependent options ---> - [*] Stack Protector buffer overflow detection [CONFIG_STACKPROTECTOR] - [*] Strong Stack Protector [CONFIG_STACKPROTECTOR_STRONG] -Device Drivers ---> - Graphics support ---> - Frame buffer Devices ---> - <*> Support for frame buffer devices ---> - Console display driver support ---> - [*] Framebuffer Console support [CONFIG_FRAMEBUFFER_CONSOLE] - Generic Driver Options ---> - [ ] Support for uevent helper [CONFIG_UEVENT_HELPER] - [*] Maintain a devtmpfs filesystem to mount at /dev [CONFIG_DEVTMPFS] - [*] Automount devtmpfs at /dev, after the kernel mounted the rootfs [CONFIG_DEVTMPFS_MOUNT] + - Processor type and features ---> - [*] Build a relocatable kernel [CONFIG_RELOCATABLE] - [*] Randomize the address of the kernel image (KASLR) [CONFIG_RANDOMIZE_BASE] -General setup ---> - [ ] Compile the kernel with warnings as errors [CONFIG_WERROR] - [ ] Auditing Support [CONFIG_AUDIT] - CPU/Task time and stats accounting ---> - [*] Pressure stall information tracking [CONFIG_PSI] - [ ] Require boot parameter to enable pressure stall information tracking [CONFIG_PSI_DEFAULT_DISABLED] - < > Enable kernel headers through /sys/kernel/kheaders.tar.xz [CONFIG_IKHEADERS] - [*] Control Group support [CONFIG_CGROUPS] ---> - [*] Memory controller [CONFIG_MEMCG] - [ ] Configure standard kernel features (expert users) [CONFIG_EXPERT] -General architecture-dependent options ---> - [*] Enable seccomp to safely compute untrusted bytecode [CONFIG_SECCOMP] - [*] Stack Protector buffer overflow detection [CONFIG_STACKPROTECTOR] - [*] Strong Stack Protector [CONFIG_STACKPROTECTOR_STRONG] -[*] Networking support ---> [CONFIG_NET] - Networking options ---> - [*] TCP/IP networking [CONFIG_INET] - <*> The IPv6 protocol [CONFIG_IPV6] -Device Drivers ---> - Generic Driver Options ---> - [ ] Support for uevent helper [CONFIG_UEVENT_HELPER] - [*] Maintain a devtmpfs filesystem to mount at /dev [CONFIG_DEVTMPFS] - [*] Automount devtmpfs at /dev, after the kernel mounted the rootfs [CONFIG_DEVTMPFS_MOUNT] - Firmware Loader ---> - [ ] Enable the firmware sysfs fallback mechanism [CONFIG_FW_LOADER_USER_HELPER] - Firmware Drivers ---> - [*] Export DMI identification via sysfs to userspace [CONFIG_DMIID] - Graphics support ---> - Frame buffer Devices ---> - <*> Support for frame buffer devices ---> - Console display driver support ---> - [*] Framebuffer Console support [CONFIG_FRAMEBUFFER_CONSOLE] -File systems ---> - [*] Inotify support for userspace [CONFIG_INOTIFY_USER] - Pseudo filesystems ---> - [*] Tmpfs POSIX Access Control Lists [CONFIG_TMPFS_POSIX_ACL] + + + Enable some additional features if you are building a 64-bit system. If you are using menuconfig, enable them in the order of CONFIG_PCI_MSI first, then @@ -198,30 +148,23 @@ File systems ---> CONFIG_X86_X2APIC because an option only shows up after its dependencies are selected. - Processor type and features ---> - [*] Support x2apic [CONFIG_X86_X2APIC] -Device Drivers ---> - [*] PCI Support ---> [CONFIG_PCI] - [*] Message Signaled Interrupts (MSI and MSI-X) [CONFIG_PCI_MSI] - [*] IOMMU Hardware Support ---> [CONFIG_IOMMU_SUPPORT] - [*] Support for Interrupt Remapping [CONFIG_IRQ_REMAP] + If you are building a 32-bit system running on a hardware with RAM more than 4GB, adjust the configuration so the kernel will be able to use up to 64GB physical RAM: - Processor type and features ---> - High Memory Support ---> - (X) 64GB [CONFIG_HIGHMEM64G] + If the partition for the LFS system is in a NVME SSD (i. e. the device node for the partition is /dev/nvme* instead of /dev/sd*), enable NVME support or the LFS system won't boot: - Device Drivers ---> - NVME Support ---> - <*> NVM Express block device [CONFIG_BLK_DEV_NVME] + @@ -349,7 +292,7 @@ Device Drivers ---> Support running the interrupt controller of 64-bit x86 processors in x2APIC mode. x2APIC may be enabled by firmware on 64-bit x86 systems, and a kernel without this option enabled will - panic on boot if x2APIC is enabled by firmware. This option has + panic on boot if x2APIC is enabled by firmware. This option has no effect, but also does no harm if x2APIC is disabled by the firmware. diff --git a/chapter10/kernel/.gitignore b/chapter10/kernel/.gitignore new file mode 100644 index 000000000..e22d2c3a4 --- /dev/null +++ b/chapter10/kernel/.gitignore @@ -0,0 +1,2 @@ +__pycache__ +s-kernel-version diff --git a/chapter10/kernel/Makefile b/chapter10/kernel/Makefile new file mode 100644 index 000000000..e04d2d6b1 --- /dev/null +++ b/chapter10/kernel/Makefile @@ -0,0 +1,23 @@ +INPUT = $(wildcard *.toml) +OUTPUT = $(patsubst %.toml, %.xml, $(INPUT)) + +ifeq ($(KERNEL_TREE),) +$(error "must set KERNEL_TREE=/path/to/kernel/source") +endif + +all: $(OUTPUT) + +kernel.version: s-kernel-version; @true + +.PHONY: s-kernel-version +s-kernel-version: + ./kernel_version.py $(KERNEL_TREE) > tmp-kernel.version + if ! diff tmp-kernel.version kernel.version ; then \ + mv tmp-kernel.version kernel.version; \ + else \ + rm tmp-kernel.version; \ + fi + touch s-kernel-version + +%.xml: %.toml kernel-config.py kernel_version.py kernel.version + ./kernel-config.py $(KERNEL_TREE) $< > $@ diff --git a/chapter10/kernel/highmem.toml b/chapter10/kernel/highmem.toml new file mode 100644 index 000000000..2caf42385 --- /dev/null +++ b/chapter10/kernel/highmem.toml @@ -0,0 +1 @@ +HIGHMEM64G='X' diff --git a/chapter10/kernel/highmem.xml b/chapter10/kernel/highmem.xml new file mode 100644 index 000000000..4f0938142 --- /dev/null +++ b/chapter10/kernel/highmem.xml @@ -0,0 +1,8 @@ + + + +Processor type and features ---> + High Memory Support ---> + (X) 64GB [HIGHMEM64G] diff --git a/chapter10/kernel/kernel-config.py b/chapter10/kernel/kernel-config.py new file mode 100755 index 000000000..a36113175 --- /dev/null +++ b/chapter10/kernel/kernel-config.py @@ -0,0 +1,298 @@ +#!/usr/bin/env python3 + +# SPDX-License-Identifier: MIT +# Copyright 2023 The LFS Editors + +# Stupid script to render "mconf"-style kernel configuration +# Usage: kernel-config.py [path to kernel tree] [needed config].toml +# The toml file should be like: +# for bool and tristate: +# EXT4="*" +# DRM="*M" +# EXPERT=" " +# DRM_I915="*M" +# for choice: +# HIGHMEM64G="X" +# an entry with comment: +# DRM_I915 = { value = " *M", comment = "for i915, crocus, or iris" } + +choice_bit = 1 << 30 +ind0 = 0 +ind1 = 0 +menu_id = 1 +stack = [] +if_stack = [] + +expand_var_mp = { 'SRCARCH': 'x86' } +main_dep = {} + +def expand_var(s): + for k in expand_var_mp: + s = s.replace('$(' + k + ')', expand_var_mp[k]) + return s + +def pop_stack(cond): + global ind0, ind1, stack + assert(cond(stack[-1][0])) + s, i0, i1, _ = stack[-1] + stack = stack[:-1] + ind0 -= i0 + ind1 -= i1 + +def pop_stack_while(cond): + while stack and cond(stack[-1][0]): + pop_stack(cond) + +def cur_menu(): + global stack + return stack[-1][3] if stack else 0 + +def cur_if(): + global if_stack + return if_stack[-1][:] if if_stack else [] + +def clean_dep(d): + d = d.strip() + if d.endswith('=y') or d.endswith('=M'): + d = d[:-2] + elif d.endswith(' != ""'): + d = d[:-6] + return d + +def parse_config(buf): + global ind0, ind1, stack, menu_id + is_choice = buf[0].strip() == 'choice' + is_menu = buf[0].startswith('menu') or is_choice + is_nonconfig_menu = buf[0].startswith('menu ') or is_choice + key = None if is_nonconfig_menu else buf[0].split()[1].strip() + title = buf[0][len('menu '):] if is_nonconfig_menu else None + deps = ['menu'] + cur_if() + klass = None + + for line in buf[1:]: + line = line.strip() + if line.startswith('depends on '): + new_deps = line[len('depends on '):].split('&&') + deps += [clean_dep(x) for x in new_deps] + elif line.startswith('prompt'): + title = line[len('prompt '):] + else: + for prefix in ['tristate', 'bool', 'string']: + if line.startswith(prefix + ' '): + title = line[len(prefix) + 1:] + klass = prefix + elif line == prefix: + klass = prefix + elif line.startswith('def_' + prefix + ' '): + klass = prefix + else: + continue + + if '"' in line: + tail = line[line.rfind('"') + 1:].strip() + if tail[:3] == 'if ': + deps += [clean_dep(x) for x in tail[3:].split('&&')] + + pop_stack_while(lambda x: x not in deps) + + menu_id += is_menu + internal_key = key or menu_id + if stack: + fa = stack[-1][0] + if fa == 'menu': + fa = cur_menu() & ~choice_bit + main_dep[internal_key] = fa + + val = known_config.get(key) + comment = None + forced = None + + if type(val) == dict: + comment = val.get('comment') + forced = val.get('forced') + val = val['value'] + + klass = klass or 'string' + if title: + title = title.strip().lstrip('"') + title = title[:title.find('"')] + + if not val: + pass + elif klass == 'string': + val = '(' + val + ')' + else: + assert((val == 'X') == bool(cur_menu() & choice_bit)) + if (val == 'X'): + val = '(X)' + else: + val = list(val) + val.sort() + for c in val: + if c not in 'M* ' or (c == 'M' and klass != 'tristate'): + raise Exception('unknown setting %s for %s' % (c, key)) + bracket = None + if klass == 'tristate' and forced != '*' : + bracket = '{}' if forced else '<>' + else: + bracket = '--' if forced else '[]' + + val = bracket[0] + '/'.join(val) + bracket[1] + + arrow = ' --->' if is_menu else '' + r = [ind0, val, ind1, title, arrow, internal_key, cur_menu(), comment] + + # Don't indent for untitled (internal) entries + x = 2 if title else 0 + + key = key or 'menu' + menu = (menu_id if is_menu else cur_menu()) + menu |= choice_bit if is_choice else 0 + stack_ent = (key, 2, 0, menu) if is_menu else (key, 0, x, menu) + ind0 += stack_ent[1] + ind1 += stack_ent[2] + stack += [stack_ent] + + return r + +def load_kconfig(file): + global ind0, ind1, stack, path, menu_id, if_stack + r = [] + config_buf = [] + with open(path + file) as f: + for line in f: + if config_buf: + if not (line.startswith('\t') or line.startswith(' ')): + r += [parse_config(config_buf)] + config_buf = [] + else: + config_buf += [line] + continue + if line.startswith('source') or line.startswith('\tsource'): + sub = expand_var(line.strip().split()[1].strip('"')) + r += load_kconfig(sub) + elif line.startswith('config') or line.startswith('menu'): + config_buf = [line] + elif line.startswith('choice'): + config_buf = [line] + elif line.startswith('endmenu') or line.startswith('endchoice'): + pop_stack_while(lambda x: x != 'menu') + pop_stack(lambda x: x == 'menu') + elif line.startswith('if '): + line = line[3:] + top = cur_if() + top += [x.strip() for x in line.split("&&")] + if_stack += [top] + elif line.startswith('endif'): + if_stack = if_stack[:-1] + return r + +known_config = {} + +def escape(x): + return x.replace('<', '<').replace('>', '>') + +from sys import argv +import tomllib + +path = argv[1] +if path[-1] != '/': + path += '/' +with open(argv[2], 'rb') as f: + known_config = tomllib.load(f) + +r = load_kconfig('Kconfig') + +# Refcount all menus + +index_ikey = {} +for i in reversed(range(len(r))): + index_ikey[r[i][5]] = i + +for i in reversed(range(len(r))): + if r[i][1] != None: + key = r[i][5] + fa = main_dep.get(key) + if not fa: + continue + j = index_ikey[fa] + if type(fa) == int or not r[j][3]: + # The main dependency is a menu or untitled magic entry, + # just mark it used + r[j][1] = '' + if r[j][1] is None: + raise Exception('[%s] needs unselected [%s]' % (key, fa)) + +r = [i for i in r if i[1] != None and i[3]] + +# Now we are going to pretty-print r + +## Calculate the maximum value length for each menu +max_val_len = {} +for _, val, _, _, _, _, menu, _ in r: + x = max_val_len.get(menu) or 0 + max_val_len[menu] = max(x, len(val)) + +## Output + +max_line = 80 +buf = [] + +done = [x[5] for x in r] + ['revision'] +for i in known_config: + if i not in done: + raise Exception("%s seems not exist" % i) + +sep = known_config.get('separate_toplevel_menu') + +for i0, val, i1, title, arrow, key, menu, comment in r: + rem = max_line + + if val: + val += (max_val_len[menu] - len(val)) * ' ' + + rem -= i0 + i1 + bool(val) + len(val) + line = i0 * ' ' + escape(val) + (i1 + bool(val)) * ' ' + + rem -= len(arrow) + + if len(title) > rem: + title = title[:rem - 3] + '...' + + b = title.lstrip('YyMmNnHh') + a = title[:len(title) - len(b)] + b0 = "" + escape(b[0]) + "" + line += escape(a) + b0 + escape(b[1:]) + escape(arrow) + + rem -= len(title) + + key = ' [' + key + ']' if type(key) == str else '' + + if len(key) <= rem: + line += (rem - len(key)) * ' ' + key + else: + key = '... ' + key + line += '\n' + ' ' * (max_line - len(key)) + key + if type(comment) == str: + comment = [comment] + if comment: + comment = '\n'.join([' ' * i0 + '# ' + line for line in comment]) + buf += [escape(comment) + ':'] + + if not menu and buf: + buf += [''] + + buf += [line.rstrip()] + +from jinja2 import Template + +t = Template(''' + + +{{ '\n'.join(buf) }}''') + +rev = known_config.get('revision') +rev = ' revision="%s"' % rev if rev else '' +print(t.render(rev = rev, buf = buf)) diff --git a/chapter10/kernel/kernel.version b/chapter10/kernel/kernel.version new file mode 100644 index 000000000..4b20d9700 --- /dev/null +++ b/chapter10/kernel/kernel.version @@ -0,0 +1 @@ +6.4.8 diff --git a/chapter10/kernel/kernel_version.py b/chapter10/kernel/kernel_version.py new file mode 100755 index 000000000..764bb2d33 --- /dev/null +++ b/chapter10/kernel/kernel_version.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 + +def kernel_version(path): + version = None + patchlevel = None + sublevel = None + + with open(path + 'Makefile') as f: + for line in f: + if line.startswith('VERSION ='): + version = line[len('VERSION ='):].strip() + elif line.startswith('PATCHLEVEL ='): + patchlevel = line[len('PATCHLEVEL ='):].strip() + elif line.startswith('SUBLEVEL ='): + sublevel = line[len('SUBLEVEL ='):].strip() + + assert(version and patchlevel and sublevel) + return '.'.join([version, patchlevel, sublevel]) + +if __name__ == '__main__': + from sys import argv + + path = argv[1] + if path[:-1] != '/': + path += '/' + + print(kernel_version(path)) diff --git a/chapter10/kernel/nvme.toml b/chapter10/kernel/nvme.toml new file mode 100644 index 000000000..1e3170fe9 --- /dev/null +++ b/chapter10/kernel/nvme.toml @@ -0,0 +1 @@ +BLK_DEV_NVME='*' diff --git a/chapter10/kernel/nvme.xml b/chapter10/kernel/nvme.xml new file mode 100644 index 000000000..2b55b7c1d --- /dev/null +++ b/chapter10/kernel/nvme.xml @@ -0,0 +1,8 @@ + + + +Device Drivers ---> + NVME Support ---> + <*> NVM Express block device [BLK_DEV_NVME] diff --git a/chapter10/kernel/systemd.toml b/chapter10/kernel/systemd.toml new file mode 100644 index 000000000..26ac61c46 --- /dev/null +++ b/chapter10/kernel/systemd.toml @@ -0,0 +1,30 @@ +# This part should be sync with sysv.toml +WERROR=' ' +PSI='*' +PSI_DEFAULT_DISABLED=' ' +IKHEADERS=' ' +CGROUPS='*' +MEMCG='*' +EXPERT=' ' +RELOCATABLE='*' +RANDOMIZE_BASE='*' +STACKPROTECTOR='*' +STACKPROTECTOR_STRONG='*' +UEVENT_HELPER=' ' +DEVTMPFS='*' +DEVTMPFS_MOUNT='*' +FB='*' +FRAMEBUFFER_CONSOLE='*' + +AUDIT=' ' +NET='*' +INET='*' +IPV6='*' +FW_LOADER=' *' +FW_LOADER_USER_HELPER=' ' +DMIID='*' +INOTIFY_USER='*' +TMPFS='*' +TMPFS_POSIX_ACL='*' + +revision='systemd' diff --git a/chapter10/kernel/systemd.xml b/chapter10/kernel/systemd.xml new file mode 100644 index 000000000..6705fdd35 --- /dev/null +++ b/chapter10/kernel/systemd.xml @@ -0,0 +1,53 @@ + + + +General setup ---> + [ ] Compile the kernel with warnings as errors [WERROR] + [ ] Auditing support [AUDIT] + CPU/Task time and stats accounting ---> + [*] Pressure stall information tracking [PSI] + [ ] Require boot parameter to enable pressure stall information tracking + ... [PSI_DEFAULT_DISABLED] + < > Enable kernel headers through /sys/kernel/kheaders.tar.xz [IKHEADERS] + [*] Control Group support ---> [CGROUPS] + [*] Memory controller [MEMCG] + [ ] Configure standard kernel features (expert users) ---> [EXPERT] + +Processor type and features ---> + [*] Build a relocatable kernel [RELOCATABLE] + [*] Randomize the address of the kernel image (KASLR) [RANDOMIZE_BASE] + +General architecture-dependent options ---> + [*] Stack Protector buffer overflow detection [STACKPROTECTOR] + [*] Strong Stack Protector [STACKPROTECTOR_STRONG] + +[*] Networking support ---> [NET] + Networking options ---> + [*] TCP/IP networking [INET] + <*> The IPv6 protocol ---> [IPV6] + +Device Drivers ---> + Generic Driver Options ---> + [ ] Support for uevent helper [UEVENT_HELPER] + [*] Maintain a devtmpfs filesystem to mount at /dev [DEVTMPFS] + [*] Automount devtmpfs at /dev, after the kernel mounted the rootfs + ... [DEVTMPFS_MOUNT] + Firmware loader ---> + < /*> Firmware loading facility [FW_LOADER] + [ ] Enable the firmware sysfs fallback mechanism + ... [FW_LOADER_USER_HELPER] + Firmware Drivers ---> + [*] Export DMI identification via sysfs to userspace [DMIID] + Graphics support ---> + Frame buffer Devices ---> + <*> Support for frame buffer devices ---> [FB] + Console display driver support ---> + [*] Framebuffer Console support [FRAMEBUFFER_CONSOLE] + +File systems ---> + [*] Inotify support for userspace [INOTIFY_USER] + Pseudo filesystems ---> + [*] Tmpfs virtual memory file system support (former shm fs) [TMPFS] + [*] Tmpfs POSIX Access Control Lists [TMPFS_POSIX_ACL] diff --git a/chapter10/kernel/sysv.toml b/chapter10/kernel/sysv.toml new file mode 100644 index 000000000..5c8b2df6e --- /dev/null +++ b/chapter10/kernel/sysv.toml @@ -0,0 +1,18 @@ +WERROR=' ' +PSI='*' +PSI_DEFAULT_DISABLED=' ' +IKHEADERS=' ' +CGROUPS='*' +MEMCG='*' +EXPERT=' ' +RELOCATABLE='*' +RANDOMIZE_BASE='*' +STACKPROTECTOR='*' +STACKPROTECTOR_STRONG='*' +UEVENT_HELPER=' ' +DEVTMPFS='*' +DEVTMPFS_MOUNT='*' +FB='*' +FRAMEBUFFER_CONSOLE='*' + +revision='sysv' diff --git a/chapter10/kernel/sysv.xml b/chapter10/kernel/sysv.xml new file mode 100644 index 000000000..7e62725e6 --- /dev/null +++ b/chapter10/kernel/sysv.xml @@ -0,0 +1,35 @@ + + + +General setup ---> + [ ] Compile the kernel with warnings as errors [WERROR] + CPU/Task time and stats accounting ---> + [*] Pressure stall information tracking [PSI] + [ ] Require boot parameter to enable pressure stall information tracking + ... [PSI_DEFAULT_DISABLED] + < > Enable kernel headers through /sys/kernel/kheaders.tar.xz [IKHEADERS] + [*] Control Group support ---> [CGROUPS] + [*] Memory controller [MEMCG] + [ ] Configure standard kernel features (expert users) ---> [EXPERT] + +Processor type and features ---> + [*] Build a relocatable kernel [RELOCATABLE] + [*] Randomize the address of the kernel image (KASLR) [RANDOMIZE_BASE] + +General architecture-dependent options ---> + [*] Stack Protector buffer overflow detection [STACKPROTECTOR] + [*] Strong Stack Protector [STACKPROTECTOR_STRONG] + +Device Drivers ---> + Generic Driver Options ---> + [ ] Support for uevent helper [UEVENT_HELPER] + [*] Maintain a devtmpfs filesystem to mount at /dev [DEVTMPFS] + [*] Automount devtmpfs at /dev, after the kernel mounted the rootfs + ... [DEVTMPFS_MOUNT] + Graphics support ---> + Frame buffer Devices ---> + <*> Support for frame buffer devices ---> [FB] + Console display driver support ---> + [*] Framebuffer Console support [FRAMEBUFFER_CONSOLE] diff --git a/chapter10/kernel/x2apic.toml b/chapter10/kernel/x2apic.toml new file mode 100644 index 000000000..6f7657b13 --- /dev/null +++ b/chapter10/kernel/x2apic.toml @@ -0,0 +1,5 @@ +X86_X2APIC='*' +PCI='*' +PCI_MSI='*' +IOMMU_SUPPORT='*' +IRQ_REMAP='*' diff --git a/chapter10/kernel/x2apic.xml b/chapter10/kernel/x2apic.xml new file mode 100644 index 000000000..9bd2a719f --- /dev/null +++ b/chapter10/kernel/x2apic.xml @@ -0,0 +1,13 @@ + + + +Processor type and features ---> + [*] Support x2apic [X86_X2APIC] + +Device Drivers ---> + [*] PCI support ---> [PCI] + [*] Message Signaled Interrupts (MSI and MSI-X) [PCI_MSI] + [*] IOMMU Hardware Support ---> [IOMMU_SUPPORT] + [*] Support for Interrupt Remapping [IRQ_REMAP] diff --git a/general.ent b/general.ent index a222812e9..0540ac6c2 100644 --- a/general.ent +++ b/general.ent @@ -103,6 +103,7 @@ --> + diff --git a/git-version.sh b/git-version.sh index 9bbd70623..8f3e9e05e 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 f9239e27b..c0c7aaea3 100644 --- a/lfs-latest-git.php +++ b/lfs-latest-git.php @@ -150,6 +150,7 @@ if ( $package == "tcl" ) $dirpath = "https://www.tcl.tk/software/tcltk/do if ( $package == "util-linux" ) $dirpath = max_parent( $dirpath, "v." ); if ( $package == "vim" ) $dirpath = "https://github.com/vim/vim/tags"; if ( $package == "wheel" ) $dirpath = "https://pypi.org/project/wheel/#files"; +if ( $package == "zlib" ) $dirpath = "https://www.zlib.net"; if ( $package == "zstd" ) $dirpath = github("facebook/zstd"); // Check for ftp 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/obfuscate.sh b/obfuscate.sh index dd2bf24d2..a01cc58b6 100644 --- a/obfuscate.sh +++ b/obfuscate.sh @@ -4,7 +4,7 @@ # obfuscate email addresses in XML/HTML # Script written (and slight perl modification) by Archaic # Modified from "sed -i" to old style "sed -e" by Manuel Canales -# to prevent hangs on very long files, like nonckunked books. +# to prevent hangs on very long files, like nonchunked books. # Original Perl expression by Anderson Lizardo # Released under the GNU General Public License # diff --git a/packages.ent b/packages.ent index 560d84bd4..73a14b81f 100644 --- a/packages.ent +++ b/packages.ent @@ -35,7 +35,7 @@ - + @@ -43,10 +43,9 @@ - - + @@ -56,27 +55,28 @@ - + - + - - + + - + - + - - - + + + + @@ -86,7 +86,7 @@ - + @@ -102,24 +102,24 @@ - + - - + + - + - + - + - - + + - + - + @@ -128,16 +128,16 @@ - + - - - + + + @@ -146,14 +146,14 @@ - + - + @@ -172,15 +172,15 @@ - - + + - + - + - - + + @@ -188,7 +188,7 @@ - + @@ -205,7 +205,7 @@ - + @@ -213,25 +213,25 @@ - + - - + + - - + + - + - - - - - - + + + + + + - + @@ -251,27 +251,27 @@ - - - - + + + + - - + + - + - - - + + + - - + + - + - + @@ -287,9 +287,9 @@ - - - + + + @@ -297,7 +297,7 @@ - + @@ -310,20 +310,20 @@ - - + + - + - + - + @@ -363,10 +363,10 @@ - - + + - + @@ -375,19 +375,19 @@ - + - - + + - + - + - + @@ -424,25 +424,25 @@ - - + + - + - - + + - + - + - + - + - + - + - - + + - - + + @@ -628,15 +628,15 @@ - - - + + + - - + + - + @@ -646,43 +646,43 @@ - + - + - + - + - - + + - - + + - - + + - + - + - - + + - + - + - - + + @@ -702,7 +702,7 @@ - + @@ -712,46 +712,46 @@ - + - - + + - + - - + + - + - + - + - + - + - + - - + + - + - + - + @@ -762,21 +762,25 @@ - - + + - + - + - + - - - - - + + + + + + @@ -785,6 +789,6 @@ - + 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 c9d483de5..6634d1f2f 100644 --- a/patches.ent +++ b/patches.ent @@ -2,54 +2,22 @@ - - - - - + - - - - + + + + @@ -58,49 +26,11 @@ - - - - - - diff --git a/prologue/why.xml b/prologue/why.xml index b43bb3a20..b5ac050eb 100644 --- a/prologue/why.xml +++ b/prologue/why.xml @@ -371,7 +371,7 @@ libcrypt library needed by various packages (notably, Shadow) for hashing passwords. It replaces the obsolete - libcrypt implmentation in + libcrypt implementation in Glibc.
diff --git a/stylesheets/lfs-xsl/lfs.css b/stylesheets/lfs-xsl/lfs.css index 3cadbc469..80eca11ed 100644 --- a/stylesheets/lfs-xsl/lfs.css +++ b/stylesheets/lfs-xsl/lfs.css @@ -265,6 +265,9 @@ li.chapter h4 a { margin: .6em 0 .2em 0; } +span.blue { + color: #2ac; +} /* Index */ .item { diff --git a/udev-lfs/55-lfs.rules b/udev-lfs/55-lfs.rules index 34229ea2c..8d37ba920 100644 --- a/udev-lfs/55-lfs.rules +++ b/udev-lfs/55-lfs.rules @@ -6,9 +6,3 @@ SUBSYSTEM=="rtc", ACTION=="add", MODE="0644", RUN+="/etc/rc.d/init.d/setclock start" KERNEL=="rtc", ACTION=="add", MODE="0644", RUN+="/etc/rc.d/init.d/setclock start" -# Comms devices - -KERNEL=="ippp[0-9]*", GROUP="dialout" -KERNEL=="isdn[0-9]*", GROUP="dialout" -KERNEL=="isdnctrl[0-9]*", GROUP="dialout" -KERNEL=="dcbri[0-9]*", GROUP="dialout" diff --git a/udev-lfs/55-lfs.txt b/udev-lfs/55-lfs.txt index 5f116f9b7..6e0afda59 100644 --- a/udev-lfs/55-lfs.txt +++ b/udev-lfs/55-lfs.txt @@ -7,14 +7,9 @@ Description of rules: By default, Udev creates device nodes with UID 0, GID 0, and permissions 0660. -ISDN-related devices should be owned by the 'dialout' group, hence the following -rule (and similar): - -KERNEL=="ippp[0-9]*", GROUP="dialout" - -The RTC-related rules cause the setclock bootscript to be run as soon as the +The RTC-related rule causes the setclock bootscript to be run as soon as the RTC device has been created by Udev, meaning that times in log files, for example, are as accurate as possible as quickly as possible. -A final word of caution: Any particular rule must be written on one line, and a -comma must separate each part of the rule. +A word of caution: A comma must separate each part of the rule. A rule can span +multiple lines if the newline is escaped by a backslash. diff --git a/udev-lfs/81-cdrom.rules b/udev-lfs/81-cdrom.rules deleted file mode 100644 index cb7ea5748..000000000 --- a/udev-lfs/81-cdrom.rules +++ /dev/null @@ -1,3 +0,0 @@ -# /etc/udev/rules.d/81-cdrom.rules: Set CD-ROM permissions and get device capabilities - -ACTION=="add", SUBSYSTEM=="block", ENV{ID_TYPE}=="cd", IMPORT{program}="cdrom_id --export $tempnode", GROUP="cdrom" diff --git a/udev-lfs/83-cdrom-symlinks.rules b/udev-lfs/83-cdrom-symlinks.rules deleted file mode 100644 index 1a21a0649..000000000 --- a/udev-lfs/83-cdrom-symlinks.rules +++ /dev/null @@ -1,13 +0,0 @@ -# /etc/udev/rules.d/83-cdrom-symlinks.rules: Determine CD drive capability. - -ACTION!="add", GOTO="cd_aliases_generator_end" -SUBSYSTEM!="block", GOTO="cd_aliases_generator_end" -ENV{GENERATED}=="?*", GOTO="cd_aliases_generator_end" - -# Fail the uevent if the autogenerated rules cannot be saved -ENV{ID_CDROM}=="?*", PROGRAM="/bin/grep -c ' / [^[:space:]]* rw' /proc/mounts", \ - RESULT!="1", RUN+="/bin/false", GOTO="cd_aliases_generator_end" - -ENV{ID_CDROM}=="?*", PROGRAM="write_cd_rules", SYMLINK+="%c" - -LABEL="cd_aliases_generator_end" diff --git a/udev-lfs/ChangeLog b/udev-lfs/ChangeLog index 560346143..302aaa679 100644 --- a/udev-lfs/ChangeLog +++ b/udev-lfs/ChangeLog @@ -1,3 +1,10 @@ +2023-08-18 + * Fix regression when removing cdrom entries + +2023-07-28 + * Remove obsolete 83-cdrom-symlinks.rules and 81-cdrom.rules + * Remove references to obsolete ISDN devices + 2017-10-27 * 83-cdrom-symlinks.rules: Adjust test for writable root directory. diff --git a/udev-lfs/Makefile.lfs b/udev-lfs/Makefile.lfs index 1218d9dcd..295cacc54 100644 --- a/udev-lfs/Makefile.lfs +++ b/udev-lfs/Makefile.lfs @@ -3,7 +3,7 @@ # vim: tabstop=3 -VERSION=20171102 +VERSION=20230818 SHELL=/bin/bash ifeq ($(V),) @@ -16,15 +16,15 @@ all: @echo "Use the install target" install: - @mkdir -pv $(DESTDIR)/lib/udev/rules.d \ + @mkdir -pv $(DESTDIR)/usr/lib/udev/rules.d \ $(DESTDIR)/etc/udev/rules.d \ $(DESTDIR)/usr/share/doc/udev-$(VERSION)/lfs # Copy rules @cp -v udev-lfs-$(VERSION)/*.rules $(DESTDIR)/etc/udev/rules.d - @cp -v udev-lfs-$(VERSION)/*_rules \ - udev-lfs-$(VERSION)/init-net-rules.sh \ - udev-lfs-$(VERSION)/rule_generator.functions $(DESTDIR)/lib/udev + @cp -v udev-lfs-$(VERSION)/init-net-rules.sh \ + udev-lfs-$(VERSION)/write_net_rules \ + udev-lfs-$(VERSION)/rule_generator.functions $(DESTDIR)/usr/lib/udev # Copy documentation @cp -v udev-lfs-$(VERSION)/README $(DESTDIR)/usr/share/doc/udev-$(VERSION)/lfs diff --git a/udev-lfs/README b/udev-lfs/README index 61d0e86bc..1f050eb15 100644 --- a/udev-lfs/README +++ b/udev-lfs/README @@ -14,9 +14,7 @@ Makefile.lfs - The LFS Makefile. Installs udev rules for LFS. contrib - Useful rules from debian contrib/debian -contrib/debian/83-cdrom-symlinks.rules contrib/debian/write_cd_aliases -contrib/debian/81-cdrom.rules 55-lfs.rules - LFS custom rules write_net_rules - Scripts for LFS rules