aboutsummaryrefslogtreecommitdiffstats
path: root/chapter08/udev.xml
diff options
context:
space:
mode:
Diffstat (limited to 'chapter08/udev.xml')
-rw-r--r--chapter08/udev.xml64
1 files changed, 43 insertions, 21 deletions
diff --git a/chapter08/udev.xml b/chapter08/udev.xml
index 35bb12f46..dd686f489 100644
--- a/chapter08/udev.xml
+++ b/chapter08/udev.xml
@@ -55,6 +55,11 @@
<screen><userinput remap="pre">sed '/systemd-sysctl/s/^/#/' -i rules.d/99-systemd.rules.in</userinput></screen>
+ <para>Adjust the hardcoded paths to network configuration files for the
+ standalone udev installation:</para>
+
+ <screen><userinput remap="pre">sed '/NETWORK_DIRS/s/systemd/udev/' -i src/basic/path-lookup.h</userinput></screen>
+
<para>Prepare Udev for compilation:</para>
<screen><userinput remap="configure">mkdir -p build
@@ -66,6 +71,8 @@ meson setup \
-Dmode=release \
-Ddev-kvm-mode=0660 \
-Dlink-udev-shared=false \
+ -Dlogind=false \
+ -Dvconsole=false \
..</userinput></screen>
<variablelist>
@@ -107,35 +114,42 @@ meson setup \
and it's too overkill for a udev-only installation.</para>
</listitem>
</varlistentry>
+
+ <varlistentry>
+ <term><parameter>-Dlogind=false -Dvconsole=false</parameter></term>
+ <listitem>
+ <para>These options prevent the generation of several udev rule
+ files belonging to the other Systemd components that we won't
+ install.</para>
+ </listitem>
+ </varlistentry>
</variablelist>
<para>Only build the components needed for udev:</para>
- <screen><userinput remap="make">ninja udevadm systemd-hwdb \
- $(grep -o -E "^build (src/libudev|src/udev|rules.d|hwdb.d)[^:]*" \
- build.ninja | awk '{ print $2 }') \
+ <screen><userinput remap="make">ninja udevadm systemd-hwdb \
+ $(ninja -n | grep -Eo '(src/(lib)?udev|rules.d|hwdb.d)/[^ ]*') \
$(realpath libudev.so --relative-to .)</userinput></screen>
- <para>Remove one udev rule file requiring a full Systemd
- installation:</para>
-
-<screen><userinput remap="make">rm rules.d/90-vconsole.rules</userinput></screen>
-
<para>Install the package:</para>
- <screen><userinput remap="install">install -vm755 -d {/usr/lib,/etc}/udev/{hwdb,rules}.d
+ <screen><userinput remap="install">install -vm755 -d {/usr/lib,/etc}/udev/{hwdb.d,rules.d,network}
install -vm755 -d /usr/{lib,share}/pkgconfig
-install -vm755 udevadm /usr/bin/
-install -vm755 systemd-hwdb /usr/bin/udev-hwdb
-ln -svfn ../bin/udevadm /usr/sbin/udevd
-cp -av libudev.so{,*[0-9]} /usr/lib/
-install -vm644 ../src/libudev/libudev.h /usr/include/
-install -vm644 src/libudev/*.pc /usr/lib/pkgconfig/
-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</userinput></screen>
+install -vm755 udevadm /usr/bin/
+install -vm755 systemd-hwdb /usr/bin/udev-hwdb
+ln -svfn ../bin/udevadm /usr/sbin/udevd
+cp -av libudev.so{,*[0-9]} /usr/lib/
+install -vm644 ../src/libudev/libudev.h /usr/include/
+install -vm644 src/libudev/*.pc /usr/lib/pkgconfig/
+install -vm644 src/udev/*.pc /usr/share/pkgconfig/
+install -vm644 ../src/udev/udev.conf /etc/udev/
+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 -vm644 ../network/99-default.link /usr/lib/udev/network</userinput></screen>
<para>Install some custom rules and support files useful in an LFS
environment:</para>
@@ -150,13 +164,21 @@ make -f &udev-lfs-version;/Makefile.lfs install</userinput></screen>
<screen><userinput remap="install">tar -xf ../../systemd-man-pages-&systemd-man-version;.tar.xz \
--no-same-owner --strip-components=1 \
-C /usr/share/man --wildcards '*/udev*' '*/libudev*' \
+ '*/systemd.link.5' \
'*/systemd-'{hwdb,udevd.service}.8
+
+sed 's|systemd/network|udev/network|' \
+ /usr/share/man/man5/systemd.link.5 \
+ > /usr/share/man/man5/udev.link.5
+
sed 's/systemd\(\\\?-\)/udev\1/' /usr/share/man/man8/systemd-hwdb.8 \
> /usr/share/man/man8/udev-hwdb.8
+
sed 's|lib.*udevd|sbin/udevd|' \
/usr/share/man/man8/systemd-udevd.service.8 \
> /usr/share/man/man8/udevd.8
-rm /usr/share/man/man8/systemd-*.8</userinput></screen>
+
+rm /usr/share/man/man*/systemd*</userinput></screen>
</sect2>