Change group of the /dev/fb0 from "root" to "video" permanently on imx6 card
Linux - Embedded & Single-board computerThis forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.
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.
Change group of the /dev/fb0 from "root" to "video" permanently on imx6 card
Hello guys ,
I am working on an embedded device (arm imx6), and i want the change the group of the /dev/fb0,
actually it looks like by default the group of this file is "root" , but i want to change the group to "video"
so i added the following rule on /lib/udev/rules.d/
name of the rule : 99-fb-permissions.rules
content of the rule: KERNEL=="fb[0-9]*", NAME="fb/%n", SYMLINK+="%k", GROUP="video", OPTIONS+="last_rule"
to change the group for fb* nodes,
when i test this rule with : udevadm trigger /lib/udev/rules.d/99-fb-permissions.rules , i see that the group of /dev/fb0 is correctly changed to "video"
crw-rw---- 1 root video 29, 0 Jul 25 09:24 /dev/fb0
But when i restart the system the group changes again to "root"
crw-rw---- 1 root root 29, 0 Jul 25 09:26 /dev/fb0
Do you have any idea what could be the cause of this change ?
How can i identify the source of this problem?
Maybe some other rule before your rule is setting the group to root and also has the option "last_rule" set? Check all rules that may be affecting your device (/etc/udev/rules.d and /lib/udev/rules.d)
I just checked the other rules, and unfortunately there are no rules that change the group,
Except udev rules , or systemd (already checked) is there any other files that are supposed to change group,
Do you have any advice on where can i search?
root@TBX01:/lib/udev/rules.d udevadm test `udevadm info -q path -n /dev/fb0`
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.
ACTION=add
DEVLINKS=/dev/fb0
DEVNAME=/dev/fb0
DEVPATH=/devices/platform/mxc_sdc_fb.0/graphics/fb0
ID_USB_INTERFACE_NUM=
MAJOR=29
MINOR=0
SUBSYSTEM=graphics
UDEV_LOG=6
USEC_INITIALIZED=1360664
And i am already having this line:
Code:
SUBSYSTEM=="graphics", GROUP="video"
Under /lib/udev/rules.d/50-udev-default.rules
So can we say that my udev rule is applied correctly , and maybe there is something else (not an udev rule who erase the video group on startup) ?
Do you have any other suggestion?
So can we say that my udev rule is applied correctly , and maybe there is something else (not an udev rule who erase this group assignation on startup) ?
Do you have any other suggestion?
It doesn't look like that's the case... Did 'udevadm test' report that this rule was applied?
I'm not sure if you pasted the full output of the command, so I can't check.
It doesn't look like that's the case... Did 'udevadm test' report that this rule was applied?
I'm not sure if you pasted the full output of the command, so I can't check.
Actually i pasted the full output,
I just found the line "SUBSYSTEM=="graphics", GROUP="video"" by myself when doing :
Code:
cat /lib/udev/rules.d/50-udev-default.rules
The full output is only this part:
Code:
root@TBX01:/lib/udev/rules.d udevadm test `udevadm info -q path -n /dev/fb0`
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.
ACTION=add
DEVLINKS=/dev/fb0
DEVNAME=/dev/fb0
DEVPATH=/devices/platform/mxc_sdc_fb.0/graphics/fb0
ID_USB_INTERFACE_NUM=
MAJOR=29
MINOR=0
SUBSYSTEM=graphics
UDEV_LOG=6
USEC_INITIALIZED=1360664
The reason why I asked if you pasted the full output is that I'm missing the lines where udevadm is telling which rules were applied. Udevadm prints that extra information to stderr (on my system), so maybe your console doesn't show that. Try this:
Code:
udevadm test `udevadm info -q path -n /dev/fb0` 2>&1
If that doesn't give you the full output, try:
Code:
udevadm test `udevadm info -q path -n /dev/fb0` &>/tmp/my-udevadm.log
cat /tmp/my-udevadm.log
The reason why I asked if you pasted the full output is that I'm missing the lines where udevadm is telling which rules were applied. Udevadm prints that extra information to stderr (on my system), so maybe your console doesn't show that. Try this:
Code:
udevadm test `udevadm info -q path -n /dev/fb0` 2>&1
If that doesn't give you the full output, try:
Code:
udevadm test `udevadm info -q path -n /dev/fb0` &>/tmp/my-udevadm.log
cat /tmp/my-udevadm.log
Please send the result.
Dear rocq, thank you for your time
Here is the result of udevadm test `udevadm info -q path -n /dev/fb0` 2>&1:
Code:
root@TBX01:~ udevadm test `udevadm info -q path -n /dev/fb0` 2>&1
This program is for debugging only, it does not run anya RUN key. It may show incorrect results, becaev/fb0
DEVNAME=/dev/fb0
DEVPATH=/devices/platform/mxc_sdc_fb.0/graphics/fb0
ID_USB_INTERFACE_NUM=
MAJOR=29
MINOR=0
So i tested udevadm test `udevadm info -q path -n /dev/fb0` &>/tmp/my-udevadm.log:
And cat /tmp/my-udevadm.log give me only this:
Code:
root@TBX01:~ cat /tmp/my-udevadm.log
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.
ACTION=add
DEVLINKS=/dev/fb0
DEVNAME=/dev/fb0
DEmxc_sdc_fb.0/graphics/fb0
ID_USB_INTERFACE_NUM=
MAJOR=29
MINOR=0
SUBSYSTEM=graphics
UDEV_LOG=6
USEC_INITIALIZED=13158416
root@TBX01:~
I don't know but maybe there is settings to change verbosity , and to get more output?
I don't know but maybe there is settings to change verbosity , and to get more output?
Yes maybe, did you check 'udevadm test -h'?
I am stumped that 'udevadm test' doesn't even show you that it is reading the udev rules (The lines that start with "Reading rules file:..."). For the sake of debugging this issue I would recommend to remove your rule for now.
Do you have any rules in /etc/udev/rules.d?
What's the output of 'udevadm test' when you try other devices?
What are the contents of /etc/udev/udev.conf
Are you running systemd? If yes, what's the output of commands 'systemctl status -l --no-pager -n 1000 systemd-udevd' and 'systemctl status -l --no-pager -n 1000 systemd-udev-trigger'?
I just found how to enable system logging with udev (option in my kernel configuration) and for now here is the output of the command:
Code:
udevadm test `udevadm info -q path -n /dev/fb0`
is:
Code:
run_command: calling: test
adm_test: version 181
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.
builtin_kmod_init: load module index
add_matching_files: unable to open '/etc/udev/rules.d': No such file or directory
add_matching_files: unable to open '/run/udev/rules.d': No such file or directory
parse_file: reading '/lib/udev/rules.d/50-udev-default.rules' as rules file
util_lookup_group: specified group 'audio' unknown
parse_file: reading '/lib/udev/rules.d/60-persistent-alsa.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-input.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-serial.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-storage-tape.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-storage.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-net-description.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-tty-description.rules' as rules file
parse_file: reading '/lib/udev/rules.d/78-sound-card.rules' as rules file
parse_file: reading '/lib/udev/rules.d/80-drivers.rules' as rules file
parse_file: reading '/lib/udev/rules.d/85-usb-drives-auto-mounting.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-keyboard-force-release.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-keymap.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-udev-late.rules' as rules file
parse_file: reading '/lib/udev/rules.d/99-permissions.rules' as rules file
parse_file: reading '/lib/udev/rules.d/99-systemd.rules' as rules file
parse_file: reading '/lib/udev/rules.d/99-usb-serial.rules' as rules file
udev_rules_new: rules use 17028 bytes tokens (1419 * 12 bytes), 12122 bytes buffer
udev_rules_new: temporary index used 11940 bytes (597 * 20 bytes)
udev_device_new_from_syspath: device 0x3a350 has devpath '/devices/platform/mxc_sdc_fb.0/graphics/fb0'
udev_device_new_from_syspath: device 0x3a4a8 has devpath '/devices/platform/mxc_sdc_fb.0/graphics/fb0'
udev_device_read_db: device 0x3a4a8 filled with db file data
udev_rules_apply_to_event: GROUP 113 /lib/udev/rules.d/50-udev-default.rules:38
udev_rules_apply_to_event: GROUP 113 /lib/udev/rules.d/99-permissions.rules:1
udev_rules_apply_to_event: NAME="fb/%n" ignored, kernel device nodes can not be renamed; please fix it in /lib/udev/rules.d/99-permissions.rules:1
udev_rules_apply_to_event: LINK 'fb0' /lib/udev/rules.d/99-permissions.rules:1
udev_node_add: handling device node '/dev/fb0', devnum=c29:0, mode=0660, uid=0, gid=113
node_fixup: set permissions /dev/fb0, 020660, uid=0, gid=113
node_symlink: preserve already existing symlink '/dev/char/29:0' to '../fb0'
link_find_prioritized: found 'c29:0' claiming '/run/udev/links/fb0'
link_update: creating link '/dev/fb0' to '/dev/fb0'
node_symlink: found existing node instead of symlink '/dev/fb0'
node_symlink: device node '/dev/fb0' already exists, link to '/dev/fb0' will not overwrite it
udev_device_update_db: created db file '/run/udev/data/c29:0' for '/devices/platform/mxc_sdc_fb.0/graphics/fb0'
ACTION=add
DEVLINKS=/dev/fb0
DEVNAME=/dev/fb0
DEVPATH=/devices/platform/mxc_sdc_fb.0/graphics/fb0
ID_USB_INTERFACE_NUM=
MAJOR=29
MINOR=0
SUBSYSTEM=graphics
UDEV_LOG=6
USEC_INITIALIZED=13576822
builtin_kmod_exit: unload module index
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.