kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* udev & modalias files
@ 2016-06-03 16:32 Muni Sekhar
  2016-06-03 18:48 ` Greg KH
  2016-06-03 18:50 ` Bjørn Mork
  0 siblings, 2 replies; 4+ messages in thread
From: Muni Sekhar @ 2016-06-03 16:32 UTC (permalink / raw)
  To: kernelnewbies

Hi,

I see lot of modalias files under /sys directory.

For e.g:

# cat /sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.0/modalias

pci:v00001556d00005555sv00004000sd00000000bc08sc05i01



I would like to know which part of the kernel module creates sysfs
modalias file?


How does udev load modules dynamically when a new device is added?
Where should I look for default udev rules?


-- 
Thanks,
Sekhar

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

* udev & modalias files
  2016-06-03 16:32 udev & modalias files Muni Sekhar
@ 2016-06-03 18:48 ` Greg KH
  2016-06-03 18:50 ` Bjørn Mork
  1 sibling, 0 replies; 4+ messages in thread
From: Greg KH @ 2016-06-03 18:48 UTC (permalink / raw)
  To: kernelnewbies

On Fri, Jun 03, 2016 at 10:02:02PM +0530, Muni Sekhar wrote:
> Hi,
> 
> I see lot of modalias files under /sys directory.
> 
> For e.g:
> 
> # cat /sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.0/modalias
> 
> pci:v00001556d00005555sv00004000sd00000000bc08sc05i01
> 
> 
> 
> I would like to know which part of the kernel module creates sysfs
> modalias file?

The kernel bus code for the device that the bus is on creates this.  For
this example, the PCI bus code does this work.

> How does udev load modules dynamically when a new device is added?

The book, "Linux Device Drivers, version 3", free online, has a whole
section on this, I suggest reading it.

> Where should I look for default udev rules?

In the udev or systemd package on your machine.  Specific ways to do
this depends on your distro.

greg k-h

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

* udev & modalias files
  2016-06-03 16:32 udev & modalias files Muni Sekhar
  2016-06-03 18:48 ` Greg KH
@ 2016-06-03 18:50 ` Bjørn Mork
  2016-06-04 13:32   ` Muni Sekhar
  1 sibling, 1 reply; 4+ messages in thread
From: Bjørn Mork @ 2016-06-03 18:50 UTC (permalink / raw)
  To: kernelnewbies

Muni Sekhar <munisekharrms@gmail.com> writes:

> I see lot of modalias files under /sys directory.
>
> For e.g:
>
> # cat /sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.0/modalias
>
> pci:v00001556d00005555sv00004000sd00000000bc08sc05i01
>
>
>
> I would like to know which part of the kernel module creates sysfs
> modalias file?

lots of different places.  Do a "git grep modalias drivers/" to see many
of them. That particular file is created by drivers/pci/pci-sysfs.c



Bj?rn

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

* udev & modalias files
  2016-06-03 18:50 ` Bjørn Mork
@ 2016-06-04 13:32   ` Muni Sekhar
  0 siblings, 0 replies; 4+ messages in thread
From: Muni Sekhar @ 2016-06-04 13:32 UTC (permalink / raw)
  To: kernelnewbies

On Sat, Jun 4, 2016 at 12:20 AM, Bj?rn Mork <bjorn@mork.no> wrote:
> Muni Sekhar <munisekharrms@gmail.com> writes:
>
>> I see lot of modalias files under /sys directory.
>>
>> For e.g:
>>
>> # cat /sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.0/modalias
>>
>> pci:v00001556d00005555sv00004000sd00000000bc08sc05i01
>>
>>
>>
>> I would like to know which part of the kernel module creates sysfs
>> modalias file?
>
> lots of different places.  Do a "git grep modalias drivers/" to see many
> of them. That particular file is created by drivers/pci/pci-sysfs.c
>
>
>
> Bj?rn

Thanks Greg & Bj?rn.


-- 
Thanks,
Sekhar

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

end of thread, other threads:[~2016-06-04 13:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-03 16:32 udev & modalias files Muni Sekhar
2016-06-03 18:48 ` Greg KH
2016-06-03 18:50 ` Bjørn Mork
2016-06-04 13:32   ` Muni Sekhar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).