Draft: main/postmarketos-base: turn off tm2-touchkey leds
The udev file "20-tm2-touchkey-leds.rules" disables the leds of tm2-touchkey by default because they are in an unconfigured state. This is a continuation of merge request !2280 (closed) that was closed due to diverging too much of the initial idea.
Strangely, when writing the udev rule like KERNEL=="tm2-touchkey", ATTR{brightness}="0"
, it causes a dmesg error:
udevd[...]: error opening ATTR{/sys/bus/i2c/drivers/tm2-touchkey/brightness} for writing: Permission denied
Actually the udev rule is executed as root. And the result of this mentioned rule is that the leds are off. So it does work, despite the error message. However, using the echo command does not print a dmesg error. This is a bit silly – but to avoid the dmesg error, I implemented the echo command.
The number in the file name is a bit random. I chose an early number but not right at the beginning.
The udev file was placed into the package postmarketos-base
because more than one device is affected. There seems to be no good way of implementation for such cases at pmaports yet. As the udev rule is driver specific, other devices ignore it.
Affected devices are:
- samsung-a3lte
- samsung-a3ulte
- samsung-a5lte
- samsung-a5ulte
- samsung-serranovelte
- samsung-klte (tm2-touchkey implemeted differently in device tree)
Additional comment:
When I tested the package upgrade, some ntftable packages were purged. I don't think this is related... Probably it's because I re-installed the package locally from home directory or something. I mention this just for the case I'm overlooking something.
$ sudo apk add --allow-untrusted ~/postmarketos-base-13-r1.apk
...
(1/3) Purging postmarketos-base-nftables (12-r1)
(2/3) Purging postmarketos-config-nftables (0.3-r0)
(3/3) Upgrading postmarketos-base (12-r1 -> 13-r1)
Executing postmarketos-base-13-r1.pre-upgrade
Executing postmarketos-base-13-r1.post-upgrade
Executing busybox-1.33.1-r4.trigger
Executing postmarketos-base-13-r1.trigger
...