public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* finding which pci device works as ide controller for root fs
@ 2003-08-14 16:26 Arkadiusz Miskiewicz
  2003-08-15  0:15 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Arkadiusz Miskiewicz @ 2003-08-14 16:26 UTC (permalink / raw)
  To: linux-kernel

Hi,

I need /dev/hdX -> pci id mapping for geninitrd script - with modular IDE I 
need to load some IDE controller driver from initrd to mount root fs.

Now I'm loading all modules for IDE devices found from:
awk ' { print $2 } ' /proc/bus/pci/devices
+ simple file which maps PCI ID to module name like
808684cb piix

How to find controller which is used for root fs (and do not load other 
modules)? I suppose that on 2.4 this is impossible from userspace but on 2.6 
maybe sysfs will be useful.

[arekm@mobarm arekm]$ ls -l /sys/block/hda/device
lrwxrwxrwx    1 root     root           46 2003-08-14 00:49 
/sys/block/hda/device -> ../../devices/pci0000:00/0000:00:11.1/ide0/0.0

Is it possible to get PCI ID from sysfs for specified device?

-- 
Arkadiusz Miśkiewicz    CS at FoE, Wroclaw University of Technology
arekm@sse.pl   AM2-6BONE, 1024/3DB19BBD, arekm(at)ircnet, PLD/Linux


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: finding which pci device works as ide controller for root fs
  2003-08-14 16:26 finding which pci device works as ide controller for root fs Arkadiusz Miskiewicz
@ 2003-08-15  0:15 ` Greg KH
  2003-08-15  0:38   ` Arkadiusz Miskiewicz
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2003-08-15  0:15 UTC (permalink / raw)
  To: Arkadiusz Miskiewicz; +Cc: linux-kernel

On Thu, Aug 14, 2003 at 06:26:30PM +0200, Arkadiusz Miskiewicz wrote:
> 
> [arekm@mobarm arekm]$ ls -l /sys/block/hda/device
> lrwxrwxrwx    1 root     root           46 2003-08-14 00:49 
> /sys/block/hda/device -> ../../devices/pci0000:00/0000:00:11.1/ide0/0.0
> 
> Is it possible to get PCI ID from sysfs for specified device?

It's right there in the path to the ide device "0000:00:11.1"


greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: finding which pci device works as ide controller for root fs
  2003-08-15  0:15 ` Greg KH
@ 2003-08-15  0:38   ` Arkadiusz Miskiewicz
  2003-08-15  2:39     ` Charles Lepple
  0 siblings, 1 reply; 4+ messages in thread
From: Arkadiusz Miskiewicz @ 2003-08-15  0:38 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

On Friday 15 of August 2003 02:15, Greg KH wrote:
> On Thu, Aug 14, 2003 at 06:26:30PM +0200, Arkadiusz Miskiewicz wrote:
> > [arekm@mobarm arekm]$ ls -l /sys/block/hda/device
> > lrwxrwxrwx    1 root     root           46 2003-08-14 00:49
> > /sys/block/hda/device -> ../../devices/pci0000:00/0000:00:11.1/ide0/0.0
> >
> > Is it possible to get PCI ID from sysfs for specified device?
>
> It's right there in the path to the ide device "0000:00:11.1"
How's that related to awk ' { print $2 } ' /proc/bus/pci/devices?

> greg k-h

-- 
Arkadiusz Miśkiewicz    CS at FoE, Wroclaw University of Technology
arekm@sse.pl   AM2-6BONE, 1024/3DB19BBD, arekm(at)ircnet, PLD/Linux


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: finding which pci device works as ide controller for root fs
  2003-08-15  0:38   ` Arkadiusz Miskiewicz
@ 2003-08-15  2:39     ` Charles Lepple
  0 siblings, 0 replies; 4+ messages in thread
From: Charles Lepple @ 2003-08-15  2:39 UTC (permalink / raw)
  To: linux-kernel

Arkadiusz Miskiewicz wrote:
> On Friday 15 of August 2003 02:15, Greg KH wrote:
> 
>>On Thu, Aug 14, 2003 at 06:26:30PM +0200, Arkadiusz Miskiewicz wrote:
>>
>>>[arekm@mobarm arekm]$ ls -l /sys/block/hda/device
>>>lrwxrwxrwx    1 root     root           46 2003-08-14 00:49
>>>/sys/block/hda/device -> ../../devices/pci0000:00/0000:00:11.1/ide0/0.0
>>>
>>>Is it possible to get PCI ID from sysfs for specified device?
>>
>>It's right there in the path to the ide device "0000:00:11.1"
> 
> How's that related to awk ' { print $2 } ' /proc/bus/pci/devices?

If you're looking for the vendor and product IDs, they're in 
/sys/devices/pci..../..../{vendor,device}

-- 
Charles Lepple <ghz.cc!clepple>



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-08-15  2:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-14 16:26 finding which pci device works as ide controller for root fs Arkadiusz Miskiewicz
2003-08-15  0:15 ` Greg KH
2003-08-15  0:38   ` Arkadiusz Miskiewicz
2003-08-15  2:39     ` Charles Lepple

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox