[PATCH] host/rootfs: fix Weston hotplugging
On the Spectrum host, the kernel delivers uevents to mdevd. By default, if mdevd doesn't have a handler for an event, it won't do anything, and other processes that might be interested in the uevent hear about it. This means that Weston isn't notified about input device hotplugs. (And USB devices can appear after init has started, so any USB device counts as hotplugging even if it's attached before boot or even built in to the computer.) To fix this, we configure mdevd to rebroadcast events it doesn't handle on Netlink group 4. These events will then be picked up by Weston via libudev-zero, which listens on group 4 for hotplug events. Reported-by: Ville Ilvonen <ville.ilvonen@unikie.com> Fixes: 372bacd ("etc/s6-rc: add weston service") --- Ville, does this fix the internal keyboard and mouse on your ThinkPad T560? host/rootfs/etc/s6-rc/mdevd/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/host/rootfs/etc/s6-rc/mdevd/run b/host/rootfs/etc/s6-rc/mdevd/run index f838d2d..c4615c8 100644 --- a/host/rootfs/etc/s6-rc/mdevd/run +++ b/host/rootfs/etc/s6-rc/mdevd/run @@ -2,4 +2,4 @@ # SPDX-License-Identifier: EUPL-1.2 # SPDX-FileCopyrightText: 2020-2022 Alyssa Ross <hi@alyssa.is> -mdevd -D3 -b134217728 +mdevd -D3 -O4 -b134217728 base-commit: 402c7fd0637e834f97b0ea1a2abb89c417e7469d -- 2.35.1
On Sun, Apr 24, 2022 at 11:02 AM Alyssa Ross <hi@alyssa.is> wrote:
On the Spectrum host, the kernel delivers uevents to mdevd. By default, if mdevd doesn't have a handler for an event, it won't do anything, and other processes that might be interested in the uevent hear about it. This means that Weston isn't notified about input device hotplugs. (And USB devices can appear after init has started, so any USB device counts as hotplugging even if it's attached before boot or even built in to the computer.)
To fix this, we configure mdevd to rebroadcast events it doesn't handle on Netlink group 4. These events will then be picked up by Weston via libudev-zero, which listens on group 4 for hotplug events.
Reported-by: Ville Ilvonen <ville.ilvonen@unikie.com> Fixes: 372bacd ("etc/s6-rc: add weston service") --- Ville, does this fix the internal keyboard and mouse on your ThinkPad T560?
It does. Thanks a lot. -Ville
host/rootfs/etc/s6-rc/mdevd/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/host/rootfs/etc/s6-rc/mdevd/run b/host/rootfs/etc/s6-rc/mdevd/run index f838d2d..c4615c8 100644 --- a/host/rootfs/etc/s6-rc/mdevd/run +++ b/host/rootfs/etc/s6-rc/mdevd/run @@ -2,4 +2,4 @@ # SPDX-License-Identifier: EUPL-1.2 # SPDX-FileCopyrightText: 2020-2022 Alyssa Ross <hi@alyssa.is>
-mdevd -D3 -b134217728 +mdevd -D3 -O4 -b134217728
base-commit: 402c7fd0637e834f97b0ea1a2abb89c417e7469d -- 2.35.1
This patch has been committed as a9c192e00d17548f75e18465baf359813bc05e72, which can be viewed online at https://spectrum-os.org/git/spectrum/commit/?id=a9c192e00d17548f75e18465baf3.... This is an automated message. Send comments/questions/requests to: Alyssa Ross <hi@alyssa.is>
participants (3)
-
Alyssa Ross -
Alyssa Ross -
Ville Ilvonen