From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1LLKDy-0002H0-C1 for garchives@archives.gentoo.org; Fri, 09 Jan 2009 16:28:42 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EA3DAE0357; Fri, 9 Jan 2009 16:28:40 +0000 (UTC) Received: from rv-out-0708.google.com (rv-out-0708.google.com [209.85.198.243]) by pigeon.gentoo.org (Postfix) with ESMTP id AC0D6E0357 for ; Fri, 9 Jan 2009 16:28:40 +0000 (UTC) Received: by rv-out-0708.google.com with SMTP id b17so10230672rvf.46 for ; Fri, 09 Jan 2009 08:28:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=BW1FvVzW3Fo96Tlu1zo2uC6HCDh61PvO4ROEe4Ruwy8=; b=r+VSYpnCe/3Utzk1mykozzmTEA74FVaFZivtgIObFYOcKf5fgA5f3h+GUAPexYRvUI gpm2cVf2fSsV/7/Ug02bNUnabHF0qSf61QglN/PqJPEjNuNU1QXzDHYzhPWLY5DlZbIj 9UXN+YIN1ZAB1JvTP0ffzA5CtK7faHtYjh3h4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=nX1sFgq7YWgVTP2K6M35zmq/YoORFnTUVwoyI+0/sZQBkzU554S3r+cEqXNPJMS3r6 rNXwZ922J5TjOmCVYGX6EZothB70DTyhx8ERDwPZObfpvSVMJ1/D9pgDbt4SF2QGRJM4 DVTBW53S/wcKTk0cMtUvSm0KYDJvoFX/T70e4= Received: by 10.141.79.12 with SMTP id g12mr12841659rvl.54.1231518520310; Fri, 09 Jan 2009 08:28:40 -0800 (PST) Received: by 10.140.202.6 with HTTP; Fri, 9 Jan 2009 08:28:40 -0800 (PST) Message-ID: <94f5c8410901090828g1f55b87du9b35c70a88bca00d@mail.gmail.com> Date: Fri, 9 Jan 2009 17:28:40 +0100 From: "Andrea Momesso" To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Permissions of files in /sys/ In-Reply-To: <58965d8a0901071247x2663df01o5e3c963f83d244df@mail.gmail.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20090107142956.GB5477@revolver> <58965d8a0901071247x2663df01o5e3c963f83d244df@mail.gmail.com> X-Archives-Salt: 955e56ed-218d-4459-a5ae-8385dc093b2a X-Archives-Hash: 3f216191bc88ea205d3fbbceff5fdc87 On Wed, Jan 7, 2009 at 9:47 PM, Paul Hartman wrote: > On Wed, Jan 7, 2009 at 8:29 AM, Momesso Andrea 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