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/askforhelp.xml b/chapter01/askforhelp.xml index 7cd2608d4..80fab7fed 100644 --- a/chapter01/askforhelp.xml +++ b/chapter01/askforhelp.xml @@ -10,6 +10,28 @@ Help + + + In case you've hit an issue building one package with the LFS + instruction, we strongly discourage posting the issue directly onto + the upstream support channel before discussing via a LFS support + channel listed in . + Doing so is often quite inefficient because the upstream + maintainers are rarely familiar with LFS building procedure. Even if + you've really hit an upstream issue, the LFS community can still help + to isolate the information wanted by the upstream maintainers and make + a proper report. + + + + If you must ask a question directly via an upstream support channel, + you shall at least note that many upstream projects have the support + channels separated from the bug tracker. The bug + reports for asking questions are considered invalid and may annoy + upstream developers for these projects. + + + If an issue or a question is encountered while working through this book, please check the FAQ page at . Questions are often already answered there. If your question is not diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index f3f0648f3..5067cb8b6 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,6 +40,59 @@ 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 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 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/chapter06/binutils-pass2.xml b/chapter06/binutils-pass2.xml index 0310417e6..4521336f8 100644 --- a/chapter06/binutils-pass2.xml +++ b/chapter06/binutils-pass2.xml @@ -118,7 +118,7 @@ cd build Remove the libtool archive files because they are harmful for cross compilation, and remove unnecessary static libraries: -rm -v $LFS/usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes}.{a,la} +rm -v $LFS/usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes,sframe}.{a,la} diff --git a/chapter08/gcc.xml b/chapter08/gcc.xml index d840cad11..0e7bfd488 100644 --- a/chapter08/gcc.xml +++ b/chapter08/gcc.xml @@ -192,10 +192,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/gmp.xml b/chapter08/gmp.xml index 7ee97e8c6..55169faf1 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: diff --git a/chapter08/systemd.xml b/chapter08/systemd.xml index d12ce391f..ea77f3696 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 @@ -205,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: @@ -367,12 +356,14 @@ rm -f /usr/bin/xsltproc busctl, coredumpctl, halt (symlink to systemctl), hostnamectl, init, journalctl, kernel-install, localectl, loginctl, - machinectl, networkctl, oomctl, portablectl, poweroff (symlink to + machinectl, mount.ddi (symlink to systemd-dissect), networkctl, + oomctl, portablectl, poweroff (symlink to systemctl), reboot (symlink to systemctl), resolvconf (symlink to resolvectl), resolvectl, runlevel (symlink to systemctl), shutdown (symlink to systemctl), systemctl, systemd-ac-power, systemd-analyze, systemd-ask-password, systemd-cat, systemd-cgls, systemd-cgtop, - systemd-creds, systemd-delta, systemd-detect-virt, + systemd-confext (symlink to systemd-sysext), systemd-creds, + systemd-delta, systemd-detect-virt, systemd-dissect, systemd-escape, systemd-hwdb, systemd-id128, systemd-inhibit, systemd-machine-id-setup, systemd-mount, systemd-notify, systemd-nspawn, systemd-path, diff --git a/chapter08/udev.xml b/chapter08/udev.xml index 163f8ca99..1074d5d75 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/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 6feeb2f1e..2c6fa90b9 100644 --- a/chapter10/kernel.xml +++ b/chapter10/kernel.xml @@ -130,53 +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 ---> +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 setup ---> - [ ] Compile the kernel with warnings as errors [CONFIG_WERROR] - < > Enable kernel headers through /sys/kernel/kheaders.tar.xz [CONFIG_IKHEADERS] - [ ] Configure standard kernel features (expert users) [CONFIG_EXPERT] + General architecture-dependent options ---> [*] Stack Protector buffer overflow detection [CONFIG_STACKPROTECTOR] [*] Strong Stack Protector [CONFIG_STACKPROTECTOR_STRONG] -Device Drivers ---> - Graphics support ---> - Frame buffer Devices ---> - <*> Support for frame buffer devices ---> - Console display driver support ---> - [*] Framebuffer Console support [CONFIG_FRAMEBUFFER_CONSOLE] - Generic Driver Options ---> - [ ] Support for uevent helper [CONFIG_UEVENT_HELPER] - [*] Maintain a devtmpfs filesystem to mount at /dev [CONFIG_DEVTMPFS] - [*] Automount devtmpfs at /dev, after the kernel mounted the rootfs [CONFIG_DEVTMPFS_MOUNT] - Processor type and features ---> - [*] Build a relocatable kernel [CONFIG_RELOCATABLE] - [*] Randomize the address of the kernel image (KASLR) [CONFIG_RANDOMIZE_BASE] +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 ---> @@ -186,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 ---> @@ -198,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] diff --git a/packages.ent b/packages.ent index 513cf9a69..c7aab7a93 100644 --- a/packages.ent +++ b/packages.ent @@ -172,10 +172,10 @@ - - + + - + @@ -218,10 +218,10 @@ - - + + - + @@ -392,7 +392,7 @@ - + @@ -442,12 +442,12 @@ - + - + - + - + - + - - + + - + @@ -677,10 +677,10 @@ - - + + - + @@ -718,10 +718,10 @@ - - + + - + @@ -746,10 +746,10 @@ - - + + - + diff --git a/prologue/why.xml b/prologue/why.xml index b43bb3a20..b5ac050eb 100644 --- a/prologue/why.xml +++ b/prologue/why.xml @@ -371,7 +371,7 @@ libcrypt library needed by various packages (notably, Shadow) for hashing passwords. It replaces the obsolete - libcrypt implmentation in + libcrypt implementation in Glibc. diff --git a/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