Use udev for chmod device access

Tested on postmarketOS and Debian. Need to change filename so all rules
are applied.

Signed-off-by: Anjandev Momi <anjan@momi.ca>
master
Jochen Sprickerhof 4 years ago committed by Anjandev Momi
parent efef4fc16a
commit 871964da4e
  1. 2
      configs/openrc/sxmo-pinephone
  2. 2
      configs/udev/50-sxmo.rules
  3. 11
      configs/udev/90-sxmo.rules

@ -3,4 +3,4 @@
description="Enable user access to pinephone hardware kernel interface" description="Enable user access to pinephone hardware kernel interface"
command="chmod" command="chmod"
command_args="a+rw /sys/module/8723cs/parameters/rtw_scan_interval_thr /sys/devices/platform/backlight/backlight/backlight/brightness /sys/power/state /sys/devices/platform/soc/1f00000.rtc/power/wakeup /sys/power/mem_sleep /sys/bus/usb/drivers/usb/unbind /sys/bus/usb/drivers/usb/bind /sys/class/leds/red:indicator/brightness /sys/class/leds/blue:indicator/brightness /sys/class/leds/green:indicator/brightness /sys/class/leds/white:flash/brightness /dev/rtc0 /sys/devices/platform/soc/1f03400.rsb/sunxi-rsb-3a3/axp221-pek/power/wakeup /sys/class/wakeup/*" command_args="a+rw /sys/module/8723cs/parameters/rtw_scan_interval_thr /sys/power/state /sys/devices/platform/soc/1f00000.rtc/power/wakeup /sys/power/mem_sleep /sys/bus/usb/drivers/usb/unbind /sys/bus/usb/drivers/usb/bind /dev/rtc0 /sys/devices/platform/soc/1f03400.rsb/sunxi-rsb-3a3/axp221-pek/power/wakeup /sys/class/wakeup/*"

@ -1,2 +0,0 @@
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", RUN+="/usr/bin/sxmo_statusbarupdate.sh"
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="0", RUN+="/usr/bin/sxmo_statusbarupdate.sh"

@ -0,0 +1,11 @@
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", RUN+="/usr/bin/sxmo_statusbarupdate.sh"
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="0", RUN+="/usr/bin/sxmo_statusbarupdate.sh"
ACTION=="add", SUBSYSTEM=="input", ENV{ID_INPUT_TOUCHSCREEN}=="1", MODE:="0666", SYMLINK+="input/touchscreen"
ACTION=="add", SUBSYSTEM=="input", ENV{ID_PATH}=="platform-vibrator", MODE:="0666"
# taken from https://github.com/haikarainen/light/blob/master/90-backlight.rules
ACTION=="add", SUBSYSTEM=="backlight", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="leds", RUN+="/bin/chgrp video /sys/class/leds/%k/brightness"
ACTION=="add", SUBSYSTEM=="leds", RUN+="/bin/chmod g+w /sys/class/leds/%k/brightness"
Loading…
Cancel
Save