SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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) ?
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)
...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.
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?
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.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.