main/postmarketos-mkinitfs: Correctly set up udev
This replaces the previous udevadm test
hack with a combination of udevd
, udevadm trigger
and udevadm settle
in order to coldplug all available devices and make them available for use via libinput / unl0kr.
Possibly fixes #1411 (comment 895465028).
To test, run
pmbootstrap install --fde --add unl0kr
pmbootstrap qemu
and verify that keyboard / mouse input works in unl0kr.
Background
The previous udevadm test
workaround worked for most but apparently not all people. The test
command is also explicitly marked as a debug tool, not meant to be used in production. Using the debug shell, I noticed that even after running udevadm test
, libinput list-devices
gave no output and libinput debug-events /dev/input/event...
failed, claiming that the device had not been set up by udev yet.
Researching how we set up udev after the initfs phase, I found that the setup-udev script starts a number of RC services that combine udevd
, udevadm trigger
and udevadm settle
.
After calling this series of commands in the debug shell, both libinput list-devices
and libinput debug-events
started working as expected.