LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 07-04-2004, 04:12 AM   #1
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,460

Rep: Reputation: 98
Question udev : framebuffer device (/dev/fb0) default permissions


Hi,

As running a 2.6 kernel, I wanted to try the udev feature. I installed udev package, then reboot.

But when I tried to run mplayer in framebuffer console, mplayer complains that he can't open framebuffer device due to permission problem. So I checked the permission for /dev/fb0 :
owner : root
group : root
perms : 0600

Ok, I edited /etc/udev/permissions.d/udev.permissions and changed the lines :
# fb devices
fb:root:root:0600
fb[0-9]*:root:root:0600
fb/*:root:root:0600

to :
# fb devices
fb:root:video:0640
fb[0-9]*:root:video:0640
fb/*:root:video:0640

Now it works just fine but do you think is there any reason why the framebuffer was originally set to root group instead of video and why it was set to these very strict permissions (0600) ?
 
Old 07-04-2004, 02:45 PM   #2
HuMJohn
Member
 
Registered: Jun 2004
Location: California - home of Slackware
Distribution: Slackware
Posts: 59

Rep: Reputation: 15
When you tried to run yur 2.6.x kernel, it messed up your /dev directory (in terms of 2.4.26 and earlier kernels). The 2.6.x kernels use a different scheme for devices. The devices are autoconfig'd when the kernel or loaded module starts up, by the 'udev' utility. For more information, please read the man page for udev.

To help you out, here is a copy of the /dev/fb* listing. (NOTE: ownership is root:tty and not root:video)

hugh@Speedy:~$ ls -l /dev/fb*
crw-rw---- 1 root tty 29, 0 2002-04-15 21:49 /dev/fb0
crw-rw---- 1 root tty 29, 1 2002-04-15 21:49 /dev/fb1
crw-rw---- 1 root tty 29, 2 2002-04-15 21:49 /dev/fb2
crw-rw---- 1 root tty 29, 3 2002-04-15 21:49 /dev/fb3
crw-rw---- 1 root tty 29, 4 2002-04-15 21:49 /dev/fb4
crw-rw---- 1 root tty 29, 5 2002-04-15 21:49 /dev/fb5
crw-rw---- 1 root tty 29, 6 2002-04-15 21:49 /dev/fb6
crw-rw---- 1 root tty 29, 7 2002-04-15 21:49 /dev/fb7
crw-rw---- 1 root tty 29, 8 2002-04-15 21:49 /dev/fb8
crw-rw---- 1 root tty 29, 9 2002-04-15 21:49 /dev/fb9
hugh@Speedy:~$
 
Old 07-04-2004, 05:00 PM   #3
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,460

Original Poster
Rep: Reputation: 98
Quote:
please read the man page for udev.
...And you please read my post before answer I did not search a fix but just an answer about the default permission for framebuffer devices resulting of the default udev permissions configuration file provided by udev package.
I found theses permissions too strict for my personal use.

And also before installing udev I rm -f /dev/* to be sure that all /dev/* files will be populated.
 
Old 07-04-2004, 06:13 PM   #4
OdieQ
Member
 
Registered: Jan 2004
Location: Stockholm, Sweden
Distribution: Debian, Slackware
Posts: 71

Rep: Reputation: 15
It is generally good practice to not grant more permission than needed. Raw framebuffer access is not needed for console use or X (as X runs suid root), so it shouldn't be granted by default. Now, I haven't run udev, so I don't know their general permission policy, but I would assume that since they're not granting group access anyway, they didn't bother to set it to a specific group (such as video).

Oh, and don't you want 0660? With your settings, the video group can only read from the framebuffer, but not output anything on it, which strikes me as odd. Just out of curiosity, what do you need g+w access for?

Edit [After following your excellent advice and actually reading your original post ]:
Mplayer on framebuffer works with only read permission?

Last edited by OdieQ; 07-04-2004 at 06:17 PM.
 
Old 07-04-2004, 06:19 PM   #5
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,460

Original Poster
Rep: Reputation: 98
Well as I said (people does not like read ) it was to play video with mplayer in framebuffer console and to run SDL programs in here too as I currently learn the SDL library, I want to work with this capability.

[edit]
You were right I need write permissions for /dev/fb0, I thought just read was sufficient because mplayer ran correctly with /dev/fb0 in 0640 mode but SDL need 0660 to do buffer cache in framebuffer.

Last edited by keefaz; 07-04-2004 at 06:29 PM.
 
Old 07-04-2004, 06:39 PM   #6
OdieQ
Member
 
Registered: Jan 2004
Location: Stockholm, Sweden
Distribution: Debian, Slackware
Posts: 71

Rep: Reputation: 15
Haha, please forgive me, its 1:23 monday morning here, but i still stand by my last post. As you are learning SDL, you might be able to explain to me why read access is needed, but not write access? It would seem as if what you want to do is write to the screen?

Also, some more thoughts on the default setting. Read access means that everyone in the video group can snoop on you. They have read access to your console screen (and even the scrollback buffer) and can see everything you are doing. This is obviously not a good default, you need to think about who has this access. One thing to consider is setting permissions to a group which only console users belong to. (add the group to CONSOLE_GROUPS in login.defs)

Edit: I read your edit, feel free to disregard portions of the above text

Last edited by OdieQ; 07-04-2004 at 06:40 PM.
 
Old 07-04-2004, 06:54 PM   #7
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,460

Original Poster
Rep: Reputation: 98
Thank for your interesting advice, I think I will reset to default permissions

But something is weird, I checked the old /dev directory I backed up before install udev and checked the permissions for fb0 : 0600 root:root and SDL worked correctly in framebuffer with these settings.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mplayer: Can't open /dev/fb0: Permission denied jojoii Linux - Software 2 09-21-2008 05:56 PM
/dev/fb0: No such file or directory mukeshj Linux - Software 2 09-04-2005 11:15 AM
restoring default device ownerships/permissions under_r_run Linux - Newbie 5 07-27-2005 01:27 PM
/dev/sound/* permissions reset using udev ratman96 Linux - General 0 05-04-2005 01:13 PM
VESA framebuffer vs Intel framebuffer in Slackware 10.0 with default kernel brancalessio Slackware 3 01-20-2005 03:21 PM


All times are GMT -5. The time now is 06:55 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration