main/postmarketos-mkinitfs: Correctly set up udev (MR 3146)

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.

Relates to: #1411

[ci:skip-build] already built successfully in CI
This commit is contained in:
Johannes Marbach 2022-05-22 13:44:51 +02:00 committed by Clayton Craft
parent 9a18e34f33
commit aa0f96edb9
No known key found for this signature in database
GPG key ID: 4A4CED6D7EDF950A
5 changed files with 16 additions and 11 deletions

View file

@ -2,7 +2,7 @@
# Co-Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=postmarketos-mkinitfs
pkgver=1.4.1
pkgrel=3
pkgrel=4
pkgdesc="Tool to generate initramfs images for postmarketOS"
url="https://postmarketos.org"
depends="
@ -70,6 +70,6 @@ check() {
sha512sums="
f827acb0a10c0e5c1631f1b712e91fde7eb4ade0f1174eb2ef1754018bf4518ea1ad3229fd335c25fb0c6fe46ae20890f5cf43e58c8143ae17b5ab9bb36f0199 postmarketos-mkinitfs-1.4.1.tar.gz
08a3e79c6fa7d3839d43515b8da7817cb36f4ab014552fd0164957c232bb16fde337e57c47c9734d396a5fca3328fbf49ebabe4728c6071c80b04dad14886bba 00-default.modules
fae45b5ee2cca9c0a4f75f29b4cb89cf07aed1f19b966964ccfeb5d2933474b60d7aa8f80190a997589e19e6aa3fc6317eaed8a54e1e349311a3564e73ab31e5 init.sh
22617f7ceab27b2c48bdbaa40193a49065b6ba3c49f6f50d5bf987064814c7eedbd97b5000320c4dec419bbf7dd31d83abd1b6792465a9e8f60adbb673defa68 init_functions.sh
d16dc495afcab64e8ae70b8de06444aac3d655ca59c544717ea779d160d597a0a32da62e55e7493b0c7626e1e7fcefa3f94b917ae16ac7d2990a3038934a6fac init.sh
ef099d394406462268fe9e2d28a5355ef09a30fa7283d58e2c567088bd767fb8079399426ccaabe48dbc7774cf9cd7a5b853d850a978ae05e0d74909cee5b207 init_functions.sh
"

View file

@ -56,7 +56,7 @@ init="/sbin/init"
setup_bootchart2
# Switch root
killall telnetd mdev msm-fb-refresher 2>/dev/null
killall telnetd mdev udevd msm-fb-refresher 2>/dev/null
umount /proc
umount /sys
umount /dev/pts

View file

@ -63,11 +63,15 @@ setup_mdev() {
echo /sbin/mdev >/proc/sys/kernel/hotplug
mdev -s
if command -v udevadm > /dev/null; then
# Initialise input devices for libinput / unl0kr
for i in /dev/input/event*; do
udevadm test "/sys/class/input/${i##/dev/input/}"
done
# If udevd and udevadm are present in the initfs, coldplug all devices so that
# they can be used via libinput (e.g. by unl0kr). This is the same series of steps
# performed by the udev, udev-trigger and udev-settle RC services. See also:
# - https://git.alpinelinux.org/aports/tree/main/eudev/setup-udev
# - https://git.alpinelinux.org/aports/tree/main/udev-init-scripts/APKBUILD
if command -v udevd > /dev/null && command -v udevadm > /dev/null; then
udevd -d
udevadm trigger --type=devices --action=add
udevadm settle
fi
}

View file

@ -1,7 +1,7 @@
# Maintainer: Johannes Marbach <n0-0ne+gitlab@mailbox.org>
pkgname=unl0kr
pkgver=0.1.0_git20220128
pkgrel=1
pkgrel=2
_commit=535f442b107999e3aa723ad59eb2fe1f984f428a
_commit_lvgl=bd19083aedd42b8f60605d2c5773719a6ccc3426
_commit_lv_drivers=97e500b200ad6e947c0b62940929f30bc8f5ef4e
@ -75,6 +75,6 @@ sha512sums="
d30c3e2e075eab4691b48d97fa0158dd4ce70e89e227be24ce7a964268fb490cd47b108d1d72a2318963e65dc09f6614703e40b7809adf473a458c09b01c846a lv_drivers-97e500b200ad6e947c0b62940929f30bc8f5ef4e.tar.gz
4253de0df22df1051c17f5edbb275cc9eaed5d9dffdb3c5208f176eea3f7c6f4b563c5e70be97ccaf99729eee9a313f4537fbc7274e5dfc295fdeb83cc3a9d29 squeek2lvgl-db4222c091a2b5584cb952324f26e97ecc938de8.tar.gz
7155c2f95dcf3716c0f392cf5717e96f1414c383a1f7c2ed30a1f8518dfe0b17c3c0e0e93f6476a342504aa855404099e2f5444eeb099023491c9a9a26fa3d90 unl0kr.conf
b14a41ca4d208ff14189ed7fe29877f01249a7b0b1ff9e2b817a43cb7e3ce214350f9ef9ca588c53071df263fd986a07df75092561d6fdcf7009d9687208b2be unl0kr.files
6bf8f121ab9be4fd0e77309b36f65ce9c601669056dddd29eab15eeaa93d5c922bfdcefeba4780fc75fe44f9356f56c3fc435729821007bca84ebfae8c568c42 unl0kr.files
5386f434cd4f1fb9e0d561a8689e5e85d6a8b3c562823122c082d4932d2fb0ad4edcd635f14f0c61e5c8b5e53648c9937b042409c21683007700faea8894c750 unlock.sh
"

View file

@ -7,6 +7,7 @@
/usr/lib/libxkbcommon.so.0
/usr/share/libinput/*.quirks
/bin/udevadm
/sbin/udevd
/etc/udev/rules.d
/lib/udev/rules.d
/usr/share/X11/xkb