aboutsummaryrefslogtreecommitdiffstats
path: root/chapter08/udev.xml
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2023-11-13 19:27:23 +0800
committerXi Ruoyao <xry111@xry111.site>2023-11-13 19:35:01 +0800
commit5196daeb4e36b321e42a8bec8302cad31c6ff690 (patch)
treef68af5858f3aa419cf54ae4ae18584ff76b74df1 /chapter08/udev.xml
parentf6bf77de74bb81eff72cef18f75b9335b94dcdd5 (diff)
udev: Adjust some command
Set -Dlogind=false -Dvconsole=false to disable out-of-scope udev rules. Use "ninja -n" to list the targets, so the disabled udev rules won't show up then we can remove some "rm" commands. Do not remove 70-power-switch.rules from the source directory so we won't break multilib.
Diffstat (limited to 'chapter08/udev.xml')
-rw-r--r--chapter08/udev.xml49
1 files changed, 27 insertions, 22 deletions
diff --git a/chapter08/udev.xml b/chapter08/udev.xml
index acc23172f..3c7d7d25c 100644
--- a/chapter08/udev.xml
+++ b/chapter08/udev.xml
@@ -66,6 +66,8 @@ meson setup \
-Dmode=release \
-Ddev-kvm-mode=0660 \
-Dlink-udev-shared=false \
+ -Dlogind=false \
+ -Dvconsole=false \
..</userinput></screen>
<variablelist>
@@ -107,38 +109,41 @@ 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 and four udev rule files for the login manager (if you need
- a login manager, install the BLFS elogind package after finishing LFS;
- the elogind package will install these udev rules as well):</para>
-
-<screen><userinput remap="make">rm rules.d/{70-uaccess,71-seat,73-seat-late,90-vconsole}.rules
-rm ../rules.d/70-power-switch.rules</userinput></screen>
-
<para>Install the package:</para>
<screen><userinput remap="install">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 -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 $(echo ../rules.d/*.rules |
+ sed 's/70-power-switch.rules//') /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</userinput></screen>
<para>Install some custom rules and support files useful in an LFS
environment:</para>