From 03682b250cfd625619e149be9476fa6b1d5cbbc7 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Thu, 14 Dec 2023 14:16:13 -0600 Subject: [PATCH 01/12] Reformat util-linux configure parameters. --- chapter01/changelog.xml | 9 +++++++++ chapter07/util-linux.xml | 8 ++++---- chapter08/util-linux.xml | 10 +++++----- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 11df22160..2cf1b64e1 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,6 +40,15 @@ appropriate for the entry or if needed the entire day's listitem. --> + + 2023-12-14 + + + [bdubbs] - Reformat util-linux configure parameters. Fixes + #5395. + + + 2023-12-04 diff --git a/chapter07/util-linux.xml b/chapter07/util-linux.xml index 2f88e7d5f..b5aca7e7b 100644 --- a/chapter07/util-linux.xml +++ b/chapter07/util-linux.xml @@ -51,10 +51,8 @@ Prepare Util-linux for compilation: -./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \ - --libdir=/usr/lib \ +./configure --libdir=/usr/lib \ --runstatedir=/run \ - --docdir=/usr/share/doc/util-linux-&util-linux-version; \ --disable-chfn-chsh \ --disable-login \ --disable-nologin \ @@ -63,7 +61,9 @@ --disable-runuser \ --disable-pylibmount \ --disable-static \ - --without-python + --without-python \ + ADJTIME_PATH=/var/lib/hwclock/adjtime \ + --docdir=/usr/share/doc/util-linux-&util-linux-version; The meaning of the configure options: diff --git a/chapter08/util-linux.xml b/chapter08/util-linux.xml index a6d058aff..dc061bccf 100644 --- a/chapter08/util-linux.xml +++ b/chapter08/util-linux.xml @@ -48,8 +48,7 @@ Prepare Util-linux for compilation: -./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \ - --bindir=/usr/bin \ +./configure --bindir=/usr/bin \ --libdir=/usr/lib \ --runstatedir=/run \ --sbindir=/usr/sbin \ @@ -63,11 +62,11 @@ --disable-static \ --without-python \ --without-systemd \ - --without-systemdsystemunitdir \ + --without-systemdsystemunitdir \ + ADJTIME_PATH=/var/lib/hwclock/adjtime \ --docdir=/usr/share/doc/util-linux-&util-linux-version; -./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \ - --bindir=/usr/bin \ +./configure --bindir=/usr/bin \ --libdir=/usr/lib \ --runstatedir=/run \ --sbindir=/usr/sbin \ @@ -80,6 +79,7 @@ --disable-pylibmount \ --disable-static \ --without-python \ + ADJTIME_PATH=/var/lib/hwclock/adjtime \ --docdir=/usr/share/doc/util-linux-&util-linux-version; The --disable and --without options prevent warnings about From 04a7336f8821bd2413b03c5a8b487d10eea0ceec Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Thu, 14 Dec 2023 16:47:50 -0600 Subject: [PATCH 02/12] Package updates. Update to util-linux v2.39.3. Update to python3-3.12.1. Update to linux-6.6.7. Update to kbd-2.6.4. Update to bc-6.7.4. --- chapter01/changelog.xml | 21 +++++++++++++++++++++ packages.ent | 32 ++++++++++++++++---------------- 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 2cf1b64e1..eba63ec9f 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -43,12 +43,33 @@ 2023-12-14 + + [bdubbs] - Update to util-linux v2.39.3. Fixes + #5390. + + + [bdubbs] - Update to python3-3.12.1. Fixes + #5392. + + + [bdubbs] - Update to linux-6.6.7. Fixes + #5387. + + + [bdubbs] - Update to kbd-2.6.4. Fixes + #5393. + + + [bdubbs] - Update to bc-6.7.4. Fixes + #5389. + [bdubbs] - Reformat util-linux configure parameters. Fixes #5395. + 2023-12-04 diff --git a/packages.ent b/packages.ent index 50b140bf2..0d1a93f77 100644 --- a/packages.ent +++ b/packages.ent @@ -57,10 +57,10 @@ - + - + @@ -357,10 +357,10 @@ - - + + - + @@ -431,12 +431,12 @@ - + - + - + - + - + - + - - + + @@ -725,10 +725,10 @@ - - + + - + From 81d572d25f5e36fbe3bd6a2b12552be8d6a8ea8d Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Thu, 14 Dec 2023 18:49:05 -0600 Subject: [PATCH 03/12] Remove invalid revision attribute --- chapter01/changelog.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index eba63ec9f..58ec89bf0 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,7 +40,7 @@ appropriate for the entry or if needed the entire day's listitem. --> - + 2023-12-14 From 9afac649f272902fe78f5d83804f8d8270b6e62b Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 17 Dec 2023 06:42:54 +0800 Subject: [PATCH 04/12] Update to systemd-255 --- appendices/dependencies.xml | 1 + chapter01/changelog.xml | 13 ++++++++++++- chapter08/systemd.xml | 17 +++++++++++++++-- chapter08/udev.xml | 12 +++++++++--- packages.ent | 12 ++++++------ 5 files changed, 43 insertions(+), 12 deletions(-) diff --git a/appendices/dependencies.xml b/appendices/dependencies.xml index 30f2b05a6..3cbfe7b8b 100644 --- a/appendices/dependencies.xml +++ b/appendices/dependencies.xml @@ -2935,6 +2935,7 @@ make-ca, p11-kit, PCRE2, + pefile, Polkit, pyelftools, qemu, diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 58ec89bf0..d8182189f 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,12 +40,23 @@ appropriate for the entry or if needed the entire day's listitem. --> + + 2023-12-16 + + + [xry111] - Update to udev + from systemd-255. Fixes + #5390. + + + + 2023-12-14 [bdubbs] - Update to util-linux v2.39.3. Fixes - #5390. + #5388. [bdubbs] - Update to python3-3.12.1. Fixes diff --git a/chapter08/systemd.xml b/chapter08/systemd.xml index 761467acd..a1999e278 100644 --- a/chapter08/systemd.xml +++ b/chapter08/systemd.xml @@ -62,13 +62,14 @@ meson setup \ -Dldconfig=false \ -Dsysusers=false \ -Drpmmacrosdir=no \ - -Dhomed=false \ + -Dhomed=disabled \ -Duserdb=false \ -Dman=false \ -Dmode=release \ -Dpamconfdir=no \ -Ddev-kvm-mode=0660 \ -Dnobody-group=nogroup \ + -Dukify=disabled \ -Ddocdir=/usr/share/doc/systemd-&systemd-version; \ .. @@ -139,7 +140,8 @@ meson setup \ - -D{userdb,homed}=false + -Dhomed=disabled and + -Duserdb=false Remove two daemons with dependencies that do not fit within the scope of LFS. @@ -187,6 +189,17 @@ meson setup \ nogroup. + + + -Dukify=disabled + + Do not install the systemd-ukify script. + At runtime this script requires the + pefile Python module that neither LFS + nor BLFS provides. + + + Compile the package: diff --git a/chapter08/udev.xml b/chapter08/udev.xml index dd686f489..967b3dd84 100644 --- a/chapter08/udev.xml +++ b/chapter08/udev.xml @@ -125,11 +125,18 @@ meson setup \ + Get the list of the shipped udev helpers and save it into an + environment variable: + + udev_helpers=$(grep "'name' :" ../src/udev/meson.build | \ + awk '{print $3}' | tr -d ",'" | grep -v 'udevadm') + Only build the components needed for udev: ninja udevadm systemd-hwdb \ $(ninja -n | grep -Eo '(src/(lib)?udev|rules.d|hwdb.d)/[^ ]*') \ - $(realpath libudev.so --relative-to .) + $(realpath libudev.so --relative-to .) \ + $udev_helpers udevadm Install the package: @@ -147,8 +154,7 @@ install -vm644 rules.d/* ../rules.d/README /usr/lib/udev/rules.d/ install -vm644 $(find ../rules.d/*.rules \ -not -name '*power-switch*') /usr/lib/udev/rules.d/ install -vm644 hwdb.d/* ../hwdb.d/{*.hwdb,README} /usr/lib/udev/hwdb.d/ -install -vm755 $(find src/udev \ - -type f -not -name '*.*') /usr/lib/udev +install -vm755 $udev_helpers /usr/lib/udev install -vm644 ../network/99-default.link /usr/lib/udev/network Install some custom rules and support files useful in an LFS diff --git a/packages.ent b/packages.ent index 0d1a93f77..df970d61f 100644 --- a/packages.ent +++ b/packages.ent @@ -652,20 +652,20 @@ - + - + - + - - + + - + From 7380559028367ee1f0da6125d1f30f3b0a64a290 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Mon, 18 Dec 2023 16:36:28 +0800 Subject: [PATCH 05/12] systemd: Disable systemd-sysupdate with a better way --- chapter08/systemd.xml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/chapter08/systemd.xml b/chapter08/systemd.xml index a1999e278..58ede8508 100644 --- a/chapter08/systemd.xml +++ b/chapter08/systemd.xml @@ -69,6 +69,7 @@ meson setup \ -Dpamconfdir=no \ -Ddev-kvm-mode=0660 \ -Dnobody-group=nogroup \ + -Dsysupdate=disabled \ -Dukify=disabled \ -Ddocdir=/usr/share/doc/systemd-&systemd-version; \ .. @@ -190,6 +191,17 @@ meson setup \ + + -Dsysupdate=disabled + + Do not install the systemd-sysupdate + tool. It's designed for automatically upgrading binary distros, + so it's useless for a basic Linux system built from source. + And it will report errors on boot if it's enabled but not properly + configured. + + + -Dukify=disabled @@ -227,12 +239,6 @@ meson setup \ systemctl preset-all - Disable two services for upgrading binary distros. They are useless for - a basic Linux system built from source, and each one will report an error if - it's enabled but not configured: - -systemctl disable systemd-sysupdate{,-reboot} - make check - - The test time for autoconf can be reduced significantly on a - system with multiple cores. To do this, append - TESTSUITEFLAGS=-j<N> to the line above. For - instance, using -j4 can reduce the test time by over 60 - percent. Install the package: diff --git a/chapter08/libtool.xml b/chapter08/libtool.xml index d21d0b751..d73bd6efb 100644 --- a/chapter08/libtool.xml +++ b/chapter08/libtool.xml @@ -54,12 +54,6 @@ make -k check - The test time for Libtool can be reduced significantly on a - system with multiple cores. To do this, append - TESTSUITEFLAGS=-j<N> to the line above. For - instance, using -j4 can reduce the test time by over 60 - percent. - 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 diff --git a/chapter08/tar.xml b/chapter08/tar.xml index ea5f44ebb..802f04d2e 100644 --- a/chapter08/tar.xml +++ b/chapter08/tar.xml @@ -72,13 +72,6 @@ make check - - The test time for Tar can be reduced significantly on a - system with multiple cores. To do this, append - TESTSUITEFLAGS=-j<N> to the line above. For - instance, using -j4 can reduce the test time by over 70 - percent. - One test, capabilities: binary store/restore, is known to fail if it is run because LFS lacks selinux, but will be skipped if the host kernel does not support extended attributes or security labels on the filesystem From 462ef6dfa4fce8610eec8001aa7b1b7794037e71 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 31 Dec 2023 01:06:22 +0800 Subject: [PATCH 09/12] gen-changelog: Handles holding tickets --- gen-changelog.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/gen-changelog.py b/gen-changelog.py index e7ee1d7e7..3bf6bc064 100755 --- a/gen-changelog.py +++ b/gen-changelog.py @@ -76,6 +76,8 @@ for i in tsv: security.add(pkg) ticket[pkg] = tic +hold_ticket = {'vim': '4500', 'iana-etc': '5006'} + print("Plain Text:") for (s, act) in [(upd, "Update to "), (add, "Add ")]: for i in s: @@ -83,6 +85,8 @@ for (s, act) in [(upd, "Update to "), (add, "Add ")]: out = act + pkgver if pkgver in ticket: out += ' (#' + ticket[pkgver] + ')' + elif i in hold_ticket: + out += ' (#' + hold_ticket[i] + ')' print("-", out) for i in rem: print("-", "Remove", i) @@ -99,10 +103,18 @@ for (s, act) in [(upd, "Update to "), (add, "Add ")]: if pkgver in security: out += " (security fix)" out += "." + + pkg_ticket = None if pkgver in ticket: out += " Fixes\n " - out += "#" - out += ticket[pkgver] + "." + pkg_ticket = ticket[pkgver] + elif i in hold_ticket: + out += " Addresses\n " + pkg_ticket = hold_ticket[i] + + if pkg_ticket: + out += "#" + out += pkg_ticket + "." out += "" print(out) print(' ') From d4ce302c0e94aa2aea766eb14f78c965b823360c Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 31 Dec 2023 01:58:11 +0800 Subject: [PATCH 10/12] Package updates - Update to meson-1.3.1 (#5402) - Update to vim-9.0.2189 (#4500) - Update to inetutils-2.5 (#5404) - Update to xml-parser-2.47 (#5403) - Update to linux-6.6.8 (#5397) - Update to tzdata-2023d (#5399) - Update to setuptools-69.0.3 (#5400) - Update to iana-etc-20231205 (#5006) - Update to autoconf-2.72 (#5398) - Update to grub-2.12 (#5396) --- chapter01/changelog.xml | 46 ++++++++++++++++++++++++++++++++ chapter01/whatsnew.xml | 24 ++++++++++------- chapter03/patches.xml | 8 ------ chapter08/autoconf.xml | 6 ----- chapter08/grub.xml | 7 ++--- packages.ent | 58 ++++++++++++++++++++--------------------- patches.ent | 4 --- 7 files changed, 91 insertions(+), 62 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index d8182189f..fef105ece 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,6 +40,52 @@ appropriate for the entry or if needed the entire day's listitem. --> + + 2023-12-31 + + + [xry111] - Update to iana-etc-20231205. Addresses + #5006. + + + [xry111] - Update to tzdata-2023d. Fixes + #5399. + + + [xry111] - Update to linux-6.6.8. Fixes + #5397. + + + [xry111] - Update to meson-1.3.1. Fixes + #5402. + + + [xry111] - Update to grub-2.12. Fixes + #5396. + + + [xry111] - Update to inetutils-2.5. Fixes + #5404. + + + [xry111] - Update to setuptools-69.0.3. Fixes + #5400. + + + [xry111] - Update to xml-parser-2.47. Fixes + #5403. + + + [xry111] - Update to vim-9.0.2189. Addresses + #4500. + + + [xry111] - Update to autoconf-2.72. Fixes + #5398. + + + + 2023-12-16 diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml index bd97a81f0..e8002fcf6 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -32,9 +32,9 @@ - + @@ -116,18 +116,18 @@ - + Gzip-&gzip-version; Iana-Etc-&iana-etc-version; - + @@ -248,9 +248,9 @@ Texinfo-&texinfo-version; - + @@ -263,9 +263,9 @@ Wheel-&wheel-version; - + Xz-&xz-version; @@ -312,6 +312,10 @@ glibc-2.38-memalign_fix-1.patch + + grub-2.06-upstream_fixes-1.patch + + readline-8.2-upstream_fix-1.patch diff --git a/chapter03/patches.xml b/chapter03/patches.xml index 00628bda7..2073638fc 100644 --- a/chapter03/patches.xml +++ b/chapter03/patches.xml @@ -93,14 +93,6 @@ - - GRUB Upstream Fixes Patch - &grub-upstream-fixes-patch-size;: - - Download: - MD5 sum: &grub-upstream-fixes-patch-md5; - - - Kbd Backspace/Delete Fix Patch - &kbd-backspace-patch-size;: diff --git a/chapter08/autoconf.xml b/chapter08/autoconf.xml index 8b2afb168..120f31632 100644 --- a/chapter08/autoconf.xml +++ b/chapter08/autoconf.xml @@ -41,12 +41,6 @@ Installation of Autoconf - First, fix several problems with the tests caused by bash-5.2 and later: - - sed -e 's/SECONDS|/&SHLVL|/' \ - -e '/BASH_ARGV=/a\ /^SHLVL=/ d' \ - -i.orig tests/local.at - Prepare Autoconf for compilation: ./configure --prefix=/usr diff --git a/chapter08/grub.xml b/chapter08/grub.xml index 357036c34..a89963189 100644 --- a/chapter08/grub.xml +++ b/chapter08/grub.xml @@ -62,13 +62,10 @@ - Fix an issue causing grub-install to fail when the - /boot partition (or the root - partition if /boot is not a - separate partition) is created by e2fsprogs-1.47.0 or later: + Add a file missing from the release tarball: -patch -Np1 -i ../grub-&grub-version;-upstream_fixes-1.patch +echo depends bli part_gpt > grub-core/extra_deps.lst Prepare GRUB for compilation: diff --git a/packages.ent b/packages.ent index df970d61f..2caa1f663 100644 --- a/packages.ent +++ b/packages.ent @@ -29,10 +29,10 @@ - - + + - + @@ -299,10 +299,10 @@ - - + + - + @@ -317,18 +317,18 @@ - - + + - + - - + + - + @@ -431,12 +431,12 @@ - + - + - + - + - + @@ -754,10 +754,10 @@ - - + + - + diff --git a/patches.ent b/patches.ent index 13f291e0f..6c03b9728 100644 --- a/patches.ent +++ b/patches.ent @@ -18,10 +18,6 @@ - - - - From 8b4fb1245dcde0370bb84c2653e3e9bb01cbae87 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 31 Dec 2023 02:04:21 +0800 Subject: [PATCH 11/12] systemd: Fix CVE-2023-7008 (#5405) --- chapter01/changelog.xml | 4 ++++ chapter08/systemd.xml | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index fef105ece..756e9d5fc 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -43,6 +43,10 @@ 2023-12-31 + + [xry111] - Fix CVE-2023-7008 for systemd-255. Fixes + #5405. + [xry111] - Update to iana-etc-20231205. Addresses #5006. diff --git a/chapter08/systemd.xml b/chapter08/systemd.xml index 58ede8508..de5a668d1 100644 --- a/chapter08/systemd.xml +++ b/chapter08/systemd.xml @@ -48,6 +48,13 @@ sed -i -e 's/GROUP="render"/GROUP="video"/' \ -e 's/GROUP="sgx", //' rules.d/50-udev-default.rules.in + + Now fix a security vulnerability in the DNSSEC verification of + systemd-resolved: + +sed -e '/return FLAGS_SET.*AUTHENTICATED/s/(t/(dt/' \ + -i src/resolve/resolved-dns-transaction.c + Prepare systemd for compilation: mkdir -p build From 6fec3f51e71f36219829eddd63b1cf6e11bcd447 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 31 Dec 2023 02:33:59 +0800 Subject: [PATCH 12/12] binutils: Add --enable-default-hash-style=gnu for configure (#5401) --- chapter01/changelog.xml | 5 +++++ chapter05/binutils-pass1.xml | 19 ++++++++++++++++++- chapter06/binutils-pass2.xml | 3 ++- chapter08/binutils.xml | 14 ++++---------- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 756e9d5fc..de94d85d9 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -43,6 +43,11 @@ 2023-12-31 + + [xry111] - Add --enable-default-hash-style=gnu configuring + binutils. Fixes + #5401. + [xry111] - Fix CVE-2023-7008 for systemd-255. Fixes #5405. diff --git a/chapter05/binutils-pass1.xml b/chapter05/binutils-pass1.xml index 65e8dd2ae..c3bf1f117 100644 --- a/chapter05/binutils-pass1.xml +++ b/chapter05/binutils-pass1.xml @@ -75,7 +75,8 @@ cd build --target=$LFS_TGT \ --disable-nls \ --enable-gprofng=no \ - --disable-werror + --disable-werror \ + --enable-default-hash-style=gnu The meaning of the configure options: @@ -132,6 +133,22 @@ cd build + + --enable-default-hash-style=gnu + + By default, the linker would generate both the GNU-style + hash table and the classic ELF hash table for shared libraries and + dynamically linked executables. The hash tables are only intended + for a dynamic linker to perform symbol lookup. On LFS the dynamic + linker (provided by the Glibc package) will always use the + GNU-style hash table which is faster to query. So the classic + ELF hash table is completely useless. This makes the the linker + only generate the GNU-style hash table by default, so we can avoid + wasting time to generate the classic ELF hash table when we build + the packages, or wasting disk space to store it. + + + Continue with compiling the package: diff --git a/chapter06/binutils-pass2.xml b/chapter06/binutils-pass2.xml index 983aaee2f..15582f937 100644 --- a/chapter06/binutils-pass2.xml +++ b/chapter06/binutils-pass2.xml @@ -72,7 +72,8 @@ cd build --enable-shared \ --enable-gprofng=no \ --disable-werror \ - --enable-64-bit-bfd + --enable-64-bit-bfd \ + --enable-default-hash-style=gnu The meaning of the new configure options: diff --git a/chapter08/binutils.xml b/chapter08/binutils.xml index 1fd436bd1..9e93e55f0 100644 --- a/chapter08/binutils.xml +++ b/chapter08/binutils.xml @@ -57,9 +57,11 @@ cd build --enable-shared \ --disable-werror \ --enable-64-bit-bfd \ - --with-system-zlib + --with-system-zlib \ + --enable-default-hash-style=gnu + - The meaning of the configure parameters: + The meaning of the new configure parameters: --enable-gold @@ -84,14 +86,6 @@ cd build - - --enable-64-bit-bfd - - Enables 64-bit support (on hosts with narrower word sizes). - May not be needed on 64-bit systems, but does no harm. - - - --with-system-zlib