WIP: Add postmarketos-ui-shelli
This adds the shelli UI created by @unrznbl which adds a gesture recognition input on top of the TTY
WIP stuff:
-
Can't wake the phone up again after pressing the power key -
The TTY freezes randomly after a few minutes of not using it.
Merge request reports
Activity
Thanks for the MR @MartijnBraam, and thanks for creating this UI @unrznbl!
This is marked as WIP because of the mentioned issues. However, this version looks like it is good enough for an initial push, and we could go from there.
Can one of you create a wiki page somewhere here, and mention the issues that still need to be resolved? https://wiki.postmarketos.org/wiki/Category:Interface
By Oliver Smith on 2019-03-15T02:17:06
Edited by Ghost UserShelli page is created. https://wiki.postmarketos.org/wiki/Shelli
By Craig Comstock on 2019-03-15T02:17:05
- Resolved by Administrator
- Resolved by Administrator
I got a dmesg -w trace when the screen freezes up. I noticed it takes about 5 minutes or so and causes the blinking cursor to stop blinking. Power button suspend/wake works around the issue.nexus5-power-button-bug-dmesg.log
By Craig Comstock on 2019-03-15T02:50:00
the brightness script doesn't work for a user because
/usr/bin/brightness: line 3: can't create /sys/class/backlight/lm3630a_leda/brightness: Permission denied /usr/bin/brightness: line 5: can't create /etc/brightness.conf: Permission denied
not sure how we would get around that other than maybe chgrp of lm3630a_leda and /etc/brightness.conf to video and make 775/664 respectively. That seem an OK solution to the brightness problem?
By Craig Comstock on 2019-03-15T03:01:56
Source: brightness
What is /etc/brightness.conf for? If we write to it, it should be in /var/lib/ or something like that (see FHS).
maybe chgrp of lm3630a_leda [...] to video and make 755 [...]
That should work, and I don't see any security downsides from doing that. About the device specific path, I've created https://gitlab.com/unrznbl/shelli/issues/1.
By Oliver Smith on 2019-03-15T14:39:12
Edited by Ghost UserI tried chgrp and sadly I'd have to do that from /sys on up. Doesn't seem like the right solution. I wonder if writing a small C program which has the path hard-coded and could be suid root and/or call setuid() to root. Want to keep this as simple as possible. For some reason I had sudo echo $1 > $BACKLIGHT_PATH before and it worked but now it doesn't on my latest build.
By Craig Comstock on 2019-05-24T05:21:36
I think I have something I like and that works now. https://gitlab.com/unrznbl/shelli/blob/suid-binaries/brightness.c I found that it is the linux kernel? (I need to confirm this) that prohibits suid as root on scripts so I need binaries. I can think of four ways to go with this:
- make very specific binaries for each purpose and each device (with the right sysfs paths),
- make specific binaries for each purpose but try to be more flexible like go through backlight/* and allow for setting a percentage of max_brightness.
- make a more generic sysfscat program with hard-coded paths in a key->value manner so like sysfscat brightness 25 would work for a normal user
- an ever more general tool which could have a /var/lib/shelli/sysfscat.conf configurable key/value pairs to use for various purposes of writing to protected sysfs resources, maybe with the assumption of a path starting at /sys for some more security.
I like options
#1
or#2
the best but would appreciate any feedback.By Craig Comstock on 2019-05-26T14:07:52
Edited by AdministratorI found that it is the linux kernel? (I need to confirm this) that prohibits suid as root on scripts so I need binaries.
Yes, this is the case on every linux distribution, for security reasons (I also found this confusing when I came across it the first time).
But let's not over-engineer this. We don't need to be able to control anything in /sys for shelli, changing the brightness is enough to allow turning the screen back on when the device's power button is pressed, right?
In the Arch Wiki I found that the permissions issue can be solved with an udev rule:
By default, only root can change the brightness by this method. To allow users in the video group to change the brightness, a udev rule such as the following can be used:
/etc/udev/rules.d/backlight.rules
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="acpi_video0", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="acpi_video0", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"
For the Nexus 5, we would need to replace
acpi_video0
withlm3630a_leda
. We could add a Nexus 5 specific udev rule to device-lg-hammerhead.By Oliver Smith on 2019-05-26T14:23:37
- Resolved by Administrator
added 164 commits
-
df6f7a25...11b1448a - 163 commits from branch
master
- fd036762 - Added postmarketos-ui-shelli
By Martijn Braam on 2019-05-30T14:14:51
-
df6f7a25...11b1448a - 163 commits from branch
added 1 commit
- 7aac0118 - Make some adjustments to use released versions of gesture and shelli.
By Martijn Braam on 2019-05-30T21:23:12
Closing in favor of !397 (merged).
By Oliver Smith on 2019-05-31T00:45:55