From 214ea81811ed5bc5a114646fe3185bda26abd0b7 Mon Sep 17 00:00:00 2001 From: "Douglas R. Reno" Date: Tue, 23 Jan 2024 13:59:46 -0600 Subject: [PATCH 01/63] Jinja2: update the home page in the All Packages section --- packages.ent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages.ent b/packages.ent index fba1f5405..cfdbd2790 100644 --- a/packages.ent +++ b/packages.ent @@ -353,7 +353,7 @@ - + From c88ec715386d9a15f374fc37532fe01f5c5797b5 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Wed, 24 Jan 2024 14:39:09 +0100 Subject: [PATCH 02/63] Put back punctuation inside quotes Reverts part of 811d59db8b. Looks like "American English prefers that periods and commas be placed inside closing quotation marks," according to https://en.wikipedia.org/wiki/American_English --- chapter07/creatingdirs.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter07/creatingdirs.xml b/chapter07/creatingdirs.xml index aee184941..eab9f5fce 100644 --- a/chapter07/creatingdirs.xml +++ b/chapter07/creatingdirs.xml @@ -54,7 +54,7 @@ install -dv -m 1777 /tmp /var/tmp /tmp and /var/tmp directories, but cannot remove another user's files from them. The latter is prohibited by the so-called - sticky bit, the highest bit (1) in the 1777 bit mask. + sticky bit, the highest bit (1) in the 1777 bit mask. FHS Compliance Note From 0d76fa268dd0503eb2e54063fb899cf6cf47f99b Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 24 Jan 2024 23:39:07 +0800 Subject: [PATCH 03/63] chapter07/python: Update the note about optional modules "Fatal error" is no longer outputted, but "Python requires OpenSSL 1.1.1 or newer" is bad as well because it's not really "required" (at least in BLFS definition). --- chapter07/python.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chapter07/python.xml b/chapter07/python.xml index 4ed385d58..84a173426 100644 --- a/chapter07/python.xml +++ b/chapter07/python.xml @@ -83,9 +83,9 @@ Some Python 3 modules can't be built now because the dependencies - are not installed yet. The building system still attempts to build - them however, so the compilation of some files will fail and the - compiler message may seem to indicate fatal error. + are not installed yet. For the ssl module, + a message Python requires a OpenSSL 1.1.1 or + newer is outputted. The message should be ignored. Just make sure the toplevel make command has not failed. The optional modules are not needed now and they will be built in From 0cca1d3831b438800eaf73d97b998ed46ae58909 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Thu, 25 Jan 2024 04:54:02 +0800 Subject: [PATCH 04/63] dependencies: gettext may use system libxml2 --- appendices/dependencies.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appendices/dependencies.xml b/appendices/dependencies.xml index 1493d84f9..158ed0f04 100644 --- a/appendices/dependencies.xml +++ b/appendices/dependencies.xml @@ -1047,7 +1047,7 @@ &external; - None + libxml2 From 9ac6ff55fccdccd4bce03e6d698d1770cea2a3d2 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Thu, 25 Jan 2024 05:13:47 +0800 Subject: [PATCH 05/63] libtool: Add "or newer" after "grep-3.8" We have grep-3.11 now. --- chapter08/libtool.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chapter08/libtool.xml b/chapter08/libtool.xml index 89b7786aa..cb550b5d6 100644 --- a/chapter08/libtool.xml +++ b/chapter08/libtool.xml @@ -56,8 +56,9 @@ Five tests are known to fail in the LFS build environment due to a circular dependency, but these tests pass if rechecked after - automake has been installed. Additionally, with grep-3.8, two tests will - trigger a warning for non-POSIX regular expressions and fail. + automake has been installed. Additionally, with grep-3.8 or newer, + two tests will trigger a warning for non-POSIX regular expressions and + fail. Install the package: From ea93c117f2971ed269d3a7d39999d8b16b6f2b7e Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 26 Jan 2024 01:49:29 +0800 Subject: [PATCH 06/63] treewide: Use instead of for man pages "gcc(1)" is really not a file name. Use and link to the online man page on https://man.archlinux.org/ so the user can refer to the man pages more easily. The change is done via a sed command and long lines are wrapped manually. --- chapter02/creatingpartition.xml | 3 ++- chapter04/addinguser.xml | 3 ++- chapter04/settingenviron.xml | 4 ++-- chapter05/glibc.xml | 5 +++-- chapter08/e2fsprogs.xml | 3 ++- chapter08/openssl.xml | 5 +++-- chapter08/shadow.xml | 4 ++-- chapter08/util-linux.xml | 3 ++- chapter09/networkd.xml | 14 +++++++++----- chapter09/systemd-custom.xml | 21 ++++++++++++--------- chapter09/udev.xml | 5 +++-- chapter09/usage.xml | 10 ++++++---- chapter10/fstab.xml | 2 +- chapter10/kernel.xml | 3 ++- general.ent | 1 + prologue/typography.xml | 11 ++++++++--- 16 files changed, 60 insertions(+), 37 deletions(-) diff --git a/chapter02/creatingpartition.xml b/chapter02/creatingpartition.xml index ef16c8b92..f5bb244cb 100644 --- a/chapter02/creatingpartition.xml +++ b/chapter02/creatingpartition.xml @@ -40,7 +40,8 @@ /dev/sda for the primary disk drive. Create a Linux native partition and a swap partition, if needed. Please - refer to cfdisk(8) or fdisk(8) if + refer to cfdisk(8) or + fdisk(8) if you do not yet know how to use the programs. For experienced users, other partitioning schemes are possible. diff --git a/chapter04/addinguser.xml b/chapter04/addinguser.xml index 18a9d20e6..e10a884b3 100644 --- a/chapter04/addinguser.xml +++ b/chapter04/addinguser.xml @@ -99,6 +99,7 @@ esac The - instructs su to start a login shell as opposed to a non-login shell. The difference between these two types of shells is described in detail in - bash(1) and info bash. + bash(1) and info + bash. diff --git a/chapter04/settingenviron.xml b/chapter04/settingenviron.xml index 20988bd3f..b179bb0b3 100644 --- a/chapter04/settingenviron.xml +++ b/chapter04/settingenviron.xml @@ -79,8 +79,8 @@ EOF Setting the user file-creation mask (umask) to 022 ensures that newly created files and directories are only writable by their owner, but are readable and executable by anyone (assuming default modes are used by the - open(2) system call, new files will end up with - permission mode 644 and directories with mode 755). + open(2) system call, new files + will end up with permission mode 644 and directories with mode 755). diff --git a/chapter05/glibc.xml b/chapter05/glibc.xml index f54a7d107..63c4f6387 100644 --- a/chapter05/glibc.xml +++ b/chapter05/glibc.xml @@ -59,8 +59,9 @@ esac The above command is correct. The ln command has several syntactic versions, so be sure to check - info coreutils ln and ln(1) - before reporting what may appear to be an error. + info coreutils ln and ln(1) before reporting what may appear to be + an error. diff --git a/chapter08/e2fsprogs.xml b/chapter08/e2fsprogs.xml index 6a4489dee..c5718c191 100644 --- a/chapter08/e2fsprogs.xml +++ b/chapter08/e2fsprogs.xml @@ -159,7 +159,8 @@ install-info --dir-file=/usr/share/info/dir /usr/share/info/com_err.infosed 's/metadata_csum_seed,//' -i /etc/mke2fs.conf - Read the man page mke2fs.conf(5) for details. + Read the man page mke2fs.conf(5) for details. diff --git a/chapter08/openssl.xml b/chapter08/openssl.xml index ae5d27e38..446dd226a 100644 --- a/chapter08/openssl.xml +++ b/chapter08/openssl.xml @@ -163,7 +163,7 @@ make MANSUFFIX=ssl install is a command-line tool for using the various cryptography functions of OpenSSL's crypto library from the shell. It can be used for various functions which are documented in - openssl(1) + openssl(1) openssl @@ -195,7 +195,8 @@ make MANSUFFIX=ssl install implements the Transport Layer Security (TLS v1) protocol. It provides a rich API, documentation - on which can be found in ssl(7) + on which can be found in ssl(7) libssl.so diff --git a/chapter08/shadow.xml b/chapter08/shadow.xml index 49bcae6de..89678b3f4 100644 --- a/chapter08/shadow.xml +++ b/chapter08/shadow.xml @@ -203,8 +203,8 @@ make -C man install-man to pass either the -g or -N parameter to useradd, or else change the setting of USERGROUPS_ENAB in - /etc/login.defs. See useradd(8) - for more information. + /etc/login.defs. See useradd(8) for more information. Second, to change the default parameters, the file /etc/default/useradd must be created and tailored diff --git a/chapter08/util-linux.xml b/chapter08/util-linux.xml index 183e58418..e6bb0b683 100644 --- a/chapter08/util-linux.xml +++ b/chapter08/util-linux.xml @@ -584,7 +584,8 @@ su tester -c "make -k check" irqtop Displays kernel interrupt counter information in - top(1) style view + top(1) style + view irqtop diff --git a/chapter09/networkd.xml b/chapter09/networkd.xml index 19a1f7c01..3b9dd2cda 100644 --- a/chapter09/networkd.xml +++ b/chapter09/networkd.xml @@ -50,9 +50,11 @@ .netdev and .network files. For detailed descriptions and example contents of these configuration files, consult - the systemd-link(5), - systemd-netdev(5) and - systemd-network(5) manual pages. + the systemd-link(5), + systemd-netdev(5), + and systemd-network(5) manual + pages. Network Device Naming @@ -113,7 +115,7 @@ Name=ether0 EOF - See systemd.link(5) for more information. + See systemd.link(5) for more information. @@ -357,7 +359,9 @@ EOF 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 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. diff --git a/chapter09/systemd-custom.xml b/chapter09/systemd-custom.xml index 81a94a148..ffca1a76f 100644 --- a/chapter09/systemd-custom.xml +++ b/chapter09/systemd-custom.xml @@ -21,8 +21,9 @@ of options to control basic systemd operations. The default file has all entries commented out with the default settings indicated. This file is where the log level may be changed as well as some basic logging settings. - See the systemd-system.conf(5) manual page for details - on each configuration option. + See the systemd-system.conf(5) manual + page for details on each configuration option. @@ -89,8 +90,8 @@ EOF /etc/tmpfiles.d override files with the same name in /usr/lib/tmpfiles.d. See - tmpfiles.d(5) manual page for file format - details. + tmpfiles.d(5) manual + page for file format details. Note that the syntax for the @@ -135,7 +136,8 @@ Restart=always RestartSec=30 EOF - See systemd.unit(5) manual page for more + See systemd.unit(5) manual page for more information. After creating the configuration file, run systemctl daemon-reload and systemctl restart foobar to activate the changes to a service. @@ -251,10 +253,11 @@ cat > /etc/systemd/coredump.conf.d/maxuse.conf << EOF MaxUse=5G EOF - See the systemd-coredump(8), - coredumpctl(1), and - coredump.conf.d(5) manual pages for more - information. + See the systemd-coredump(8), + coredumpctl(1), and + coredump.conf.d(5) manual pages for + more information. diff --git a/chapter09/udev.xml b/chapter09/udev.xml index 0fba5a8b4..bd0b75912 100644 --- a/chapter09/udev.xml +++ b/chapter09/udev.xml @@ -225,8 +225,9 @@ Note that the softdep command also allows pre: dependencies, or a mixture of both pre: and post: dependencies. See - the modprobe.d(5) manual page for more information - on softdep syntax and capabilities. + the modprobe.d(5) + manual page for more information on softdep syntax and + capabilities. If the module in question is not a wrapper and is useful by itself, configure the modules bootscript to diff --git a/chapter09/usage.xml b/chapter09/usage.xml index 1fc7189d6..25175c45f 100644 --- a/chapter09/usage.xml +++ b/chapter09/usage.xml @@ -32,7 +32,8 @@ SysVinit (which will be referred to as init from now on) uses a run levels scheme. There are seven run levels, numbered 0 to 6. (Actually, there are more run levels, but the others are for special cases and are - generally not used. See init(8) for more details.) + generally not used. See init(8) for more details.) Each one of the seven corresponds to actions the computer is supposed to perform when it starts up or shuts down. The default run level is 3. Here are the descriptions of the different run levels as they are implemented in LFS: @@ -341,9 +342,10 @@ EOF url="https://tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>. If still in doubt, look in the /usr/share/keymaps and /usr/share/consolefonts directories - for valid keymaps and screen fonts. Read the loadkeys(1) and - setfont(8) manual pages to determine the correct - arguments for these programs. + for valid keymaps and screen fonts. Read the loadkeys(1) and setfont(8) manual pages to determine the + correct arguments for these programs. The /etc/sysconfig/console file should contain lines of the form: VARIABLE="value". The following variables are recognized: diff --git a/chapter10/fstab.xml b/chapter10/fstab.xml index c20f806dd..ad835be30 100644 --- a/chapter10/fstab.xml +++ b/chapter10/fstab.xml @@ -56,7 +56,7 @@ EOF class="partition">sda2, sda5, and ext4. For details on the six - fields in this file, see fstab(5). + fields in this file, see fstab(5). Filesystems with MS-DOS or Windows origin (i.e. vfat, ntfs, smbfs, cifs, iso9660, udf) need a special option, utf8, in order for non-ASCII diff --git a/chapter10/kernel.xml b/chapter10/kernel.xml index ce732ccb5..cf0b30f35 100644 --- a/chapter10/kernel.xml +++ b/chapter10/kernel.xml @@ -324,7 +324,8 @@ located in and in the kernel documentation in the linux-&linux-version;/Documentation directory. - Also, modprobe.d(5) may be of interest. + Also, modprobe.d(5) + may be of interest. Unless module support has been disabled in the kernel configuration, install the modules with: diff --git a/general.ent b/general.ent index 0540ac6c2..31e6daecc 100644 --- a/general.ent +++ b/general.ent @@ -125,6 +125,7 @@ + root"> lfs"> diff --git a/prologue/typography.xml b/prologue/typography.xml index 303a107c5..db66b345c 100644 --- a/prologue/typography.xml +++ b/prologue/typography.xml @@ -74,14 +74,15 @@ EOF This format is used to encapsulate text that is optional. - passwd(5) + passwd(5) This format is used to refer to a specific manual (man) page. The number inside parentheses indicates a specific section inside the manuals. For example, passwd has two man pages. Per LFS installation instructions, those two man pages will be located at /usr/share/man/man1/passwd.1 and - /usr/share/man/man5/passwd.5. When the book uses passwd(5) it is + /usr/share/man/man5/passwd.5. When the book uses + passwd(5) it is specifically referring to /usr/share/man/man5/passwd.5. man passwd will print the first man page it finds that matches passwd, which will be @@ -89,7 +90,11 @@ EOF need to run man 5 passwd in order to read the page being specified. Note that most man pages do not have duplicate page names in different sections. Therefore, man <program - name> is generally sufficient. + name> is generally sufficient. In the LFS + book these references to man pages are also hyperlinks, so clicking on + such a reference will open the man page rendered in HTML from + Arch Linux manual + pages. From 44850bb9f2fdc6a9336c76e3f98b0c39632fbe95 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Fri, 26 Jan 2024 14:53:30 +0100 Subject: [PATCH 07/63] Fix some defects of lfs book formatting - have title of section stay visible when scrolling - when clicking on an internal link, make it fully visible instead of hidden behind the header --- stylesheets/lfs-xsl/lfs.css | 86 ++++++++++++++-------- stylesheets/lfs-xsl/xhtml/lfs-sections.xsl | 82 +++++++++++++++++++-- 2 files changed, 130 insertions(+), 38 deletions(-) diff --git a/stylesheets/lfs-xsl/lfs.css b/stylesheets/lfs-xsl/lfs.css index 80eca11ed..d453cac89 100644 --- a/stylesheets/lfs-xsl/lfs.css +++ b/stylesheets/lfs-xsl/lfs.css @@ -1,13 +1,13 @@ /* Global settings */ body { - font-family: verdana, tahoma, helvetica, arial, sans-serif; + font-family: verdana, tahoma, arial, sans-serif; text-align: left; background: #fff; color: #222; margin: 1em; padding: 0; font-size: 1em; - line-height: 1.2em + line-height: 1.2em; } @@ -38,10 +38,36 @@ div.dedication { padding-left: 1em; } +/* Section titles */ +h1.sect1, h1.preface, h1.part, h1.chapter, h1.appendix, .glossary h1, .index h1 + { + background: #f5f6f7; + border-bottom: .1em solid #dbddec; + margin-bottom:1em; + margin-top: 0; + padding: .4em; +} -/* Sections */ -div.sect1, div.appendix { - padding-left: .3em; +/* Scrolling parts + The header is taller for sect1 and chapter pages than on the + other pages. Since we want fixed boxes, their top has to be calculated + by trial and errors to fit below the static header box.*/ + +div.sect1, div.chapter, div.appendix, div.wrap { + top: 11.55em; +} +div.preface, div.part, .index div.index { + top: 10.15em; +} +div.sect1, div.appendix, div.preface, div.part, div.chapter, div.wrap, .index div.index { +/* padding-left: .3em;*/ + overflow:auto; + height: auto; + position: fixed; + left:1em; + right:1em; + bottom: 1em; + border-bottom: 1em solid #dbddec; } div.important ul { @@ -63,8 +89,12 @@ div.important ul li p { background: #f5f6f7; border-bottom: 0.2em solid #dbddec; padding-top: .1em; - margin-top: 0; +/* margin-top: 0;*/ } +/* +.lfs .package p:first-child { + margin-top: 0; +}*/ .lfs .configuration { background: #fefefe; @@ -74,11 +104,11 @@ div.important ul li p { .lfs .content { background: #f5f6f7; border-top: 0.2em solid #dbddec; + border-bottom: 0.2em solid #dbddec; padding-bottom: .1em; - margin-bottom: 0; + margin-bottom: .5em; } - /* Headers */ h1, h2, h3, h4, h5, h6, b, .strong { color: #000; @@ -96,18 +126,6 @@ h1 { padding: 0.4em; } -.preface h1, .part h1, .chapter h1, .appendix h1, .index h1, .sect1 h1, .glossary h1 { - background: #f5f6f7; - border-bottom: .1em solid #dbddec; - margin-bottom: 1em; - margin-top: 0; - padding: .4em; -} - -.sect1 h1, .appendix h1 { - margin-left: -.2em; -} - .wrap h1 { background: #f5f6f7; margin: 0; @@ -157,13 +175,19 @@ div.navheader, div.navfooter { } div.navheader { - border-bottom: 1px solid #dbddec; - position: sticky; - top: 0; + border-bottom: .1em solid #dbddec; } +/* no need for a footer now that the header is always visible */ div.navfooter { - border-top: 1px solid #dbddec; + display:none; +} + +/* Except for the first page (TOC), where the bottom is the only + place where navigation is displayed. */ + +div.book + div.navfooter { + display:block } div.navheader h4 { @@ -179,7 +203,7 @@ div.navheader h3 { } div.navheader ul, div.navfooter ul { - padding: .2em .5em .5em 0; + padding: .2em .5em .5em .5em; /*top right bottom left*/ margin: .5em 0; position: relative; background: #dbddec; @@ -196,29 +220,29 @@ div.navheader ul li.prev, div.navfooter ul li.prev { left: 0; text-align: left; padding: 0.2em 1em; - margin-left: 6px; + margin-left: .4em; } div.navheader ul li.next, div.navfooter ul li.next { position: absolute; display: block; text-align: right; - right: 5px; - padding: 0.2em 0.5em; - margin-right: 7px; + right: 0; + padding: 0.2em 1em; + margin-right: .4em; } div.navheader ul li.prev p, div.navfooter ul li.prev p, div.navheader ul li.next p, div.navfooter ul li.next p { padding: 0; - margin: 1px 0px; + margin: .1em 0; } div.navheader ul li.home, div.navheader ul li.up, div.navfooter ul li.home, div.navfooter ul li.up { text-align: center; padding: 0; - margin: 0px auto; + margin: 0 auto; display: block; color: #dbddec; } diff --git a/stylesheets/lfs-xsl/xhtml/lfs-sections.xsl b/stylesheets/lfs-xsl/xhtml/lfs-sections.xsl index cde5f0349..c44aa229c 100644 --- a/stylesheets/lfs-xsl/xhtml/lfs-sections.xsl +++ b/stylesheets/lfs-xsl/xhtml/lfs-sections.xsl @@ -11,10 +11,14 @@ + Output non sect1 child elements before the TOC + Output title outside of the
because we want to be able to + use it at a fixed position --> + +
@@ -26,8 +30,6 @@ - - @@ -44,11 +46,42 @@
+ + + + + + + +
+ + + + + + + + + + + + + + +
+
+ + Output non sect1 child elements before the TOC + Output title before div to be able to fix the title position --> + +
@@ -60,8 +93,6 @@ - - @@ -78,12 +109,50 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -96,7 +165,6 @@ -
From 360fdfca9cd146ed32f09df00a4986646b50e467 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Fri, 26 Jan 2024 18:28:53 +0100 Subject: [PATCH 08/63] Fix punctuation in quotes, and quote signs - period and comma inside quotes - " to - some " to when it is a var value --- chapter02/hostreqs.xml | 2 +- chapter02/mounting.xml | 2 +- chapter02/stages.xml | 2 +- chapter05/glibc.xml | 4 ++-- chapter06/file.xml | 5 ----- chapter07/python.xml | 2 +- chapter08/coreutils.xml | 2 +- chapter08/expect.xml | 4 ++-- chapter08/gmp.xml | 7 ++++--- chapter08/stripping.xml | 2 +- chapter09/consoled.xml | 2 +- chapter09/locale.xml | 30 +++++++----------------------- chapter09/network.xml | 4 ++-- chapter09/networkd.xml | 11 ++++++----- chapter09/profile.xml | 24 ++++-------------------- chapter09/udev.xml | 6 +++--- chapter09/usage.xml | 28 ++++++++++++++-------------- chapter10/grub.xml | 11 ----------- part3intro/toolchaintechnotes.xml | 2 +- prologue/standards.xml | 2 +- prologue/typography.xml | 2 +- 21 files changed, 54 insertions(+), 100 deletions(-) diff --git a/chapter02/hostreqs.xml b/chapter02/hostreqs.xml index 8d9d13567..546555e9b 100644 --- a/chapter02/hostreqs.xml +++ b/chapter02/hostreqs.xml @@ -30,7 +30,7 @@ modern Linux distributions. Also note that many distributions will place software headers into separate packages, often in the form of <package-name>-devel or - <package-name>-dev. Be sure to install those if + <package-name>-dev. Be sure to install those if your distribution provides them. Earlier versions of the listed software packages may work, but have diff --git a/chapter02/mounting.xml b/chapter02/mounting.xml index 6c279ac78..60e5cdc62 100644 --- a/chapter02/mounting.xml +++ b/chapter02/mounting.xml @@ -16,7 +16,7 @@ LFS environment variable described in the previous section. - Strictly speaking, one cannot "mount a partition". One mounts the file + Strictly speaking, one cannot "mount a partition." One mounts the file system embedded in that partition. But since a single partition can't contain more than one file system, people often speak of the partition and the associated file system as if they were one and the same. diff --git a/chapter02/stages.xml b/chapter02/stages.xml index 710ff6585..aeee2588e 100644 --- a/chapter02/stages.xml +++ b/chapter02/stages.xml @@ -69,7 +69,7 @@ A few operations, from Changing Ownership to - Entering the Chroot Environment, must be done as the + Entering the Chroot Environment, must be done as the root user, with the LFS environment variable set for the &root; user. diff --git a/chapter05/glibc.xml b/chapter05/glibc.xml index 63c4f6387..b8b8171da 100644 --- a/chapter05/glibc.xml +++ b/chapter05/glibc.xml @@ -159,8 +159,8 @@ cd build Gettext package, which the host distribution should provide. There have been reports that this package may fail when - building as a "parallel make". If that occurs, rerun the make command - with the "-j1" option. + building as a parallel make. If that occurs, rerun the make command + with the option. Compile the package: diff --git a/chapter06/file.xml b/chapter06/file.xml index cb952d9bb..ada0dddeb 100644 --- a/chapter06/file.xml +++ b/chapter06/file.xml @@ -78,11 +78,6 @@ popd ./configure --prefix=/usr --host=$LFS_TGT --build=$(./config.guess) - Compile the package: make FILE_COMPILE=$(pwd)/build/src/file diff --git a/chapter07/python.xml b/chapter07/python.xml index 84a173426..3729c6ccf 100644 --- a/chapter07/python.xml +++ b/chapter07/python.xml @@ -45,7 +45,7 @@ There are two package files whose name starts with - python. The one to extract from is + python. The one to extract from is Python-&python-version;.tar.xz (notice the uppercase first letter). diff --git a/chapter08/coreutils.xml b/chapter08/coreutils.xml index e6114461f..3357fabc5 100644 --- a/chapter08/coreutils.xml +++ b/chapter08/coreutils.xml @@ -1261,7 +1261,7 @@ sed -i 's/"1"/"8"/' /usr/share/man/man8/chroot.8 yes - Repeatedly outputs y, or a given string, until + Repeatedly outputs y, or a given string, until killed yes diff --git a/chapter08/expect.xml b/chapter08/expect.xml index 90584ced1..95dc8beae 100644 --- a/chapter08/expect.xml +++ b/chapter08/expect.xml @@ -92,8 +92,8 @@ make test If any test fails with the message - The system has no more ptys. Ask your system - administrator to create more, it indicates + The system has no more ptys. Ask your system + administrator to create more, it indicates you've not mounted the devpts file system correctly. You need to exit from the chroot environment, read diff --git a/chapter08/gmp.xml b/chapter08/gmp.xml index 2b8f0fa8c..15274cf4b 100644 --- a/chapter08/gmp.xml +++ b/chapter08/gmp.xml @@ -58,7 +58,7 @@ to the configure command. @@ -106,8 +106,9 @@ make html The code in gmp is highly optimized for the processor where it is built. Occasionally, the code that detects the processor misidentifies 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 + applications using the gmp libraries with the message + Illegal instruction. + In this case, gmp should be reconfigured with the option and rebuilt. - Some packages beyond LFS may also lack support for your chosen locale. One - example is the X library (part of the X Window System), which outputs the - following error message if the locale does not exactly match one of the character - map names in its internal files: - -Warning: locale not supported by Xlib, locale set to C - - In several cases Xlib expects that the character map will be listed in - uppercase notation with canonical dashes. For instance, "ISO-8859-1" rather - than "iso88591". It is also possible to find an appropriate specification by - removing the charmap part of the locale specification. This can be checked - by running the locale charmap command in both locales. - For example, one would have to change "de_DE.ISO-8859-15@euro" to - "de_DE@euro" in order to get this locale recognized by Xlib. - Other packages can also function incorrectly (but may not necessarily display any error messages) if the locale name does not meet their expectations. In those cases, investigating how other Linux distributions support your locale diff --git a/chapter09/network.xml b/chapter09/network.xml index f8b549eff..a443ada2c 100644 --- a/chapter09/network.xml +++ b/chapter09/network.xml @@ -62,9 +62,9 @@ EOF The values in italics must be changed in each file, to set the interfaces up correctly. - If the ONBOOT variable is set to yes the + If the ONBOOT variable is set to yes the System V network script will bring up the Network Interface Card (NIC) during - the system boot process. If set to anything besides yes, the NIC + the system boot process. If set to anything besides yes, the NIC will be ignored by the network script and will not be started automatically. Interfaces can be manually started or stopped with the ifup and ifdown commands. diff --git a/chapter09/networkd.xml b/chapter09/networkd.xml index 3b9dd2cda..363e8d883 100644 --- a/chapter09/networkd.xml +++ b/chapter09/networkd.xml @@ -98,11 +98,12 @@ - Create a manual naming scheme, for example by naming the - interfaces something like "internet0", "dmz0", or "lan0". - To do that, create .link files in /etc/systemd/network/ that - select an explicit name or a better naming scheme for your - network interfaces. For example: + Create a manual naming scheme, for example by naming the + interfaces something like internet0, + dmz0, or lan0. + To do that, create .link files in /etc/systemd/network/ that + select an explicit name or a better naming scheme for your + network interfaces. For example: cat > /etc/systemd/network/10-ether0.link << "EOF" diff --git a/chapter09/profile.xml b/chapter09/profile.xml index 8f0f59d1f..55cc5dbb0 100644 --- a/chapter09/profile.xml +++ b/chapter09/profile.xml @@ -75,10 +75,10 @@ locale -a Charmaps can have a number of aliases, e.g., ISO-8859-1 - is also referred to as iso8859-1 and iso88591. + is also referred to as iso8859-1 and iso88591. Some applications cannot handle the various synonyms correctly (e.g., require - that UTF-8 is written as UTF-8, not - utf8), so it is safest in most + that UTF-8 is written as UTF-8, not + utf8), so it is safest in most cases to choose the canonical name for a particular locale. To determine the canonical name, run the following command, where <locale name> is the output given by locale -a for @@ -91,7 +91,7 @@ ISO-8859-1 - This results in a final locale setting of en_GB.ISO-8859-1. + This results in a final locale setting of en_GB.ISO-8859-1. It is important that the locale found using the heuristic above is tested before it is added to the Bash startup files: @@ -114,22 +114,6 @@ LC_ALL=<locale name> locale int_prefix Further instructions assume that there are no such error messages from Glibc. - - Other packages may also function incorrectly (but will not necessarily display any error messages) if the locale name does not meet their expectations. In such cases, investigating how other Linux distributions support your locale diff --git a/chapter09/udev.xml b/chapter09/udev.xml index bd0b75912..06db345a2 100644 --- a/chapter09/udev.xml +++ b/chapter09/udev.xml @@ -129,13 +129,13 @@ program and are usually related to the bus-specific identifiers of devices supported by a module. For example, the snd-fm801 driver supports PCI devices with vendor ID 0x1319 and device ID 0x0801, - and has an alias of pci:v00001319d00000801sv*sd*bc04sc01i*. + and has an alias of pci:v00001319d00000801sv*sd*bc04sc01i*. For most devices, the bus driver exports the alias of the driver that would handle the device via sysfs. E.g., the /sys/bus/pci/devices/0000:00:0d.0/modalias file might contain the string - pci:v00001319d00000801sv00001319sd00001319bc04sc01i00. + pci:v00001319d00000801sv00001319sd00001319bc04sc01i00. The default rules provided with udev will cause udevd to call out to /sbin/modprobe with the contents of the MODALIAS uevent environment variable (which should be the @@ -301,7 +301,7 @@ This is due to the fact that udev, by design, handles uevents and loads modules in parallel, and thus in an unpredictable order. This will - never be fixed. You should not rely upon the kernel device + never be fixed. You should not rely upon the kernel device names being stable. Instead, create your own rules that make symlinks with stable names based on some stable attributes of the device, such as a serial number or the output of various *_id utilities installed by udev. diff --git a/chapter09/usage.xml b/chapter09/usage.xml index 25175c45f..85b35d16d 100644 --- a/chapter09/usage.xml +++ b/chapter09/usage.xml @@ -48,11 +48,11 @@ - Classically, run level 2 above was defined as - "multi-user mode without networking", but this was only the case - many years ago when multiple users could connect to a system via - serial ports. In today's environment it makes no sense, and - we now say it is "reserved". + Classically, run level 2 above was defined as multi-user + mode without networking, but this was only the case + many years ago when multiple users could connect to a system via + serial ports. In today's environment it makes no sense, and + we now say it is reserved. @@ -348,7 +348,7 @@ EOF correct arguments for these programs. The /etc/sysconfig/console file should contain lines - of the form: VARIABLE="value". The following variables are recognized: + of the form: VARIABLE=value. The following variables are recognized: @@ -356,7 +356,7 @@ EOF This variable specifies the log level for kernel messages sent to the console as set by dmesg -n. Valid levels are - from "1" (no messages) to "8". The default level is "7". + from 1 (no messages) to 8. The default level is 7, which is quite verbose. @@ -365,7 +365,7 @@ EOF This variable specifies the arguments for the loadkeys program, typically, the name of the keymap - to load, e.g., it. If this variable is not set, the + to load, e.g., it. If this variable is not set, the bootscript will not run the loadkeys program, and the default kernel keymap will be used. Note that a few keymaps have multiple versions with the same name (cz and its variants in @@ -384,7 +384,7 @@ EOF loadkeys program. This is useful if the stock keymap is not completely satisfactory and a small adjustment has to be made. E.g., to include the Euro sign into a keymap that normally doesn't have it, - set this variable to euro2. + set this variable to euro2. @@ -393,12 +393,12 @@ EOF This variable specifies the arguments for the setfont program. Typically, this includes the font - name, -m, and the name of the application character + name, -m, and the name of the application character map to load. E.g., in order to load the lat1-16 font together with the 8859-1 application character map (appropriate in the USA), - set this variable to lat1-16 -m 8859-1. + set this variable to lat1-16 -m 8859-1. In UTF-8 mode, the kernel uses the application character map to convert 8-bit key codes to UTF-8. Therefore the argument of the "-m" parameter should be set to the encoding of the @@ -410,8 +410,8 @@ EOF UNICODE - Set this variable to 1, yes, or - true in order to put the + Set this variable to 1, yes, or + true in order to put the console into UTF-8 mode. This is useful in UTF-8 based locales and harmful otherwise. @@ -526,7 +526,7 @@ EOF languages, because there accents are added to unaccented ASCII characters, or two ASCII characters are composed together. However, in UTF-8 mode it is a problem; e.g., for the Greek language, where one - sometimes needs to put an accent on the letter alpha. + sometimes needs to put an accent on the letter alpha. The solution is either to avoid the use of UTF-8, or to install the X window system, which doesn't have this limitation, in its input handling. diff --git a/chapter10/grub.xml b/chapter10/grub.xml index cb6518791..1706ccb3c 100644 --- a/chapter10/grub.xml +++ b/chapter10/grub.xml @@ -120,17 +120,6 @@ xorriso -as cdrecord -v dev=/dev/cdrw blank=as_needed grub-img.iso - diff --git a/part3intro/toolchaintechnotes.xml b/part3intro/toolchaintechnotes.xml index c220d24d8..7997b0891 100644 --- a/part3intro/toolchaintechnotes.xml +++ b/part3intro/toolchaintechnotes.xml @@ -56,7 +56,7 @@ The build is the machine where we build programs. Note that this machine - is also referred to as the host. + is also referred to as the host. The host diff --git a/prologue/standards.xml b/prologue/standards.xml index 05fe22745..187264812 100644 --- a/prologue/standards.xml +++ b/prologue/standards.xml @@ -49,7 +49,7 @@ While it is possible to create a complete system that will pass the LSB - certification tests "from scratch", this can't be done without many additional packages + certification tests from scratch, this can't be done without many additional packages that are beyond the scope of the LFS book. Installation instructions for these additional packages can be found in BLFS. diff --git a/prologue/typography.xml b/prologue/typography.xml index db66b345c..d394e9b17 100644 --- a/prologue/typography.xml +++ b/prologue/typography.xml @@ -85,7 +85,7 @@ EOF passwd(5) it is specifically referring to /usr/share/man/man5/passwd.5. man passwd will print the first man page it finds that - matches passwd, which will be + matches passwd, which will be /usr/share/man/man1/passwd.1. For this example, you will need to run man 5 passwd in order to read the page being specified. Note that most man pages do not have duplicate From 0d80918aec7ce426ecb4da841fc4e82ff35a655b Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Sat, 27 Jan 2024 15:34:34 +0100 Subject: [PATCH 09/63] Makefile: change ~ to $(HOME) This is more readable. Also remove obsolete variables at start. Part of a patch by Boian Berberov --- Makefile | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 1f1de8d23..8c80eb9aa 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,4 @@ # vim:ts=3 -#BASEDIR = ~/lfs-book -#SYSDDIR = ~/lfs-systemd -#DUMPDIR = ~/lfs-commands RENDERTMP = $(HOME)/tmp CHUNK_QUIET = 1 ROOT_ID = @@ -24,15 +21,15 @@ ifneq ($(REV), sysv) endif ifeq ($(REV), sysv) - BASEDIR ?= ~/public_html/lfs-book + BASEDIR ?= $(HOME)/public_html/lfs-book PDF_OUTPUT ?= LFS-BOOK.pdf NOCHUNKS_OUTPUT ?= LFS-BOOK.html - DUMPDIR ?= ~/lfs-commands + DUMPDIR ?= $(HOME)/lfs-commands else - BASEDIR ?= ~/public_html/lfs-systemd + BASEDIR ?= $(HOME)/public_html/lfs-systemd PDF_OUTPUT ?= LFS-SYSD-BOOK.pdf NOCHUNKS_OUTPUT ?= LFS-SYSD-BOOK.html - DUMPDIR ?= ~/lfs-sysd-commands + DUMPDIR ?= $(HOME)/lfs-sysd-commands endif book: validate profile-html From 4ac089b5b201eb34874be25d5d64fb789eaa348c Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Sat, 27 Jan 2024 16:56:22 +0100 Subject: [PATCH 10/63] Unify the writing of sed's in Makefile also remove a commented out line Part of a patch by Boian Berberov --- Makefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 8c80eb9aa..9ec33696a 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,8 @@ book: validate profile-html @echo "Copying CSS code and images..." $(Q)mkdir -p $(BASEDIR)/stylesheets $(Q)cp stylesheets/lfs-xsl/*.css $(BASEDIR)/stylesheets - $(Q)sed -i 's|../stylesheet|stylesheet|' $(BASEDIR)/index.html + $(Q)sed -e 's|../stylesheet|stylesheet|' \ + -i $(BASEDIR)/index.html $(Q)mkdir -p $(BASEDIR)/images $(Q)cp images/*.png $(BASEDIR)/images @@ -54,9 +55,9 @@ book: validate profile-html tidy -config tidy.conf $$filename; \ true; \ /bin/bash obfuscate.sh $$filename; \ - sed -e "s@text/html@application/xhtml+xml@g" \ + sed -e "s|text/html|application/xhtml+xml|g" \ -i $$filename; \ - done; + done $(Q)$(MAKE) --no-print-directory wget-list md5sums @@ -95,16 +96,16 @@ nochunks: validate profile-html --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \ stylesheets/lfs-nochunks.xsl \ $(RENDERTMP)/lfs-html.xml -# $(RENDERTMP)/lfs-html2.xml @echo "Running Tidy..." $(Q)tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true @echo "Running obfuscate.sh..." - $(Q)bash obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT) - $(Q)sed -i -e "s@text/html@application/xhtml+xml@g" $(BASEDIR)/$(NOCHUNKS_OUTPUT) - $(Q)sed -i -e "s@../wget-list@wget-list@" $(BASEDIR)/$(NOCHUNKS_OUTPUT) - $(Q)sed -i -e "s@../md5sums@md5sums@" $(BASEDIR)/$(NOCHUNKS_OUTPUT) + $(Q)bash obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT) + $(Q)sed -e "s|text/html|application/xhtml+xml|g" \ + -e "s|../wget-list|wget-list|" \ + -e "s|../md5sums|md5sums|" \ + -i $(BASEDIR)/$(NOCHUNKS_OUTPUT) @echo "Output at $(BASEDIR)/$(NOCHUNKS_OUTPUT)" From 16d01822df0dff12762a77658210784c2583e99a Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Sat, 27 Jan 2024 16:58:34 +0100 Subject: [PATCH 11/63] Makefile: remove "true" after tidy If in a series of commands, and not the last, true has no effect If in the last command, it is better to exit if there is a real error in tidy, so use "|| test $$? -le 1", but only when tidy is the last in a series of commands Part of a patch by Boian Berberov --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9ec33696a..dadbb3783 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,6 @@ book: validate profile-html @echo "Running Tidy and obfuscate.sh..." $(Q)for filename in `find $(BASEDIR) -name "*.html"`; do \ tidy -config tidy.conf $$filename; \ - true; \ /bin/bash obfuscate.sh $$filename; \ sed -e "s|text/html|application/xhtml+xml|g" \ -i $$filename; \ @@ -98,7 +97,7 @@ nochunks: validate profile-html $(RENDERTMP)/lfs-html.xml @echo "Running Tidy..." - $(Q)tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true + $(Q)tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || test $$? -le 1 @echo "Running obfuscate.sh..." $(Q)bash obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT) From b6dd23c76bf4a819c291395d49da566cb391b9e4 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Sat, 27 Jan 2024 17:03:47 +0100 Subject: [PATCH 12/63] Makefile: improvements in xsltproc commands - remove some useless --xinclude - write only one option per line - use --encode UTF-8 instead of --noent (which is useless after profiling anyway - try to be consistent in option order - use --output instead of -o --- Makefile | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index dadbb3783..6247b294d 100644 --- a/Makefile +++ b/Makefile @@ -123,16 +123,16 @@ validate: tmpdir version @echo "Adjusting for revision $(REV)..." $(Q)xsltproc --nonet \ --xinclude \ - --output $(RENDERTMP)/lfs-html2.xml \ --stringparam profile.revision $(REV) \ + --output $(RENDERTMP)/lfs-html2.xml \ stylesheets/lfs-xsl/profile.xsl \ index.xml @echo "Validating the book..." - $(Q)xmllint --nonet \ - --noent \ - --postvalid \ - -o $(RENDERTMP)/lfs-full.xml \ + $(Q)xmllint --nonet \ + --encode UTF-8 \ + --postvalid \ + --output $(RENDERTMP)/lfs-full.xml \ $(RENDERTMP)/lfs-html2.xml $(Q)rm -f appendices/*.script @@ -154,18 +154,21 @@ wget-list: $(BASEDIR)/wget-list $(BASEDIR)/wget-list-$(REV) $(BASEDIR)/wget-list: stylesheets/wget-list.xsl $(DOWNLOADS_DEP) @echo "Generating consolidated wget list at $(BASEDIR)/wget-list ..." $(Q)mkdir -p $(BASEDIR) - $(Q)xsltproc --xinclude --nonet \ + $(Q)xsltproc --nonet \ + --xinclude \ --output $(BASEDIR)/wget-list \ stylesheets/wget-list.xsl \ chapter03/chapter03.xml $(BASEDIR)/wget-list-$(REV): stylesheets/wget-list.xsl $(DOWNLOADS_DEP) - $(Q)xsltproc --nonet --xinclude \ + $(Q)xsltproc --nonet \ + --xinclude \ --stringparam profile.revision $(REV) \ --output $(RENDERTMP)/wget-list.xml \ stylesheets/lfs-xsl/profile.xsl \ chapter03/chapter03.xml - $(Q)xsltproc --xinclude --nonet \ + + $(Q)xsltproc --nonet \ --output $(BASEDIR)/wget-list-$(REV) \ stylesheets/wget-list.xsl \ $(RENDERTMP)/wget-list.xml @@ -175,13 +178,14 @@ $(BASEDIR)/md5sums: stylesheets/wget-list.xsl $(DOWNLOADS_DEP) @echo "Generating consolidated md5sum file at $(BASEDIR)/md5sums ..." $(Q)mkdir -p $(BASEDIR) - $(Q)xsltproc --nonet --xinclude \ + $(Q)xsltproc --nonet \ + --xinclude \ --stringparam profile.revision $(REV) \ --output $(RENDERTMP)/md5sum.xml \ stylesheets/lfs-xsl/profile.xsl \ chapter03/chapter03.xml - $(Q)xsltproc --xinclude --nonet \ + $(Q)xsltproc --nonet \ --output $(BASEDIR)/md5sums \ stylesheets/md5sum.xsl \ $(RENDERTMP)/md5sum.xml From b8d33a557b77b91dfbf18e983462b1a28bfe91e7 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Sat, 27 Jan 2024 17:28:43 +0100 Subject: [PATCH 13/63] rendering: some utf-8 fixes Reinstate some character entities Have some stylesheets output UTF-8 Part of a patch by Boian Berberov --- stylesheets/dump-commands.xsl | 5 ++--- stylesheets/lfs-xsl/pdf.xsl | 4 ++-- stylesheets/lfs-xsl/profile.xsl | 1 + stylesheets/md5sum.xsl | 3 +-- stylesheets/wget-list.xsl | 3 +-- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/stylesheets/dump-commands.xsl b/stylesheets/dump-commands.xsl index 48af34c20..526a33102 100644 --- a/stylesheets/dump-commands.xsl +++ b/stylesheets/dump-commands.xsl @@ -1,4 +1,4 @@ - + - - + diff --git a/stylesheets/lfs-xsl/pdf.xsl b/stylesheets/lfs-xsl/pdf.xsl index 679f73b84..ea247f5db 100644 --- a/stylesheets/lfs-xsl/pdf.xsl +++ b/stylesheets/lfs-xsl/pdf.xsl @@ -53,8 +53,8 @@ We have expanded the support to several inline tags. See pdf/lfs-mixed.xsl. Note: the argument in select= is a zero-width space - (unicode 200b, encoded in utf-8)--> - + (unicode 200b)--> + diff --git a/stylesheets/md5sum.xsl b/stylesheets/md5sum.xsl index bb7268276..121e0a274 100644 --- a/stylesheets/md5sum.xsl +++ b/stylesheets/md5sum.xsl @@ -31,8 +31,7 @@
- - +
diff --git a/stylesheets/wget-list.xsl b/stylesheets/wget-list.xsl index aa8d263c4..f55c37346 100644 --- a/stylesheets/wget-list.xsl +++ b/stylesheets/wget-list.xsl @@ -28,8 +28,7 @@ - - + From 5d064fb3c30ea9c83df96774f7a348833d4f7628 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Sat, 27 Jan 2024 17:30:51 +0100 Subject: [PATCH 14/63] Align attributes in xsl:stylesheet elements Part of a patch by Boian Berberov --- stylesheets/dump-commands.xsl | 6 +++--- stylesheets/md5sum.xsl | 2 +- stylesheets/wget-list.xsl | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/stylesheets/dump-commands.xsl b/stylesheets/dump-commands.xsl index 526a33102..83e24dfc6 100644 --- a/stylesheets/dump-commands.xsl +++ b/stylesheets/dump-commands.xsl @@ -1,8 +1,8 @@ + xmlns:exsl="http://exslt.org/common" + extension-element-prefixes="exsl" + version="1.0"> diff --git a/stylesheets/md5sum.xsl b/stylesheets/md5sum.xsl index 121e0a274..57723df97 100644 --- a/stylesheets/md5sum.xsl +++ b/stylesheets/md5sum.xsl @@ -3,7 +3,7 @@ + version="1.0"> diff --git a/stylesheets/wget-list.xsl b/stylesheets/wget-list.xsl index f55c37346..eca53a4c9 100644 --- a/stylesheets/wget-list.xsl +++ b/stylesheets/wget-list.xsl @@ -4,7 +4,7 @@ with wget. --> + version="1.0"> From a4eaba6d553e4545e9ed3ae576e28a49b968b496 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Sat, 27 Jan 2024 17:31:56 +0100 Subject: [PATCH 15/63] Tidy doctype and xml declarations in .html output Part of a patch by Boian Berberov --- stylesheets/lfs-xsl/chunk-slave.xsl | 11 ++++++++--- stylesheets/lfs-xsl/nochunks.xsl | 7 +++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/stylesheets/lfs-xsl/chunk-slave.xsl b/stylesheets/lfs-xsl/chunk-slave.xsl index f5bc8a956..45d33e04a 100644 --- a/stylesheets/lfs-xsl/chunk-slave.xsl +++ b/stylesheets/lfs-xsl/chunk-slave.xsl @@ -10,6 +10,14 @@ + + + + + + + + @@ -31,9 +39,6 @@ - - - book toc,title diff --git a/stylesheets/lfs-xsl/nochunks.xsl b/stylesheets/lfs-xsl/nochunks.xsl index 5a5ad36f5..896449d7c 100644 --- a/stylesheets/lfs-xsl/nochunks.xsl +++ b/stylesheets/lfs-xsl/nochunks.xsl @@ -10,6 +10,13 @@ + From 81f727aca6b200a85c7fd3700d8aa54c01bc9232 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 28 Jan 2024 17:44:24 +0800 Subject: [PATCH 16/63] chapter07/python: Work around a puzzling punctuation in quote Here no file name starts with "python." (including the dot). Slightly reword to prevent the punctuation from following the quote or being quoted. --- chapter07/python.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter07/python.xml b/chapter07/python.xml index 3729c6ccf..8268df8e4 100644 --- a/chapter07/python.xml +++ b/chapter07/python.xml @@ -44,8 +44,8 @@ Installation of Python - There are two package files whose name starts with - python. The one to extract from is + There are two package files whose name starts with the + python prefix. The one to extract from is Python-&python-version;.tar.xz (notice the uppercase first letter). From 84974486d96fac6f86cff344a77cee52fe1081eb Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 28 Jan 2024 18:36:16 +0800 Subject: [PATCH 17/63] locale: Replace with for locale specifiers Prevent ambigious quoted punctuations. --- chapter09/locale.xml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/chapter09/locale.xml b/chapter09/locale.xml index c5e55d0da..fa8508828 100644 --- a/chapter09/locale.xml +++ b/chapter09/locale.xml @@ -50,19 +50,21 @@ locale -a - Charmaps can have a number of aliases, e.g., ISO-8859-1 - is also referred to as iso8859-1 and iso88591. + Charmaps can have a number of aliases, e.g., + ISO-8859-1 is also referred to as + iso8859-1 and iso88591. Some applications cannot handle the various synonyms correctly (e.g., require - that UTF-8 is written as UTF-8, not + that UTF-8 is written as UTF-8, not utf8), so it is the safest in most cases to choose the canonical name for a particular locale. To determine the canonical name, run the following command, where <locale name> is the output given by locale -a for - your preferred locale (en_GB.iso88591 in our example). + your preferred locale (en_GB.iso88591 in our + example). LC_ALL=<locale name> locale charmap - For the en_GB.iso88591 locale, the above command + For the en_GB.iso88591 locale, the above command will print: ISO-8859-1 @@ -120,14 +122,16 @@ EOF doesn't work in the chroot environment. It can only be used after the LFS system is booted with systemd. - The C (default) and en_US (the recommended - one for United States English users) locales are different. C + The C (default) and en_US + (the recommended one for United States English users) locales are + different. C uses the US-ASCII 7-bit character set, and treats bytes with the high bit set as invalid characters. That's why, e.g., the ls command substitutes them with question marks in that locale. Also, an attempt to send mail with such characters from Mutt or Pine results in non-RFC-conforming - messages being sent (the charset in the outgoing mail is indicated as unknown - 8-bit). It's suggested that you use the C locale only + messages being sent (the charset in the outgoing mail is indicated as + unknown 8-bit). It's suggested that you + use the C locale only if you are certain that you will never need 8-bit characters. - - + diff --git a/chapter09/locale.xml b/chapter09/locale.xml index fa8508828..803978267 100644 --- a/chapter09/locale.xml +++ b/chapter09/locale.xml @@ -5,18 +5,25 @@ %general-entities; ]> - + Configuring the System Locale - /etc/locale.conf + /etc/profile - The /etc/locale.conf file below sets some - environment variables necessary for native language support. Setting - them properly results in: + + /etc/locale.conf + + + The /etc/locale.conf file + below sets some environment variables necessary for native language + support. Setting them properly results in: + + Some environment variables are necessary for native language + support. Setting them properly results in: @@ -97,30 +104,103 @@ LC_ALL=<locale name> locale int_prefix In those cases, investigating how other Linux distributions support your locale might provide some useful information. - Once the proper locale settings have been determined, create the - /etc/locale.conf file: + Once the proper locale settings have been + determined, create the /etc/locale.conf file: -cat > /etc/locale.conf << "EOF" +cat > /etc/locale.conf << "EOF" LANG=<ll>_<CC>.<charmap><@modifiers> EOF - Note that you can modify /etc/locale.conf with the + The shell program /bin/bash (here after referred + as the shell) uses a collection of startup files to help + create the environment to run in. Each file has a specific use and may + affect login and interactive environments differently. The files in the + /etc directory provide global + settings. If equivalent files exist in the home directory, they + may override the global settings. + + An interactive login shell is started after a successful login, + using /bin/login, by reading the + /etc/passwd file. An interactive non-login shell is + started at the command-line (e.g. + [prompt]$/bin/bash). A + non-interactive shell is usually present when a shell script is running. + It is non-interactive because it is processing a script and not waiting + for user input between commands. + + The login shells are often unaffected by + the settings in /etc/locale.conf. Create the + /etc/profile + once the proper locale settings have been + determined to set the desired localeto read the locale settings from + /etc/locale.conf and export them, + but set the C locale instead if running in the Linux + console (to prevent programs from outputting characters that the Linux + console is unable to render): + +cat > /etc/profile << "EOF" +# Begin /etc/profile + +for i in $(locale); do + unset ${i%=*} +done + +if [[ "$TERM" = linux ]]; then + export LANG=C +else + source /etc/locale.conf + + for i in $(locale); do + key=${i%=*} + if [[ -v $key ]]; then + export $key + fi + done +fi + +# End /etc/profile +EOF + +cat > /etc/profile << "EOF" +# Begin /etc/profile + +for i in $(locale); do + unset ${i%=*} +done + +if [[ "$TERM" = linux ]]; then + for i in $(locale); do + unset ${i%=*} + done + + export LANG=C +else + export LANG=<ll>_<CC>.<charmap><@modifiers> +fi + +# End /etc/profile +EOF + + Note that you can modify /etc/locale.conf with the systemd localectl utility. To use localectl for the example above, run: -localectl set-locale LANG="<ll>_<CC>.<charmap><@modifiers>" +localectl set-locale LANG="<ll>_<CC>.<charmap><@modifiers>" - You can also specify other language specific environment variables such - as LANG, LC_CTYPE, LC_NUMERIC or - any other environment variable from locale output. Just - separate them with a space. An example where LANG is set as + You can also specify other language specific + environment variables such as LANG, + LC_CTYPE, LC_NUMERIC or any other + environment variable from locale output. Just separate + them with a space. An example where LANG is set as en_US.UTF-8 but LC_CTYPE is set as just en_US is: -localectl set-locale LANG="en_US.UTF-8" LC_CTYPE="en_US" +localectl set-locale LANG="en_US.UTF-8" LC_CTYPE="en_US" - Please note that the localectl command - doesn't work in the chroot environment. It can only - be used after the LFS system is booted with systemd. + Please note that the + localectl command doesn't work in the chroot + environment. It can only be used after the LFS system is booted with + systemd. The C (default) and en_US (the recommended one for United States English users) locales are @@ -134,10 +214,4 @@ EOF use the C locale only if you are certain that you will never need 8-bit characters. - - diff --git a/chapter09/profile.xml b/chapter09/profile.xml deleted file mode 100644 index 55cc5dbb0..000000000 --- a/chapter09/profile.xml +++ /dev/null @@ -1,147 +0,0 @@ - - - %general-entities; -]> - - - - - The Bash Shell Startup Files - - - /etc/profile - - - The shell program /bin/bash (hereafter referred to - as the shell) uses a collection of startup files to help - create the environment to run in. Each file has a specific use and may affect - login and interactive environments differently. The files in the /etc directory provide global settings. If - equivalent files exist in the home directory, they may override the global - settings. - - An interactive login shell is started after a successful login, using - /bin/login, by reading the /etc/passwd - file. An interactive non-login shell is started at the command-line (e.g., - [prompt]$/bin/bash). A non-interactive - shell is usually present when a shell script is running. It is non-interactive - because it is processing a script and not waiting for user input between - commands. - -For more information, see the Bash Startup Files and - Interactive Shells sections in the Bash - Features chapter of the Bash info pages (info bash). - - The files /etc/profile and - ~/.bash_profile are read when the shell is - invoked as an interactive login shell. - - The base /etc/profile below sets some - environment variables necessary for native language support. Setting - them properly results in: - - - - The output of programs translated into the native language - - - Correct classification of characters into letters, digits and other - classes. This is necessary for bash to properly accept - non-ASCII characters in command lines in non-English locales - - - The correct alphabetical sorting order for the country - - - Appropriate default paper size - - - Correct formatting of monetary, time, and date values - - - - Replace <ll> below with the two-letter code - for the desired language (e.g., en) and - <CC> with the two-letter code for the appropriate - country (e.g., GB). <charmap> should - be replaced with the canonical charmap for your chosen locale. Optional - modifiers such as @euro may also be present. - - The list of all locales supported by Glibc can be obtained by running - the following command: - -locale -a - - Charmaps can have a number of aliases, e.g., ISO-8859-1 - is also referred to as iso8859-1 and iso88591. - Some applications cannot handle the various synonyms correctly (e.g., require - that UTF-8 is written as UTF-8, not - utf8), so it is safest in most - cases to choose the canonical name for a particular locale. To determine - the canonical name, run the following command, where <locale - name> is the output given by locale -a for - your preferred locale (en_GB.iso88591 in our example). - -LC_ALL=<locale name> locale charmap - - For the en_GB.iso88591 locale, the above command - will print: - -ISO-8859-1 - - This results in a final locale setting of en_GB.ISO-8859-1. - It is important that the locale found using the heuristic above is tested before - it is added to the Bash startup files: - -LC_ALL=<locale name> locale language -LC_ALL=<locale name> locale charmap -LC_ALL=<locale name> locale int_curr_symbol -LC_ALL=<locale name> locale int_prefix - - The above commands should print the language name, the character - encoding used by the locale, the local currency, and the prefix to dial - before the telephone number in order to get into the country. If any of the - commands above fail with a message similar to the one shown below, this means - that your locale was either not installed in - or is not supported by the default installation of Glibc. - -locale: Cannot set LC_* to default locale: No such file or directory - - If this happens, you should either install the desired locale using the - localedef command, or consider choosing a different locale. - Further instructions assume that there are no such error messages from - Glibc. - - Other packages may also function incorrectly (but will not necessarily - display any error messages) if the locale name does not meet their expectations. - In such cases, investigating how other Linux distributions support your locale - might provide some useful information. - - Once the proper locale settings have been determined, create the - /etc/profile file: - -cat > /etc/profile << "EOF" -# Begin /etc/profile - -export LANG=<ll>_<CC>.<charmap><@modifiers> - -# End /etc/profile -EOF - - The C (default) and en_US.utf8 (the recommended - one for United States English users) locales are different. C - uses the US-ASCII 7-bit character set, and treats bytes with the high-order bit set - on as invalid characters. That's why, e.g., the ls command - displays them as question marks in that locale. Also, an attempt to send - mail with such characters from Mutt or Pine results in non-RFC-conforming - messages being sent (the charset in the outgoing mail is indicated as unknown - 8-bit). So you can only use the C locale if you are sure - you will never need 8-bit characters. - - UTF-8 based locales are not supported well by some programs. - Work is in progress to document and, if possible, fix such problems. See - . - - From ee950a5e0dd576887096d9ee50cd9e551aaa9202 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 28 Jan 2024 20:53:47 +0800 Subject: [PATCH 19/63] More clean up Use instead of '"' if possible. Use , , etc. instead of if possible. Replace alpha with a UTF-8 Greek alpha character. BTW decorate ".link" with . --- chapter02/hostreqs.xml | 7 ++++--- chapter02/mounting.xml | 2 +- chapter07/python.xml | 4 ++-- chapter08/coreutils.xml | 4 ++-- chapter08/expect.xml | 4 ++-- chapter08/stripping.xml | 2 +- chapter09/networkd.xml | 9 +++++---- chapter09/usage.xml | 2 +- 8 files changed, 18 insertions(+), 16 deletions(-) diff --git a/chapter02/hostreqs.xml b/chapter02/hostreqs.xml index 546555e9b..3dc451856 100644 --- a/chapter02/hostreqs.xml +++ b/chapter02/hostreqs.xml @@ -29,9 +29,10 @@ minimum versions indicated. This should not be an issue for most modern Linux distributions. Also note that many distributions will place software headers into separate packages, often in the form of - <package-name>-devel or - <package-name>-dev. Be sure to install those if - your distribution provides them. + <package-name>-devel + or + <package-name>-dev. + Be sure to install those if your distribution provides them. Earlier versions of the listed software packages may work, but have not been tested. diff --git a/chapter02/mounting.xml b/chapter02/mounting.xml index 60e5cdc62..4db0f5bfc 100644 --- a/chapter02/mounting.xml +++ b/chapter02/mounting.xml @@ -16,7 +16,7 @@ LFS environment variable described in the previous section. - Strictly speaking, one cannot "mount a partition." One mounts the file + Strictly speaking, one cannot mount a partition. One mounts the file system embedded in that partition. But since a single partition can't contain more than one file system, people often speak of the partition and the associated file system as if they were one and the same. diff --git a/chapter07/python.xml b/chapter07/python.xml index 8268df8e4..872cf4a36 100644 --- a/chapter07/python.xml +++ b/chapter07/python.xml @@ -84,8 +84,8 @@ Some Python 3 modules can't be built now because the dependencies are not installed yet. For the ssl module, - a message Python requires a OpenSSL 1.1.1 or - newer is outputted. + a message Python requires a OpenSSL 1.1.1 or + newer is outputted. The message should be ignored. Just make sure the toplevel make command has not failed. The optional modules are not needed now and they will be built in diff --git a/chapter08/coreutils.xml b/chapter08/coreutils.xml index 3357fabc5..96c46996d 100644 --- a/chapter08/coreutils.xml +++ b/chapter08/coreutils.xml @@ -1261,8 +1261,8 @@ sed -i 's/"1"/"8"/' /usr/share/man/man8/chroot.8 yes - Repeatedly outputs y, or a given string, until - killed + Repeatedly outputs y or a given string, + until killed yes diff --git a/chapter08/expect.xml b/chapter08/expect.xml index 95dc8beae..810bc55a2 100644 --- a/chapter08/expect.xml +++ b/chapter08/expect.xml @@ -92,8 +92,8 @@ make test If any test fails with the message - The system has no more ptys. Ask your system - administrator to create more, it indicates + The system has no more ptys. Ask your system + administrator to create more, it indicates you've not mounted the devpts file system correctly. You need to exit from the chroot environment, read diff --git a/chapter08/stripping.xml b/chapter08/stripping.xml index 6c3cc7c98..5ce0235d3 100644 --- a/chapter08/stripping.xml +++ b/chapter08/stripping.xml @@ -52,7 +52,7 @@ The ELF loader's name is ld-linux-x86-64.so.2 on 64-bit systems and ld-linux.so.2 on 32-bit systems. The construct below selects the correct name for the current architecture, excluding anything ending - with g, in case the commands below have already been + with g, in case the commands below have already been run. diff --git a/chapter09/networkd.xml b/chapter09/networkd.xml index 363e8d883..6c2935de1 100644 --- a/chapter09/networkd.xml +++ b/chapter09/networkd.xml @@ -91,7 +91,8 @@ - Mask udev's .link file for the default policy: + Mask udev's .link file + for the default policy: ln -s /dev/null /etc/systemd/network/99-default.link @@ -101,9 +102,9 @@ Create a manual naming scheme, for example by naming the interfaces something like internet0, dmz0, or lan0. - To do that, create .link files in /etc/systemd/network/ that - select an explicit name or a better naming scheme for your - network interfaces. For example: + To do that, create .link + files in /etc/systemd/network/ that select an explicit name or a + better naming scheme for your network interfaces. For example: cat > /etc/systemd/network/10-ether0.link << "EOF" diff --git a/chapter09/usage.xml b/chapter09/usage.xml index 85b35d16d..7c4f18600 100644 --- a/chapter09/usage.xml +++ b/chapter09/usage.xml @@ -526,7 +526,7 @@ EOF languages, because there accents are added to unaccented ASCII characters, or two ASCII characters are composed together. However, in UTF-8 mode it is a problem; e.g., for the Greek language, where one - sometimes needs to put an accent on the letter alpha. + sometimes needs to put an accent on the letter α. The solution is either to avoid the use of UTF-8, or to install the X window system, which doesn't have this limitation, in its input handling. From 5dd707361faeaa09bc9ebd45329cfd167b8472af Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 28 Jan 2024 21:04:30 +0800 Subject: [PATCH 20/63] locale: Dedup --- chapter09/locale.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/chapter09/locale.xml b/chapter09/locale.xml index 803978267..ee45a1f4a 100644 --- a/chapter09/locale.xml +++ b/chapter09/locale.xml @@ -18,10 +18,6 @@ /etc/locale.conf - The /etc/locale.conf file - below sets some environment variables necessary for native language - support. Setting them properly results in: - Some environment variables are necessary for native language support. Setting them properly results in: From 7c630340c2813897c6424670edefa3a98e970ab7 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 28 Jan 2024 21:06:19 +0800 Subject: [PATCH 21/63] locale: Dedup in /etc/profile --- chapter09/locale.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/chapter09/locale.xml b/chapter09/locale.xml index ee45a1f4a..92a71ee6e 100644 --- a/chapter09/locale.xml +++ b/chapter09/locale.xml @@ -166,10 +166,6 @@ for i in $(locale); do done if [[ "$TERM" = linux ]]; then - for i in $(locale); do - unset ${i%=*} - done - export LANG=C else export LANG=<ll>_<CC>.<charmap><@modifiers> From 4ecfc55ddba0e6ffae4c2f74ad773eea8d290364 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Mon, 29 Jan 2024 01:47:41 +0800 Subject: [PATCH 22/63] Use C.UTF-8 instead of C in console, and set the consolefont for it --- chapter09/consoled.xml | 14 ++++++++++++++ chapter09/locale.xml | 6 +++--- chapter09/usage.xml | 29 +++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/chapter09/consoled.xml b/chapter09/consoled.xml index f35a586fe..fe1744ddc 100644 --- a/chapter09/consoled.xml +++ b/chapter09/consoled.xml @@ -74,6 +74,20 @@ + We'll use C.UTF-8 as the locale for interactive + sessions in the Linux console in The only console font shipped by + the Kbd package containing the glyphs for + all characters from the program messages in the C.UTF-8 + locale is Lat2-Terminus16 (the other shipped console + fonts lack glyphs of some characters like the Unicode left/right + quotation marks and the Unicode English dash). So set + Lat2-Terminus16 as the default console font: + + +echo FONT=Lat2-Terminus16 > /etc/vconsole.conf + An example for a German keyboard and console is given below: +cat > /etc/sysconfig/console << "EOF" +# Begin /etc/sysconfig/console + +UNICODE="1" +FONT="Lat2-Terminus16" + +# End /etc/sysconfig/console +EOF + + For a non-Unicode setup, only the KEYMAP and FONT variables are From 40cd8a18016e92e48454bf24e2c4d853d1b2b3a9 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Mon, 29 Jan 2024 23:45:33 +0800 Subject: [PATCH 23/63] glibc: Drop --with-headers=/usr/include MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Glibc INSTALL file says: ‘--with-headers=DIRECTORY’ Look for kernel header files in DIRECTORY, not ‘/usr/include’. ... So --with-headers=/usr/include seems just doing nothing. --- chapter08/glibc.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/chapter08/glibc.xml b/chapter08/glibc.xml index 1c365ccb1..f82c86d5b 100644 --- a/chapter08/glibc.xml +++ b/chapter08/glibc.xml @@ -73,7 +73,6 @@ cd build --disable-werror \ --enable-kernel=&min-kernel; \ --enable-stack-protector=strong \ - --with-headers=/usr/include \ --disable-nscd \ libc_cv_slibdir=/usr/lib From 39b5bb69894f9b54c8d605b6ac3382531b4c214f Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 30 Jan 2024 12:10:13 +0800 Subject: [PATCH 24/63] console font: Add more "working for C.UTF-8" console fonts --- chapter09/consoled.xml | 15 ++++++++++----- chapter09/usage.xml | 19 ++++++++++++------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/chapter09/consoled.xml b/chapter09/consoled.xml index fe1744ddc..ce922d6a8 100644 --- a/chapter09/consoled.xml +++ b/chapter09/consoled.xml @@ -76,13 +76,18 @@ We'll use C.UTF-8 as the locale for interactive sessions in the Linux console in The only console font shipped by + linkend='ch-config-locale'/> The console fonts shipped by the Kbd package containing the glyphs for all characters from the program messages in the C.UTF-8 - locale is Lat2-Terminus16 (the other shipped console - fonts lack glyphs of some characters like the Unicode left/right - quotation marks and the Unicode English dash). So set - Lat2-Terminus16 as the default console font: + locale are LatArCyrHeb*.psfu.gz, + LatGrkCyr*.psfu.gz, + Lat2-Terminus16.psfu.gz, and + pancyrillic.f16.psfu.gz in + /usr/share/consolefonts (the other + shipped console fonts lack glyphs of some characters like the Unicode + left/right quotation marks and the Unicode English dash). So set one of + them, for example Lat2-Terminus16.psfu.gz as the + default console font: diff --git a/chapter09/usage.xml b/chapter09/usage.xml index 73f92ebef..6b5441bba 100644 --- a/chapter09/usage.xml +++ b/chapter09/usage.xml @@ -437,14 +437,19 @@ EOF We'll use C.UTF-8 as the locale for interactive sessions in the Linux console in so we should set - UNICODE to 1. And the only - console font shipped by the Kbd package + UNICODE to 1. And the console + fonts shipped by the Kbd package containing the glyphs for all characters from the program messages - in the C.UTF-8 locale is - Lat2-Terminus16 (the other shipped console - fonts lack glyphs of some characters like the Unicode left/right - quotation marks and the Unicode English dash). So set - Lat2-Terminus16 as the default console + in the C.UTF-8 locale are + LatArCyrHeb*.psfu.gz, + LatGrkCyr*.psfu.gz, + Lat2-Terminus16.psfu.gz, and + pancyrillic.f16.psfu.gz in + /usr/share/consolefonts (the + other shipped console fonts lack glyphs of some characters like the + Unicode left/right quotation marks and the Unicode English dash). + So set one of them, for example + Lat2-Terminus16.psfu.gz as the default console font: From bbcac389a3e239ba034b9a63b80e1b9376b72aee Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 31 Jan 2024 16:16:14 +0800 Subject: [PATCH 25/63] glibc: Update upstream fixes patch To include fixes for CVE-2023-6246, CVE-2023-6779, and CVE-2023-6780. --- patches.ent | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patches.ent b/patches.ent index d27c717de..bad5abff6 100644 --- a/patches.ent +++ b/patches.ent @@ -14,9 +14,9 @@ - - - + + + From bed3894b899f05fb586cdcb407de635b71bdf97f Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 31 Jan 2024 17:35:03 +0800 Subject: [PATCH 26/63] glibc: Add more rationale about --enable-stack-protector, and remove the stale explanation of --with-headers --- chapter08/glibc.xml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/chapter08/glibc.xml b/chapter08/glibc.xml index f82c86d5b..ae4856581 100644 --- a/chapter08/glibc.xml +++ b/chapter08/glibc.xml @@ -102,15 +102,10 @@ cd build This option increases system security by adding extra code to check for buffer overflows, such as stack - smashing attacks. - - - - - --with-headers=/usr/include - - This option tells the build system where to find the - kernel API headers. + smashing attacks. Note that Glibc always explicitly overrides + the default of GCC, so this option is still needed even though + we've already specified for + GCC. From cdf280e3373c65b8979a3d152d9b2b39003c39ff Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Wed, 31 Jan 2024 08:42:20 -0600 Subject: [PATCH 27/63] Package updates. Update to openssl-3.2.1. Update to zlib-1.3.1. Update to xz-5.4.6. Update to linux-6.7.2. Update to iana-etc-20240125. Update to binutils-2.42. Update to acl-2.3.2. Update upstream fixes for readline-8.2. Apply upstream fix for bash-5.2.21. --- chapter01/changelog.xml | 42 +++++++++++++++++++++++++++++++++++++++ chapter01/whatsnew.xml | 12 +++++++---- chapter03/patches.xml | 10 +++++----- chapter08/bash.xml | 4 ++++ chapter08/binutils.xml | 2 +- packages.ent | 44 ++++++++++++++++++++--------------------- patches.ent | 10 +++++++--- 7 files changed, 89 insertions(+), 35 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index aba69a0de..d16a6181b 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,6 +40,48 @@ appropriate for the entry or if needed the entire day's listitem. --> + + 2024-02-01 + + + [bdubbs] - Update to openssl-3.2.1. Fixes + #5425. + + + [bdubbs] - Update to zlib-1.3.1. Fixes + #5419. + + + [bdubbs] - Update to xz-5.4.6. Fixes + #5423. + + + [bdubbs] - Update to linux-6.7.2. Fixes + #5422. + + + [bdubbs] - Update to iana-etc-20240125. Addresses + #5006. + + + [bdubbs] - Update to binutils-2.42. Fixes + #5424. + + + [bdubbs] - Update to acl-2.3.2. Fixes + #5421. + + + [bdubbs] - Update upstream fixes for readline-8.2. Fixes + #5420. + + + [bdubbs] - Apply upstream fix for bash-5.2.21. Fixes + #5420. + + + + 2024-01-21 diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml index 2dd0a8d02..ceca1c108 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -26,9 +26,9 @@ - + Attr-&attr-version; @@ -44,9 +44,9 @@ Bc-&bc-version; - + @@ -290,6 +290,10 @@ Added: + + &bash-upstream-fixes-patch; + + setuptools-&setuptools-version; diff --git a/chapter03/patches.xml b/chapter03/patches.xml index 50ff56a6f..106527518 100644 --- a/chapter03/patches.xml +++ b/chapter03/patches.xml @@ -27,14 +27,14 @@ --> - + Install the package: diff --git a/packages.ent b/packages.ent index cfdbd2790..22e143878 100644 --- a/packages.ent +++ b/packages.ent @@ -13,10 +13,10 @@ *-knl-* Package info for Kernel stuff --> - - + + - + @@ -65,10 +65,10 @@ - - + + - + @@ -317,10 +317,10 @@ - - + + - + @@ -431,12 +431,12 @@ - + - + - + - + diff --git a/patches.ent b/patches.ent index bad5abff6..c2f957aad 100644 --- a/patches.ent +++ b/patches.ent @@ -2,6 +2,10 @@ + + + + @@ -26,9 +30,9 @@ - - - + + + From d3b0a0842ea875cf9609cb3c07e5234af8abfdc9 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Thu, 1 Feb 2024 01:20:15 +0800 Subject: [PATCH 28/63] pkgmgt: Upgrading Linux API headers cannot be dangerous Per a discussion in the team, we only consider an upgradation dangerous if it may render the system unusable. "Causing something not able to build" is never considered dangerous. Thus upgrading some headers cannot be dangerous. The Glibc portion will need an update too (it can be upgraded safely with some caution) to ease security updates. But let's do the easy change first... --- chapter08/pkgmgt.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter08/pkgmgt.xml b/chapter08/pkgmgt.xml index 42a6ff945..4c7bb6dd7 100644 --- a/chapter08/pkgmgt.xml +++ b/chapter08/pkgmgt.xml @@ -56,13 +56,13 @@ 5.10.17 to 5.10.18 or 5.11.1), nothing else needs to be rebuilt. The system will keep working fine thanks to the well-defined interface between the kernel and userspace. Specifically, Linux API headers - need not be (and should not be, see the next item) upgraded + need not be upgraded along with the kernel. You will merely need to reboot your system to use the upgraded kernel. - If the Linux API headers or Glibc need to be upgraded to a newer + If Glibc needs to be upgraded to a newer version, (e.g., from Glibc-2.31 to Glibc-2.32), it is safer to rebuild LFS. Though you may be able to rebuild all the packages in their dependency order, we do not recommend From d386e51ec48321f45708a93c8a0a895997dad20c Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 2 Feb 2024 05:18:35 +0800 Subject: [PATCH 29/63] changelog: OpenSSL 3.2.1 is a security fix I'll write the SA for it... --- chapter01/changelog.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index d16a6181b..5f20d6177 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -44,7 +44,7 @@ 2024-02-01 - [bdubbs] - Update to openssl-3.2.1. Fixes + [bdubbs] - Update to openssl-3.2.1 (security fix). Fixes #5425. From 1e180412f93db670c42458f1b00963a0ae1b56d0 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 2 Feb 2024 05:06:17 +0800 Subject: [PATCH 30/63] hostreq: Raise min-kernel to 4.19 4.14 is no longer supported by the upstream since Jan 2024. --- chapter02/hostreqs.xml | 8 ++++++-- general.ent | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/chapter02/hostreqs.xml b/chapter02/hostreqs.xml index 3dc451856..7375ca327 100644 --- a/chapter02/hostreqs.xml +++ b/chapter02/hostreqs.xml @@ -100,8 +100,12 @@ , so the workarounds for older kernels are not enabled and the compiled glibc is slightly faster and smaller. - As at June 2023, &min-kernel; is the oldest kernel release still - supported by the kernel developers. + As at Feb 2024, &min-kernel; is the oldest kernel release still + supported by the kernel developers. Some kernel releases older than + &min-kernel; may be still supported by third-party teams, but they + are not considered official upstream kernel releases; read + for the + details. If the host kernel is earlier than &min-kernel; you will need to replace the kernel with a more up-to-date version. There are two ways diff --git a/general.ent b/general.ent index 31e6daecc..cad537e5b 100644 --- a/general.ent +++ b/general.ent @@ -92,9 +92,9 @@ - - + + + + 2024-02-02 + + + [xry111] - Update to glibc-2.39 (security fix). Fixes + #5426. + + + [xry111] - Update to linux-6.7.3. Fixes + #5427. + + + + 2024-02-01 diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml index ceca1c108..5faf938b7 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -101,9 +101,9 @@ Gettext-&gettext-version; - + @@ -298,10 +298,6 @@ setuptools-&setuptools-version; - - &glibc-upstream-fixes-patch; - - &pkgconf-upstream-fix-patch; diff --git a/chapter03/patches.xml b/chapter03/patches.xml index 106527518..f05fbd604 100644 --- a/chapter03/patches.xml +++ b/chapter03/patches.xml @@ -76,7 +76,7 @@ MD5 sum: &gcc-upstream-fixes-patch-md5; ---> + Glibc Upstream Fixes Patch - &glibc-upstream-fixes-patch-size;: @@ -84,7 +84,7 @@ MD5 sum: &glibc-upstream-fixes-patch-md5; - +--> Glibc FHS Patch - &glibc-fhs-patch-size;: diff --git a/chapter08/glibc.xml b/chapter08/glibc.xml index ae4856581..86b830249 100644 --- a/chapter08/glibc.xml +++ b/chapter08/glibc.xml @@ -49,12 +49,12 @@ store their runtime data in the FHS-compliant locations: patch -Np1 -i ../&glibc-fhs-patch; - + The Glibc documentation recommends building Glibc in a dedicated build directory: diff --git a/packages.ent b/packages.ent index 22e143878..4d607f89c 100644 --- a/packages.ent +++ b/packages.ent @@ -255,10 +255,10 @@ - - + + - + @@ -431,12 +431,12 @@ - + - + - + From 343ab1388a38dc622766a4a43e02c63e30096fe2 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 2 Feb 2024 05:15:03 +0800 Subject: [PATCH 32/63] Add info about how to upgrade Glibc on a running system Let's change our policy to match other "rolling release" distros and ease the procedure to fix Glibc security vulnerabilities. Squashed the commits in xry111/update-glibc branch to keep the history clean. Co-Authored-By: Pierre Labastie Co-Authored-By: Douglas R. Reno --- chapter08/glibc.xml | 115 +++++++++++++++++++++++++++++++++++++++++++ chapter08/pkgmgt.xml | 18 ++----- 2 files changed, 118 insertions(+), 15 deletions(-) diff --git a/chapter08/glibc.xml b/chapter08/glibc.xml index 86b830249..e09fe4900 100644 --- a/chapter08/glibc.xml +++ b/chapter08/glibc.xml @@ -201,6 +201,121 @@ esac sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile + + + If upgrading Glibc to a new minor version (for example, from + Glibc-2.36 to Glibc-&glibc-version;) on a running LFS system, you + need to take some extra precautions to avoid breaking the system: + + + + + + + Upgrading Glibc on a LFS system prior to 11.0 (exclusive) is + not supported. Rebuild LFS if you are running such an old LFS + system but you need a newer Glibc. + + + + + + + If upgrading on a LFS system prior to 12.0 (exclusive), install + Libxcrypt following + In addition to + a normal Libxcrypt installation, + you MUST follow the note in Libxcrypt + section to install + libcrypt.so.1* + (overwritting + libcrypt.so.1 from the + prior Glibc installation). + + + + + + + If upgrading on a LFS system prior to 12.1 (exclusive), + remove the nscd program: + + + rm -f /usr/sbin/nscd + + + If this system (prior to LFS 12.1, exclusive) is based on + Systemd, it's also needed to disable and stop the + nscd service now: + + + systemctl disable --now nscd + + + + + Upgrade the kernel and reboot if it's older than &min-kernel; + (check the current version with uname -r) + or if you want to upgrade it anyway, following + + + + + + + Upgrade the kernel API headers if it's older than &min-kernel; + (check the current version with + cat /usr/include/linux/version.h) + or if you want to upgrade it anyway, following + (but removing + $LFS from the cp command). + + + + + + + Perform a DESTDIR installation and upgrade + the Glibc shared libraries on the system using one single + install command: + + + make DESTDIR=$PWD/dest install +install -vm755 dest/usr/lib/*.so.* /usr/lib + + + + + It's imperative to strictly follow these steps above unless you + completely understand what you are doing. + Any unexpected deviation may render the + system completely unusable. YOU ARE WARNED. + + + + Then continue to run the make install command + and the sed command against + /usr/bin/ldd. Once they are finished, reboot + the system immediately. + + + Install the package: make install diff --git a/chapter08/pkgmgt.xml b/chapter08/pkgmgt.xml index 4c7bb6dd7..10ec5d199 100644 --- a/chapter08/pkgmgt.xml +++ b/chapter08/pkgmgt.xml @@ -63,21 +63,9 @@ If Glibc needs to be upgraded to a newer - version, (e.g., from Glibc-2.31 to Glibc-2.32), it is safer to - rebuild LFS. Though you may be able to rebuild - all the packages in their dependency order, we do not recommend - it. - - - - Reinstalling the same version of Glibc (&glibc-version; for - this release of LFS) with patches should be safe when these patches - do not change ABI and API. When a security vulnerability is found - in Glibc, we often need to apply such a patch to fix the - vulnerability and reinstall Glibc. Consult - LFS security - advisories if you are alerted for a published Glibc security - vulnerability but unsure about the action to take. + version, (e.g., from Glibc-2.36 to Glibc-&glibc-version;), + some extra steps are needed to avoid breaking the system. + Read for details. If a package containing a shared library is updated, and From 9c73d91186bc1d24fcc3a634876ae4c49d7dfa84 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 2 Feb 2024 15:19:41 +0800 Subject: [PATCH 33/63] Remove -v from "chown -R tester" commands It does no good: normally we have -v for chown so once it no longer has an effect we can know, but in this case these chown commands will never have no effect. And a huge amount of output with -v wastes the server storage and bandwidth (for both the server and the people reading the build logs). --- chapter08/bash.xml | 2 +- chapter08/coreutils.xml | 2 +- chapter08/findutils.xml | 2 +- chapter08/gawk.xml | 2 +- chapter08/gcc.xml | 2 +- chapter08/make.xml | 2 +- chapter08/sed.xml | 2 +- chapter08/util-linux.xml | 2 +- chapter08/vim.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/chapter08/bash.xml b/chapter08/bash.xml index 4e7a418f5..4b5b47e62 100644 --- a/chapter08/bash.xml +++ b/chapter08/bash.xml @@ -75,7 +75,7 @@ To prepare the tests, ensure that the tester user can write to the sources tree: -chown -Rv tester . +chown -R tester . The test suite of this package is designed to be run as a non-&root; user who owns the terminal connected to standard input. To satisfy the diff --git a/chapter08/coreutils.xml b/chapter08/coreutils.xml index 96c46996d..655e0dd66 100644 --- a/chapter08/coreutils.xml +++ b/chapter08/coreutils.xml @@ -121,7 +121,7 @@ FORCE_UNSAFE_CONFIGURE=1 ./configure \ Fix some of the permissions so that the non-&root; user can compile and run the tests: -chown -Rv tester . +chown -R tester . Now run the tests: diff --git a/chapter08/findutils.xml b/chapter08/findutils.xml index 7012c221a..5671f6183 100644 --- a/chapter08/findutils.xml +++ b/chapter08/findutils.xml @@ -82,7 +82,7 @@ esac To test the results, issue: -chown -Rv tester . +chown -R tester . su tester -c "PATH=$PATH make check" Install the package: diff --git a/chapter08/gawk.xml b/chapter08/gawk.xml index a7f74eb92..bc19acaaf 100644 --- a/chapter08/gawk.xml +++ b/chapter08/gawk.xml @@ -54,7 +54,7 @@ To test the results, issue: -chown -Rv tester . +chown -R tester . su tester -c "PATH=$PATH make check" Install the package: diff --git a/chapter08/gcc.xml b/chapter08/gcc.xml index 7f21cf853..84cf8a86f 100644 --- a/chapter08/gcc.xml +++ b/chapter08/gcc.xml @@ -158,7 +158,7 @@ cd build Test the results as a non-privileged user, but do not stop at errors: -chown -Rv tester . +chown -R tester . su tester -c "PATH=$PATH make -k check" To extract a summary of the test suite results, run: diff --git a/chapter08/make.xml b/chapter08/make.xml index 186698a58..41a77c649 100644 --- a/chapter08/make.xml +++ b/chapter08/make.xml @@ -53,7 +53,7 @@ https://savannah.gnu.org/bugs/?63852 --> To test the results, issue: -chown -Rv tester . +chown -R tester . su tester -c "PATH=$PATH make check" Install the package: diff --git a/chapter08/sed.xml b/chapter08/sed.xml index 4a524c751..75d015600 100644 --- a/chapter08/sed.xml +++ b/chapter08/sed.xml @@ -51,7 +51,7 @@ make html To test the results, issue: -chown -Rv tester . +chown -R tester . su tester -c "PATH=$PATH make check" Install the package and its documentation: diff --git a/chapter08/util-linux.xml b/chapter08/util-linux.xml index e6bb0b683..4c53b4eb5 100644 --- a/chapter08/util-linux.xml +++ b/chapter08/util-linux.xml @@ -103,7 +103,7 @@ bash tests/run.sh --srcdir=$PWD --builddir=$PWD -chown -Rv tester . +chown -R tester . su tester -c "make -k check" The hardlink tests will fail if the host's kernel diff --git a/chapter08/vim.xml b/chapter08/vim.xml index 9dd3b4b74..030c50442 100644 --- a/chapter08/vim.xml +++ b/chapter08/vim.xml @@ -66,7 +66,7 @@ tester can write to the source tree: -chown -Rv tester . +chown -R tester . Now run the tests as user tester: From e14adea67362b7ee813eafff7c193132fc762a81 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 2 Feb 2024 16:22:11 +0800 Subject: [PATCH 34/63] Update to tzdata-2024a (#5428) --- chapter01/changelog.xml | 4 ++++ packages.ent | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 72e12ddf2..fa7fc12c4 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -43,6 +43,10 @@ 2024-02-02 + + [xry111] - Update to tzdata-2024a. Fixes + #5428. + [xry111] - Update to glibc-2.39 (security fix). Fixes #5426. diff --git a/packages.ent b/packages.ent index 4d607f89c..6d319968a 100644 --- a/packages.ent +++ b/packages.ent @@ -712,10 +712,10 @@ - - + + - + From 7b54528e96a6d715f55222fb071d0dcb0021258d Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Fri, 2 Feb 2024 10:10:53 -0600 Subject: [PATCH 35/63] Fix currency for xz --- lfs-latest-git.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lfs-latest-git.php b/lfs-latest-git.php index 162d8d6c8..c2414789a 100644 --- a/lfs-latest-git.php +++ b/lfs-latest-git.php @@ -152,6 +152,7 @@ if ( $package == "tcl" ) $dirpath = "https://www.tcl.tk/software/tcltk/do if ( $package == "util-linux" ) $dirpath = max_parent( $dirpath, "v." ); if ( $package == "vim" ) $dirpath = "https://github.com/vim/vim/tags"; if ( $package == "wheel" ) $dirpath = "https://pypi.org/project/wheel/#files"; +if ( $package == "xz" ) $dirpath = github("tukaani-project/xz"); if ( $package == "zlib" ) $dirpath = "https://www.zlib.net"; if ( $package == "zstd" ) $dirpath = github("facebook/zstd"); From 677f795cf85f1ecb40dfedf1624817d3288ea1ca Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sat, 3 Feb 2024 18:55:26 +0800 Subject: [PATCH 36/63] glibc: When update, also regenerate the locales A Glibc update may contain locale updates, so keep /usr/lib/locale/locale-archive synced. Other distros are also doing this when Glibc is updated with the package manager. --- chapter08/glibc.xml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/chapter08/glibc.xml b/chapter08/glibc.xml index e09fe4900..64ed3b630 100644 --- a/chapter08/glibc.xml +++ b/chapter08/glibc.xml @@ -309,10 +309,11 @@ install -vm755 dest/usr/lib/*.so.* /usr/lib - Then continue to run the make install command - and the sed command against - /usr/bin/ldd. Once they are finished, reboot - the system immediately. + Then continue to run the make install command, + the sed command against + /usr/bin/ldd, and the commands to install + the locales. Once they are finished, reboot the system + immediately. From 8cf42d4c72d9e0b773c32849af2fb237b557029e Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 4 Feb 2024 03:40:36 +0800 Subject: [PATCH 37/63] Fix and unify the commands creating the link target of /dev/shm $(realpath /dev/shm) will return the absolute path of the target of /dev/shm, thus the command will work for both absolute symlink and relative symlink. --- chapter07/kernfs.xml | 5 +++-- chapter11/afterlfs.xml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/chapter07/kernfs.xml b/chapter07/kernfs.xml index 00a971b59..ecdff0dd2 100644 --- a/chapter07/kernfs.xml +++ b/chapter07/kernfs.xml @@ -97,7 +97,8 @@ mount -vt tmpfs tmpfs $LFS/run --> In some host systems, /dev/shm is a - symbolic link to /run/shm. + symbolic link to a directory, typically + /run/shm. The /run tmpfs was mounted above so in this case only a directory needs to be created. @@ -107,7 +108,7 @@ mount -vt tmpfs tmpfs $LFS/run we must explicitly mount a tmpfs: if [ -h $LFS/dev/shm ]; then - (cd $LFS/dev; mkdir $(readlink shm)) + mkdir -pv $LFS$(realpath /dev/shm) else mount -vt tmpfs -o nosuid,nodev tmpfs $LFS/dev/shm fi diff --git a/chapter11/afterlfs.xml b/chapter11/afterlfs.xml index ff8bae006..5c2693ade 100644 --- a/chapter11/afterlfs.xml +++ b/chapter11/afterlfs.xml @@ -130,7 +130,7 @@ mounttype proc proc proc mounttype sys sysfs sysfs mounttype run tmpfs run if [ -h $LFS/dev/shm ]; then - mkdir -pv $LFS/$(readlink $LFS/dev/shm) + mkdir -pv $LFS$(realpath /dev/shm) else mounttype dev/shm tmpfs tmpfs -o nosuid,nodev fi From 7436c28ae4acc14d3646131bb59cc3574e42936e Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 4 Feb 2024 22:56:04 +0800 Subject: [PATCH 38/63] If we need to create the link target of /dev/shm, make its mode 1777 To match the behavior of a tmpfs mount. Otherwise non-root user (for e.g. the tester user) will get errors using Glibc shm functions. --- chapter07/kernfs.xml | 4 ++-- chapter11/afterlfs.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chapter07/kernfs.xml b/chapter07/kernfs.xml index ecdff0dd2..31244e8c0 100644 --- a/chapter07/kernfs.xml +++ b/chapter07/kernfs.xml @@ -100,7 +100,7 @@ mount -vt tmpfs tmpfs $LFS/run symbolic link to a directory, typically /run/shm. The /run tmpfs was mounted above so in this case only a - directory needs to be created. + directory needs to be created with a correct mode. In other host systems /dev/shm is a mount point for a tmpfs. In that case the mount of /dev above will only create @@ -108,7 +108,7 @@ mount -vt tmpfs tmpfs $LFS/run we must explicitly mount a tmpfs: if [ -h $LFS/dev/shm ]; then - mkdir -pv $LFS$(realpath /dev/shm) + install -v -d -m 1777 $LFS$(realpath /dev/shm) else mount -vt tmpfs -o nosuid,nodev tmpfs $LFS/dev/shm fi diff --git a/chapter11/afterlfs.xml b/chapter11/afterlfs.xml index 5c2693ade..633a782df 100644 --- a/chapter11/afterlfs.xml +++ b/chapter11/afterlfs.xml @@ -130,7 +130,7 @@ mounttype proc proc proc mounttype sys sysfs sysfs mounttype run tmpfs run if [ -h $LFS/dev/shm ]; then - mkdir -pv $LFS$(realpath /dev/shm) + install -v -d -m 1777 $LFS$(realpath /dev/shm) else mounttype dev/shm tmpfs tmpfs -o nosuid,nodev fi From 1541b7c29f10b6cfaf954dbb67345206e4f78e93 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Sun, 4 Feb 2024 12:13:17 -0600 Subject: [PATCH 39/63] Minor wording update --- chapter07/kernfs.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter07/kernfs.xml b/chapter07/kernfs.xml index 31244e8c0..575044106 100644 --- a/chapter07/kernfs.xml +++ b/chapter07/kernfs.xml @@ -100,7 +100,7 @@ mount -vt tmpfs tmpfs $LFS/run symbolic link to a directory, typically /run/shm. The /run tmpfs was mounted above so in this case only a - directory needs to be created with a correct mode. + directory needs to be created with the correct permissions. In other host systems /dev/shm is a mount point for a tmpfs. In that case the mount of /dev above will only create From ce11e97f013485bdedd834b960c88a1452701648 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 6 Feb 2024 00:15:33 +0800 Subject: [PATCH 40/63] kernfs: Use a separate devpts filesystem for chroot environment IIRC we switched from separate devpts to bind mount, and matched the UID of tester with the host UID owning the TTY, to satisify the Bash test suite. But now we are always using UID 101 for tester and expect to spawn a PTY for Bash test suite (so when building LFS in a TTY owned by the root user of the host tester won't be UID 0). Thus we can switch back to a separate devpts mount which is cleaner and safer. And we are already using a separate devpts mount in Chapter 11. --- chapter07/kernfs.xml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/chapter07/kernfs.xml b/chapter07/kernfs.xml index 575044106..067a614f4 100644 --- a/chapter07/kernfs.xml +++ b/chapter07/kernfs.xml @@ -63,11 +63,14 @@ Now mount the remaining virtual kernel file systems: -mount -v --bind /dev/pts $LFS/dev/pts + + +mount -vt devpts devpts -o gid=5,mode=0620 $LFS/dev/pts mount -vt proc proc $LFS/proc mount -vt sysfs sysfs $LFS/sys mount -vt tmpfs tmpfs $LFS/run - + In some host systems, /dev/shm is a symbolic link to a directory, typically /run/shm. From 1fde756b121ffcba522f252475418714240358c7 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 6 Feb 2024 01:00:53 +0800 Subject: [PATCH 41/63] expect: Add (back) a simple test for PTY We used to run "expect -c 'spawn ls'" for this in Binutils, but then we thought expect test suite was enough as such a simple PTY test. However expect test can fail due to some different reason, so add back a simple test using Python pty module before building expect. Now we no longer need to consider expect test critical (IIRC there was a report saying one expect test failed for unknown reason but all other things OK). --- chapter08/expect.xml | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/chapter08/expect.xml b/chapter08/expect.xml index 810bc55a2..5c21e390f 100644 --- a/chapter08/expect.xml +++ b/chapter08/expect.xml @@ -48,6 +48,25 @@ Installation of Expect + Expect needs PTYs to work. Verify that the PTYs are working + properly inside the chroot environment by performing a simple + test: + +python3 -c 'from pty import spawn; spawn(["echo", "ok"])' + + This command should output ok. + If, instead, the output includes OSError: out of pty + devices, then the environment is not set up for proper + PTY operation. You need to exit from the chroot environment, read + again, and ensure the + devpts file system (and + other virtual kernel file systems) mounted correctly. Then reenter + the chroot environment following . + This issue needs to be resolved before continuing, or the test suites + requring Expect (for example the test suites of Bash, Binutils, GCC, + GDBM, and of course Expect itself) will fail catastrophically, and other + subtle breakages may also happen. + Prepare Expect for compilation: ./configure --prefix=/usr \ @@ -82,27 +101,10 @@ make - - The test suite for Expect is considered critical. - Do not skip it under any circumstances. - - To test the results, issue: make test - If any test fails with the message - The system has no more ptys. Ask your system - administrator to create more, it indicates - you've not mounted the - devpts file system - correctly. You need to exit from the chroot environment, read - again, and ensure the - devpts file system (and - other virtual kernel file systems) mounted correctly. Then reenter - the chroot environment following . - This issue needs to be resolved before continuing. - Install the package: make install From 4816dc69f596e962ecb050fdfea3704e65514a47 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 6 Feb 2024 03:44:38 +0800 Subject: [PATCH 42/63] bash: Really pass through the return code We want expect to return the return code of "make test" (stored in $value), but $value is expanded too early to nothing by Bash. Quote EOF so Bash won't expand $xxx. --- chapter08/bash.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter08/bash.xml b/chapter08/bash.xml index 4b5b47e62..1490e7791 100644 --- a/chapter08/bash.xml +++ b/chapter08/bash.xml @@ -83,7 +83,7 @@ Expect and run the tests as the tester user: -su -s /usr/bin/expect tester << EOF +su -s /usr/bin/expect tester << "EOF" set timeout -1 spawn make tests expect eof From e67d9960224e8bf8638ab8496bd3038222405f75 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Thu, 8 Feb 2024 13:56:10 +0100 Subject: [PATCH 43/63] Typo in expect Thanks to rhubarbpieguy for the report Fix #5436 --- chapter08/expect.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter08/expect.xml b/chapter08/expect.xml index 5c21e390f..76795782d 100644 --- a/chapter08/expect.xml +++ b/chapter08/expect.xml @@ -63,7 +63,7 @@ other virtual kernel file systems) mounted correctly. Then reenter the chroot environment following . This issue needs to be resolved before continuing, or the test suites - requring Expect (for example the test suites of Bash, Binutils, GCC, + requiring Expect (for example the test suites of Bash, Binutils, GCC, GDBM, and of course Expect itself) will fail catastrophically, and other subtle breakages may also happen. From fe99d50d949255dbb5a9f28d9fcbaa05b4bc55a2 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sat, 10 Feb 2024 18:49:55 +0800 Subject: [PATCH 44/63] systemd: Fix a bug breaking systemd-verify an instantiated unit It's breaking Git test suite (and maybe other things). --- chapter01/changelog.xml | 10 ++++++++++ chapter01/whatsnew.xml | 12 ++++++++---- chapter03/patches.xml | 4 +--- chapter08/systemd.xml | 7 ++++--- patches.ent | 3 +++ 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index fa7fc12c4..0a646f658 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,6 +40,16 @@ appropriate for the entry or if needed the entire day's listitem. --> + + 2024-02-10 + + + [xry111] - Fix a bug in systemd breaking running + systemd-analyze on an instantiated systemd unit. + + + + 2024-02-02 diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml index 5faf938b7..f7b9ed05c 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -294,10 +294,6 @@ &bash-upstream-fixes-patch; - - setuptools-&setuptools-version; - - &pkgconf-upstream-fix-patch; @@ -306,6 +302,14 @@ &readline-fixes-patch; + + setuptools-&setuptools-version; + + + + &systemd-upstream-patch; + + diff --git a/chapter03/patches.xml b/chapter03/patches.xml index f05fbd604..c48e2ce0e 100644 --- a/chapter03/patches.xml +++ b/chapter03/patches.xml @@ -142,15 +142,13 @@ - Now fix a security vulnerability in the DNSSEC verification of - systemd-resolved: + systemd-resolved and a bug breaking running + systemd-analyze verify on an instantiated systemd + unit: -sed -e '/return FLAGS_SET.*AUTHENTICATED/s/(t/(dt/' \ - -i src/resolve/resolved-dns-transaction.c +patch -Np1 -i ../&systemd-upstream-patch; Prepare systemd for compilation: diff --git a/patches.ent b/patches.ent index a6e3a306e..b10f24414 100644 --- a/patches.ent +++ b/patches.ent @@ -38,3 +38,6 @@ + + + From b1998a2375cac0e9ecf56c663adde5263a2eb9a5 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Sat, 10 Feb 2024 12:28:12 +0100 Subject: [PATCH 45/63] Use http://cdn.docbook.org to run on other distros Upstream documentation has been changed a few years ago to point to https rather than http, but for example ubuntu-2023.10 still has only http in its catalog file. So use http here, and change the catalog file in blfs to have both http and https... --- stylesheets/lfs-xsl/lfs-l10n.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stylesheets/lfs-xsl/lfs-l10n.xml b/stylesheets/lfs-xsl/lfs-l10n.xml index 783bb1118..b47ee7f76 100644 --- a/stylesheets/lfs-xsl/lfs-l10n.xml +++ b/stylesheets/lfs-xsl/lfs-l10n.xml @@ -1,5 +1,5 @@ - + From 96026a103a050853137c244a66145e7006092f17 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Mon, 12 Feb 2024 11:05:36 -0600 Subject: [PATCH 46/63] Package updates. Update to shadow-4.14.4. Update to setuptools-69.1.0 (Python module). Update to python-3.12.2. Update to pkgconf-2.1.1. Update to MarkupSafe-2.1.5 (Python module). Update to man-pages-6.06. Update to expat-2.6.0. Update to linux-6.7.4. --- chapter01/changelog.xml | 38 ++++++++++++++++++++++++++++++++ chapter01/whatsnew.xml | 16 ++++++-------- chapter03/patches.xml | 4 ++-- chapter08/pkgconf.xml | 5 ----- packages.ent | 48 ++++++++++++++++++++--------------------- patches.ent | 4 ---- 6 files changed, 70 insertions(+), 45 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 0a646f658..f7bd0c405 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,6 +40,44 @@ appropriate for the entry or if needed the entire day's listitem. --> + + 2024-02-12 + + + [bdubbs] - Update to shadow-4.14.4. Fixes + #5437. + + + [bdubbs] - Update to setuptools-69.1.0 (Python module). Fixes + #5439. + + + [bdubbs] - Update to python-3.12.2. Fixes + #5434. + + + [bdubbs] - Update to pkgconf-2.1.1. Fixes + #5432. + + + [bdubbs] - Update to MarkupSafe-2.1.5 (Python module). Fixes + #5431. + + + [bdubbs] - Update to man-pages-6.06. Fixes + #5438. + + + [bdubbs] - Update to expat-2.6.0. Fixes + #5435. + + + [bdubbs] - Update to linux-6.7.4. Fixes + #5433. + + + + 2024-02-10 diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml index f7b9ed05c..d1cc11706 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -71,9 +71,9 @@ - + @@ -176,9 +176,9 @@ Man-DB-&man-db-version; - + MarkupSafe-&markupsafe-version; @@ -224,9 +224,9 @@ - Setuptools-&setuptools-version; - --> + Shadow-&shadow-version; @@ -294,10 +294,6 @@ &bash-upstream-fixes-patch; - - &pkgconf-upstream-fix-patch; - - &readline-fixes-patch; diff --git a/chapter03/patches.xml b/chapter03/patches.xml index c48e2ce0e..067dc9aea 100644 --- a/chapter03/patches.xml +++ b/chapter03/patches.xml @@ -117,7 +117,7 @@ --> - + Readline Upstream Fix Patch - &readline-fixes-patch-size;: diff --git a/chapter08/pkgconf.xml b/chapter08/pkgconf.xml index 139e0c810..3e7e737fa 100644 --- a/chapter08/pkgconf.xml +++ b/chapter08/pkgconf.xml @@ -44,11 +44,6 @@ Installation of Pkgconf - - Fix a regression in pkgconf-2.1.0 breaking BLFS packages: - - patch -Np1 -i ../&pkgconf-upstream-fix-patch; - Prepare Pkgconf for compilation: ./configure --prefix=/usr \ diff --git a/packages.ent b/packages.ent index 6d319968a..ccff2c3f2 100644 --- a/packages.ent +++ b/packages.ent @@ -156,10 +156,10 @@ - - + + - + @@ -431,12 +431,12 @@ - + - + - + - + - + - + - - + + @@ -631,18 +631,18 @@ - + - + - - + + - + diff --git a/patches.ent b/patches.ent index b10f24414..17966e30c 100644 --- a/patches.ent +++ b/patches.ent @@ -26,10 +26,6 @@ - - - - From d93d11b5bae6562aed6c51bf632feccd4a0b9657 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Wed, 14 Feb 2024 09:37:42 -0600 Subject: [PATCH 47/63] Package updates and stats updates. Update to meson-1.3.2. Update to shadow-4.14.5. --- chapter01/changelog.xml | 12 +++- packages.ent | 136 ++++++++++++++++++++-------------------- 2 files changed, 79 insertions(+), 69 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index f7bd0c405..43423619c 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,11 +40,21 @@ appropriate for the entry or if needed the entire day's listitem. --> + + 2024-02-14 + + + [bdubbs] - Update to meson-1.3.2. Fixes + #5442. + + + + 2024-02-12 - [bdubbs] - Update to shadow-4.14.4. Fixes + [bdubbs] - Update to shadow-4.14.5. Fixes #5437. diff --git a/packages.ent b/packages.ent index ccff2c3f2..9d7cf84df 100644 --- a/packages.ent +++ b/packages.ent @@ -18,7 +18,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -34,8 +34,8 @@ - - + + @@ -44,8 +44,8 @@ - - + + @@ -55,14 +55,14 @@ - + - + @@ -70,9 +70,9 @@ - + - + @@ -86,7 +86,7 @@ - + @@ -109,10 +109,10 @@ - + - - + + @@ -128,7 +128,7 @@ - + @@ -146,14 +146,14 @@ - + - + @@ -161,7 +161,7 @@ - + @@ -205,7 +205,7 @@ - + @@ -213,9 +213,9 @@ - + - + @@ -223,10 +223,10 @@ - - + + - + @@ -243,7 +243,7 @@ - + @@ -260,10 +260,10 @@ - - - - + + + + @@ -304,7 +304,7 @@ - + @@ -330,7 +330,7 @@ - + @@ -354,7 +354,7 @@ - + @@ -362,7 +362,7 @@ - + @@ -419,7 +419,7 @@ - + @@ -475,7 +475,7 @@ - + @@ -491,13 +491,13 @@ - + - + - + @@ -515,8 +515,8 @@ - - + + @@ -544,8 +544,8 @@ - - + + @@ -569,7 +569,7 @@ - + @@ -584,7 +584,7 @@ - + @@ -604,10 +604,10 @@ - - - - + + + + @@ -636,15 +636,15 @@ - - + + - - + + - + - + @@ -677,7 +677,7 @@ - + @@ -688,7 +688,7 @@ - + @@ -707,9 +707,9 @@ - - - + + + @@ -718,7 +718,7 @@ - + @@ -733,9 +733,9 @@ - + - + @@ -746,8 +746,8 @@ - - + + @@ -762,7 +762,7 @@ - + @@ -772,7 +772,7 @@ - + @@ -784,7 +784,7 @@ - + @@ -793,5 +793,5 @@ - + From 28614cdda5ef1b1173ea36b237a3b38c802dc93c Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Wed, 14 Feb 2024 15:41:22 -0600 Subject: [PATCH 48/63] Update descriptions for some test failures. --- chapter08/gcc.xml | 17 +++++++++++------ chapter08/glibc.xml | 5 +++++ chapter08/procps.xml | 2 ++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/chapter08/gcc.xml b/chapter08/gcc.xml index 84cf8a86f..b97b0b8cc 100644 --- a/chapter08/gcc.xml +++ b/chapter08/gcc.xml @@ -177,15 +177,20 @@ su tester -c "PATH=$PATH make -k check" files does not account for the - -enable-default-ssp option.--> - Two tests named copy.cc and - pr56837.c are known to fail. - + Eight gcc tests (out of over 185,000), data-model-4.c, pr56837.c, + and six "analyzer" tests are known to fail. + + One libstdc++ test (out of over 15000), copy.cc, is known to fail. + + For g++, 21 tests (out of approximately 250,000), 14 "AddressSanitizer*" + tests and 7 interception-malloc-test-1.C tests, are known to fail. + Additionally, several tests in the vect directory are known to fail if the hardware does not support AVX. - + A few unexpected failures cannot always be avoided. The GCC developers are usually aware of these issues, but have not resolved them yet. Unless the test results are vastly different from those at the above URL, diff --git a/chapter08/glibc.xml b/chapter08/glibc.xml index 64ed3b630..e8432fe19 100644 --- a/chapter08/glibc.xml +++ b/chapter08/glibc.xml @@ -163,6 +163,11 @@ esac is known to fail in the LFS chroot environment. + + Three nptl/tst-thread-affinity* + tests are known to fail. + + - + From 0800455fb6619c45f5313b3dbc74db88ec4922a4 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 18 Feb 2024 15:34:58 +0800 Subject: [PATCH 50/63] Glibc: Re-organize test failures and mention how to rule out timed out tests Glibc tests occansionally fail due to a timeout because: 1. The hardware is slower than the developers expected. 2. Some tests use multiple or even all CPU cores internally, for e.g. with 8 active CPU cores we may end up running 8 tests (due to -j8) each of them uses 8 cores in the worst case, resulting a severe congestion. I'm almost sure nptl/tst-thread-affinity* are cases of 2. Let's document how to rule out the timed out tests instead of making the list of known failures longer and longer. --- chapter08/glibc.xml | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/chapter08/glibc.xml b/chapter08/glibc.xml index e8432fe19..10fccb3a9 100644 --- a/chapter08/glibc.xml +++ b/chapter08/glibc.xml @@ -163,34 +163,34 @@ esac is known to fail in the LFS chroot environment. - - Three nptl/tst-thread-affinity* - tests are known to fail. - - - - - - - The stdlib/tst-arc4random-thread - test is known to fail if the host kernel is relatively old. - - Some tests, for example - nss/tst-nss-files-hosts-multi, - are known to fail on relatively slow systems due to an internal - timeout. + nss/tst-nss-files-hosts-multi and + nptl/tst-thread-affinity* + are known to fail due to a timeout (especially when the system is + relatively slow and/or running the test suite with multiple + parallel make jobs). These tests can be identified with: + + + grep "Timed out" -l $(find -name \*.out) + + It's possible to re-run a single test with enlarged timeout + with + TIMEOUTFACTOR=<factor> + make test t=<test name>. + For example, TIMEOUTFACTOR=10 make test + t=nss/tst-nss-files-hosts-multi will re-run + nss/tst-nss-files-hosts-multi with ten times + the original timeout. Additionally, some tests may fail with a relatively old CPU - model or host kernel version. + model (for example + elf/tst-cpu-features-cpuinfo) or host kernel + version (for example + stdlib/tst-arc4random-thread). From 5f2ba8ce99b9e189615f9ae975e9ea1b902173de Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 18 Feb 2024 22:09:17 +0800 Subject: [PATCH 51/63] gcc: Decorate test failures, remove outdated comments, ... move comments for upstream PR links to correct location. BTW data-model-4.c is also in analyzer directory, so we can just say 7 analyzer tests. --- chapter08/gcc.xml | 44 +++++++++++++------------------------------- 1 file changed, 13 insertions(+), 31 deletions(-) diff --git a/chapter08/gcc.xml b/chapter08/gcc.xml index b97b0b8cc..66f803273 100644 --- a/chapter08/gcc.xml +++ b/chapter08/gcc.xml @@ -172,48 +172,30 @@ su tester -c "PATH=$PATH make -k check" url="&test-results;"/> and . - - - Eight gcc tests (out of over 185,000), data-model-4.c, pr56837.c, - and six "analyzer" tests are known to fail. + + Eight gcc tests (out of over 185,000): + pr56837.c + and seven tests in the analyzer + directory are known to fail. - One libstdc++ test (out of over 15000), copy.cc, is known to fail. + + One libstdc++ test (out of over 15000), copy.cc, is + known to fail. - For g++, 21 tests (out of approximately 250,000), 14 "AddressSanitizer*" - tests and 7 interception-malloc-test-1.C tests, are known to fail. + For g++, 21 tests (out of approximately 250,000): 14 + AddressSanitizer* + tests and 7 interception-malloc-test-1.C tests, are + known to fail. Additionally, several tests in the vect directory are known to fail if the hardware does not support AVX. - + 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, it is safe to continue. - - Install the package: make install From 109afb297c1f15f2c6ccb33af74a486e3f7a8aa1 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 23 Feb 2024 03:33:14 +0800 Subject: [PATCH 52/63] dependencies: Kbd can use Linux-PAM The book already mentions the vlock program needs PAM to be built, but in dependencies page we say Kbd has no external optional dependencies. This is obviously incorrect... --- appendices/dependencies.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/appendices/dependencies.xml b/appendices/dependencies.xml index 158ed0f04..2fb197ffa 100644 --- a/appendices/dependencies.xml +++ b/appendices/dependencies.xml @@ -1566,7 +1566,9 @@ &external; - None + + Linux-PAM + From 3827fcf6e2e7c5ae7303e8a2c3af8f4b3b813874 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 23 Feb 2024 23:47:06 +0800 Subject: [PATCH 53/63] vim: Set TERM=xterm-256color for test I spent some time investigating the difference of vim test results from different editors. It turns out the value of TERM can affect the test results in a deterministic way: when TERM=xterm-256color all tests pass, when TERM=linux one test fails, and when TERM=vt100 20+ tests fail. As we are redirecting the output to a file, the actual type of the terminal does not matter and we can just specify a value known to work. --- chapter08/vim.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/chapter08/vim.xml b/chapter08/vim.xml index 030c50442..0a1af29be 100644 --- a/chapter08/vim.xml +++ b/chapter08/vim.xml @@ -71,10 +71,13 @@ Now run the tests as user tester: -su tester -c "LANG=en_US.UTF-8 make -j1 test" &> vim-test.log +su tester -c "TERM=xterm-256color LANG=en_US.UTF-8 make -j1 test" \ + &> vim-test.log The test suite outputs a lot of binary data to the screen. This can - cause issues with the settings of the current terminal. The problem can be + cause issues with the settings of the current terminal (especially while + we are overriding the TERM variable to satisify some + assumptions of the test suite). The problem can be avoided by redirecting the output to a log file as shown above. A successful test will result in the words "ALL DONE" in the log file at completion. From bd003a8a8c6bd262b5f00ebea8387ebc4cc2657b Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sat, 24 Feb 2024 13:15:49 +0800 Subject: [PATCH 54/63] glibc: Correctly mark revision='systemd' for a paragraph in update note --- chapter08/glibc.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter08/glibc.xml b/chapter08/glibc.xml index 10fccb3a9..486164cf9 100644 --- a/chapter08/glibc.xml +++ b/chapter08/glibc.xml @@ -258,7 +258,7 @@ esac rm -f /usr/sbin/nscd - + If this system (prior to LFS 12.1, exclusive) is based on Systemd, it's also needed to disable and stop the nscd service now: From 4aa6831f14175db6e3792cf84bb992fcfde832bd Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sat, 24 Feb 2024 13:24:20 +0800 Subject: [PATCH 55/63] glibc: Don't "overwrite" libcrypt.so.1* when updating As we've already concluded, overwriting a shared object can crash running processes using code or data from this shared object. For example if gdm is crashed, we may leave the system unusable :(. --- chapter08/glibc.xml | 2 +- chapter08/libxcrypt.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter08/glibc.xml b/chapter08/glibc.xml index 486164cf9..49eeceb1c 100644 --- a/chapter08/glibc.xml +++ b/chapter08/glibc.xml @@ -240,7 +240,7 @@ esac you MUST follow the note in Libxcrypt section to install libcrypt.so.1* - (overwritting + (replacing libcrypt.so.1 from the prior Glibc installation). diff --git a/chapter08/libxcrypt.xml b/chapter08/libxcrypt.xml index 7c6cc15ba..fb4c4adaa 100644 --- a/chapter08/libxcrypt.xml +++ b/chapter08/libxcrypt.xml @@ -110,7 +110,7 @@ --disable-static \ --disable-failure-tokens make -cp -av .libs/libcrypt.so.1* /usr/lib +cp -av --remove-destination .libs/libcrypt.so.1* /usr/lib From 64be5a4bfa0cde2defacc744d2f137edbea64c12 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 25 Feb 2024 00:53:31 +0800 Subject: [PATCH 56/63] dependencies: Gettext may use system libunistring When system libunistring is not installed (for eg building LFS), a shipped copy of libunistring is used. --- appendices/dependencies.xml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/appendices/dependencies.xml b/appendices/dependencies.xml index 2fb197ffa..d3fd94707 100644 --- a/appendices/dependencies.xml +++ b/appendices/dependencies.xml @@ -1047,7 +1047,15 @@ &external; - libxml2 + + + libunistring + + and + + libxml2 + + From 141a1fa181f9f5526bfb5d2129c319d31baf2698 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Mon, 26 Feb 2024 14:52:49 +0800 Subject: [PATCH 57/63] vim: Minor decoration --- chapter08/vim.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter08/vim.xml b/chapter08/vim.xml index 0a1af29be..88322132e 100644 --- a/chapter08/vim.xml +++ b/chapter08/vim.xml @@ -79,8 +79,8 @@ we are overriding the TERM variable to satisify some assumptions of the test suite). The problem can be avoided by redirecting the output to a log file as shown above. A - successful test will result in the words "ALL DONE" in the log file - at completion. + successful test will result in the words ALL + DONE in the log file at completion. Install the package: From 64ef2e93db6afd606da03af486b2354d77bdf34c Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 27 Feb 2024 00:40:57 +0800 Subject: [PATCH 58/63] coreutils: Comment out test-getlogin failure It seems fixed by the upstream. (Well, they'd claimed this "fixed" in 2014 but we were still seeing this failure in ten years. However let me trust the upstream once again...) Link: https://lists.gnu.org/archive/html/bug-gnulib/2022-06/msg00079.html --- chapter08/coreutils.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chapter08/coreutils.xml b/chapter08/coreutils.xml index 655e0dd66..94c276360 100644 --- a/chapter08/coreutils.xml +++ b/chapter08/coreutils.xml @@ -129,8 +129,14 @@ FORCE_UNSAFE_CONFIGURE=1 ./configure \ + understand it! The test-getlogin test may fail in the LFS chroot environment. + 20240226: Commented out as it seems the upstream has root-caused and + fixed the issue. I've checked the fix is in Coreutils 9.4 release + tarball: + + https://lists.gnu.org/archive/html/bug-gnulib/2022-06/msg00079.html +--> Remove the temporary group: From ed38e9d2cfd1c73d5dbb9ad5da63728412229718 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 27 Feb 2024 01:29:23 +0800 Subject: [PATCH 59/63] procps: Be more specific about the known ps test failure --- chapter08/procps.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chapter08/procps.xml b/chapter08/procps.xml index 5f3e5c6e6..9b014face 100644 --- a/chapter08/procps.xml +++ b/chapter08/procps.xml @@ -74,7 +74,10 @@ make check - One test in the "ps" tests is known to fail. + One test named + ps with output flag bsdtime,cputime,etime,etimes + is known to fail if the host kernel is not built with + CONFIG_BSD_PROCESS_ACCT enabled. Install the package: From 74f9697fdd649307ecd89ae99a7189e5fc387583 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 27 Feb 2024 17:43:47 +0800 Subject: [PATCH 60/63] changelog: Mark procps-4.0.4 as a security fix It contains a fix for CVE-2023-4016, rated low and only affecting 32-bit systems. --- chapter01/changelog.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 43423619c..72ef95ea8 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -697,7 +697,8 @@ #5330. - [bdubbs] - Update to procps-ng-4.0.4. Fixes + [bdubbs] - Update to procps-ng-4.0.4 (security fix + for 32-bit systems). Fixes #5335. From 4e486a2efc09142cc3b56d34e8254b729651e062 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Tue, 20 Feb 2024 14:54:50 -0600 Subject: [PATCH 61/63] Typo (cherry picked from commit 0c06e1e04885602e3eda558edb6ea1b6885cf277) --- chapter10/kernel.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter10/kernel.xml b/chapter10/kernel.xml index cf0b30f35..6eafeaf27 100644 --- a/chapter10/kernel.xml +++ b/chapter10/kernel.xml @@ -87,7 +87,7 @@ un-tarring. There are several ways to configure the kernel options. Usually, - This is done through a menu-driven interface, for example: + this is done through a menu-driven interface, for example: make menuconfig From 283f7119a0d5cc3c433159b3dbcdb8d9ab5c3e99 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Sun, 18 Feb 2024 13:44:30 -0600 Subject: [PATCH 62/63] Typos (cherry picked from commit a2808be815801c0b3bb2d7c1919b1623bb19c12e) --- appendices/dependencies.xml | 2 +- chapter08/glibc.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/appendices/dependencies.xml b/appendices/dependencies.xml index d3fd94707..9d92de448 100644 --- a/appendices/dependencies.xml +++ b/appendices/dependencies.xml @@ -2480,7 +2480,7 @@ &testsuites; - Iana-Etc, Less. and Procps-ng + Iana-Etc, Less, and Procps-ng diff --git a/chapter08/glibc.xml b/chapter08/glibc.xml index 49eeceb1c..39923c03b 100644 --- a/chapter08/glibc.xml +++ b/chapter08/glibc.xml @@ -535,7 +535,7 @@ unset ZONEINFO zic ... -p ... This creates the posixrules file. We use - New York because POSIX requires the daylight savings time rules + New York because POSIX requires the daylight saving time rules to be in accordance with US rules. From 23f436750e4bf87e802b9b6015197db4ec2561cc Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 27 Feb 2024 20:53:38 +0800 Subject: [PATCH 63/63] procps: Add "-k" for make check and document two additional failures --- chapter08/procps.xml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/chapter08/procps.xml b/chapter08/procps.xml index 9b014face..3f229c713 100644 --- a/chapter08/procps.xml +++ b/chapter08/procps.xml @@ -72,12 +72,20 @@ To run the test suite, run: -make check +make -k check One test named ps with output flag bsdtime,cputime,etime,etimes is known to fail if the host kernel is not built with - CONFIG_BSD_PROCESS_ACCT enabled. + CONFIG_BSD_PROCESS_ACCT enabled. + + Two tests named + pmap X with unreachable process and + pmap XX with unreachable process are known to + fail occasionally. Install the package: