main/postmarketos-base: udev tm2-touchkey and rt5033-battery (MR 2330)

The udev file "20-tm2-touchkey-leds.rules" disables the leds of
tm2-touchkey by default because they are in an unconfigured state.

The udev file "95-rt5033-battery-refresh.rules" triggers a refresh
of the rt5033-battery information within UPower 5 secs after
initialization. This avoids a wrong battery icon after boot.

The udev file "50-firmware.rules" was moved from /etc/udev/rules.d
to /lib/udev/rules.d.

Related: https://wiki.postmarketos.org/wiki/Packaging#Device_specific_quirks
This commit is contained in:
Jakob Hauser 2021-07-08 23:39:21 +02:00 committed by Oliver Smith
parent 705f673aac
commit bd85700dea
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
4 changed files with 16 additions and 4 deletions

View file

@ -1,6 +1,6 @@
pkgname=postmarketos-base
pkgver=12
pkgrel=1
pkgver=13
pkgrel=0
pkgdesc="Meta package for minimal postmarketOS base"
url="https://postmarketos.org"
arch="noarch"
@ -37,8 +37,10 @@ _source644="
etc/fstab
etc/issue
etc/motd
etc/udev/rules.d/50-firmware.rules
etc/os-release
lib/udev/rules.d/20-tm2-touchkey-leds.rules
lib/udev/rules.d/50-firmware.rules
lib/udev/rules.d/95-rt5033-battery-refresh.rules
"
_source755="
etc/init.d/deferred-initcalls
@ -102,10 +104,12 @@ e4576c58c35f80bedddb1e89e186f37d31a186d3e9eb046581b8c5d7b7d435e18924539e851d3e67
9b8d0493bb64457fe176fea801e0771d3c5279302c61559824bf81b3d2b66d2c1e076f4aaac65f55389005acb18c27e44bed858c2bdbad37d74199f07c86c354 rootfs-etc-fstab
45bd0742a64a9d3c4a88e152b97edcf3fa1edca28884f9ea69e7c4c365f1e41ef9056dbe204545de7d4b2ba92e1e5872b2a929c2dcc1dd468e627cc3f090b8e6 rootfs-etc-issue
01403df3b5a2be0dd70387a3c32cf24a77bc097679fbefca585082a0970b7d756723c33687be3809351b5e31c85947db84861118bfeced8f5f865fe2452555ec rootfs-etc-motd
0b098828080055d3646ea54891cb0e1b578cbc30f5e16f7284f2814c08192f18079a38fb686d192715ae6a3d2cd6625d9e3cf99f234a6f0d94088bb0cb2ce43d rootfs-etc-udev-rules.d-50-firmware.rules
6723ae5035b959ed8c0c5ee490ce2e1abc9fe89e6c7348533e488b78b2a15593df406d6691f6b854ed71633960257a6aa5c65aa01db189732e26ba8e15ef23b8 rootfs-etc-os-release
5fd6dd7f9941e975a6ce559924eb252606943276dc09455bbeb05ff718ecd28f20a08eee8e04ca580e5af71d4c944c256ec04f07b07286394f5dfedfa59273e7 rootfs-etc-init.d-deferred-initcalls
f5cc0f1265955d2646e5f099dd4b5d4c287945bfc18c16044db57670d456f55c678fc11cc59e6dab3fa340832ce869d516302a3a35c13518539ed0cedca51819 rootfs-etc-init.d-swapfile
5f5086e84389323673284a9734cdd14bffc5277a484c481f7d95d42d8fdeb7a098eb9b62f894f3e12533fe7b1dd47859e77313d816a14591d4e07a9c7531ad16 rootfs-lib-udev-rules.d-20-tm2-touchkey-leds.rules
0b098828080055d3646ea54891cb0e1b578cbc30f5e16f7284f2814c08192f18079a38fb686d192715ae6a3d2cd6625d9e3cf99f234a6f0d94088bb0cb2ce43d rootfs-lib-udev-rules.d-50-firmware.rules
766aace60f7aea2515e03aec9f6d3215fcabcd81a235acb7b79bac1ae44e75c3087c541370fe1565a05a78f70a071fe20380b91e23e1fb48390b9df19354d008 rootfs-lib-udev-rules.d-95-rt5033-battery-refresh.rules
3ceeee37f558e7c95ad973692b6a437f997e6b46c3d1c2257ddfb1529a5633477373aa123c7f08164e818daae50acb203d151379f27ca11bd458809e6a0d4de7 rootfs-sbin-swapfile
38dc75c0ed32b76dccd3d8e7e8173e8b7d91847cf2b07123f376b95af46b4f89798b24f45302a0726fdc1cf253aecaac140f431735ac5c6511553f790badd0af rootfs-usr-lib-firmwareload.sh
"

View file

@ -0,0 +1,3 @@
# disable tm2-touchkey leds by default
# To change the default, copy the file to /etc/udev/rules.d, increase the file name number and change echo to 1.
ACTION=="add", KERNEL=="tm2-touchkey", RUN+="/bin/sh -c 'echo 0 > /sys/class/leds/tm2-touchkey/brightness'"

View file

@ -0,0 +1,5 @@
# refresh rt5033-battery information in UPower 5 secs after initialization
ACTION=="add", KERNEL=="rt5033-battery", RUN+="/bin/sh -c 'sleep 5 && \
dbus-send --print-reply --system --dest=org.freedesktop.UPower \
/org/freedesktop/UPower/devices/battery_rt5033_battery \
org.freedesktop.UPower.Device.Refresh > /dev/null 2>&1'"