LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This 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


Reply
  Search this Thread
Old 07-25-2018, 03:24 AM   #1
mostefa
LQ Newbie
 
Registered: Jul 2018
Posts: 10

Rep: Reputation: Disabled
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?

Thank you in advance
 
Old 07-26-2018, 01:32 AM   #2
rocq
Member
 
Registered: Jan 2013
Location: Netherlands
Distribution: XUbuntu
Posts: 57

Rep: Reputation: Disabled
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)
 
Old 07-26-2018, 06:50 AM   #3
mostefa
LQ Newbie
 
Registered: Jul 2018
Posts: 10

Original Poster
Rep: Reputation: Disabled
Dear rocq,

Thank you for your answer,

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?
 
Old 07-27-2018, 12:35 AM   #4
rocq
Member
 
Registered: Jan 2013
Location: Netherlands
Distribution: XUbuntu
Posts: 57

Rep: Reputation: Disabled
Execute the following command and inspect the output:
Code:
udevadm test `udevadm info -q path -n /dev/fb0`
This will show which rules are applied to the /dev/fb0 device.

I'm using a board based on Beagleboard Black (TI AM335x processor). On that system it looks like this:
Code:
# ls -l /dev/fb0
crw-rw---- 1 root video 29, 0 Jul 17 14:38 /dev/fb0
# udevadm test `udevadm info -q path -n /dev/fb0`                                                                                                                            
calling: test
version 232
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.

=== trie on-disk ===
tool version:          232
file size:         8440991 bytes
header size             80 bytes
strings            1846911 bytes
nodes              6594000 bytes
Load module index
Found container virtualization none
timestamp of '/etc/systemd/network' changed
Parsed configuration file /lib/systemd/network/99-default.link
Created link configuration context.
timestamp of '/etc/udev/rules.d' changed
Reading rules file: /lib/udev/rules.d/50-firmware.rules
Reading rules file: /lib/udev/rules.d/50-udev-default.rules
Reading rules file: /lib/udev/rules.d/60-block.rules
Reading rules file: /lib/udev/rules.d/60-cdrom_id.rules
Reading rules file: /lib/udev/rules.d/60-drm.rules
Reading rules file: /lib/udev/rules.d/60-evdev.rules
Reading rules file: /lib/udev/rules.d/60-persistent-alsa.rules
Reading rules file: /lib/udev/rules.d/60-persistent-input.rules
Reading rules file: /lib/udev/rules.d/60-persistent-storage-tape.rules
Reading rules file: /lib/udev/rules.d/60-persistent-storage.rules
Reading rules file: /lib/udev/rules.d/60-persistent-v4l.rules
Reading rules file: /lib/udev/rules.d/60-serial.rules
Reading rules file: /lib/udev/rules.d/64-btrfs-dm.rules
Reading rules file: /lib/udev/rules.d/64-btrfs.rules
Reading rules file: /lib/udev/rules.d/70-mouse.rules
Reading rules file: /lib/udev/rules.d/70-power-switch.rules
Reading rules file: /lib/udev/rules.d/70-touchpad.rules
Reading rules file: /lib/udev/rules.d/70-uaccess.rules
Reading rules file: /lib/udev/rules.d/71-seat.rules
Reading rules file: /lib/udev/rules.d/73-seat-late.rules
Reading rules file: /lib/udev/rules.d/75-net-description.rules
Reading rules file: /lib/udev/rules.d/75-probe_mtd.rules
Reading rules file: /lib/udev/rules.d/78-sound-card.rules
Reading rules file: /lib/udev/rules.d/80-drivers.rules
Reading rules file: /lib/udev/rules.d/80-net-setup-link.rules
Reading rules file: /lib/udev/rules.d/90-alsa-restore.rules
Reading rules file: /lib/udev/rules.d/99-systemd.rules
Reading rules file: /lib/udev/rules.d/automount.rules
Reading rules file: /etc/udev/rules.d/touchscreen.rules
rules contain 24576 bytes tokens (2048 * 12 bytes), 9367 bytes strings
1383 strings (16845 bytes), 900 de-duplicated (7962 bytes), 484 trie nodes used
GROUP 44 /lib/udev/rules.d/50-udev-default.rules:34
IMPORT builtin 'path_id' /lib/udev/rules.d/71-seat.rules:49
handling device node '/dev/fb0', devnum=c29:0, mode=0660, uid=0, gid=44
preserve permissions /dev/fb0, 020660, uid=0, gid=44
preserve already existing symlink '/dev/char/29:0' to '../fb0'
created db file '/run/udev/data/c29:0' for '/devices/platform/ocp/4830e000.lcdc/graphics/fb0'
ACTION=add
DEVNAME=/dev/fb0
DEVPATH=/devices/platform/ocp/4830e000.lcdc/graphics/fb0
ID_FOR_SEAT=graphics-platform-4830e000_lcdc
ID_PATH=platform-4830e000.lcdc
ID_PATH_TAG=platform-4830e000_lcdc
MAJOR=29
MINOR=0
SUBSYSTEM=graphics
TAGS=:master-of-seat:seat:
USEC_INITIALIZED=12011403
Unload module index
Unloaded link configuration context.
So on my system the video group is assigned to /dev/fb0 by rule /lib/udev/rules.d/50-udev-default.rules, line 34:
Code:
...
SUBSYSTEM=="video4linux", GROUP="video"
SUBSYSTEM=="graphics", GROUP="video"
SUBSYSTEM=="drm", GROUP="video"
SUBSYSTEM=="dvb", GROUP="video"
...

