[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-hotplug
Subject:    Re: a question on hardware probing mechanism in linux( before udev
From:       Greg KH <greg () kroah ! com>
Date:       2007-12-18 23:09:52
Message-ID: 20071218230952.GB13614 () kroah ! com
[Download RAW message or body]

On Tue, Dec 18, 2007 at 02:25:01PM +0800, leilei175@gmail.com wrote:
> I have checked many places to find the answer to this question.
> 
> Apparently I'm not the only person bothered by this problem.
> according to the explanation from redhat
> ````````snip````````
> The 2.6.9-55 version of the Red Hat Enterprise Linux 4 kernel (Update
> 5) reverts to the 2.4 ordering of network interface cards (NICs) on
> certain systems. Note that if the "HWADDR=MAC ADDRESS" line is present
> in the /etc/sysconfig/network-scripts/ifcfg-ethX files, the NIC
> ordering will not change.
> 
> To restore the original 2.6 ordering, which is different from the 2.4
> ordering, boot with the option pci=nobfsort
> ``````````snip`````````
> 
> I have checked the source code for this.Setting "pci=nobfsort" would
> go to the pci_sort_breadthfirst kernel path.As I'm not quite familiar
> with the pci subsystem of linux I can't figure out how the probing and
> sorting process is going on.I guess there are a certain data structure
> in the kernel space to store the hardware detecting result,and then
> use the result along with modprobe.conf to insert the coresponding
> module .After this the /sys fs can store information related to
> hardware connected to this box.
> 
> I am not sure if this is the right process of hardware probing and
> device naming.
> 
> Really apreciate your explaination to make this more clear to me.
> 
> Thanks
> 
> 2007/12/14, leilei175@gmail.com <leilei175@gmail.com>:
> > Hi greg,
> >
> > I have some question about the naming method in linux.I have read a
> > lot articles written by you concerning udev,all of them are quite
> > useful,and the consistent naming rules is fantastic.However there is
> > still some questions in my head.
> > As udev is running in userspace,and it can't be used before /sysfs is
> > mounted,how and when did linux kernel managed to probe all those
> > devices connected to the box?I guess it has something to do with the
> > init script file in initrd.img.
> > such as:
> > echo "Loading scsi_mod.ko module"
> > insmod /lib/scsi_mod.ko
> > echo "Loading sd_mod.ko module"
> > insmod /lib/sd_mod.ko
> > echo "Loading libata.ko module"
> > insmod /lib/libata.ko
> > echo "Loading ata_piix.ko module"
> > insmod /lib/ata_piix.ko
> > echo "Loading jbd.ko module"
> > insmod /lib/jbd.ko
> > echo "Loading ext3.ko module"

What distro does this?  That's pretty deterministic, no ordering issues
there :)

> > then another question comes to me,how did the kernel decide the order
> > of these module inserting?Is this has anything to do with
> > modprobe.conf file?

It all depends on the distro involved.

> > Actully this question come from a EL4U5 installation problem I am facing.
> >
> > when booting from "install CD".My two disks are detected as sda&sdb
> > however after the installation(partition,format,installing packages)
> > these two become sdb&sdc,the sda become my usb-storage.(no plug in or
> > remove device during the installation)
> >
> > This problem never come up when installing other version of RedHat linux.
> > In other version of EL and RHEL create /etc/modprobe.conf like this,
> > @ alias scsi_hostadapter mptbase
> > @ alias scsi_hostadapter1 mptsas
> > @ alias scsi_hostadapter2 usb-storage
> >
> > But EL4 U5 creates,
> > @ alias scsi_hostadapter usb-storage
> > @ alias scsi_hostadapter1 mptbase
> > @ alias scsi_hostadapter2 mptsas
> > Because of this, "sda" is reserved for usb-storage and "mpt" devices shift.
> > I'm not sure which command generates /etc/modprobe.conf file, and what
> > determines the order of module inserting.

As this is a RHEL specific question, I suggest you ask this on a RHEL
mailing list, as I have no idea what they are doing in their init
scripts, and it really has nothing to do with hotplug or udev issues at
all, it looks to be all hard-coded here.

good luck,

greg k-h

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic