LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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, 08: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, 08:50 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 1,773

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
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 09:01 AM. Reason: de-smilify
 
Old 04-04-2011, 09: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, 10:59 AM   #4
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 1,773

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Drivers that don't depend on each other can be loaded in any order. Why does it matter?
 
Old 04-05-2011, 11: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, 09:26 AM   #6
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 1,773

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
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 7 02-27-2013 01:27 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 09:03 PM
how do I determine the order modules get loaded? Simon Bridge Linux - General 6 04-26-2006 10:15 AM
Looking for the file that control what processes are loaded! sjia Linux - Software 1 04-08-2004 01:21 AM


All times are GMT -5. The time now is 02:27 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration