public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Andrea Momesso" <momesso.andrea@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Permissions of files in /sys/
Date: Fri, 9 Jan 2009 17:28:40 +0100	[thread overview]
Message-ID: <94f5c8410901090828g1f55b87du9b35c70a88bca00d@mail.gmail.com> (raw)
In-Reply-To: <58965d8a0901071247x2663df01o5e3c963f83d244df@mail.gmail.com>

On Wed, Jan 7, 2009 at 9:47 PM, Paul Hartman
<paul.hartman+gentoo@gmail.com> wrote:
> On Wed, Jan 7, 2009 at 8:29 AM, Momesso Andrea <momesso.andrea@gmail.com> wrote:
>> I'd like to make the file /sys/class/backlight/asus-laptop/brightness
>> writeable for users, so that I don't need to be root anymore to change
>> the brightness.
>>
>> Of course I can chown or chmod ot in local.start but I'm asking if there
>> is a cleaner way.
>
> I guess you need to use udevinfo to get the important information
> about /sys/class/backlight/asus-laptop/brightness and then write up a
> rule, slap it into a file in /etc/udev/rules.d/ and enjoy your new
> permissions. :) I don't have that device on my system so I can't
> really suggest anything more specific.
>
> Here's a udev rules HOWTO that might help:
>
> http://www.reactivated.net/writing_udev_rules.html
>
> (specifically "Controlling permissions and ownership")
>
> Good luck :)
> Paul
>
>

It looks like I cannot simply write a rule to change that permission...
After experiencing some failures I guess that udev rules can change
permissions on /dev/ files, but not on /sys/ files...

This is my case:

# udevadm info -a -p /sys/class/backlight/asus-laptop/

  looking at device '/class/backlight/asus-laptop':
    KERNEL=="asus-laptop"
    SUBSYSTEM=="backlight"
    DRIVER==""
    ATTR{bl_power}=="0"
    ATTR{brightness}=="5"
    ATTR{actual_brightness}=="5"
    ATTR{max_brightness}=="15"

And this is the rule I added in /etc/udev/rules.d/10-local.rules

KERNEL=="asus-laptop", SUBSYSTEM=="backlight", GROUP="video", MODE="0660"

After a reboot I still get this:

# ls -la /sys/class/backlight/asus-laptop
total 0
drwxr-xr-x 3 root root    0 2009-01-09 15:18 .
drwxr-xr-x 3 root root    0 2009-01-09 15:18 ..
-r--r--r-- 1 root root 4096 2009-01-09 15:18 actual_brightness
-rw-r--r-- 1 root root 4096 2009-01-09 15:19 bl_power
-rw-r--r-- 1 root root 4096 2009-01-09 17:02 brightness
-r--r--r-- 1 root root 4096 2009-01-09 15:18 max_brightness
drwxr-xr-x 2 root root    0 2009-01-09 15:19 power
lrwxrwxrwx 1 root root    0 2009-01-09 15:18 subsystem -> ../../backlight
-rw-r--r-- 1 root root 4096 2009-01-09 15:18 uevent

Googling a bit I found some solutions [1] [2], but all of them are
changing the permissions at every
boot. It works, but it looks to me a bit unclean...
[1] http://wiki.laptop.org/go/Xfce_keybindings#Adjust_screen_brightness_buttons
[2] http://www.thinkwiki.org/wiki/Automatically_reduce_brightness

-- 
Momesso (TopperH) Andrea
http://topperh.blogspot.com
Jabber: topper_harley@jabber.org
ICQ: 224179391



  reply	other threads:[~2009-01-09 16:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-07 14:29 [gentoo-user] Permissions of files in /sys/ Momesso Andrea
2009-01-07 17:43 ` Dale
2009-01-07 17:49   ` Alan McKinnon
2009-01-07 20:36     ` Dale
2009-01-07 20:47 ` Paul Hartman
2009-01-09 16:28   ` Andrea Momesso [this message]
2009-01-12 18:13     ` Momesso Andrea
2009-01-12 23:54       ` Neil Bothwick
2009-01-13  6:19         ` Andrea Momesso
2009-01-13  8:17           ` Francisco Ares
2009-01-13 11:09             ` Momesso Andrea
2009-01-13 10:53           ` Volker Armin Hemmann
2009-01-13 10:59             ` Neil Bothwick
2009-01-13 11:11               ` Volker Armin Hemmann
2009-01-13 11:56                 ` Neil Bothwick
2009-01-13 11:05         ` Momesso Andrea
2009-01-17 14:30       ` pk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=94f5c8410901090828g1f55b87du9b35c70a88bca00d@mail.gmail.com \
    --to=momesso.andrea@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox