Skip to content
Snippets Groups Projects

WIP: Add postmarketos-ui-shelli

Closed Imported Administrator requested to merge feature/shelli-ui into master
2 unresolved threads

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

Checking pipeline status.

Closed by AdministratorAdministrator 5 years ago (May 31, 2019 12:45am UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Author Owner

    I'm back online reliably. Will try to get this fixed up quick.

    By Craig Comstock on 2019-03-14T13:50:44

  • Administrator
  • Author Owner

    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

  • Author Owner

    the battery script doesn't report a percentage because I think the kernel isn't quite right in regards to /sys/class/power_supply/battery/capacity. I tried gauging capacity in terms of some scale but didn't come up with anything.

    By Craig Comstock on 2019-03-15T03:01:51

  • Author Owner

    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

    • Author Owner

      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 User
    • Author Owner

      I like /var/lib/shelli/brightness.conf. Will try that.

      By Craig Comstock on 2019-03-15T14:39:11

    • Author Owner

      I 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

    • Author Owner

      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:

      1. make very specific binaries for each purpose and each device (with the right sysfs paths),
      2. 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.
      3. 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
      4. 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 Administrator
    • Author Owner

      2 sounds like a good solution to me, we kinda need a HAL for this stuff.

      By Martijn Braam on 2019-05-25T12:51:38

    • Author Owner

      Right. I guess I am wanting to write a sucklless/minimal HAL. We'll see how it goes. ;)

      By Craig Comstock on 2019-05-25T14:21:54

    • Author Owner

      I 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 with lm3630a_leda. We could add a Nexus 5 specific udev rule to device-lg-hammerhead.

      By Oliver Smith on 2019-05-26T14:23:37

    • Author Owner

      Funny. I just committed something similar to shelli master, but will adjust as your arch linux example is better. Thanks!

      By Craig Comstock on 2019-05-26T15:06:50

    • Please register or sign in to reply
  • Administrator
  • Administrator added 164 commits · Imported

    added 164 commits

    Compare with previous version

    By Martijn Braam on 2019-05-30T14:14:51

  • Administrator added 1 commit · Imported

    added 1 commit

    • 7aac0118 - Make some adjustments to use released versions of gesture and shelli.

    Compare with previous version

    By Martijn Braam on 2019-05-30T21:23:12

  • Author Owner

    Closing in favor of !397 (merged).

    By Oliver Smith on 2019-05-31T00:45:55

  • Administrator closed · Imported

    closed

    By Oliver Smith on 2019-05-31T00:45:56

  • Please register or sign in to reply
    Loading