From fb3b88e8f288563f26096ecf5eb6d2ad749ae5e5 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 25 Jul 2023 12:33:32 +0800 Subject: [PATCH 001/100] binutils-pass2: Remove libsframe.{a,la} like other libs --- chapter06/binutils-pass2.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter06/binutils-pass2.xml b/chapter06/binutils-pass2.xml index ef5c18433..7b0f1fc20 100644 --- a/chapter06/binutils-pass2.xml +++ b/chapter06/binutils-pass2.xml @@ -101,7 +101,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} From b15bebf96f9df4260904cb682c1692bcc43891c2 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Thu, 27 Jul 2023 09:43:35 +0800 Subject: [PATCH 002/100] askforhelp: Add a note to stop people from spamming upstream I've seen two cases of invalid upstream "bug" reports this month because the user has (mis)built LFS. Let's stop this before irritating the upstream maintainers. --- chapter01/askforhelp.xml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/chapter01/askforhelp.xml b/chapter01/askforhelp.xml index 367e880c0..405b40804 100644 --- a/chapter01/askforhelp.xml +++ b/chapter01/askforhelp.xml @@ -10,6 +10,27 @@ Help + + + We strongly discourage posting your issues building one LFS package + directly onto the upstream support channel, without discussing via + a LFS support channel listed in + first. 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 From 49d402ee78cc17fab3501b544a83dca826f7a91d Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Thu, 27 Jul 2023 10:03:30 +0800 Subject: [PATCH 003/100] askforhelp: Reword the note added in previous commit a little --- chapter01/askforhelp.xml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/chapter01/askforhelp.xml b/chapter01/askforhelp.xml index 405b40804..5eb1d939f 100644 --- a/chapter01/askforhelp.xml +++ b/chapter01/askforhelp.xml @@ -12,10 +12,11 @@ - We strongly discourage posting your issues building one LFS package - directly onto the upstream support channel, without discussing via - a LFS support channel listed in - first. Doing so is often quite inefficient because the upstream + 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 From d0de26cbe0bf877b25219936b7b688f0b17d0a16 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Thu, 27 Jul 2023 13:06:49 +0800 Subject: [PATCH 004/100] gmp: (Optionally) use --host=none-linux-gnu for generic library This is suggested by GCC maintainer Andrew Pinski in https://gcc.gnu.org/PR110789. It's easier than what we've suggested in the book. --- chapter08/gmp.xml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/chapter08/gmp.xml b/chapter08/gmp.xml index 0820f726c..01dace92f 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,7 +108,7 @@ 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. Check the results by issuing the following command: From 44674e4c92f7ef20dbc985f479c5c19548378a08 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 28 Jul 2023 19:59:01 +0800 Subject: [PATCH 005/100] sysv: Mount cgroup fs for memory pressure information early Prepare for systemd-254 update. See #5293 for details. --- bootscripts/ChangeLog | 3 +++ bootscripts/lfs/init.d/mountvirtfs | 4 ++++ chapter01/changelog.xml | 13 +++++++++++++ chapter10/fstab.xml | 21 +++++++++++---------- chapter10/kernel.xml | 5 +++++ packages.ent | 2 +- 6 files changed, 37 insertions(+), 11 deletions(-) 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/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/changelog.xml b/chapter01/changelog.xml index cfb845733..73fc65f72 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,6 +40,19 @@ appropriate for the entry or if needed the entire day's listitem. --> + + 2023-07-28 + + + [xry111] - Enable cgroup-based memory pressure information + in kernel, and add the cgroup file system into /etc/fstab and the + mountvirtfs bootscript. This is a preparation for udev from + systemd-254. Addresses + #5293. + + + + 2023-07-22 diff --git a/chapter10/fstab.xml b/chapter10/fstab.xml index f78b234db..ccf767ab6 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/<xxx> / <fff> defaults 1 1 -/dev/<yyy> 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 +/dev/<xxx> / <fff> defaults 1 1 +/dev/<yyy> 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/kernel.xml b/chapter10/kernel.xml index ad6b252a7..376f6cdff 100644 --- a/chapter10/kernel.xml +++ b/chapter10/kernel.xml @@ -135,7 +135,12 @@ [*] Randomize the address of the kernel image (KASLR) [CONFIG_RANDOMIZE_BASE] General setup ---> [ ] Compile the kernel with warnings as errors [CONFIG_WERROR] + 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 ---> [*] Stack Protector buffer overflow detection [CONFIG_STACKPROTECTOR] diff --git a/packages.ent b/packages.ent index 6fd5c0280..09008604d 100644 --- a/packages.ent +++ b/packages.ent @@ -383,7 +383,7 @@ - + From ac90ea8104148900ca3209cf5a56c4a16cbafd77 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 28 Jul 2023 20:01:29 +0800 Subject: [PATCH 006/100] package choices: Fix a typo Reported-by: rhubarbpieguy --- prologue/why.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. From 6de383a26215753a2b0a6d2dba6956ecfd786a90 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Fri, 28 Jul 2023 19:23:11 -0500 Subject: [PATCH 007/100] Package updates. Update udev-lfs tarball to remove obsolete cdrom rules and references to ISDN devices. Update to wheel-0.41.0 (Python Module). Update to tar-1.35. Update to systemd-254. Update to meson-1.2.0. Update to linux-6.4.7. Update to gcc-13.2.0. Update to file-5.45. --- chapter01/changelog.xml | 39 +++++++++++++++++++++++ chapter01/whatsnew.xml | 14 ++++----- chapter08/gcc.xml | 4 +-- chapter08/udev.xml | 4 +-- packages.ent | 54 ++++++++++++++++---------------- udev-lfs/55-lfs.rules | 6 ---- udev-lfs/55-lfs.txt | 11 ++----- udev-lfs/81-cdrom.rules | 3 -- udev-lfs/83-cdrom-symlinks.rules | 13 -------- udev-lfs/ChangeLog | 4 +++ udev-lfs/Makefile.lfs | 9 +++--- udev-lfs/README | 2 -- 12 files changed, 88 insertions(+), 75 deletions(-) delete mode 100644 udev-lfs/81-cdrom.rules delete mode 100644 udev-lfs/83-cdrom-symlinks.rules diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 73fc65f72..d5debd345 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,6 +40,45 @@ appropriate for the entry or if needed the entire day's listitem. --> + + 2023-07-28 + + + [bdubbs] - Update udev-lfs tarball to remove obsolete + cdrom rules and references to ISDN devices. Fixes + #5291. + + + [bdubbs] - Update to wheel-0.41.0 (Python Module). Fixes + #5290. + + + [bdubbs] - Update to tar-1.35. Fixes + #5287. + + + [bdubbs] - Update to systemd-254. Fixes + #5293. + + + [bdubbs] - Update to meson-1.2.0. Fixes + #5286. + + + [bdubbs] - Update to linux-6.4.7. Fixes + #5288. + + + [bdubbs] - Update to gcc-13.2.0. Fixes + #5292. + + + [bdubbs] - Update to file-5.45. Fixes + #5294. + + + + 2023-07-28 diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml index 42d10c0aa..f40d3b33a 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -100,9 +100,9 @@ - + @@ -250,15 +250,15 @@ Sysklogd-&sysklogd-version; - + Systemd-&systemd-version; - + @@ -274,9 +274,9 @@ Vim-&vim-version; - + diff --git a/chapter08/gcc.xml b/chapter08/gcc.xml index 43f699689..bb22fbca5 100644 --- a/chapter08/gcc.xml +++ b/chapter08/gcc.xml @@ -172,10 +172,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. diff --git a/chapter08/udev.xml b/chapter08/udev.xml index 2d3792511..67e835afc 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,7 +147,7 @@ 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 --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 \ diff --git a/packages.ent b/packages.ent index 09008604d..66e7314ab 100644 --- a/packages.ent +++ b/packages.ent @@ -172,10 +172,10 @@ - - + + - + @@ -218,10 +218,10 @@ - - + + - + @@ -433,12 +433,12 @@ - + - + - + - + - + - - + + - + @@ -668,10 +668,10 @@ - - + + - + @@ -709,10 +709,10 @@ - - + + - + @@ -737,10 +737,10 @@ - - + + - + 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..53660938a 100644 --- a/udev-lfs/ChangeLog +++ b/udev-lfs/ChangeLog @@ -1,3 +1,7 @@ +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..a8b4d7f30 100644 --- a/udev-lfs/Makefile.lfs +++ b/udev-lfs/Makefile.lfs @@ -3,7 +3,7 @@ # vim: tabstop=3 -VERSION=20171102 +VERSION=20230728 SHELL=/bin/bash ifeq ($(V),) @@ -16,15 +16,14 @@ 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)/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 From 7dcd8c782bab203dcba04013f4ecc6846a12bd93 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sat, 29 Jul 2023 09:51:28 +0800 Subject: [PATCH 008/100] systemd: Remove sed unneeded with 254 --- chapter08/systemd.xml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/chapter08/systemd.xml b/chapter08/systemd.xml index e99167d07..c71616725 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 From 57f16783edb41bf517c52d453278f5b3b4bac434 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sat, 29 Jul 2023 09:53:44 +0800 Subject: [PATCH 009/100] systemd: Add --no-same-owner for man page extraction Well, I forgot to create the man pages tarball as root, so if we don't use --no-same-owner the man pages will be owned by UID 1000 :(. Instead of regenerating the tarball again let's just fix this in the book. --- chapter08/systemd.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chapter08/systemd.xml b/chapter08/systemd.xml index c71616725..eb8ea77b0 100644 --- a/chapter08/systemd.xml +++ b/chapter08/systemd.xml @@ -192,7 +192,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: From bec5f879a3940faf011c853b66f37c242fe85302 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sat, 29 Jul 2023 09:59:44 +0800 Subject: [PATCH 010/100] changelog: Prefix new "systemd" entry with "udev from" for sysv --- chapter01/changelog.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index d5debd345..ac551a947 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -57,7 +57,8 @@ #5287. - [bdubbs] - Update to systemd-254. Fixes + [bdubbs] - Update to udev + from systemd-254. Fixes #5293. From c2ccad14a5ed01857b84199133d7468ccd02c461 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sat, 29 Jul 2023 10:19:04 +0800 Subject: [PATCH 011/100] systemd: Add two new symlinks into contents --- chapter08/systemd.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chapter08/systemd.xml b/chapter08/systemd.xml index eb8ea77b0..63003ac68 100644 --- a/chapter08/systemd.xml +++ b/chapter08/systemd.xml @@ -233,12 +233,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, From 83e616f79e84539b34d912b4a4ed430e00b86839 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Fri, 28 Jul 2023 23:14:10 -0500 Subject: [PATCH 012/100] Reformat kernel configuuration options. A couple of the newer kernel options overflow past 80 columns on the kernel page. It's not optimal, but insert newlines for these options. Also reorder the options to to same ordeer as they appear in menuconfig and add some blank lines between major setions for clarity. --- chapter10/kernel.xml | 62 +++++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 24 deletions(-) diff --git a/chapter10/kernel.xml b/chapter10/kernel.xml index 376f6cdff..ea367054a 100644 --- a/chapter10/kernel.xml +++ b/chapter10/kernel.xml @@ -130,58 +130,70 @@ 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 ---> +General setup ---> [ ] Compile the kernel with warnings as errors [CONFIG_WERROR] - 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] + 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] + +Processor type and features ---> + [*] Build a relocatable kernel [CONFIG_RELOCATABLE] + [*] Randomize the address of the kernel image (KASLR) [CONFIG_RANDOMIZE_BASE] + 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] +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] + Graphics support ---> + Frame buffer Devices ---> + <*> Support for frame buffer devices ---> + Console display driver support ---> + [*] Framebuffer Console support [CONFIG_FRAMEBUFFER_CONSOLE] + + 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] + [ ] 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] + +Processor type and features ---> + [*] Build a relocatable kernel [CONFIG_RELOCATABLE] + [*] Randomize the address of the kernel image (KASLR) [CONFIG_RANDOMIZE_BASE] + 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] + [*] 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] + [*] 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 ---> @@ -191,6 +203,7 @@ Device Drivers ---> <*> 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 ---> @@ -203,8 +216,9 @@ File systems ---> CONFIG_X86_X2APIC because an option only shows up after its dependencies are selected. - Processor type and features ---> +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] From 2cf01ab7023ce34da711af45413f4ed7850a9837 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Mon, 31 Jul 2023 01:09:24 -0500 Subject: [PATCH 013/100] Add some color to kernel options --- chapter10/kernel.xml | 74 ++++++++++++++++++------------------- stylesheets/lfs-xsl/lfs.css | 3 ++ 2 files changed, 40 insertions(+), 37 deletions(-) diff --git a/chapter10/kernel.xml b/chapter10/kernel.xml index ea367054a..9e522cb0d 100644 --- a/chapter10/kernel.xml +++ b/chapter10/kernel.xml @@ -130,36 +130,36 @@ Be sure to enable/disable/set the following features or the system might not work correctly or boot at all: -General setup ---> - [ ] Compile the kernel with warnings as errors [CONFIG_WERROR] - CPU/Task time and stats accounting ---> - [*] Pressure stall information tracking [CONFIG_PSI] - [ ] Require boot parameter to enable pressure stall information tracking +General setup ---> + [ ] Compile the kernel with warnings as errors [CONFIG_WERROR] + 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] + < > 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] -Processor type and features ---> - [*] Build a relocatable kernel [CONFIG_RELOCATABLE] - [*] Randomize the address of the kernel image (KASLR) [CONFIG_RANDOMIZE_BASE] +Processor type and features ---> + [*] Build a relocatable kernel [CONFIG_RELOCATABLE] + [*] Randomize the address of the kernel image (KASLR) [CONFIG_RANDOMIZE_BASE] -General architecture-dependent options ---> - [*] Stack Protector buffer overflow detection [CONFIG_STACKPROTECTOR] - [*] Strong Stack Protector [CONFIG_STACKPROTECTOR_STRONG] +General architecture-dependent options ---> + [*] Stack Protector buffer overflow detection [CONFIG_STACKPROTECTOR] + [*] Strong Stack Protector [CONFIG_STACKPROTECTOR_STRONG] -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 +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] - Graphics support ---> - Frame buffer Devices ---> - <*> Support for frame buffer devices ---> - Console display driver support ---> - [*] Framebuffer Console support [CONFIG_FRAMEBUFFER_CONSOLE] + Graphics support ---> + Frame buffer Devices ---> + <*> Support for frame buffer devices ---> + Console display driver support ---> + [*] Framebuffer Console support [CONFIG_FRAMEBUFFER_CONSOLE] General setup ---> @@ -216,31 +216,31 @@ 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] +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] + [*] 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] + 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] + Device Drivers ---> + NVME Support ---> + <*> NVM Express block device [CONFIG_BLK_DEV_NVME] 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 { From 70bf5512d96389ea1c068cd20a48093a10d6a963 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 1 Aug 2023 00:08:56 +0800 Subject: [PATCH 014/100] kernel: Use new kernel configuration rendering method Import kernel-config infrastructure from BLFS and use it for kernel configuration. Note that kernel-config.py is slightly different from BLFS: we need role="nodump" for here. --- chapter10/kernel.xml | 103 ++-------- chapter10/kernel/.gitignore | 2 + chapter10/kernel/Makefile | 19 ++ chapter10/kernel/highmem.toml | 1 + chapter10/kernel/highmem.xml | 8 + chapter10/kernel/kernel-config.py | 293 +++++++++++++++++++++++++++++ chapter10/kernel/kernel.version | 1 + chapter10/kernel/kernel_version.py | 27 +++ chapter10/kernel/nvme.toml | 1 + chapter10/kernel/nvme.xml | 8 + chapter10/kernel/systemd.toml | 30 +++ chapter10/kernel/systemd.xml | 48 +++++ chapter10/kernel/sysv.toml | 18 ++ chapter10/kernel/sysv.xml | 32 ++++ chapter10/kernel/x2apic.toml | 5 + chapter10/kernel/x2apic.xml | 12 ++ 16 files changed, 518 insertions(+), 90 deletions(-) create mode 100644 chapter10/kernel/.gitignore create mode 100644 chapter10/kernel/Makefile create mode 100644 chapter10/kernel/highmem.toml create mode 100644 chapter10/kernel/highmem.xml create mode 100755 chapter10/kernel/kernel-config.py create mode 100644 chapter10/kernel/kernel.version create mode 100755 chapter10/kernel/kernel_version.py create mode 100644 chapter10/kernel/nvme.toml create mode 100644 chapter10/kernel/nvme.xml create mode 100644 chapter10/kernel/systemd.toml create mode 100644 chapter10/kernel/systemd.xml create mode 100644 chapter10/kernel/sysv.toml create mode 100644 chapter10/kernel/sysv.xml create mode 100644 chapter10/kernel/x2apic.toml create mode 100644 chapter10/kernel/x2apic.xml diff --git a/chapter10/kernel.xml b/chapter10/kernel.xml index 9e522cb0d..8609b1474 100644 --- a/chapter10/kernel.xml +++ b/chapter10/kernel.xml @@ -130,84 +130,15 @@ Be sure to enable/disable/set the following features or the system might not work correctly or boot at all: -General setup ---> - [ ] Compile the kernel with warnings as errors [CONFIG_WERROR] - 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] + -Processor type and features ---> - [*] Build a relocatable kernel [CONFIG_RELOCATABLE] - [*] Randomize the address of the kernel image (KASLR) [CONFIG_RANDOMIZE_BASE] + -General architecture-dependent options ---> - [*] Stack Protector buffer overflow detection [CONFIG_STACKPROTECTOR] - [*] Strong Stack Protector [CONFIG_STACKPROTECTOR_STRONG] - -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] - Graphics support ---> - Frame buffer Devices ---> - <*> Support for frame buffer devices ---> - Console display driver support ---> - [*] Framebuffer Console support [CONFIG_FRAMEBUFFER_CONSOLE] - - -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] - -Processor type and features ---> - [*] Build a relocatable kernel [CONFIG_RELOCATABLE] - [*] Randomize the address of the kernel image (KASLR) [CONFIG_RANDOMIZE_BASE] - -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 @@ -216,31 +147,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] + 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..d02408dcc --- /dev/null +++ b/chapter10/kernel/Makefile @@ -0,0 +1,19 @@ +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 +s-kernel-version: Makefile kernel_version.py + ./kernel_version.py $(KERNEL_TREE) > tmp-kernel.version + if ! diff tmp-kernel.version $@ 2>/dev/null >/dev/null; then \ + mv tmp-kernel.version 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..93b203a46 --- /dev/null +++ b/chapter10/kernel/kernel-config.py @@ -0,0 +1,293 @@ +#!/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) + +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]) + line = escape(comment) + ':\n' + line + + 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..3c43d7159 --- /dev/null +++ b/chapter10/kernel/kernel.version @@ -0,0 +1 @@ +6.4.7 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..936c50492 --- /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..0bbe1d42a --- /dev/null +++ b/chapter10/kernel/systemd.xml @@ -0,0 +1,48 @@ + + + +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..7e615a56c --- /dev/null +++ b/chapter10/kernel/sysv.xml @@ -0,0 +1,32 @@ + + + +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..4e4bd9571 --- /dev/null +++ b/chapter10/kernel/x2apic.xml @@ -0,0 +1,12 @@ + + + +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] From 57499d5909d515e8e4d9bfab91c90350816e148c Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 1 Aug 2023 09:17:05 +0800 Subject: [PATCH 015/100] kernel: Separate toplevel menus in rendering --- chapter10/kernel/kernel-config.py | 7 ++++++- chapter10/kernel/systemd.xml | 5 +++++ chapter10/kernel/sysv.xml | 3 +++ chapter10/kernel/x2apic.xml | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/chapter10/kernel/kernel-config.py b/chapter10/kernel/kernel-config.py index 93b203a46..fc9bcc0d2 100755 --- a/chapter10/kernel/kernel-config.py +++ b/chapter10/kernel/kernel-config.py @@ -243,6 +243,8 @@ 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 @@ -275,7 +277,10 @@ for i0, val, i1, title, arrow, key, menu, comment in r: comment = [comment] if comment: comment = '\n'.join([' ' * i0 + '# ' + line for line in comment]) - line = escape(comment) + ':\n' + line + buf += escape(comment) + ':' + + if not menu and buf: + buf += [''] buf += [line.rstrip()] diff --git a/chapter10/kernel/systemd.xml b/chapter10/kernel/systemd.xml index 0bbe1d42a..4c57776c2 100644 --- a/chapter10/kernel/systemd.xml +++ b/chapter10/kernel/systemd.xml @@ -14,16 +14,20 @@ [*] 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] @@ -41,6 +45,7 @@ <*> 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 ---> diff --git a/chapter10/kernel/sysv.xml b/chapter10/kernel/sysv.xml index 7e615a56c..7e62725e6 100644 --- a/chapter10/kernel/sysv.xml +++ b/chapter10/kernel/sysv.xml @@ -13,12 +13,15 @@ [*] 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] diff --git a/chapter10/kernel/x2apic.xml b/chapter10/kernel/x2apic.xml index 4e4bd9571..9bd2a719f 100644 --- a/chapter10/kernel/x2apic.xml +++ b/chapter10/kernel/x2apic.xml @@ -5,6 +5,7 @@ DO NOT EDIT! --> Processor type and features ---> [*] Support x2apic [X86_X2APIC] + Device Drivers ---> [*] PCI support ---> [PCI] [*] Message Signaled Interrupts (MSI and MSI-X) [PCI_MSI] From 3d99820133c0ffcd2f51a6a88b4a476f2f6d340a Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 1 Aug 2023 09:20:08 +0800 Subject: [PATCH 016/100] kernel: Fix a typo --- chapter10/kernel/kernel-config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter10/kernel/kernel-config.py b/chapter10/kernel/kernel-config.py index fc9bcc0d2..a36113175 100755 --- a/chapter10/kernel/kernel-config.py +++ b/chapter10/kernel/kernel-config.py @@ -277,7 +277,7 @@ for i0, val, i1, title, arrow, key, menu, comment in r: comment = [comment] if comment: comment = '\n'.join([' ' * i0 + '# ' + line for line in comment]) - buf += escape(comment) + ':' + buf += [escape(comment) + ':'] if not menu and buf: buf += [''] From be5b2e03fc6e7382f8c012d9fdb8e29a9bbbf17c Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Tue, 1 Aug 2023 13:52:22 -0500 Subject: [PATCH 017/100] Package updates: Update to vim-9.0.1677. Update to openssl-3.1.2. Update to man-pages-6.05. Update to binutils-2.41. Update to gmp-6.3.0. Update to glibc-2.38. --- chapter01/changelog.xml | 30 ++++++++++++++++++++++++++++++ chapter01/whatsnew.xml | 12 ++++++------ chapter06/diffutils.xml | 4 +++- chapter06/grep.xml | 5 +++-- chapter06/sed.xml | 5 +++-- chapter08/binutils.xml | 2 ++ chapter08/glibc.xml | 2 ++ chapter08/gmp.xml | 2 +- chapter08/stripping.xml | 2 +- packages.ent | 37 +++++++++++++++++++------------------ 10 files changed, 70 insertions(+), 31 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index ac551a947..caf35cc90 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,6 +40,36 @@ appropriate for the entry or if needed the entire day's listitem. --> + + 2023-08-01 + + + [bdubbs] - Update to vim-9.0.1677. Addresses + #4500. + + + [bdubbs] - Update to openssl-3.1.2. Fixes + #5305. + + + [bdubbs] - Update to man-pages-6.05. Fixes + #5303. + + + [bdubbs] - Update to binutils-2.41. Fixes + #5300. + + + [bdubbs] - Update to gmp-6.3.0. Fixes + #5301. + + + [bdubbs] - Update to glibc-2.38. Fixes + #5302. + + + + 2023-07-28 diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml index f40d3b33a..a2e7823da 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -64,9 +64,9 @@ Bc &bc-version; - + @@ -124,12 +124,12 @@ Gettext-&gettext-version; - - + 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/chapter08/binutils.xml b/chapter08/binutils.xml index cf1c4f895..c35bf136e 100644 --- a/chapter08/binutils.xml +++ b/chapter08/binutils.xml @@ -145,6 +145,8 @@ 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 diff --git a/chapter08/glibc.xml b/chapter08/glibc.xml index 4245b0ff4..a1f23a96b 100644 --- a/chapter08/glibc.xml +++ b/chapter08/glibc.xml @@ -166,10 +166,12 @@ esac is known to fail in the LFS chroot environment. + diff --git a/chapter08/gmp.xml b/chapter08/gmp.xml index 01dace92f..05e16722a 100644 --- a/chapter08/gmp.xml +++ b/chapter08/gmp.xml @@ -110,7 +110,7 @@ make html instruction". In this case, gmp should be reconfigured with the option and rebuilt. - Ensure that all 197 tests in the test suite passed. + Ensure that all 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 diff --git a/chapter08/stripping.xml b/chapter08/stripping.xml index 70e0d6ebb..9e71f4382 100644 --- a/chapter08/stripping.xml +++ b/chapter08/stripping.xml @@ -88,7 +88,7 @@ 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 diff --git a/packages.ent b/packages.ent index 66e7314ab..ac08d20a8 100644 --- a/packages.ent +++ b/packages.ent @@ -66,10 +66,10 @@ - - + + - + @@ -77,6 +77,7 @@ + @@ -256,20 +257,20 @@ - - + + - + - - + + - + @@ -477,10 +478,10 @@ - - + + - + @@ -535,10 +536,10 @@ - - + + - + @@ -726,13 +727,13 @@ - + - + - + From 8ada78d73e3bb15ad193dee84b830e3d8cf64cea Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 2 Aug 2023 10:37:52 +0800 Subject: [PATCH 018/100] binutils: gprofng man pages are OK now --- chapter08/binutils.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/chapter08/binutils.xml b/chapter08/binutils.xml index c35bf136e..5ff11a755 100644 --- a/chapter08/binutils.xml +++ b/chapter08/binutils.xml @@ -151,10 +151,9 @@ cd build 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,sframe,opcodes}.a From 7a8fcc39182cf2c556f9a738f0f3fe6e39cd0737 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 2 Aug 2023 10:54:44 +0800 Subject: [PATCH 019/100] glibc: Remove sed and option unneeded with 2.38 --disable-crypt is now the default, and the security fix for 2.37 is included. --- chapter05/glibc.xml | 1 - chapter08/glibc.xml | 11 ----------- 2 files changed, 12 deletions(-) diff --git a/chapter05/glibc.xml b/chapter05/glibc.xml index 7fb5e98c5..14f1fac6c 100644 --- a/chapter05/glibc.xml +++ b/chapter05/glibc.xml @@ -91,7 +91,6 @@ cd build --build=$(../scripts/config.guess) \ --enable-kernel=&min-kernel; \ --with-headers=$LFS/usr/include \ - --disable-crypt \ libc_cv_slibdir=/usr/lib diff --git a/chapter08/glibc.xml b/chapter08/glibc.xml index a1f23a96b..791a6b707 100644 --- a/chapter08/glibc.xml +++ b/chapter08/glibc.xml @@ -50,16 +50,6 @@ patch -Np1 -i ../&glibc-fhs-patch; - - Fix a security issue identified upstream: - -sed '/width -=/s/workend - string/number_length/' \ - -i stdio-common/vfprintf-process-arg.c - The Glibc documentation recommends building Glibc in a dedicated build directory: @@ -79,7 +69,6 @@ cd build --enable-kernel=&min-kernel; \ --enable-stack-protector=strong \ --with-headers=/usr/include \ - --disable-crypt \ libc_cv_slibdir=/usr/lib From f40b2e7be5bba58ee021211e872426262a093000 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 2 Aug 2023 14:02:08 +0800 Subject: [PATCH 020/100] gcc: Document new test failures with Glibc-2.38 Well, the analyzer failures are introduced by literally *my* Glibc change [1] and I'll sort them out for GCC 14... And the ASAN failures seem caused by the introduction of __isoc23_strtol (the libsanitizer does not know to intercept it). I'll test with LLVM once I reach it in BLFS (LLVM is the upstream of libsanitizer) and make a bug report. limits-exprparen.c also fails to me, it needs "ulimit -s 65536" instead of "ulimit -s 32768" in my build but maybe it's caused by my custom *FLAGS. [1]:https://sourceware.org/git/?p=glibc.git;a=commit;h=71d9e0fe766a --- chapter08/gcc.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/chapter08/gcc.xml b/chapter08/gcc.xml index bb22fbca5..0c4f591f2 100644 --- a/chapter08/gcc.xml +++ b/chapter08/gcc.xml @@ -184,6 +184,16 @@ 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, the subtest named + AddressSanitizer_StrtolOOBTest in the test + asan_test.C and the test named + interception-malloc-test-1.C are 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, From e65bfc4f69efeae0d18c0158b2050c045b724239 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 2 Aug 2023 18:54:42 +0800 Subject: [PATCH 021/100] procps: The "free with commit" test failure is fixed now Link: https://gitlab.com/procps-ng/procps/-/commit/414e33a8afb6 --- chapter08/procps.xml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/chapter08/procps.xml b/chapter08/procps.xml index e17d199ca..20a6be096 100644 --- a/chapter08/procps.xml +++ b/chapter08/procps.xml @@ -83,16 +83,6 @@ make check 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 From c7c6c1548a055aeba377ab2ec1dd100042b91da7 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 2 Aug 2023 19:06:09 +0800 Subject: [PATCH 022/100] kernel: systemd: FW_LOADER_USER_HELPER should be n, not y --- chapter10/kernel/systemd.toml | 2 +- chapter10/kernel/systemd.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter10/kernel/systemd.toml b/chapter10/kernel/systemd.toml index 936c50492..26ac61c46 100644 --- a/chapter10/kernel/systemd.toml +++ b/chapter10/kernel/systemd.toml @@ -21,7 +21,7 @@ NET='*' INET='*' IPV6='*' FW_LOADER=' *' -FW_LOADER_USER_HELPER='*' +FW_LOADER_USER_HELPER=' ' DMIID='*' INOTIFY_USER='*' TMPFS='*' diff --git a/chapter10/kernel/systemd.xml b/chapter10/kernel/systemd.xml index 4c57776c2..6705fdd35 100644 --- a/chapter10/kernel/systemd.xml +++ b/chapter10/kernel/systemd.xml @@ -36,7 +36,7 @@ ... [DEVTMPFS_MOUNT] Firmware loader ---> < /*> Firmware loading facility [FW_LOADER] - [*] Enable the firmware sysfs fallback mechanism + [ ] Enable the firmware sysfs fallback mechanism ... [FW_LOADER_USER_HELPER] Firmware Drivers ---> [*] Export DMI identification via sysfs to userspace [DMIID] From 264a80d60fe1938d94718c6e3f353c5e4e27e1cb Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Thu, 3 Aug 2023 10:10:11 +0800 Subject: [PATCH 023/100] udev: Use --no-same-owner for man pages, like systemd By the way, fix a minor formatting issue in udev-hwdb.8. --- chapter08/udev.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chapter08/udev.xml b/chapter08/udev.xml index 67e835afc..35bb12f46 100644 --- a/chapter08/udev.xml +++ b/chapter08/udev.xml @@ -147,11 +147,12 @@ make -f &udev-lfs-version;/Makefile.lfs install -tar -xf ../../systemd-man-pages-&systemd-man-version;.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 From 308ec7a37ffbf0d8fb43dcd897c44df69daa5ca3 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Thu, 3 Aug 2023 15:07:06 +0800 Subject: [PATCH 024/100] dbus: Add --enable-user-session like BLFS This will install dbus.service and dbus.socket into /usr/lib/systemd/user. In a base LFS installation the systemd per-user daemon is not usable at all, so they may seem useless. But if we install them, we can start to use them once systemd is rebuilt with PAM in BLFS (without rebuilding dbus). --- chapter08/dbus.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/chapter08/dbus.xml b/chapter08/dbus.xml index f59dd122b..62200fc27 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 + + + These 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: From 2ce66c4197c41ce73f095a36892e420f0c13f3c2 Mon Sep 17 00:00:00 2001 From: Thomas Trepl Date: Thu, 3 Aug 2023 12:27:16 +0200 Subject: [PATCH 025/100] Remove shasum (automake is the only one pkg were a sha sum is presented). Remove it for consistency --- chapter03/packages.xml | 1 - packages.ent | 1 - 2 files changed, 2 deletions(-) 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/packages.ent b/packages.ent index ac08d20a8..e87b49588 100644 --- a/packages.ent +++ b/packages.ent @@ -43,7 +43,6 @@ - From 2d6ced8aec6d7e8691bb2e3b04ed6fc2bb0d8322 Mon Sep 17 00:00:00 2001 From: Anton Mosich Date: Thu, 3 Aug 2023 15:47:57 +0200 Subject: [PATCH 026/100] Fix small typos --- chapter04/settingenviron.xml | 2 +- obfuscate.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter04/settingenviron.xml b/chapter04/settingenviron.xml index d801aa9ab..b255a4b45 100644 --- a/chapter04/settingenviron.xml +++ b/chapter04/settingenviron.xml @@ -104,7 +104,7 @@ EOF - LFS_TGT=(uname -m)-lfs-linux-gnu + LFS_TGT=$(uname -m)-lfs-linux-gnu The LFS_TGT variable sets a non-default, but compatible machine description for use when building our cross-compiler and linker and when 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 # From 67ca5ef3f788e952e04f142808193b9504afc468 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Thu, 3 Aug 2023 13:13:16 -0500 Subject: [PATCH 027/100] Add insmod part_gpt to example grub.cfg --- chapter10/grub.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/chapter10/grub.xml b/chapter10/grub.xml index f3ffc8ab8..965fa56c3 100644 --- a/chapter10/grub.xml +++ b/chapter10/grub.xml @@ -141,6 +141,7 @@ xorriso -as cdrecord -v dev=/dev/cdrw blank=as_needed grub-img.iso Date: Mon, 7 Aug 2023 23:00:42 +0800 Subject: [PATCH 028/100] dbus: Fix a typo (misusing plural) --- chapter08/dbus.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter08/dbus.xml b/chapter08/dbus.xml index 62200fc27..8ab4744ad 100644 --- a/chapter08/dbus.xml +++ b/chapter08/dbus.xml @@ -79,7 +79,7 @@ --enable-user-session - These ensures the D-Bus per-user service and socket unit + 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. From 9b7d651a54314b80138f1254a64005e6b7e95e53 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Mon, 7 Aug 2023 15:46:36 -0500 Subject: [PATCH 029/100] Package updates. Update to xz-5.4.4. Update to wheel-0.41.1 (Python Module). Update to man-pages-6.05.01. Update to linux-6.4.8. Update to iana-etc-20230804. Update to pkgconf 2.0.0. --- chapter01/changelog.xml | 29 +++++++++++++++++++++++++++++ chapter01/whatsnew.xml | 9 ++++++--- chapter08/pkgconf.xml | 8 ++++++++ packages.ent | 34 +++++++++++++++++----------------- 4 files changed, 60 insertions(+), 20 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index caf35cc90..df8af5973 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -39,6 +39,35 @@ or as appropriate for the entry or if needed the entire day's listitem. --> + + 2023-08-07 + + + [bdubbs] - Update to xz-5.4.4. Fixes + #5307. + + + [bdubbs] - Update to wheel-0.41.1 (Python Module). Fixes + #5311. + + + [bdubbs] - Update to man-pages-6.05.01. Fixes + #5306. + + + [bdubbs] - Update to linux-6.4.8. Fixes + #5309. + + + [bdubbs] - Update to iana-etc-20230804. Addresses + #5006. + + + [rahul] - Update to pkgconf 2.0.0. Fixes + #5310. + + + 2023-08-01 diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml index a2e7823da..4b95515cc 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -226,6 +226,9 @@ + + pkgconf-&pkgconf-version; + Perl-&perl-version; @@ -280,9 +283,9 @@ - + @@ -321,7 +324,7 @@ - Pkgconf-&flit-core-version; + Pkgconf-&pkgconf-version; diff --git a/chapter08/pkgconf.xml b/chapter08/pkgconf.xml index 724a1ff24..8c1031b14 100644 --- a/chapter08/pkgconf.xml +++ b/chapter08/pkgconf.xml @@ -41,8 +41,16 @@ + Installation of Pkgconf + Pkgconf 2.0.0 explicitly errors when attempting to run + --modversion with multiple packages. This breaks many + packages in BLFS. Run this sed to reinstate the old + output for pkgconf. + + sed -i '/1330,1336/s|^|//|' cli/main.c + Prepare Pkgconf for compilation: ./configure --prefix=/usr \ diff --git a/packages.ent b/packages.ent index e87b49588..59797bed2 100644 --- a/packages.ent +++ b/packages.ent @@ -318,10 +318,10 @@ - + - + @@ -433,12 +433,12 @@ - + - + - + - - pkgconf-&pkgconf-version; - + Perl-&perl-version; From 70b20e7c25088c5bc42bcb176f0dff4d9b1a552f Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 8 Aug 2023 08:31:33 +0800 Subject: [PATCH 031/100] changelog: Use a dash before pkgconf version number To be consistent will all other entries. --- chapter01/changelog.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index df8af5973..5f0b0a98c 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -63,7 +63,7 @@ #5006. - [rahul] - Update to pkgconf 2.0.0. Fixes + [rahul] - Update to pkgconf-2.0.0. Fixes #5310. @@ -253,7 +253,7 @@ #5273. - [rahul] - Changed from pkg-config to pkgconf 1.9.5. Fixes + [rahul] - Changed from pkg-config to pkgconf-1.9.5. Fixes #5274. From f4835ed6ad3d808c4f06cd109e657120e8f22fb5 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 8 Aug 2023 08:35:21 +0800 Subject: [PATCH 032/100] pkgconf: Reword the reason of sed Specifying --modversion with multiple packages just does not make sense. The real problem here is it's erroring out even if the multiple arguments are for the same package. --- chapter08/pkgconf.xml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/chapter08/pkgconf.xml b/chapter08/pkgconf.xml index 8c1031b14..7a9569178 100644 --- a/chapter08/pkgconf.xml +++ b/chapter08/pkgconf.xml @@ -44,10 +44,11 @@ Installation of Pkgconf - Pkgconf 2.0.0 explicitly errors when attempting to run - --modversion with multiple packages. This breaks many - packages in BLFS. Run this sed to reinstate the old - output for pkgconf. + Pkgconf-2.0.0 explicitly errors when attempting to run + with multiple arguments, even if these + arguments are constraints for the same package. This breaks many + packages in BLFS. Run this sed to reinstate the old + output for pkgconf: sed -i '/1330,1336/s|^|//|' cli/main.c From 9cca53dcac7a29b471491be27076cfcc06f21921 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 8 Aug 2023 11:12:36 +0800 Subject: [PATCH 033/100] kernel: Fix move-if-changed logic and regenerate with 6.4.8 --- chapter10/kernel/Makefile | 8 ++++++-- chapter10/kernel/kernel.version | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/chapter10/kernel/Makefile b/chapter10/kernel/Makefile index d02408dcc..e04d2d6b1 100644 --- a/chapter10/kernel/Makefile +++ b/chapter10/kernel/Makefile @@ -8,10 +8,14 @@ endif all: $(OUTPUT) kernel.version: s-kernel-version; @true -s-kernel-version: Makefile kernel_version.py + +.PHONY: s-kernel-version +s-kernel-version: ./kernel_version.py $(KERNEL_TREE) > tmp-kernel.version - if ! diff tmp-kernel.version $@ 2>/dev/null >/dev/null; then \ + if ! diff tmp-kernel.version kernel.version ; then \ mv tmp-kernel.version kernel.version; \ + else \ + rm tmp-kernel.version; \ fi touch s-kernel-version diff --git a/chapter10/kernel/kernel.version b/chapter10/kernel/kernel.version index 3c43d7159..4b20d9700 100644 --- a/chapter10/kernel/kernel.version +++ b/chapter10/kernel/kernel.version @@ -1 +1 @@ -6.4.7 +6.4.8 From 45f40e899be8d017e94d7cd606a5015c8737dee7 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Tue, 8 Aug 2023 16:07:19 -0500 Subject: [PATCH 034/100] Fix sed in pkgconf --- chapter08/pkgconf.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter08/pkgconf.xml b/chapter08/pkgconf.xml index 8c1031b14..89226dbf0 100644 --- a/chapter08/pkgconf.xml +++ b/chapter08/pkgconf.xml @@ -49,7 +49,7 @@ packages in BLFS. Run this sed to reinstate the old output for pkgconf. - sed -i '/1330,1336/s|^|//|' cli/main.c + sed -i '1330,1336s|^|//|' cli/main.c Prepare Pkgconf for compilation: From 91f9a174b535628ce48a1a8f9c3dddc3b9389f06 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 9 Aug 2023 12:37:52 +0800 Subject: [PATCH 035/100] ncurses: Simplify documentation install command --- chapter08/ncurses.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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; From 7c306241b640614e28805de23becdd339fcb2d73 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 9 Aug 2023 22:29:44 +0800 Subject: [PATCH 036/100] coreutils: Use groupadd/groupdel for creating/removing dummy group They look better than "echo >>" and "sed -i". And I think an example showing how to use groupadd/groupdel is good anyway. The format of /etc/group is already shown in chapter 7. --- chapter08/coreutils.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chapter08/coreutils.xml b/chapter08/coreutils.xml index c72041b3b..7d715f2f3 100644 --- a/chapter08/coreutils.xml +++ b/chapter08/coreutils.xml @@ -116,7 +116,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: @@ -134,7 +134,8 @@ FORCE_UNSAFE_CONFIGURE=1 ./configure \ Remove the temporary group: -sed -i '/dummy/d' /etc/group +groupdel dummy + Install the package: make install From 30e0a7b28fa9c2a1c2e0347cf62eef44448ab1b3 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 9 Aug 2023 22:39:53 +0800 Subject: [PATCH 037/100] gawk: Move the creation of awk.1 after the explanation of the previous command --- chapter08/gawk.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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; From f0b518a01e2cfaf12c277ca6fb4cf30e96498d8a Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Thu, 10 Aug 2023 13:45:01 +0800 Subject: [PATCH 038/100] binutils: Remove libgprofng.a, add libgprofng.so into contents section --- chapter08/binutils.xml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/chapter08/binutils.xml b/chapter08/binutils.xml index 5ff11a755..1fd436bd1 100644 --- a/chapter08/binutils.xml +++ b/chapter08/binutils.xml @@ -153,7 +153,7 @@ cd build Remove useless static libraries: -rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,sframe,opcodes}.a +rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,gprofng,opcodes,sframe}.a @@ -168,7 +168,8 @@ cd build 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 @@ -416,6 +417,17 @@ cd build + + libgprofng + + A library containing most routines used by + gprofng + + libgprofng + + + + libopcodes From 93ec8b32bf6486d3fdb47bb11c5b91120d442647 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Mon, 14 Aug 2023 09:15:54 +0800 Subject: [PATCH 039/100] grub cfg: Add an explanation for the insmod commands --- chapter10/grub.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/chapter10/grub.xml b/chapter10/grub.xml index 965fa56c3..f232a1675 100644 --- a/chapter10/grub.xml +++ b/chapter10/grub.xml @@ -150,6 +150,24 @@ menuentry "GNU/Linux, Linux &linux-version;-lfs-&version;" { } 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 From f7d3b6ed213e8957b3c32318fc240c9f73ffe7ea Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Mon, 14 Aug 2023 13:47:25 -0500 Subject: [PATCH 040/100] Package updates. Update to xz-5.4.4. Update to less-643. Update to meson-1.2.1. Update to linux-6.4.10. Update to iana-etc-20230810. Update to pkgconf-2.0.1. All build times and sizes were also checked and updated as needed. --- chapter01/changelog.xml | 30 +++++++ chapter01/whatsnew.xml | 4 +- chapter03/patches.xml | 8 ++ chapter08/gcc.xml | 11 +-- chapter08/glibc.xml | 5 ++ chapter08/less.xml | 4 +- chapter08/pkgconf.xml | 6 +- packages.ent | 190 ++++++++++++++++++++-------------------- patches.ent | 4 + 9 files changed, 156 insertions(+), 106 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 5f0b0a98c..39cb92c7d 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -39,6 +39,36 @@ or as appropriate for the entry or if needed the entire day's listitem. --> + + 2023-08-15 + + + [bdubbs] - Update to xz-5.4.4. Fixes + #5307. + + + [bdubbs] - Update to less-643. Fixes + #5317. + + + [bdubbs] - Update to meson-1.2.1. Fixes + #5314. + + + [bdubbs] - Update to linux-6.4.10. Fixes + #5313. + + + [bdubbs] - Update to iana-etc-20230810. Addresses + #5006. + + + [rahul] - Update to pkgconf-2.0.1. Fixes + #5316. + + + + 2023-08-07 diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml index 50eb75507..cf5156d40 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -226,9 +226,9 @@ - + Perl-&perl-version; diff --git a/chapter03/patches.xml b/chapter03/patches.xml index 5f1bbf0c2..bbf09ae27 100644 --- a/chapter03/patches.xml +++ b/chapter03/patches.xml @@ -77,6 +77,14 @@ --> + + Glibc Memalign Patch - &glibc-memalign-patch-size;: + + Download: + MD5 sum: &glibc-memalign-patch-md5; + + + Glibc FHS Patch - &glibc-fhs-patch-size;: diff --git a/chapter08/gcc.xml b/chapter08/gcc.xml index 0c4f591f2..5a9a0c5a5 100644 --- a/chapter08/gcc.xml +++ b/chapter08/gcc.xml @@ -187,11 +187,12 @@ su tester -c "PATH=$PATH make -k check" With Glibc-2.38, the analyzer tests named data-model-4.c and - conftest-1.c are known to fail. - In the asan tests, the subtest named - AddressSanitizer_StrtolOOBTest in the test - asan_test.C and the test named - interception-malloc-test-1.C are known to fail. + 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 + are known to fail. A few unexpected failures cannot always be avoided. The GCC developers diff --git a/chapter08/glibc.xml b/chapter08/glibc.xml index 791a6b707..ed25a1ba8 100644 --- a/chapter08/glibc.xml +++ b/chapter08/glibc.xml @@ -50,6 +50,11 @@ patch -Np1 -i ../&glibc-fhs-patch; + Now fix a regression causing the posix_memalign() function + to be very slow slow in some conditions. + +patch -Np1 -i ../&glibc-memalign-patch; + The Glibc documentation recommends building Glibc in a dedicated build directory: 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/pkgconf.xml b/chapter08/pkgconf.xml index 3bbec0705..fd61b4d40 100644 --- a/chapter08/pkgconf.xml +++ b/chapter08/pkgconf.xml @@ -43,15 +43,15 @@ Installation of Pkgconf - + Prepare Pkgconf for compilation: ./configure --prefix=/usr \ diff --git a/packages.ent b/packages.ent index 59797bed2..ac86afcc5 100644 --- a/packages.ent +++ b/packages.ent @@ -35,7 +35,7 @@ - + @@ -45,7 +45,7 @@ - + @@ -55,14 +55,14 @@ - + - + @@ -70,11 +70,11 @@ - + - - - + + + @@ -86,7 +86,7 @@ - + @@ -102,16 +102,16 @@ - + - + - + @@ -128,16 +128,16 @@ - + - - - + + + @@ -146,14 +146,14 @@ - + - + @@ -177,10 +177,10 @@ - + - - + + @@ -188,7 +188,7 @@ - + @@ -205,7 +205,7 @@ - + @@ -213,10 +213,10 @@ - + - - + + @@ -224,14 +224,14 @@ - - - - - - + + + + + + - + @@ -251,19 +251,19 @@ - - - - + + + + - - - + + + @@ -271,7 +271,7 @@ - + @@ -287,9 +287,9 @@ - - - + + + @@ -297,7 +297,7 @@ - + @@ -318,10 +318,10 @@ - + - + @@ -375,12 +375,12 @@ - - + + - + - + @@ -420,25 +420,25 @@ - - + + - + - + - + - + + GCC-&gcc-version; @@ -265,12 +265,12 @@ - - + Util-Linux-&util-linux-version; @@ -331,6 +331,10 @@ Flit-core-&flit-core-version; + + &glibc-memalign-patch; + + From b24fbe02b8d52d1b82d54a70434f04def4178bb0 Mon Sep 17 00:00:00 2001 From: "Douglas R. Reno" Date: Mon, 14 Aug 2023 19:45:49 -0500 Subject: [PATCH 043/100] Update stats for systemd/dbus Test results for dbus were clean --- packages.ent | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages.ent b/packages.ent index ac86afcc5..a5e7c19a8 100644 --- a/packages.ent +++ b/packages.ent @@ -119,7 +119,7 @@ - + @@ -657,7 +657,7 @@ - + From d280997ec6662dbba9a87020dc44bac1983860d7 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Tue, 15 Aug 2023 15:55:29 -0500 Subject: [PATCH 044/100] Typo --- chapter11/afterlfs.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter11/afterlfs.xml b/chapter11/afterlfs.xml index 279cc1108..dcd14fed5 100644 --- a/chapter11/afterlfs.xml +++ b/chapter11/afterlfs.xml @@ -80,7 +80,7 @@ featured browser and copy/paste capabilities are available. This method allows using applications like the host's version of wget to download package sources to a location available when working in the chroot - envirnment. + environment. From 58fc92b47eb36e7c5b2c4ac04001a7439152be08 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Tue, 15 Aug 2023 22:06:36 -0500 Subject: [PATCH 045/100] Typo --- chapter01/changelog.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 551a4a1f5..53018d5cd 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -65,7 +65,7 @@ [rahul] - Update to pkgconf-2.0.1. Fixes - #5316. + #5316. From cfcc2fe6cd00fb3606f76ba5591b6e4cb4384447 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 16 Aug 2023 12:26:14 +0800 Subject: [PATCH 046/100] gcc: Fix a grammar error in text --- chapter08/gcc.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter08/gcc.xml b/chapter08/gcc.xml index 5a9a0c5a5..693d6e975 100644 --- a/chapter08/gcc.xml +++ b/chapter08/gcc.xml @@ -192,7 +192,7 @@ su tester -c "PATH=$PATH make -k check" In the asan tests, several tests in asan_test.C are known to fail. The test named interception-malloc-test-1.C - are known to fail. + is known to fail. A few unexpected failures cannot always be avoided. The GCC developers From 76412317772426581b947d4a46835b2329432459 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Fri, 18 Aug 2023 10:35:49 -0500 Subject: [PATCH 047/100] Update to udev-lfs-20230818 --- chapter01/changelog.xml | 9 +++++++++ packages.ent | 4 ++-- udev-lfs/ChangeLog | 3 +++ udev-lfs/Makefile.lfs | 3 ++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 53018d5cd..b4b4c76ef 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -39,6 +39,15 @@ or as appropriate for the entry or if needed the entire day's listitem. --> + + 2023-08-18 + + + [bdubbs] - Update to udev-lfs-20230818. + + + + 2023-08-15 diff --git a/packages.ent b/packages.ent index a5e7c19a8..5ccfc42f2 100644 --- a/packages.ent +++ b/packages.ent @@ -709,10 +709,10 @@ - + - + diff --git a/udev-lfs/ChangeLog b/udev-lfs/ChangeLog index 53660938a..302aaa679 100644 --- a/udev-lfs/ChangeLog +++ b/udev-lfs/ChangeLog @@ -1,3 +1,6 @@ +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 diff --git a/udev-lfs/Makefile.lfs b/udev-lfs/Makefile.lfs index a8b4d7f30..295cacc54 100644 --- a/udev-lfs/Makefile.lfs +++ b/udev-lfs/Makefile.lfs @@ -3,7 +3,7 @@ # vim: tabstop=3 -VERSION=20230728 +VERSION=20230818 SHELL=/bin/bash ifeq ($(V),) @@ -23,6 +23,7 @@ install: # Copy rules @cp -v udev-lfs-$(VERSION)/*.rules $(DESTDIR)/etc/udev/rules.d @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 From b59c9e9155e6fffe4c35d4a622a9eaa5eb93d226 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Mon, 21 Aug 2023 10:50:31 +0800 Subject: [PATCH 048/100] grub configuration: The instructions should be skipped for UEFI, but the text not --- chapter10/grub.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chapter10/grub.xml b/chapter10/grub.xml index f232a1675..1b2335623 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. From b55a1a261498893c1a207675be1873104cda2a7a Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Mon, 21 Aug 2023 15:13:37 +0200 Subject: [PATCH 049/100] libxcrypt: typo and misplaced "nodump" --- chapter08/libxcrypt.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 \ From 0f5e0b42aeb116836aa1bcd1c9d1f29c69468cd9 Mon Sep 17 00:00:00 2001 From: "Douglas R. Reno" Date: Wed, 23 Aug 2023 19:58:53 -0500 Subject: [PATCH 050/100] Move the zlib URL to anduin --- packages.ent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages.ent b/packages.ent index 5ccfc42f2..cf4b71754 100644 --- a/packages.ent +++ b/packages.ent @@ -765,7 +765,7 @@ - + From 1e9ad78f818044104de05888a80e513b30585063 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Fri, 25 Aug 2023 11:46:27 -0500 Subject: [PATCH 051/100] Update to linux-6.4.12. --- chapter01/changelog.xml | 9 +++++++++ packages.ent | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index b4b4c76ef..5d3261228 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -39,6 +39,15 @@ or as appropriate for the entry or if needed the entire day's listitem. --> + + 2023-08-18 + + + [bdubbs] - Update to linux-6.4.12. + + + + 2023-08-18 diff --git a/packages.ent b/packages.ent index 5ccfc42f2..46122ee1b 100644 --- a/packages.ent +++ b/packages.ent @@ -433,12 +433,12 @@ - + - + - + + 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 From e5455293e338907c4a3cf9a461a7544083d7c762 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Mon, 28 Aug 2023 16:57:45 +0800 Subject: [PATCH 056/100] tar: Mention TESTSUITEFLAGS for testing --- chapter08/tar.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/chapter08/tar.xml b/chapter08/tar.xml index bfb1cf469..e55ad664d 100644 --- a/chapter08/tar.xml +++ b/chapter08/tar.xml @@ -72,6 +72,13 @@ 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. From 22c36bb8e41ebe08d9ac022d68d619583e556f21 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Mon, 28 Aug 2023 16:59:00 +0800 Subject: [PATCH 057/100] tar: The problematic test can also be skipped if security labels disabled For example, if CONFIG_EXT4_FS_SECURITY (Ext4 Security Labels) not set and we are building on an ext4 file system, the test will be skipeed. --- chapter08/tar.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chapter08/tar.xml b/chapter08/tar.xml index e55ad664d..ea5f44ebb 100644 --- a/chapter08/tar.xml +++ b/chapter08/tar.xml @@ -81,7 +81,8 @@ 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: From 4b1b79442c8cd616cea81ed0ee90ebe665f2e4a1 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 30 Aug 2023 00:32:30 +0800 Subject: [PATCH 058/100] hostreqs: Raise texinfo minimal version to 5.0 Binutils-2.41 FTBFS with texinfo-4.x. I've tested 5.0 and it works. Link: https://sourceware.org/bugzilla/show_bug.cgi?id=30703 --- chapter02/hostreqs.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter02/hostreqs.xml b/chapter02/hostreqs.xml index 862d2605c..e2fbce07b 100644 --- a/chapter02/hostreqs.xml +++ b/chapter02/hostreqs.xml @@ -145,7 +145,7 @@ - Texinfo-4.7 + Texinfo-5.0 @@ -235,7 +235,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 ver_kernel &min-kernel; From 4d22dd60635719fc3e4eae7f71faf727b1a5db9d Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Thu, 31 Aug 2023 13:54:42 +0800 Subject: [PATCH 059/100] dependencies: Coreutils needs Autoconf and Automake The autoreconf command is from Autoconf, and "autoconf -fi" invokes automake. --- appendices/dependencies.xml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/appendices/dependencies.xml b/appendices/dependencies.xml index 8038ee943..aa35eeb41 100644 --- a/appendices/dependencies.xml +++ b/appendices/dependencies.xml @@ -147,7 +147,7 @@ &before; - Automake + Automake and Coreutils @@ -189,7 +189,7 @@ &before; - None + Coreutils @@ -447,8 +447,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 @@ -2516,7 +2517,7 @@ D-Bus, E2fsprogs, IProute2, Kmod, Man-DB, Procps-ng, Python, - &systemd-udev;, and Util-linux + &systemd-udev;, and Util-linux From d2c6441ff60d42cadb984f0f031d560b4187c78c Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Thu, 31 Aug 2023 18:07:52 +0800 Subject: [PATCH 060/100] dependencies: sync Systemd external dependency list from BLFS --- appendices/dependencies.xml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/appendices/dependencies.xml b/appendices/dependencies.xml index aa35eeb41..81f11a2c8 100644 --- a/appendices/dependencies.xml +++ b/appendices/dependencies.xml @@ -2855,6 +2855,11 @@ &external; + AppArmor, + + audit-userspace, + + bash-completion, btrfs-progs, cURL, @@ -2862,20 +2867,20 @@ docbook-xml, docbook-xsl-nons, - elfutils, Git, - gnu-efi, GnuTLS, iptables, + jekyll, kexec-tools, + libbpf, + libdw, libfido2, libgcrypt, libidn2, - Libmicrohttpd, + libmicrohttpd, libpwquality, libseccomp, @@ -2890,16 +2895,23 @@ p11-kit, PCRE2, Polkit, + pyelftools, qemu, qrencode, - - quota-tools, + quota-tools, + rpm, rsync, + + SELinux, Sphinx, + + systemtap, tpm2-tss, Valgrind, + Xen, and zsh From 5561764f6f1e588a42a0100b45037934f38d0a12 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 1 Sep 2023 18:33:42 +0800 Subject: [PATCH 061/100] whatsnew: The coming release is 12.0, not 11.4 --- chapter01/whatsnew.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml index 78a241373..03647e34c 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -25,7 +25,7 @@ - In the 11.4 release, --disable-fixincludes + In the 12.0 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 From c9167804f9dc1bfaf7a7a841210ab1359007aca9 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Fri, 1 Sep 2023 12:47:49 -0500 Subject: [PATCH 062/100] Cleanup after 12.0 release --- chapter01/changelog.xml | 574 +--------------------------------------- chapter01/whatsnew.xml | 202 +++++++------- 2 files changed, 93 insertions(+), 683 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index f7a808cea..c3e6b7640 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -39,582 +39,12 @@ or as appropriate for the entry or if needed the entire day's listitem. --> - - 2023-08-18 - - - [bdubbs] - Update to linux-6.4.12. Fixes - #5320. - - - - 2023-08-18 + 2023-09-01 - [bdubbs] - Update to udev-lfs-20230818. - - - - - - 2023-08-15 - - - [bdubbs] - Add a patch to fix a performance regression in - glibc's posix_memalign() function. Fixes - #5315. - - - [bdubbs] - Update to less-643. Fixes - #5317. - - - [bdubbs] - Update to meson-1.2.1. Fixes - #5314. - - - [bdubbs] - Update to linux-6.4.10. Fixes - #5313. - - - [bdubbs] - Update to iana-etc-20230810. Addresses - #5006. - - - [rahul] - Update to pkgconf-2.0.1. Fixes - #5316. - - - - - - 2023-08-07 - - - [bdubbs] - Update to xz-5.4.4. Fixes - #5307. - - - [bdubbs] - Update to wheel-0.41.1 (Python Module). Fixes - #5311. - - - [bdubbs] - Update to man-pages-6.05.01. Fixes - #5306. - - - [bdubbs] - Update to linux-6.4.8. Fixes - #5309. - - - [bdubbs] - Update to iana-etc-20230804. Addresses - #5006. - - - [rahul] - Update to pkgconf-2.0.0. Fixes - #5310. - - - - - - 2023-08-01 - - - [bdubbs] - Update to vim-9.0.1677. Addresses - #4500. - - - [bdubbs] - Update to openssl-3.1.2. Fixes - #5305. - - - [bdubbs] - Update to man-pages-6.05. Fixes - #5303. - - - [bdubbs] - Update to binutils-2.41. Fixes - #5300. - - - [bdubbs] - Update to gmp-6.3.0. Fixes - #5301. - - - [bdubbs] - Update to glibc-2.38. Fixes - #5302. - - - - - - 2023-07-28 - - - [bdubbs] - Update udev-lfs tarball to remove obsolete - cdrom rules and references to ISDN devices. Fixes - #5291. - - - [bdubbs] - Update to wheel-0.41.0 (Python Module). Fixes - #5290. - - - [bdubbs] - Update to tar-1.35. Fixes - #5287. - - - [bdubbs] - Update to udev - from systemd-254. Fixes - #5293. - - - [bdubbs] - Update to meson-1.2.0. Fixes - #5286. - - - [bdubbs] - Update to linux-6.4.7. Fixes - #5288. - - - [bdubbs] - Update to gcc-13.2.0. Fixes - #5292. - - - [bdubbs] - Update to file-5.45. Fixes - #5294. - - - - - - 2023-07-28 - - - [xry111] - Enable cgroup-based memory pressure information - in kernel, and add the cgroup file system into /etc/fstab and the - mountvirtfs bootscript. This is a preparation for udev from - systemd-254. Addresses - #5293. - - - - - - 2023-07-22 - - - [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 iana-etc-20230629. Addresses - #5006. - - - [bdubbs] - Update to linux-6.4.3. Fixes - #5284. - - - [bdubbs] - Update to libxcrypt-4.4.36. Fixes - #5283. - - - [bdubbs] - Update to groff-1.23.0. Fixes - #5282. - - - [bdubbs] - Update to perl-5.38.0. Fixes - #5281. - - - - - - 2023-07-02 - - - [xry111] - Add libxcrypt-4.4.35. Fixes - #5280. - - - [xry111] - Update to iproute2-6.4.0. Fixes - #5277. - - - [xry111] - Update to linux-6.4.1. Fixes - #5276. - - - - - - 2023-07-01 - - - [bdubbs] - Update to iana-etc-20230615. Addresses - #5006. - - - [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 MarkupSafe-2.1.3 (Python Module). Fixes - #5268. - - - [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. - - - - - - 2023-05-18 - - - [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 78a241373..3b9d5fd1e 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -11,6 +11,13 @@ What's new since the last release + - + + @@ -76,18 +83,18 @@ - + - + + @@ -100,84 +107,84 @@ - + - + + + - + + + - + + - + - + - + - + - + + @@ -187,27 +194,27 @@ - + - + - + + + @@ -220,27 +227,27 @@ - + - + + + - + @@ -250,48 +257,48 @@ - + + - + - + + + + + - + - + - - Udev-&systemd-version; (from systemd) - - - - Jinja2-&jinja2-version; - - - - MarkupSafe-&markupsafe-version; - - - - Libxcrypt-&libxcrypt-version; - - - - Pkgconf-&pkgconf-version; - - - - Flit-core-&flit-core-version; - - - - &glibc-memalign-patch; - - @@ -351,7 +330,7 @@ Removed: - + From 3182685f702025eacd6a437cf1dd0ade7e732742 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sat, 2 Sep 2023 04:03:50 +0800 Subject: [PATCH 063/100] dependencies: Fix stupid typo in BLFS elogind page URL :( --- appendices/dependencies.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appendices/dependencies.xml b/appendices/dependencies.xml index 81f11a2c8..31796da9b 100644 --- a/appendices/dependencies.xml +++ b/appendices/dependencies.xml @@ -2567,7 +2567,7 @@ None - elogind + elogind From 1ebfa8e664dfa4f2425036f37d7c563d1674b249 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sat, 2 Sep 2023 14:17:17 +0800 Subject: [PATCH 064/100] pdf: Allow breaking pages in version-check and kernel configuration They are very long or . By default they are attributed "keep-together.within-column = always", override it to allow line break. Fixes #5336. Link: http://www.sagehill.net/docbookxsl/PageBreaking.html --- chapter02/hostreqs.xml | 2 +- chapter10/kernel.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/chapter02/hostreqs.xml b/chapter02/hostreqs.xml index e2fbce07b..10c1bf16e 100644 --- a/chapter02/hostreqs.xml +++ b/chapter02/hostreqs.xml @@ -173,7 +173,7 @@ To see whether your host system has all the appropriate versions, and the ability to compile programs, run the following commands: -cat > version-check.sh << "EOF" +cat > version-check.sh << "EOF" #!/bin/bash # A script to list version numbers of critical development tools diff --git a/chapter10/kernel.xml b/chapter10/kernel.xml index 8609b1474..52b2a3c39 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 From fd409751bf218dab1399088dbf0c6edee2506b10 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sat, 2 Sep 2023 17:23:27 +0800 Subject: [PATCH 065/100] Revert "openssl: Add a warning about minor version bump and OpenSSH" This reverts commit ad09ba40a1d521857bf440b093167d91e5172f04. This reverts commit bbaf00d41541380665f0b146d60d12afb44cc62b. No longer needed with OpenSSH-9.4 or later. --- chapter08/openssl.xml | 15 --------------- 1 file changed, 15 deletions(-) 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 From 3864d235cfd3623f6a4765d9acd13caee62c6629 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Sat, 2 Sep 2023 08:54:55 -0500 Subject: [PATCH 066/100] Package updates and misc upates/typos. Update to vim-1837.$ Update to zlib-1.3.$ Update to wheel-0.41.2 (Python Module).$ Update to util-linux-2.39.2.$ Update to sysvinit-3.08.$ Update to shadow-4.14.0.$ Update to Python-3.11.5.$ Update to procps-ng-4.0.4.$ Update to pkgconf-2.0.2.$ Update to mpfr-4.2.1.$ Update to kbd-2.6.2.$ Update to gzip-1.13.$ Update to coreutils-9.4.$ Specify the 'nobody-group' for systemd.$ Remove unused usb group.$ --- bootscripts/lfs/init.d/checkfs | 2 +- chapter01/changelog.xml | 66 ++++++++++++++++++++++++++++ chapter01/whatsnew.xml | 52 +++++++++++------------ chapter07/createfiles.xml | 2 - chapter08/autoconf.xml | 2 +- chapter08/mpfr.xml | 14 ------ chapter08/procps.xml | 13 +----- chapter08/shadow.xml | 9 ++++ chapter08/systemd.xml | 9 ++++ chapter10/kernel.xml | 4 +- packages.ent | 78 +++++++++++++++++----------------- patches.ent | 76 +-------------------------------- 12 files changed, 156 insertions(+), 171 deletions(-) diff --git a/bootscripts/lfs/init.d/checkfs b/bootscripts/lfs/init.d/checkfs index 0903a0111..bbbae8d99 100644 --- a/bootscripts/lfs/init.d/checkfs +++ b/bootscripts/lfs/init.d/checkfs @@ -101,7 +101,7 @@ case "${1}" in if [ "${error_value}" = 2 -o "${error_value}" = 3 ]; then msg="\nWARNING:\n\nFile system errors " - msg="${msg}were found and have been been " + msg="${msg}were found and have been " msg="${msg}corrected, but the nature of the " msg="${msg}errors require this system to be rebooted.\n\n" msg="${msg}After you press enter, " diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index c3e6b7640..d7e9c544f 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,6 +40,72 @@ appropriate for the entry or if needed the entire day's listitem. --> + + 2023-09-02 + + + [bdubbs] - Update to vim-1837. Addresses + #4500. + + + [bdubbs] - Update to zlib-1.3. Fixes + #5324. + + + [bdubbs] - Update to wheel-0.41.2 (Python Module). Fixes + #5328. + + + [bdubbs] - Update to util-linux-2.39.2. Fixes + #5322. + + + [bdubbs] - Update to sysvinit-3.08. Fixes + #5321. + + + [bdubbs] - Update to shadow-4.14.0. Fixes + #5319. + + + [bdubbs] - Update to Python-3.11.5. Fixes + #5330. + + + [bdubbs] - Update to procps-ng-4.0.4. Fixes + #5335. + + + [bdubbs] - Update to pkgconf-2.0.2. Fixes + #5323. + + + [bdubbs] - Update to mpfr-4.2.1. Fixes + #5326. + + + [bdubbs] - Update to kbd-2.6.2. Fixes + #5318. + + + [bdubbs] - Update to gzip-1.13. Fixes + #5325. + + + [bdubbs] - Update to coreutils-9.4. Fixes + #5334. + + + [bdubbs] - Specify the 'nobody-group' for systemd. Fixes + #5333. + + + [bdubbs] - Remove unused usb group. Fixes + #5331. + + + + 2023-09-01 diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml index 3b9d5fd1e..0f72bd434 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -83,9 +83,9 @@ Perhaps a new page - somthing like 'Upgrading an Existing LFS System'. - + @@ -149,9 +149,9 @@ Perhaps a new page - somthing like 'Upgrading an Existing LFS System'. - + @@ -167,9 +167,9 @@ Perhaps a new page - somthing like 'Upgrading an Existing LFS System'. - + @@ -218,9 +218,9 @@ Perhaps a new page - somthing like 'Upgrading an Existing LFS System'. - + @@ -233,39 +233,39 @@ Perhaps a new page - somthing like 'Upgrading an Existing LFS System'. - + - + - + - + - + @@ -278,24 +278,24 @@ Perhaps a new page - somthing like 'Upgrading an Existing LFS System'. - - - + - + 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/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/mpfr.xml b/chapter08/mpfr.xml index 2d16053de..c9e7c1a7d 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 \ diff --git a/chapter08/procps.xml b/chapter08/procps.xml index 20a6be096..7fc74f587 100644 --- a/chapter08/procps.xml +++ b/chapter08/procps.xml @@ -67,18 +67,9 @@ Compile the package: -make - To run the test suite, run: make check diff --git a/chapter08/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/systemd.xml b/chapter08/systemd.xml index 63003ac68..b5b50e623 100644 --- a/chapter08/systemd.xml +++ b/chapter08/systemd.xml @@ -68,6 +68,7 @@ meson setup \ -Dmode=release \ -Dpamconfdir=no \ -Ddev-kvm-mode=0660 \ + -Dnobody-group=nogroup \ -Ddocdir=/usr/share/doc/systemd-&systemd-version; \ .. @@ -178,6 +179,14 @@ meson setup \ consider it dangerous. This option overrides it. + + + -Dnobody-group=nogroup + + Tell the package what group name to use for + the 'nobody-group'. + + Compile the package: diff --git a/chapter10/kernel.xml b/chapter10/kernel.xml index 52b2a3c39..5c7a9d703 100644 --- a/chapter10/kernel.xml +++ b/chapter10/kernel.xml @@ -140,7 +140,7 @@ - + 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 @@ -292,7 +292,7 @@ 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/packages.ent b/packages.ent index 67ad4012c..e93984a98 100644 --- a/packages.ent +++ b/packages.ent @@ -104,10 +104,10 @@ - - + + - + @@ -308,10 +308,10 @@ - - + + - + @@ -359,10 +359,10 @@ - - + + - + @@ -509,10 +509,10 @@ - - + + - + @@ -567,18 +567,18 @@ - + - + - - + + - + @@ -594,19 +594,19 @@ - + - + - + - - + + @@ -627,10 +627,10 @@ - - + + - + @@ -660,10 +660,10 @@ - - + + - + @@ -716,31 +716,31 @@ - - + + - + - + - + - + - + - + @@ -763,10 +763,10 @@ - - + + - + diff --git a/patches.ent b/patches.ent index c3b6dfb18..7bb34e656 100644 --- a/patches.ent +++ b/patches.ent @@ -2,50 +2,14 @@ - - - - - + - - - - @@ -62,49 +26,11 @@ - - - - - - From 1b807632f6f1aa8a67680b34bac95b300952e624 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 3 Sep 2023 00:45:13 +0800 Subject: [PATCH 067/100] Add --no-cache-dir into pip3 wheel commands for Python modules --- chapter01/changelog.xml | 5 +++++ chapter08/flit-core.xml | 11 ++++++++++- chapter08/jinja2.xml | 2 +- chapter08/markupsafe.xml | 2 +- chapter08/meson.xml | 2 +- chapter08/wheel.xml | 2 +- general.ent | 1 + 7 files changed, 20 insertions(+), 5 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index d7e9c544f..e5ff7b4b8 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -43,6 +43,11 @@ 2023-09-02 + + [xry111] - Add --no-cache-dir option for pip3 wheel + commands. Addresses + BLFS #18466. + [bdubbs] - Update to vim-1837. Addresses #4500. 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/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/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/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/general.ent b/general.ent index a222812e9..0540ac6c2 100644 --- a/general.ent +++ b/general.ent @@ -103,6 +103,7 @@ --> + From eae99efe05983aa27903d9ab24f510e7823692d4 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 3 Sep 2023 00:49:07 +0800 Subject: [PATCH 068/100] changelog: Fix vim version string --- chapter01/changelog.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index e5ff7b4b8..3677af3d9 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -49,7 +49,7 @@ BLFS #18466. - [bdubbs] - Update to vim-1837. Addresses + [bdubbs] - Update to vim-9.0.1837. Addresses #4500. From 1a77fa6eddb8db236ec37a0f8c0c7d95f2741d5f Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Sat, 2 Sep 2023 19:33:50 +0200 Subject: [PATCH 069/100] Fix zlib download url We may want to use either archive or github. But right now, use directly zlib.net... --- packages.ent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages.ent b/packages.ent index e93984a98..087deb3a1 100644 --- a/packages.ent +++ b/packages.ent @@ -765,7 +765,7 @@ - + From 815b4a786d2abba6047dac9b164c92a530627aa3 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 3 Sep 2023 03:25:07 +0800 Subject: [PATCH 070/100] zlib: Switch to https://zlib.net/fossils See added comment for rationale. I've "diff -Naur"ed extracted zlib-1.3.tar.xz and zlib-1.3.tar.gz and there is no difference. --- packages.ent | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages.ent b/packages.ent index 087deb3a1..92bc3082a 100644 --- a/packages.ent +++ b/packages.ent @@ -764,10 +764,14 @@ - - - - + + + + + From 62a4fea4be6e0aeecea3063ebfd99f71a8c24cb7 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 3 Sep 2023 03:30:43 +0800 Subject: [PATCH 071/100] currency: Remove stale lfs-latest.php and symlink lfs-latest-git.php to it It just does not make sense to keep a completely useless script here... --- lfs-latest.php | 482 +------------------------------------------------ 1 file changed, 1 insertion(+), 481 deletions(-) mode change 100644 => 120000 lfs-latest.php 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 From ffecb9ef81622be4dd465e359bea824858514495 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 3 Sep 2023 03:40:13 +0800 Subject: [PATCH 072/100] systemd: Slightly adjust the desc for -Dnobody-group --- chapter08/systemd.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter08/systemd.xml b/chapter08/systemd.xml index b5b50e623..761467acd 100644 --- a/chapter08/systemd.xml +++ b/chapter08/systemd.xml @@ -183,8 +183,8 @@ meson setup \ -Dnobody-group=nogroup - Tell the package what group name to use for - the 'nobody-group'. + Tell the package the group name with GID 65534 is + nogroup. From 26c031abf9658f0bb8b0ea335c56b23671f49942 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Mon, 4 Sep 2023 17:49:55 +0800 Subject: [PATCH 073/100] dependencies: Add patchutils as check optional dependency The configure script says: configure: WARNING: filterdiff not installed; build will not be reproducible. The filterdiff program is a part of patchutils. --- appendices/dependencies.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/appendices/dependencies.xml b/appendices/dependencies.xml index 31796da9b..6f03da578 100644 --- a/appendices/dependencies.xml +++ b/appendices/dependencies.xml @@ -437,6 +437,9 @@ libsubunit + and + + patchutils From 1ec60f1daf34b0021d903405899a217e4d214b93 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Mon, 4 Sep 2023 15:08:43 -0500 Subject: [PATCH 074/100] Move a caution to a better page. Move caution regarding building by mixing different versions of LFS to General Compilation Instructions. --- chapter01/changelog.xml | 11 +++++++++++ chapter01/whatsnew.xml | 29 +---------------------------- part3intro/generalinstructions.xml | 14 ++++++++++++++ 3 files changed, 26 insertions(+), 28 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 3677af3d9..46215237f 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,6 +40,17 @@ appropriate for the entry or if needed the entire day's listitem. --> + + 2023-09-04 + + + [bdubbs] - Move caution regarding building by mixing + different version of LFS to General Compilation Instructions. Fixes + #5338. + + + + 2023-09-02 diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml index 0f72bd434..d7c391796 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -11,36 +11,9 @@ What's new since the last release - + + + 2023-09-05 + + + [xry111] - Move pkgconf before binutils for binutils + building system to detect zstd properly. + #5340. + + + + 2023-09-04 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/stripping.xml b/chapter08/stripping.xml index 9e71f4382..68e0f8da1 100644 --- a/chapter08/stripping.xml +++ b/chapter08/stripping.xml @@ -94,6 +94,7 @@ online_usrlib="libbfd-&binutils-version;.so libm.so.6 libreadline.so.&readline-soversion; libz.so.&zlib-version; + libzstd.so.&zstd-version; $(cd /usr/lib; find libnss*.so* -type f)" for BIN in $online_usrbin; do From 5f36bceaa9d8460764a80306ac0d9586b8d864b7 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 5 Sep 2023 18:20:24 +0800 Subject: [PATCH 076/100] Package updates - Update to linux-6.5.1 (#5332) - Update to pkgconf-2.0.3 (#5339) - Update to dbus-1.14.10 (#5337) --- chapter01/changelog.xml | 12 ++++++++++++ packages.ent | 18 +++++++++--------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 29b9dfb19..2debc0c0a 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -48,6 +48,18 @@ building system to detect zstd properly. #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. + diff --git a/packages.ent b/packages.ent index 92bc3082a..7827212da 100644 --- a/packages.ent +++ b/packages.ent @@ -114,10 +114,10 @@ - - + + - + @@ -432,13 +432,13 @@ - - + + - + - + + + 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 \ From 6ad40199fc99428a8a26b5e53366c6c1086624fa Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Thu, 7 Sep 2023 20:01:00 +0800 Subject: [PATCH 081/100] Add some missed whatsnew and changelog entries --- chapter01/changelog.xml | 11 +++++++++++ chapter01/whatsnew.xml | 8 ++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index af1590611..07493ad16 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,6 +40,17 @@ appropriate for the entry or if needed the entire day's listitem. --> + + 2023-09-07 + + + [xry111] - Fix an issue in pkgconf-2.0.3 causing + BLFS packages fail to build. Fixes + #5341. + + + + 2023-09-05 diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml index d7c391796..d78d35df0 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -62,9 +62,9 @@ - + @@ -167,9 +167,9 @@ - + From 93f077212ef1a390dfcd092e667e02e46fcb4b16 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 8 Sep 2023 15:52:08 +0800 Subject: [PATCH 082/100] packages: Add kmod home page --- packages.ent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages.ent b/packages.ent index 7827212da..fb514b77d 100644 --- a/packages.ent +++ b/packages.ent @@ -371,7 +371,7 @@ - + From ae802cf97d91b780ca84c757057cfb30fc36a955 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 8 Sep 2023 16:13:37 +0800 Subject: [PATCH 083/100] whatsnew: Align package names with s in package pages It makes the package names more consistent, and it reduces the number of different msgid's for translators. By the way, move Udev to keep alphabetic order. --- chapter01/whatsnew.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml index d78d35df0..6f1291ad6 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -39,10 +39,10 @@ <para>Automake-&automake-version;</para> </listitem>--> <!--<listitem> - <para>Bash &bash-version;</para> + <para>Bash-&bash-version;</para> </listitem>--> <!--<listitem> - <para>Bc &bc-version;</para> + <para>Bc-&bc-version;</para> </listitem>--> <!--<listitem> <para>Binutils-&binutils-version;</para> @@ -71,9 +71,6 @@ <!--<listitem> <para>E2fsprogs-&e2fsprogs-version;</para> </listitem>--> - <!--<listitem revision="sysv"> - <para>Udev-&systemd-version; (from systemd)</para> - </listitem>--> <!--<listitem> <para>Expat-&expat-version;</para> </listitem>--> @@ -126,7 +123,7 @@ <para>Gzip-&gzip-version;</para> </listitem> <!--<listitem> - <para>IANA-Etc-&iana-etc-version;</para> + <para>Iana-Etc-&iana-etc-version;</para> </listitem>--> <!--<listitem> <para>Inetutils-&inetutils-version;</para> @@ -251,20 +248,23 @@ <!--<listitem> <para>Tzdata-&tzdata-version;</para> </listitem>--> + <!--<listitem revision="sysv"> + <para>Udev-&systemd-version; (from systemd)</para> + </listitem>--> <listitem> - <para>Util-Linux-&util-linux-version;</para> + <para>Util-linux-&util-linux-version;</para> </listitem> <listitem> <para>Vim-&vim-version;</para> </listitem> <listitem> - <para>wheel-&wheel-version;</para> + <para>Wheel-&wheel-version;</para> </listitem> <!--<listitem> - <para>XML-Parser-&xml-parser-version;</para> + <para>XML::Parser-&xml-parser-version;</para> </listitem>--> <!--<listitem> - <para>XZ-Utils-&xz-version;</para> + <para>Xz-&xz-version;</para> </listitem>--> <listitem> <para>Zlib-&zlib-version;</para> From aa5fa04a5adb8502ecd6430fc6816ac59fe8e4b9 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao <xry111@xry111.site> Date: Fri, 8 Sep 2023 17:10:14 +0800 Subject: [PATCH 084/100] coreutils: Drop gl_cv_macro_MB_CUR_MAX_good override It's not needed anymore with 9.4. --- chapter06/coreutils.xml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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 @@ <sect2 role="installation"> <title>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: From 9f9a9b495005f94f9fd6e0d7e1436e5a8b4916ef Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 8 Sep 2023 21:45:15 +0800 Subject: [PATCH 085/100] binutils-pass2: Reword the paragraph about libtool workaround Well, I was blaming libtool too much. If the entire Binutils tree uses libtool this won't happen. The problem is Binutils building system is using libtool-style idiom on non-libtool components. And this issue is not related to cross compiling, at all. A native build can exploit the issue as well (see the updated comment). Maybe I'll submit a patch to GCC (yes, not a typo, GCC is the upstream of Binutils building system) to fix the issue when I have the mood... --- chapter06/binutils-pass2.xml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/chapter06/binutils-pass2.xml b/chapter06/binutils-pass2.xml index 7b0f1fc20..abe829a4c 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 relies on an internal 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 From c7df34cbc51739936cf0006ced0024a8ea8436e8 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sat, 9 Sep 2023 03:15:32 +0800 Subject: [PATCH 086/100] mpfr: 4.2.1 has 198 tests --- chapter08/mpfr.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter08/mpfr.xml b/chapter08/mpfr.xml index c9e7c1a7d..60181d6e9 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 From 1f20176cfb95061660c51225336f0c516fad64e0 Mon Sep 17 00:00:00 2001 From: "Douglas R. Reno" Date: Sat, 9 Sep 2023 01:08:20 -0500 Subject: [PATCH 087/100] util-linux: minor grammar reword --- chapter08/util-linux.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter08/util-linux.xml b/chapter08/util-linux.xml index b49168396..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 From 6c51e5ce7b92227de7406efd5e5db131db8163ac Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sat, 9 Sep 2023 14:45:05 +0800 Subject: [PATCH 088/100] perl: Move some explanations from Chapter 8 to Chapter 7 Explain switches once they show up first time. --- chapter07/perl.xml | 32 +++++++++++++++++++++++++++++++- chapter08/perl.xml | 29 +---------------------------- 2 files changed, 32 insertions(+), 29 deletions(-) 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/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: From ab31b973c86b400b12d9f88e7087fd15ef693df3 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sat, 9 Sep 2023 14:51:24 +0800 Subject: [PATCH 089/100] chapter08: Make Installed "program(s)/library(ies)/directory(ies)" consistently lowercase --- chapter08/gmp.xml | 2 +- chapter08/libelf.xml | 4 ++-- chapter08/mpc.xml | 4 ++-- chapter08/mpfr.xml | 2 +- chapter08/python.xml | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/chapter08/gmp.xml b/chapter08/gmp.xml index de3f0ee8b..c2fd316f8 100644 --- a/chapter08/gmp.xml +++ b/chapter08/gmp.xml @@ -128,7 +128,7 @@ make install-html Contents of GMP - Installed Libraries + Installed libraries Installed directory diff --git a/chapter08/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/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 60181d6e9..cba4a64aa 100644 --- a/chapter08/mpfr.xml +++ b/chapter08/mpfr.xml @@ -74,7 +74,7 @@ make install-html Contents of MPFR - Installed Libraries + Installed libraries Installed directory 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 From cb6fcea9bf179795b704a26f44f9ec6951ae0342 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 10 Sep 2023 15:25:04 +0800 Subject: [PATCH 090/100] binutils-pass2: Minor reword --- chapter06/binutils-pass2.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter06/binutils-pass2.xml b/chapter06/binutils-pass2.xml index abe829a4c..983aaee2f 100644 --- a/chapter06/binutils-pass2.xml +++ b/chapter06/binutils-pass2.xml @@ -49,7 +49,7 @@ without-system-zlib. If the resulted libctf.so still links against libz.so (check with readelf -d) despite we are saying without-system-zlib, then the issue is still unresolved. --> - Binutils relies on an internal libtool copy to link against + 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 From 0627fc2281ad4ef567ae49db6938a5c37bde712f Mon Sep 17 00:00:00 2001 From: Thomas Trepl Date: Mon, 11 Sep 2023 11:26:10 +0200 Subject: [PATCH 091/100] Fix hardcoded copyright year --- git-version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-version.sh b/git-version.sh index 6dd3d90be..f6ff6d44a 100755 --- a/git-version.sh +++ b/git-version.sh @@ -24,7 +24,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 From c5fe6ee346919cc7c33780d7b91350e4bf57b97b Mon Sep 17 00:00:00 2001 From: Thomas Trepl Date: Mon, 11 Sep 2023 13:18:30 +0200 Subject: [PATCH 092/100] Do not retrieve yr from sysdate --- git-version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-version.sh b/git-version.sh index f6ff6d44a..db2ed62a1 100755 --- a/git-version.sh +++ b/git-version.sh @@ -24,7 +24,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 From e0a942748e6c2d475cc86ccab752d0f0379d2665 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Tue, 12 Sep 2023 18:54:01 +0200 Subject: [PATCH 093/100] Make /dev/shm mount and umount verbose Almost all commands in lfs are verbose. Don't know why these ones were not. --- chapter07/kernfs.xml | 2 +- chapter11/reboot.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter07/kernfs.xml b/chapter07/kernfs.xml index b5b0762bb..4757b257d 100644 --- a/chapter07/kernfs.xml +++ b/chapter07/kernfs.xml @@ -109,7 +109,7 @@ mount -vt tmpfs tmpfs $LFS/run if [ -h $LFS/dev/shm ]; then mkdir -pv $LFS/$(readlink $LFS/dev/shm) else - mount -t tmpfs -o nosuid,nodev tmpfs $LFS/dev/shm + mount -vt tmpfs -o nosuid,nodev tmpfs $LFS/dev/shm fi diff --git a/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 From a9dc9724ae2a954405dd4dbc6a1593f1b469c3dd Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 13 Sep 2023 13:46:57 +0800 Subject: [PATCH 094/100] git-version: Make shebang #!/bin/bash There is some bash-ism in the script. --- git-version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-version.sh b/git-version.sh index db2ed62a1..7a430fec3 100755 --- a/git-version.sh +++ b/git-version.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash if [ "$1" = sysv ]; then SYSV="INCLUDE" From c858ba4e17a445591520ddcea8b288b8e3d6db42 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 13 Sep 2023 14:08:06 +0800 Subject: [PATCH 095/100] build: Add "make dist" For creating a tarball without .git directory easier. The tarball will include version.ent and LFS-RELEASE files so the book rendered from it won't show "unknown" for all dates. --- .gitignore | 1 + Makefile | 11 ++++++++++- git-version.sh | 7 +++++++ 3 files changed, 18 insertions(+), 1 deletion(-) 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-$$(" >> conditional.ent if ! git status > /dev/null; then # Either it's not a git repository, or git is unavaliable. # Just workaround. + + if [ -e LFS-RELEASE ]; then + exit 0 + fi + echo " version.ent echo "" >> version.ent echo "]]>" >> version.ent @@ -65,3 +70,5 @@ echo "" >> version.ent echo "]]>" >> version.ent echo "" >> version.ent echo "" >> version.ent + +[ -z "$DIST" ] || echo $version > "$DIST" From 48d8f5a51d5dfe58ac6d205fa7430f364225fab2 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 13 Sep 2023 14:31:39 +0800 Subject: [PATCH 096/100] glibc: Fix CVE-2023-4527 --- chapter08/glibc.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/chapter08/glibc.xml b/chapter08/glibc.xml index 3932a2147..c648fe129 100644 --- a/chapter08/glibc.xml +++ b/chapter08/glibc.xml @@ -55,6 +55,18 @@ patch -Np1 -i ../&glibc-memalign-patch; + + Then fix a security vulnerability exploitable when the + option is used in + /etc/resolv.conf: + +sed \ + -E "/__res_context_search/\ + {N;N;s/(search \(([^,]*,){6}[^,]*)NULL/\1\&alt_dns_packet_buffer/}" \ + -i resolv/nss_dns/dns-host.c + The Glibc documentation recommends building Glibc in a dedicated build directory: From 80da60f0c070dee52f7add18aea74c0e124ed8f7 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 13 Sep 2023 15:39:25 +0800 Subject: [PATCH 097/100] stripping: Compress the kept debug info with Zlib --- chapter08/stripping.xml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/chapter08/stripping.xml b/chapter08/stripping.xml index 68e0f8da1..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 From b91b12adf3d7926f570b900f758e4670de3d4ec1 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 13 Sep 2023 16:07:33 +0800 Subject: [PATCH 098/100] git-version: Always skip creating version.ent if LFS-RELEASE exists --- git-version.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/git-version.sh b/git-version.sh index 4a3c6d1e4..5d8d32e5d 100755 --- a/git-version.sh +++ b/git-version.sh @@ -14,14 +14,13 @@ 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. - - if [ -e LFS-RELEASE ]; then - exit 0 - fi - echo " version.ent echo "" >> version.ent echo "]]>" >> version.ent From efd11134bb9bfa33f3c64aee634b2232bee571d3 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Thu, 14 Sep 2023 14:25:04 +0800 Subject: [PATCH 099/100] Glibc: Fix CVE-2023-4806 --- chapter01/changelog.xml | 20 ++++++++++++++++++++ chapter01/whatsnew.xml | 23 ++++------------------- chapter03/patches.xml | 6 +++--- chapter08/glibc.xml | 18 +++--------------- patches.ent | 6 +++--- 5 files changed, 33 insertions(+), 40 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 07493ad16..5f2d4860f 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,6 +40,26 @@ appropriate for the entry or if needed the entire day's listitem. --> + + 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 diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml index 6f1291ad6..e1fca225c 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -287,35 +287,20 @@ Added: - + + &glibc-upstream-fixes-patch; + - - - Removed: - 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/chapter08/glibc.xml b/chapter08/glibc.xml index c648fe129..f48d95d09 100644 --- a/chapter08/glibc.xml +++ b/chapter08/glibc.xml @@ -50,22 +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; - - - Then fix a security vulnerability exploitable when the - option is used in - /etc/resolv.conf: - -sed \ - -E "/__res_context_search/\ - {N;N;s/(search \(([^,]*,){6}[^,]*)NULL/\1\&alt_dns_packet_buffer/}" \ - -i resolv/nss_dns/dns-host.c +patch -Np1 -i ../&glibc-upstream-fixes-patch; The Glibc documentation recommends building Glibc in a dedicated build directory: diff --git a/patches.ent b/patches.ent index 7bb34e656..6634d1f2f 100644 --- a/patches.ent +++ b/patches.ent @@ -14,9 +14,9 @@ - - - + + + From ba40e325667d24c3988ae5c0395c79a7fe73e6ea Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Thu, 14 Sep 2023 16:48:46 +0800 Subject: [PATCH 100/100] systemd: Use NSS modules provided by systemd in nsswitch.conf It allows a simplification to /etc/hosts. Also correct some info about FQDN in both sysv and systemd. --- chapter08/glibc.xml | 20 +++++++++++++++- chapter09/network.xml | 22 ++++++++++++------ chapter09/networkd.xml | 53 +++++++++++++++++++----------------------- 3 files changed, 58 insertions(+), 37 deletions(-) diff --git a/chapter08/glibc.xml b/chapter08/glibc.xml index f48d95d09..cf1a4bd59 100644 --- a/chapter08/glibc.xml +++ b/chapter08/glibc.xml @@ -320,7 +320,7 @@ localedef -i ja_JP -f SHIFT_JIS ja_JP.SJIS 2> /dev/null || trueCreate a new file /etc/nsswitch.conf by running the following: -cat > /etc/nsswitch.conf << "EOF" +cat > /etc/nsswitch.conf << "EOF" # Begin /etc/nsswitch.conf passwd: files @@ -335,6 +335,24 @@ services: files ethers: files rpc: files +# End /etc/nsswitch.conf +EOF + +cat > /etc/nsswitch.conf << "EOF" +# Begin /etc/nsswitch.conf + +passwd: files systemd +group: files systemd +shadow: files systemd + +hosts: mymachines resolve [!UNAVAIL=return] files myhostname dns +networks: files + +protocols: files +services: files +ethers: files +rpc: files + # End /etc/nsswitch.conf EOF diff --git a/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.