XE303C12 with mainline kernel, backlight permissions problem

This forum is for supported devices using an ARMv7 Samsung SoC.

XE303C12 with mainline kernel, backlight permissions problem

Postby doragasu1 » Wed Jul 13, 2016 10:32 am

I'm running mainline kernel (4.6.3-1) on this machine and I got almost everything working. Now I'm trying to set keyboard shortcuts to change the backlight. It mostly works, but by default the backlight file is read only:

$this->bbcode_second_pass_code('', '$ ls -l /sys/class/backlight/backlight/brightness
-rw-r--r-- 1 root root 4096 jul 12 10:26 /sys/class/backlight/backlight/brightness')
I have tried making this file r/w via tmpfiles.d, but it doesn't work:
$this->bbcode_second_pass_code('', '$ cat /etc/tmpfiles.d/brightness.conf
f /sys/class/backlight/backlight/brightness 0666 - - - 4')
I also tried setting an udev rule to do this without success:
$this->bbcode_second_pass_code('', '$ cat /etc/udev/rules.d/99-backlight.rules
KERNEL="backlight", SUBSYSTEM="backlight", GROUP="users", MODE="0660"')
I'm sure the udev rule must be wrong (will I ever understand udev rules?) but I don't know why using tmpfiles.d does not work... any suggestion is welcome.
doragasu1
 
Posts: 100
Joined: Sun Jun 03, 2012 3:52 pm

Re: XE303C12 with mainline kernel, backlight permissions pro

Postby doragasu1 » Wed Jul 13, 2016 4:20 pm

Finally I got it working, but I'm not really proud of the hackish udev rule I wrote:

$this->bbcode_second_pass_code('', '$ cat /etc/udev/rules.d/99-backlight.rules
KERNEL=="backlight", SUBSYSTEM=="backlight", ACTION=="add", PROGRAM="/bin/sh -c 'chown root:users /sys/devices/platform/backlight/backlight/backlight/brightness ; chmod 660 /sys/devices/platform/backlight/backlight/backlight/brightness'"')
Sure there must be a more elegant way of doing this.
doragasu1
 
Posts: 100
Joined: Sun Jun 03, 2012 3:52 pm

Re: XE303C12 with mainline kernel, backlight permissions pro

Postby WarheadsSE » Wed Jul 13, 2016 8:38 pm

Seems more like the kernel should be creating it as root:video 660 out of the gate.

For a tmpfiles.d entry, you will want 'z' and not 'f', IIRC.
Last edited by WarheadsSE on Wed Jul 13, 2016 8:38 pm, edited 1 time in total.
Reason: typo
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: XE303C12 with mainline kernel, backlight permissions pro

Postby doragasu1 » Thu Jul 14, 2016 7:25 am

I already tried with 'z', same result. Also tried with several different paths to the file (the original path under /sys/devices/platform/backlight/... and some going through symlinks).
doragasu1
 
Posts: 100
Joined: Sun Jun 03, 2012 3:52 pm

Re: XE303C12 with mainline kernel, backlight permissions pro

Postby WarheadsSE » Thu Jul 14, 2016 4:26 pm

Still, should be root:video and not root:users
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: XE303C12 with mainline kernel, backlight permissions pro

Postby doragasu1 » Thu Jul 14, 2016 4:30 pm

OK, I'll change it. Thanks for the tip!
doragasu1
 
Posts: 100
Joined: Sun Jun 03, 2012 3:52 pm


Return to Samsung

Who is online

Users browsing this forum: No registered users and 5 guests

cron