2

How can I obtain what device drivers are incorporated in a running kernel?

More than this, how can I categorize these device drivers?

For instance, this is a Linux kernel conceptual map, from Wikipedia:

enter image description here

How can I distribute detected device drivers into correspondent area in the map above?

My impression is that such info could be obtained from kernel config files.

(I am not expecting answer to be in a graphical form. Textual categorization would suffice, but with the appropriate categories that can be, overall, matched to the areas in the picture.)

  • Do you want the categorization purely out of interest, or is there some ultimate purpose to it? – ilkkachu Sep 12 '16 at 10:08
  • Purely out of interest. :) @ilkkachu – VividD Sep 12 '16 at 11:10
2
+25

You can list the loaded drivers using lsmod. For example,

[root@vm bin]# lsmod Module Size Used by coretemp 13435 0 crc32_pclmul 13113 0 ghash_clmulni_intel 13259 0 aesni_intel 69884 0 lrw 13286 1 aesni_intel gf128mul 14951 1 lrw glue_helper 13990 1 aesni_intel ablk_helper 13597 1 aesni_intel cryptd 20359 3 ghash_clmulni_intel,aesni_intel,ablk_helper sg 40721 0 ppdev 17671 0 pcspkr 12718 0 vmw_balloon 13415 0 parport_pc 28165 0 parport 42348 2 ppdev,parport_pc vmw_vmci 67106 0 i2c_piix4 22106 0 shpchp 37032 0 ip_tables 27240 0 xfs 939662 3 libcrc32c 12644 1 xfs sr_mod 22416 0 cdrom 42556 1 sr_mod sd_mod 45497 3 crc_t10dif 12714 1 sd_mod ata_generic 12910 0 crct10dif_generic 12647 0 pata_acpi 13038 0 mptspi 22542 2 scsi_transport_spi 30732 1 mptspi mptscsih 40150 1 mptspi vmwgfx 176029 1 drm_kms_helper 125008 1 vmwgfx crct10dif_pclmul 14289 1 crct10dif_common 12595 3 crct10dif_pclmul,crct10dif_generic,crc_t10dif ttm 93441 1 vmwgfx crc32c_intel 22079 1 ata_piix 35038 0 drm 349210 4 ttm,drm_kms_helper,vmwgfx mptbase 105960 2 mptspi,mptscsih serio_raw 13462 0 libata 218730 3 pata_acpi,ata_generic,ata_piix vmxnet3 53833 0 i2c_core 40582 3 drm,i2c_piix4,drm_kms_helper floppy 69417 0 dm_mirror 22135 0 dm_region_hash 20862 1 dm_mirror dm_log 18411 2 dm_region_hash,dm_mirror dm_mod 113292 11 dm_log,dm_mirror

Then to further understand what each driver relates to, use modinfo

[root@vm bin]# modinfo coretemp filename: /lib/modules/3.10.0-327.el7.x86_64/kernel/drivers/hwmon/coretemp.ko license: GPL description: Intel Core temperature monitor author: Rudolf Marek <r.marek@assembler.cz> rhelversion: 7.2 srcversion: 39EE385A7A807BDCB75C480 alias: x86cpu:vendor:0000:family:*:model:*:feature:*00E7* depends:
intree: Y vermagic: 3.10.0-327.el7.x86_64 SMP mod_unload modversions signer: CentOS Linux kernel signing key sig_key: 79:AD:88:6A:11:3C:A0:22:35:26:33:6C:0F:82:5B:8A:94:29:6A:B3 sig_hashalgo: sha256 parm: tjmax:TjMax value in degrees Celsius (int)

You then can use this info and categorize where each driver belongs to.

  • That is cool, but do you have any idea how to do categorization in an automatic, od semi-automatic way? I see we can extract dependency tree from "lsmod". Do you have any other idea? – VividD Sep 16 '16 at 14:08
  • 1
    I'm not aware of an easy way. Do you need to do it on multiple machines? To achieve what you ask, you would need to have a Map that holds this info [which drivers relates to which category]. Then you can build a script that find active drivers and look for a match. – Chen A. Sep 18 '16 at 6:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.