LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-04-2011, 07:04 AM   #1
skiron.liu
Member
 
Registered: Jun 2009
Location: Harbin
Posts: 32

Rep: Reputation: 0
Unhappy How to control the driver order be loaded by linux


How to control the driver order be loaded by linux?

For example:
I have two ethernet card is A and B. Sometimes A be loaded first sometimes another. How to control A card be load first in every times?
 
Old 04-04-2011, 07:50 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,125

Rep: Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260
The real question is why do you care what order drivers are loaded?

I don't know the answer to that but I'm going to take a wild guess that the real problem you are trying to solve is that you want eth0 and eth1 to be specific ports and to come up the same every time.

You can specify the MAC address in the /etc/sysconfig/network-scripts/ifcfg-eth0 file. Add a line like this:
Code:
HWADDR=00:0B:DB:E7:29:D9
Or you could use /etc/modprobe.conf to set a desired alias for each driver:
eth0 bnx2
eth1 e1000

Last edited by smallpond; 04-04-2011 at 08:01 AM. Reason: de-smilify
 
Old 04-04-2011, 08:10 AM   #3
skiron.liu
Member
 
Registered: Jun 2009
Location: Harbin
Posts: 32

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by smallpond View Post
The real question is why do you care what order drivers are loaded?

I don't know the answer to that but I'm going to take a wild guess that the real problem you are trying to solve is that you want eth0 and eth1 to be specific ports and to come up the same every time.

You can specify the MAC address in the /etc/sysconfig/network-scripts/ifcfg-eth0 file. Add a line like this:
HWADDR=00:0BB:E7:299

Or you could use /etc/modprobe.conf to set a desired alias for each driver:
eth0 bnx2
eth1 e1000
But in my case the alias and MAC mapping has doesn't change! Just changed the driver order be loaded.
I use the "ip addr" command, it show me the Ethernet Card information. First, the eth0 is No.1 but after I reboot the computer, it show me the eth1 is No.1.
 
Old 04-04-2011, 09:59 AM   #4
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,125

Rep: Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260
Drivers that don't depend on each other can be loaded in any order. Why does it matter?
 
Old 04-05-2011, 10:41 AM   #5
skiron.liu
Member
 
Registered: Jun 2009
Location: Harbin
Posts: 32

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by smallpond View Post
Drivers that don't depend on each other can be loaded in any order. Why does it matter?
My server run a software , it read the first load driver of Ethernet Card that software generate a S/N. My software use this to register. If I reboot my server, the first load driver is B not A that meaning I will reapply register!

do you know my meaning?
 
Old 04-06-2011, 08:26 AM   #6
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,125

Rep: Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260
Quote:
Originally Posted by skiron.liu View Post
My server run a software , it read the first load driver of Ethernet Card that software generate a S/N. My software use this to register. If I reboot my server, the first load driver is B not A that meaning I will reapply register!

do you know my meaning?
OK. Try the following in /etc/modprobe.conf:

install module2 /sbin/modprobe module1; /sbin/modprobe --ignore-install module2

where you want module1 loaded before module2.
 
  


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
How to control file order in rsync Skaperen Linux - Software 10 06-19-2020 08:10 PM
what linux driver do i need in order to get internet using a WiFi-AP Solo solution spinksc Linux - Newbie 3 05-02-2008 08:03 PM
how do I determine the order modules get loaded? Simon Bridge Linux - General 6 04-26-2006 09:15 AM
Looking for the file that control what processes are loaded! sjia Linux - Software 1 04-08-2004 12:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 10:38 AM.

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