]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
rules: Limit the number of device units generated for serial ttys
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 10 Jun 2024 10:59:58 +0000 (12:59 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 11 Jun 2024 23:09:26 +0000 (00:09 +0100)
As per the suggestion in https://github.com/systemd/systemd/issues/33242.

This reduces the number of /dev/ttySXX device units generated in
mkosi from 32 to 4.

rules.d/99-systemd.rules.in

index ad0c7e2fb5e45fd4af7c39d5ce85edb8a6dc6c06..8ba6f177f845d506469058b7ac07a500963d9fa5 100644 (file)
@@ -10,6 +10,8 @@
 ACTION=="remove", GOTO="systemd_end"
 
 SUBSYSTEM=="tty", KERNEL=="tty[a-zA-Z]*|hvc*|xvc*|hvsi*|ttysclp*|sclp_line*|3270/tty[0-9]*", TAG+="systemd"
+# Exclude 8250 serial ports with a zero IO port, as they are not usable until "setserial /dev/ttySxxx port …" is invoked.
+SUBSYSTEM=="tty", KERNEL=="ttyS*", DRIVERS=="serial8250", ATTR{port}=="0x0", ENV{SYSTEMD_READY}="0"
 KERNEL=="vport*", TAG+="systemd"
 
 SUBSYSTEM=="ptp", TAG+="systemd"