Last edited by rocq; 07-27-2018 at 12:40 AM.
 
1 members found this post helpful.
Old 07-27-2018, 02:26 AM   #5
mostefa
LQ Newbie
 
Registered: Jul 2018
Posts: 10

Original Poster
Rep: Reputation: Disabled
Here is the output of the command:

Code:
udevadm test `udevadm info -q path -n /dev/fb0`
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
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?

Last edited by mostefa; 07-27-2018 at 02:34 AM.
 
Old 07-27-2018, 02:37 AM   #6
rocq
Member
 
Registered: Jan 2013
Location: Netherlands
Distribution: XUbuntu
Posts: 57

Rep: Reputation: Disabled
Quote:
And i am already having this line on:

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 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.
 
Old 07-27-2018, 02:49 AM   #7
mostefa
LQ Newbie
 
Registered: Jul 2018
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rocq View Post
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

Last edited by mostefa; 07-27-2018 at 02:50 AM.
 
Old 07-27-2018, 02:53 AM   #8
mostefa
LQ Newbie
 
Registered: Jul 2018
Posts: 10

Original Poster
Rep: Reputation: Disabled
Here is a screenshot of my terminal

https://image.ibb.co/k88heT/udev_Rules_Problem.png
 
Old 07-27-2018, 03:08 AM   #9
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: arch
Posts: 668

Rep: Reputation: 190Reputation: 190
I am not sure of the use case here, so please enlighten me if my suggestion is off base. But couldn't you just chown the location? e.g.
Code:
 chown root:video /dev/fb0
if all you want is to change the group ownership to video?
 
Old 07-27-2018, 04:45 AM   #10
rocq
Member
 
Registered: Jan 2013
Location: Netherlands
Distribution: XUbuntu
Posts: 57

Rep: Reputation: Disabled
Quote:
Originally Posted by TheEzekielProject View Post
I am not sure of the use case here, so please enlighten me if my suggestion is off base. But couldn't you just chown the location? e.g.
Code:
 chown root:video /dev/fb0
if all you want is to change the group ownership to video?
No, udev will reset that back to the original after a reboot. Unless... the device isn't managed by udev.
 
Old 07-27-2018, 04:55 AM   #11
rocq
Member
 
Registered: Jan 2013
Location: Netherlands
Distribution: XUbuntu
Posts: 57

Rep: Reputation: Disabled
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.
 
1 members found this post helpful.
Old 07-27-2018, 08:31 AM   #12
mostefa
LQ Newbie
 
Registered: Jul 2018
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rocq View Post
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?

Last edited by mostefa; 07-27-2018 at 08:38 AM.
 
Old 07-30-2018, 02:39 AM   #13
rocq
Member
 
Registered: Jan 2013
Location: Netherlands
Distribution: XUbuntu
Posts: 57

Rep: Reputation: Disabled
Quote:
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'?
 
Old 07-31-2018, 04:09 AM   #14
mostefa
LQ Newbie
 
Registered: Jul 2018
Posts: 10

Original Poster
Rep: Reputation: Disabled
Dear rocq,

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
 
Old 07-31-2018, 06:12 AM   #15
rocq
Member
 
Registered: Jan 2013
Location: Netherlands
Distribution: XUbuntu
Posts: 57

Rep: Reputation: Disabled
Great!

Now verify that 113 is actually the group ID of the "video" group:
Code:
cat /etc/group | grep video
Secondly, I would recommend that you remove your own rule 99-permissions.rules since 50-udev-default.rules already applies the video group to /dev/fb0
 
  


Reply



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
Logged in as "root"/Fedora 8 but get "Operation not permitted" when using "chmod etc gosunlee Linux - Newbie 7 02-10-2008 05:56 AM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
Video Card Nvidia Driver Xlib: extension "GLX" missing on display ":0.0". HELP! badgerbox76 Linux - Newbie 35 03-08-2007 02:27 AM
Video Card Nvidia Driver Xlib: extension "GLX" missing on display ":0.0". badgerbox76 Linux - Games 13 01-11-2006 04:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration