/dev/fb0 access denied when using fbi


Forum: Other Help Topics
Topic: /dev/fb0 access denied when using fbi
started by: Zucca

Posted by Zucca on Jan. 23 2007,15:26
I found really neat program called < fbi >.
fbi uses framebuffer console to view images. It's handy tool if you have a server and no X installed (or want to save resources by not running X).
Now my problem is when I try to view any pictire with it I get an error telling me that I have no permissions to open /dev/fb0.
I managed to bypass the problem by executing fbi with sudo.
cdmodding can't be done and I wouldn't like to do that anyways.

Do I need to add user dsl to some group(s) to make that work?

Any suggestions?

Posted by mikshaw on Jan. 23 2007,17:32
You might be able to fix it by changing permissions on /dev/fb0. For example, if you need write access to the device, you might chmod g+w and chown root.staff

I was trying to get fbi running in DSL as a uci a long while ago, had a problem relating to a font server, which I didn't understand, and so I gave up. Good luck.

Posted by Zucca on Jan. 24 2007,04:41
Even if I was root I can't change permissions to /dev/fb0 or any other /dev/fb*.
It works just fine but that is the problem. As I said, it works just fine as running it as root.

Posted by ^thehatsrule^ on Jan. 24 2007,05:11
What's the problem when you try to change the permission on /deb/fb0 ?  What's the current permissions on them?

From google, it seems to be working for others... maybe just try and chmod 666 it.

Posted by Zucca on Jan. 24 2007,11:17
I get this:
Code Sample
$ sudo chmod 666 /dev/fb0
chmod: changing permissions of `/dev/fb0': Read-only file system

Posted by roberts on Jan. 24 2007,14:36
SOP
# rm /dev/fb0
# cp /KNOPPIX/dev/fb0 /dev/fb0

Posted by Zucca on Jan. 25 2007,09:50
Oh no.
Something went badly wrong:
Code Sample
sudo cp /KNOPPIX/dev/fb0 /dev/fb0
cp: writing `/dev/fb0': No space left on device

Removing was succesful, but as you can see copying wasn't.
Now I have no /dev/fb0 at all!

Posted by Zucca on Jan. 25 2007,10:09
Ok. I got it back like it was.
It seems that when I copied fb0 from /KNOPPIX it filled all available space and then reported about the unsufficient space.
AFAIK all files in /KNOPPIX/dev aren't just regular files. They have no size and so on. So it would be actually impossible to copy those files.
I belive I must somehow re-mount /KNOPPIX as read-write then chmod /KNOPPIX/dev/fb0 and then again re-mount /KNOPPIX to read-only.

Posted by mikshaw on Jan. 25 2007,14:05
You can't remount KNOPPIX read-write because it is an iso9660 filesystem. The filesystem itself is read-only by design.

I can't think of any solution at the moment...i'll think about it.

Posted by roberts on Jan. 25 2007,16:38
Instead of cp on character special file do this after the removal of the link /dev/fb0

sudo mknod /dev/fb0 c 29 0

This will re-create the "c" special file.
Then be sure to chmod and chgrp per your requirements.


One other thing you might want to consider instead of removing and recreating /dev/fb0...

The group for /dev/fb0 is tty, add this group to user dsl and try your program

sudo usermod -G tty dsl

Posted by mikshaw on Jan. 25 2007,18:22
one thing about usermod -G....
I had the understanding that this replaces the user's groups, rather than adds to them.  Would you need to do this:
sudo usermod -G staff,dialout,fax,voice,cdrom,floppy,tape,sudo,audio,dip,video,games,users,usb,tty dsl

I'm not sure about that, but it's the command I use to fix dsl's permissions to use a subshell with mc.uci

Posted by ^thehatsrule^ on Jan. 26 2007,00:13
For special device files, I've used cp -a on them before to get them to work.
Posted by mikshaw on Jan. 26 2007,00:51
That may not work for the framebuffer device, or other tty device.  I'm guessing cp tries to read the device, which i assume is constantly changing or being written...something like that (example: try "cat /dev/tty1" and the command doesn't complete). Copying some devices may just copy the /dev/whatever file itself, but I have a feeling that this is an exception.
Posted by Zucca on Jan. 30 2007,12:07
Quote
      -G group,[...]
             A  list of supplementary groups which the user is also a member
             of.  Each group is separated from the next by a comma, with  no
             intervening  whitespace.   The  groups  are subject to the same
             restrictions as the group given with the  -g  option.   If  the
             user  is currently a member of a group which is not listed, the
             user will be removed from the  group.  This  behaviour  can  be
             changed  via  -a option, which appends user to the current sup-
             plementary group list.

AND
Quote
$ ls -lhaF /KNOPPIX/dev/fb* | head -n 3
crw--w--w-    1 root     tty       29,   0 Apr 15  2001 /KNOPPIX/dev/fb0
crw--w--w-    1 root     tty       29,   1 Apr 15  2001 /KNOPPIX/dev/fb0autodetect
crw--w--w-    1 root     tty       29,   0 Apr 15  2001 /KNOPPIX/dev/fb0current

Then this should work:
Code Sample
sudo usermod -a -G tty dsl


... But as usermod is old in dsl you must specify all the groups. ;(
I wonder if there's a way somehow to list groups where a user belongs to..?

Posted by mikshaw on Jan. 30 2007,14:34
As dsl: groups
As root: groups dsl

I imagine one could write a small script that uses groups to list your groups and appends to that, so you don't need to type a list of groups.

GRPS=`groups`
sudo usermod -G $GRPS tty dsl

Posted by roberts on Jan. 30 2007,16:32
How about:

sudo adduser dsl tty


You can also check groups assigned to user dsl with

grep dsl /etc/group

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.