From c7ee38fb5ad62d2153980b4a2518cc5d527a1c86 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 16 Jul 2023 10:04:12 +0800 Subject: [PATCH 01/10] bootscripts: Use /bin/udevadm instead of /sbin/udevadm We are switching from eudev to systemd-udev for SysV. Systemd installs udevadm into /usr/bin, and at least a part of its function can be used as non-root user, so we'll no longer put it into /usr/sbin. --- bootscripts/ChangeLog | 3 +++ bootscripts/lfs/init.d/udev | 8 ++++---- bootscripts/lfs/init.d/udev_retry | 6 ++---- packages.ent | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/bootscripts/ChangeLog b/bootscripts/ChangeLog index c7a3d9a7b..0c1d33f6d 100644 --- a/bootscripts/ChangeLog +++ b/bootscripts/ChangeLog @@ -1,3 +1,6 @@ +2023-07-15 Xi Ruoyao + * Use /bin/udevadm instead of /sbin/udevadm. + 2022-09-30 Bruce Dubbs * Mount /dev/shm as a tmpfs. diff --git a/bootscripts/lfs/init.d/udev b/bootscripts/lfs/init.d/udev index c74c8e19f..612685af7 100644 --- a/bootscripts/lfs/init.d/udev +++ b/bootscripts/lfs/init.d/udev @@ -49,13 +49,13 @@ case "${1}" in # Now traverse /sys in order to "coldplug" devices that have # already been discovered - /sbin/udevadm trigger --action=add --type=subsystems - /sbin/udevadm trigger --action=add --type=devices - /sbin/udevadm trigger --action=change --type=devices + /bin/udevadm trigger --action=add --type=subsystems + /bin/udevadm trigger --action=add --type=devices + /bin/udevadm trigger --action=change --type=devices # Now wait for udevd to process the uevents we triggered if ! is_true "$OMIT_UDEV_SETTLE"; then - /sbin/udevadm settle + /bin/udevadm settle fi # If any LVM based partitions are on the system, ensure they diff --git a/bootscripts/lfs/init.d/udev_retry b/bootscripts/lfs/init.d/udev_retry index 112846a03..ccac9a2bd 100644 --- a/bootscripts/lfs/init.d/udev_retry +++ b/bootscripts/lfs/init.d/udev_retry @@ -34,8 +34,6 @@ case "${1}" in start) log_info_msg "Retrying failed uevents, if any..." - # As of udev-186, the --run option is no longer valid - #rundir=$(/sbin/udevadm info --run) rundir=/run/udev # From Debian: "copy the rules generated before / was mounted # read-write": @@ -52,13 +50,13 @@ case "${1}" in /bin/sed -e 's/#.*$//' /etc/sysconfig/udev_retry | /bin/grep -v '^$' | \ while read line ; do for subsystem in $line ; do - /sbin/udevadm trigger --subsystem-match=$subsystem --action=add + /bin/udevadm trigger --subsystem-match=$subsystem --action=add done done # Now wait for udevd to process the uevents we triggered if ! is_true "$OMIT_UDEV_RETRY_SETTLE"; then - /sbin/udevadm settle + /bin/udevadm settle fi evaluate_retval diff --git a/packages.ent b/packages.ent index 2abb800d1..8e0a2d222 100644 --- a/packages.ent +++ b/packages.ent @@ -390,7 +390,7 @@ - + From a289860668ca293abca38227ae3a0721d2558688 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 16 Jul 2023 11:02:09 +0800 Subject: [PATCH 02/10] Replace eudev with udev from systemd --- appendices/udev-rules.xml | 2 +- chapter01/changelog.xml | 4 + chapter01/whatsnew.xml | 14 ++- chapter03/packages.xml | 10 +- chapter08/chapter08.xml | 2 +- chapter08/eudev.xml | 202 ------------------------------- chapter08/udev.xml | 245 ++++++++++++++++++++++++++++++++++++++ chapter09/network.xml | 2 +- packages.ent | 10 +- 9 files changed, 267 insertions(+), 224 deletions(-) delete mode 100644 chapter08/eudev.xml create mode 100644 chapter08/udev.xml diff --git a/appendices/udev-rules.xml b/appendices/udev-rules.xml index d1ab70dcf..ca1a7c88b 100644 --- a/appendices/udev-rules.xml +++ b/appendices/udev-rules.xml @@ -13,7 +13,7 @@ Udev configuration rules The rules in this appendix are listed for convenience. Installation is - normally done via instructions in . + normally done via instructions in . 55-lfs.rules diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index e13faf328..18ac4f3f7 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -43,6 +43,10 @@ 2023-07-15 + + [xry111] - Replace eudev-3.2.12 with udev from systemd-253. + Fixes #5085. + [bdubbs] - Update to iana-etc-20230629. Addresses #5006. diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml index a2d4cc179..e2803d08c 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -91,9 +91,9 @@ - - Eudev-&eudev-version; - + @@ -304,6 +304,10 @@ Added: + + Udev-&systemd-version; (from systemd) + + Libxcrypt-&libxcrypt-version; @@ -333,6 +337,10 @@ Removed: + + eudev-3.2.12 + + Pkg-config-0.29.2 diff --git a/chapter03/packages.xml b/chapter03/packages.xml index 86932b428..30474944c 100644 --- a/chapter03/packages.xml +++ b/chapter03/packages.xml @@ -174,14 +174,6 @@ - - Eudev (&eudev-version;) - &eudev-size;: - - Download: - MD5 sum: &eudev-md5; - - - Expat (&expat-version;) - &expat-size;: @@ -697,7 +689,7 @@ - + Systemd (&systemd-version;) - &systemd-size;: Home page: diff --git a/chapter08/chapter08.xml b/chapter08/chapter08.xml index e97ae7057..3f356d39e 100644 --- a/chapter08/chapter08.xml +++ b/chapter08/chapter08.xml @@ -91,7 +91,7 @@ - + diff --git a/chapter08/eudev.xml b/chapter08/eudev.xml deleted file mode 100644 index 785e70103..000000000 --- a/chapter08/eudev.xml +++ /dev/null @@ -1,202 +0,0 @@ - - - %general-entities; -]> - - - - - - eudev - &eudev-version; -
&eudev-url;
-
- - Eudev-&eudev-version; - - - Eudev - - - - - - <para>The Eudev package contains programs for dynamic creation of device - nodes.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&eudev-fin-sbu;</seg> - <seg>&eudev-fin-du;</seg> - </seglistitem> - </segmentedlist> - </sect2> - - <sect2 role="installation"> - <title>Installation of Eudev - - - Remove an unneeded group - sgx, from the default udev - rules: - -sed -i -e 's/GROUP="sgx", //' rules/50-udev-default.rules - - Prepare Eudev for compilation: - -./configure --prefix=/usr \ - --bindir=/usr/sbin \ - --sysconfdir=/etc \ - --enable-manpages \ - --disable-static - - Compile the package: - -make - - Create some directories now that are needed for tests, but - will also be used as a part of installation: - -mkdir -pv /usr/lib/udev/rules.d -mkdir -pv /etc/udev/rules.d - - To test the results, issue: - -make check - - Install the package: - -make install - - Install some custom rules and support files useful in an LFS - environment: - -tar -xvf ../&udev-lfs-version;.tar.xz -make -f &udev-lfs-version;/Makefile.lfs install - - - - - Configuring Eudev - - - Eudev - configuring - - - - /etc/udev/rules.d/65-kvm.rules - - - - The default udev rule installed by Eudev would allow all users to - access /dev/kvm. The editors - consider it dangerous. Create a configuration file to override it: - - -cat > /etc/udev/rules.d/65-kvm.rules << "EOF" -KERNEL=="kvm", GROUP="kvm", MODE="0660", TAG+="uaccess" -EOF - - - /etc/udev/hwdb.bin - - - Information about hardware devices is maintained in the - /etc/udev/hwdb.d and - /usr/lib/udev/hwdb.d directories. - Eudev needs that information to be compiled - into a binary database /etc/udev/hwdb.bin. Create the - initial database: - -udevadm hwdb --update - - This command needs to be run each time the hardware information is - updated. - - - - - Contents of Eudev - - - Installed programs - Installed libraries - Installed directories - - - udevadm and udevd - - libudev.so - - /etc/udev, /usr/lib/udev, and /usr/share/doc/udev-&udev-lfs-version; - - - - - Short Descriptions - - - - udevadm - - Generic udev administration tool: controls the udevd daemon, - provides info from the Udev database, monitors uevents, waits for - uevents to finish, tests Udev configuration, and triggers uevents - for a given device - - udevadm - - - - - - udevd - - A daemon that listens for uevents on the netlink socket, - creates devices and runs the configured external programs in - response to these uevents - - udevd - - - - - - libudev - - A library interface to udev device information - - libudev - - - - - - /etc/udev - - Contains Udev configuration files, - device permissions, and rules for device naming - - /etc/udev - - - - - - - - -
diff --git a/chapter08/udev.xml b/chapter08/udev.xml new file mode 100644 index 000000000..c1e2af312 --- /dev/null +++ b/chapter08/udev.xml @@ -0,0 +1,245 @@ + + + %general-entities; +]> + + + + + + udev + &systemd-version; +
&systemd-url;
+
+ + Udev from Systemd-&systemd-version; + + + Udev + + + + + + <para>The Udev package contains programs for dynamic creation of device + nodes.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&udev-fin-sbu;</seg> + <seg>&udev-fin-du;</seg> + </seglistitem> + </segmentedlist> + </sect2> + + <sect2 role="installation"> + <title>Installation of Udev + + Udev is part of the systemd-&systemd-version; package. Use + the systemd-&systemd-version;.tar.xz file as the source tarball. + + Remove two unneeded groups, + render and + sgx, from the default udev + rules: + + sed -i -e 's/GROUP="render"/GROUP="video"/' \ + -e 's/GROUP="sgx", //' rules.d/50-udev-default.rules.in + + Prepare Udev for compilation: + +mkdir -p build +cd build + +meson setup \ + --prefix=/usr \ + --buildtype=release \ + -Dmode=release \ + -Ddev-kvm-mode=0660 \ + -Dlink-udev-shared=false \ + .. + + + The meaning of the meson options: + + + --buildtype=release + + This switch overrides the default buildtype + (debug), which produces unoptimized + binaries. + + + + + -Dmode=release + + Disable some features considered experimental by upstream. + + + + + + -Ddev-kvm-mode=0660 + + The default udev rule would allow all users to access + /dev/kvm. The editors + consider it dangerous. This option overrides it. + + + + + -Dlink-udev-shared=false + + This option prevents udev from linking to the internal + systemd shared library, + libsystemd-shared. + This library is designed to be shared by many Systemd components + and it's too overkill for a udev-only installation. + + + + + Only build the components needed for udev: + + ninja udevadm systemd-hwdb \ + $(grep -o -E "^build (src/libudev|src/udev|rules.d|hwdb.d)[^:]*" \ + build.ninja | awk '{ print $2 }') \ + $(realpath libudev.so --relative-to .) + + Install the package: + + install -vm755 -d {/usr/lib,/etc}/udev/{hwdb,rules}.d +install -vm755 udevadm /usr/bin/ +install -vm755 systemd-hwdb /usr/bin/udev-hwdb +ln -sv ../bin/udevadm /usr/sbin/udevd +cp -av libudev.so{,*[0-9]} /usr/lib/ +install -vm644 ../src/libudev/libudev.h /usr/include/ +install -vm644 src/libudev/*.pc /usr/lib/pkgconfig/ +install -vm644 src/udev/*.pc /usr/share/pkgconfig/ +install -vm644 ../src/udev/udev.conf /etc/udev/ +install -vm644 rules.d/* ../rules.d/{*.rules,README} /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 | grep -F -v ".") /usr/lib/udev + + Install some custom rules and support files useful in an LFS + environment: + +tar -xvf ../../&udev-lfs-version;.tar.xz +make -f &udev-lfs-version;/Makefile.lfs install + + + + + Configuring Udev + + + Udev + configuring + + + + /etc/udev/hwdb.bin + + + Information about hardware devices is maintained in the + /etc/udev/hwdb.d and + /usr/lib/udev/hwdb.d directories. + Udev needs that information to be compiled + into a binary database /etc/udev/hwdb.bin. Create the + initial database: + +udev-hwdb update + + This command needs to be run each time the hardware information is + updated. + + + + + Contents of Udev + + + Installed programs + Installed libraries + Installed directories + + + udevadm, udevd (symlink to udevadm), and udev-hwdb + + libudev.so + + /etc/udev and /usr/lib/udev + + + + + Short Descriptions + + + + udevadm + + Generic udev administration tool: controls the udevd daemon, + provides info from the Udev database, monitors uevents, waits for + uevents to finish, tests Udev configuration, and triggers uevents + for a given device + + udevadm + + + + + + udevd + + A daemon that listens for uevents on the netlink socket, + creates devices and runs the configured external programs in + response to these uevents + + udevd + + + + + + udev-hwdb + + Updates or query the hardware database. + + udev-hwdb + + + + + + libudev + + A library interface to udev device information + + libudev + + + + + + /etc/udev + + Contains Udev configuration files, + device permissions, and rules for device naming + + /etc/udev + + + + + + + + +
diff --git a/chapter09/network.xml b/chapter09/network.xml index e2d0a5edf..c86edf56a 100644 --- a/chapter09/network.xml +++ b/chapter09/network.xml @@ -37,7 +37,7 @@ The interface names depend on the implementation and configuration of the udev daemon running on the system. The udev - daemon for LFS (installed in ) will + daemon for LFS (installed in ) will not run until the LFS system is booted. So the interface names in the LFS system cannot always be determined by running those commands on the host distro, diff --git a/packages.ent b/packages.ent index 8e0a2d222..ab075f7a4 100644 --- a/packages.ent +++ b/packages.ent @@ -156,13 +156,6 @@ - - - - - - - @@ -713,6 +706,9 @@ + + + From 13288b9165e60ff8537091d8dbd49cdf91485efa Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 16 Jul 2023 11:08:36 +0800 Subject: [PATCH 03/10] SysV: Add MarkupSafe and Jinja2 Jinja2 is needed for building udev from systemd. --- chapter01/whatsnew.xml | 8 ++++++++ chapter03/packages.xml | 4 ++-- chapter08/jinja2.xml | 2 +- chapter08/markupsafe.xml | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml index e2803d08c..bd3843566 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -308,6 +308,14 @@ Udev-&systemd-version; (from systemd)
+ + Jinja2-&jinja2-version; + + + + MarkupSafe-&markupsafe-version; + + Libxcrypt-&libxcrypt-version; diff --git a/chapter03/packages.xml b/chapter03/packages.xml index 30474944c..3e8277b37 100644 --- a/chapter03/packages.xml +++ b/chapter03/packages.xml @@ -379,7 +379,7 @@
- + Jinja2 (&jinja2-version;) - &jinja2-size;: Home page: @@ -528,7 +528,7 @@ - + MarkupSafe (&markupsafe-version;) - &markupsafe-size;: Home page: diff --git a/chapter08/jinja2.xml b/chapter08/jinja2.xml index 8fa12dd25..ca614ecdc 100644 --- a/chapter08/jinja2.xml +++ b/chapter08/jinja2.xml @@ -5,7 +5,7 @@ %general-entities; ]> - + diff --git a/chapter08/markupsafe.xml b/chapter08/markupsafe.xml index 27fdb1627..b4a0cbc58 100644 --- a/chapter08/markupsafe.xml +++ b/chapter08/markupsafe.xml @@ -5,7 +5,7 @@ %general-entities; ]> - + From cce6c924637464556f437bb9eb417967966c5be1 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 16 Jul 2023 11:58:01 +0800 Subject: [PATCH 04/10] udev: Install man pages from systemd man pages tarball --- chapter03/packages.xml | 2 +- chapter08/udev.xml | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/chapter03/packages.xml b/chapter03/packages.xml index 3e8277b37..4db7bb5a1 100644 --- a/chapter03/packages.xml +++ b/chapter03/packages.xml @@ -698,7 +698,7 @@ - + Systemd Man Pages(&systemd-version;) - &systemd-man-size;: Home page: diff --git a/chapter08/udev.xml b/chapter08/udev.xml index c1e2af312..4e79ef899 100644 --- a/chapter08/udev.xml +++ b/chapter08/udev.xml @@ -133,6 +133,20 @@ install -vm755 $(find src/udev -type f | grep -F -v ".") /usr/lib/udevtar -xvf ../../&udev-lfs-version;.tar.xz make -f &udev-lfs-version;/Makefile.lfs install + Install the man pages: + + +tar -xf ../../systemd-man-pages-253.tar.xz --strip-components=1 \ + -C /usr/share/man --wildcards '*/udev*' '*/libudev*' \ + '*/systemd-'{hwdb,udevd.service}.8 +sed 's/systemd\(\\\?-\)/udev-/' /usr/share/man/man8/systemd-hwdb.8 \ + > /usr/share/man/man8/udev-hwdb.8 +sed 's|lib.*udevd|sbin/udevd|' \ + /usr/share/man/man8/systemd-udevd.service.8 \ + > /usr/share/man/man8/udevd.8 +rm /usr/share/man/man8/systemd-*.8 + From f7c36d049f1a2dc0b3d8d867f1c0d06dac055904 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 16 Jul 2023 13:46:20 +0800 Subject: [PATCH 05/10] udev: Create /usr/{lib,share}/pkgconfig They are not created in chapter 7.5, so we should create them before installing files into them. --- chapter08/udev.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/chapter08/udev.xml b/chapter08/udev.xml index 4e79ef899..951240d32 100644 --- a/chapter08/udev.xml +++ b/chapter08/udev.xml @@ -115,6 +115,7 @@ meson setup \ Install the package: install -vm755 -d {/usr/lib,/etc}/udev/{hwdb,rules}.d +install -vm755 -d /usr/{lib,share}/pkgconfig install -vm755 udevadm /usr/bin/ install -vm755 systemd-hwdb /usr/bin/udev-hwdb ln -sv ../bin/udevadm /usr/sbin/udevd From 4ca4e8b1bad63a4e4d50b942f527bf28ec79a075 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 16 Jul 2023 23:29:18 +0800 Subject: [PATCH 06/10] udev: Fix a typo --- chapter08/udev.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter08/udev.xml b/chapter08/udev.xml index 951240d32..36edcc8a0 100644 --- a/chapter08/udev.xml +++ b/chapter08/udev.xml @@ -225,7 +225,7 @@ rm /usr/share/man/man8/systemd-*.8 udev-hwdb - Updates or query the hardware database. + Updates or queries the hardware database. udev-hwdb From 06610cefabc3abf7cf2504bab271224de52ab2b4 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 16 Jul 2023 23:59:45 +0800 Subject: [PATCH 07/10] dependencies: Update for Udev The Udev build dependencies are directly copied from systemd. Though they might be unneeded for a Udev-only build, meson will check them anyway. And I'm sure Jinja2 is really used. In systemd dependencies Attr is dropped because Attr is not used directly, it's just Acl needs Attr. OpenSSL is added because udevadm links to libcrypto. As "S" and "U" are closer, create a "systemd-udev" entity to simplify the choices. In Util-linux, lsblk and findmnt links to libudev so it depends on &systemd-udev;. --- appendices/dependencies.xml | 125 +++++++++++++++++------------------- 1 file changed, 59 insertions(+), 66 deletions(-) diff --git a/appendices/dependencies.xml b/appendices/dependencies.xml index 1d693e064..8038ee943 100644 --- a/appendices/dependencies.xml +++ b/appendices/dependencies.xml @@ -3,6 +3,9 @@ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ %general-entities; + + Systemd + Udev"> ]> @@ -466,9 +469,7 @@ &before; - Bash, Diffutils, Eudev, - Findutils, and Man-DB, and Systemd + Bash, Diffutils, Findutils, Man-DB, and &systemd-udev; @@ -642,45 +643,6 @@ - - Eudev - - - &dependencies; - - Bash, Binutils, Coreutils, Gawk, GCC, Glibc, Grep, Gperf, Make, - Sed, and Util-linux - - - - - &runtime; - - Glibc, Kmod, Xz, Util-linux, and Zlib. - - - - - &testsuites; - - None - - - - - &before; - - None - - - - - &external; - - None - - - Expat @@ -1555,7 +1517,7 @@ &before; - Systemd + &systemd-udev; @@ -1633,8 +1595,7 @@ &before; - Eudev - Systemd + &systemd-udev; @@ -1913,9 +1874,7 @@ &before; - GCC, Perl, Python, - and Shadow, and Systemd + GCC, Perl, Python, Shadow, and &systemd-udev; @@ -2236,10 +2195,7 @@ &before; - - None - Systemd - + &systemd-udev; @@ -2438,7 +2394,7 @@ &before; - Coreutils, Kmod, and Linux + Coreutils, Kmod, Linux, and &systemd-udev; @@ -2560,7 +2516,7 @@ D-Bus, E2fsprogs, IProute2, Kmod, Man-DB, Procps-ng, Python, - Systemd, and Util-linux + &systemd-udev;, and Util-linux @@ -2866,16 +2822,17 @@ &dependencies; - Acl, Attr, Bash, Binutils, Coreutils, Diffutils, Expat, Gawk, + Acl, Bash, Binutils, Coreutils, Diffutils, Gawk, GCC, Glibc, Gperf, Grep, Jinja2, Libcap, Libxcrypt, Meson, - Pkgconf, Sed, Util-linux, and Zstd + OpenSSL, Pkgconf, Sed, Util-linux, and Zstd &runtime; - Acl, Attr, Glibc, Libcap, Libxcrypt, and Util-linux + Acl, Glibc, Libcap, Libxcrypt, OpenSSL, Util-linux, Xz, + Zlib, and Zstd @@ -3104,23 +3061,62 @@ + + Udev + + + &dependencies; + + Acl, Bash, Binutils, Coreutils, Diffutils, Gawk, + GCC, Glibc, Gperf, Grep, Jinja2, Libcap, Libxcrypt, Meson, + OpenSSL, Pkgconf, Sed, Util-linux, and Zstd + + + + + &runtime; + + Acl, Glibc, Libcap, OpenSSL, and Util-linux + + + + + &testsuites; + + None + + + + + &before; + + Util-linux + + + + + &external; + + None + + + Util-linux &dependencies; - Bash, Binutils, Coreutils, Diffutils, - Eudev, File, Findutils, Gawk, + Bash, Binutils, Coreutils, Diffutils, File, Findutils, Gawk, GCC, Gettext, Glibc, Grep, Make, Ncurses, Pkgconf, Sed, - Systemd, and Zlib + &systemd-udev;, and Zlib &runtime; - Glibc, Ncurses, Readline, and Zlib + Glibc, Ncurses, Readline, &systemd-udev;, and Zlib @@ -3308,9 +3304,7 @@ &before; - Eudev, File, GRUB, Kmod, - Libelf, and Man-DB, and Systemd + File, GRUB, Kmod, Libelf, Man-DB, and &systemd-udev; @@ -3386,8 +3380,7 @@ &before; - GCC and Libelf - GCC, Libelf, and Systemd + GCC, Libelf, and &systemd-udev; From 870d24c5cb3ce12dc43e5b8f71aee84d74e73015 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Mon, 17 Jul 2023 09:40:59 +0800 Subject: [PATCH 08/10] bootscripts: udev: Set SYSTEMD_LOG_TARGET=kmsg for udevd This makes udevd send log entries to kmsg buffer and sysklogd will pick them up. Ideally we should use "syslog" here, but at the time udevd starts, sysklogd has not started yet and /dev/log does not exist. So udevd cannot open /dev/log and it will still use stderr as a fallback. We cannot make udevd depending on sysklogd either, because it would cause a circular dependency... --- bootscripts/lfs/init.d/udev | 2 +- packages.ent | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bootscripts/lfs/init.d/udev b/bootscripts/lfs/init.d/udev index 612685af7..f7d4b9bff 100644 --- a/bootscripts/lfs/init.d/udev +++ b/bootscripts/lfs/init.d/udev @@ -45,7 +45,7 @@ case "${1}" in # Start the udev daemon to continually watch for, and act on, # uevents - /sbin/udevd --daemon + SYSTEMD_LOG_TARGET=kmsg /sbin/udevd --daemon # Now traverse /sys in order to "coldplug" devices that have # already been discovered diff --git a/packages.ent b/packages.ent index ab075f7a4..8fd962d0e 100644 --- a/packages.ent +++ b/packages.ent @@ -383,7 +383,7 @@ - + From f24a041cd43c00c86dee8f737647ca8997d854a6 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Mon, 17 Jul 2023 09:58:53 +0800 Subject: [PATCH 09/10] udev: Remove two udev rules requiring a full systemd installation Or they'll produce some error messages saying "cannot execute systemd-sysctl or systemd-vconsole-setup". --- chapter08/udev.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/chapter08/udev.xml b/chapter08/udev.xml index 36edcc8a0..2d3792511 100644 --- a/chapter08/udev.xml +++ b/chapter08/udev.xml @@ -51,6 +51,10 @@ sed -i -e 's/GROUP="render"/GROUP="video"/' \ -e 's/GROUP="sgx", //' rules.d/50-udev-default.rules.in + Remove one udev rule requiring a full Systemd installation: + + sed '/systemd-sysctl/s/^/#/' -i rules.d/99-systemd.rules.in + Prepare Udev for compilation: mkdir -p build @@ -112,6 +116,11 @@ meson setup \ build.ninja | awk '{ print $2 }') \ $(realpath libudev.so --relative-to .) + Remove one udev rule file requiring a full Systemd + installation: + +rm rules.d/90-vconsole.rules + Install the package: install -vm755 -d {/usr/lib,/etc}/udev/{hwdb,rules}.d From 51c7e709c05ab01ad800212e388545aa189fcd40 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Mon, 17 Jul 2023 11:53:12 +0800 Subject: [PATCH 10/10] udev: Update SBU and DU --- packages.ent | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages.ent b/packages.ent index 8fd962d0e..11378b56e 100644 --- a/packages.ent +++ b/packages.ent @@ -706,8 +706,8 @@ - - + +