LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 06-02-2023, 05:35 PM   #1
husarz
Member
 
Registered: Dec 2016
Location: Poland
Distribution: Fedora/CentOS
Posts: 41

Rep: Reputation: Disabled
Proper way of overriding default GOTO udev rule


I use system with former sever board Supermicro X9SCL-F, with buil-in Matrox G200ew gaphics card, on Fedora 38. It has

Code:
61-gdm.rules
file with defaults in the path:

Code:
/usr/lib/udev/rules.d/
One of rules in the file is:

Code:
ATTR{vendor}=="0x102b", ATTR{device}=="0x0532", GOTO="gdm_disable_wayland"
This disables Wayland and forces xorg to run when defined Matrox device is detected. It is not possible to turn off the built-in Matrox G200ew in BIOS. Then even if PCIe graphics is installed the Matrox is still active, detected during system boot and disables Wayland.

How can I properly override the rule? By 'proper' I mean without editing the default rules file or shadowing it by file with same name under:

Code:
/etc/udev/rules.d
to avoid any problems after upgrades?
 
Old 06-02-2023, 07:17 PM   #2
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,702
Blog Entries: 33

Rep: Reputation: 290Reputation: 290Reputation: 290
Hi, I'm not a slack user but can you use "modeset" to ban or promote a particular module for the kernel to use?

then wayland and X11 have no choice.

on the kernel command line, use e to edit...

modeset.<module-name>=0 to ban, eg.(matrox) I use this one to ban nouveau
modeset.<module-name>=1 to promote, eg.(nvidia)

if this works for you after testing, write it into your /etc/default/grub file so it is included each time the kernel is changed.

I hope this helps you.
 
Old 06-02-2023, 09:19 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,437

Rep: Reputation: 4203Reputation: 4203Reputation: 4203Reputation: 4203Reputation: 4203Reputation: 4203Reputation: 4203Reputation: 4203Reputation: 4203Reputation: 4203Reputation: 4203
How often do yo expect the default rule to get changed such that it breaks your override ?. Should be pretty obvious if it does happen.
 
Old 06-03-2023, 03:12 PM   #4
husarz
Member
 
Registered: Dec 2016
Location: Poland
Distribution: Fedora/CentOS
Posts: 41

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by GlennsPref View Post
Hi, I'm not a slack user but can you use "modeset" to ban or promote a particular module for the kernel to use?

then wayland and X11 have no choice.

on the kernel command line, use e to edit...

modeset.<module-name>=0 to ban, eg.(matrox) I use this one to ban nouveau
modeset.<module-name>=1 to promote, eg.(nvidia)

if this works for you after testing, write it into your /etc/default/grub file so it is included each time the kernel is changed.

I hope this helps you.
Well this is not the case here. What udev is doing here is looking for the existence of particular device by its vendor id and device id and do not care if its functional by working kernel driver or not. What you referring to is just blacklisting the kernel driver preventing the device from using some part of its capabilities like higher resolutions etc. But the device is still listed and discovered by udev even when driver is not loaded.

By the way, to disable the driver you should add to kernel parameters parameter in this format:

Code:
<module-name>.modeset=0
Quote:
Originally Posted by syg00 View Post
How often do yo expect the default rule to get changed such that it breaks your override ?. Should be pretty obvious if it does happen.
Actually you can never be sure what update and in what extents will appear and be applied. This is the danger. Some more details can be found in this answer: https://stackoverflow.com/a/73661279/2968398
 
1 members found this post helpful.
Old 06-05-2023, 01:30 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,437

Rep: Reputation: 4203Reputation: 4203Reputation: 4203Reputation: 4203Reputation: 4203Reputation: 4203Reputation: 4203Reputation: 4203Reputation: 4203Reputation: 4203Reputation: 4203
Yes, I wondered if that thread prompted your concern. You should be aware of what changes are going into your system(s). Fedora doesn't blindly update /etc - maybe you should investigate rpmconf, although I've never used it; I hand check the rpm{save,new} files directly.
Later: oops, that's not what you're concerned about is it ... FWIW, I don't recall any over-rides of mine being regressed silently.

Last edited by syg00; 06-05-2023 at 02:01 AM. Reason: Later:
 
  


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
overriding /etc/udev/rules.d/70-persistent-net.rules Skaperen Linux - Networking 11 03-06-2014 09:24 PM
Proper iptables rule for vsftpd jbdkz Linux - Security 7 04-09-2013 10:14 PM
Using udev to tell Ubuntu to use the proper device on a multiple USB device Jeff91 Linux - Hardware 20 08-20-2009 12:10 PM
Goto command? batfoot Linux - General 4 08-26-2003 07:17 PM
GOTO function in bash? sobchak Programming 1 07-22-2002 05:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 02:59 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