Pages

Unixbhaskar's Blog

Monday, February 1, 2010

Enlisting kernel modules by Name,Description and Depends

I was wondering how to get a glimpse of all kernel module at once with specific information I need.

I do not issue any guarantee that this will work for you.

I know how to use modinfo ,so thought to implement within a small AWK script which will fetch me the required info.

So just wrote a one liner for that like this:

awk '{print $1}' "/proc/modules" | xargs modinfo | awk '/^(filename|desc|depends)/'

That's all I have done.I put it in a file and give it a execution permission.Once you run it you get the info like below,which is very useful:

bhaskar@Bhaskar-laptop_10:02:34_Mon Feb 01:~/bin> sudo list_module
filename: /lib/modules/2.6.31.8-0.1-default/kernel/fs/ext4/ext4.ko
description: Fourth Extended Filesystem
depends: jbd2,crc16
filename: /lib/modules/2.6.31.8-0.1-default/kernel/fs/jbd2/jbd2.ko
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/lib/crc16.ko
description: CRC16 calculations
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/net/ppp_deflate.ko
depends: zlib_deflate,ppp_generic
filename: /lib/modules/2.6.31.8-0.1-default/kernel/lib/zlib_deflate/zlib_deflate.ko
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/net/bsd_comp.ko
depends: ppp_generic
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/net/ppp_async.ko
depends: ppp_generic,crc-ccitt
filename: /lib/modules/2.6.31.8-0.1-default/kernel/lib/crc-ccitt.ko
description: CRC-CCITT calculations
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/net/ppp_generic.ko
depends: slhc
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/net/slhc.ko
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/usb/serial/usbserial.ko
description: USB Serial Driver core
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/net/packet/af_packet.ko
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/net/bluetooth/rfcomm/rfcomm.ko
description: Bluetooth RFCOMM ver 1.11
depends: bluetooth,l2cap
filename: /lib/modules/2.6.31.8-0.1-default/updates/vboxnetadp.ko
description: VirtualBox Network Adapter Driver
depends:
filename: /lib/modules/2.6.31.8-0.1-default/updates/vboxnetflt.ko
description: VirtualBox Network Filter Driver
depends: vboxdrv
filename: /lib/modules/2.6.31.8-0.1-default/updates/vboxdrv.ko
description: VirtualBox Support Driver
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/gpu/drm/i915/i915.ko
description: Intel Graphics
depends: drm,i2c-core,video,i2c-algo-bit
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/gpu/drm/drm.ko
description: DRM shared core routines
depends: i2c-core
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/i2c/algos/i2c-algo-bit.ko
description: I2C-Bus bit-banging algorithm
depends: i2c-core
filename: /lib/modules/2.6.31.8-0.1-default/kernel/net/bluetooth/sco.ko
description: Bluetooth SCO ver 0.6
depends: bluetooth
filename: /lib/modules/2.6.31.8-0.1-default/kernel/net/bridge/bridge.ko
depends: stp,llc
filename: /lib/modules/2.6.31.8-0.1-default/kernel/net/802/stp.ko
depends: llc
filename: /lib/modules/2.6.31.8-0.1-default/kernel/net/llc/llc.ko
description: LLC IEEE 802.2 core support
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/net/bluetooth/bnep/bnep.ko
description: Bluetooth BNEP ver 1.3
depends: bluetooth,l2cap
filename: /lib/modules/2.6.31.8-0.1-default/kernel/sound/core/oss/snd-pcm-oss.ko
description: PCM OSS emulation for ALSA.
depends: snd-pcm,snd,snd-mixer-oss
filename: /lib/modules/2.6.31.8-0.1-default/kernel/sound/core/oss/snd-mixer-oss.ko
description: Mixer OSS emulation for ALSA.
depends: snd
filename: /lib/modules/2.6.31.8-0.1-default/kernel/sound/core/seq/snd-seq.ko
description: Advanced Linux Sound Architecture sequencer.
depends: snd,snd-seq-device,snd-timer
filename: /lib/modules/2.6.31.8-0.1-default/kernel/net/bluetooth/l2cap.ko
description: Bluetooth L2CAP ver 2.13
depends: bluetooth
filename: /lib/modules/2.6.31.8-0.1-default/kernel/sound/core/seq/snd-seq-device.ko
description: ALSA sequencer device management
depends: snd
filename: /lib/modules/2.6.31.8-0.1-default/kernel/fs/binfmt_misc.ko
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/net/ipv6/ipv6.ko
description: IPv6 protocol stack for Linux
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/cpufreq/cpufreq_conservative.ko
description: 'cpufreq_conservative' - A dynamic cpufreq governor for Low Latency Frequency Transition capable processors optimised for use in a battery environment
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/cpufreq/cpufreq_userspace.ko
description: CPUfreq policy governor 'userspace'
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/cpufreq/cpufreq_powersave.ko
description: CPUfreq policy governor 'powersave'
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.ko
description: ACPI Processor P-States Driver
depends: processor
filename: /lib/modules/2.6.31.8-0.1-default/kernel/arch/x86/kernel/cpu/cpufreq/speedstep-lib.ko
description: Library for Intel SpeedStep 1 or 2 cpufreq drivers.
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/fs/fuse/fuse.ko
description: Filesystem in Userspace
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/block/loop.ko
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/md/dm-mod.ko
description: device-mapper driver
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/crypto/arc4.ko
description: ARC4 Cipher Algorithm
depends: crypto_algapi
filename: /lib/modules/2.6.31.8-0.1-default/kernel/crypto/ecb.ko
description: ECB block cipher algorithm
depends: crypto_algapi,crypto_blkcipher
filename: /lib/modules/2.6.31.8-0.1-default/kernel/crypto/cryptomgr.ko
description: Crypto Algorithm Manager
depends: crypto_hash,crypto_algapi,crypto_blkcipher,aead,pcompress
filename: /lib/modules/2.6.31.8-0.1-default/kernel/crypto/aead.ko
description: Authenticated Encryption with Associated Data (AEAD)
depends: crypto_algapi
filename: /lib/modules/2.6.31.8-0.1-default/kernel/crypto/pcompress.ko
description: Partial (de)compression type
depends: crypto_algapi
filename: /lib/modules/2.6.31.8-0.1-default/kernel/crypto/crypto_blkcipher.ko
description: Generic block chaining cipher type
depends: crypto_algapi
filename: /lib/modules/2.6.31.8-0.1-default/kernel/crypto/crypto_hash.ko
description: Generic cryptographic hash type
description: Asynchronous cryptographic hash type
description: Synchronous cryptographic hash type
depends: crypto_algapi
filename: /lib/modules/2.6.31.8-0.1-default/kernel/sound/pci/hda/snd-hda-codec-analog.ko
description: Analog Devices HD-audio codec
depends: snd-hda-codec,snd
filename: /lib/modules/2.6.31.8-0.1-default/kernel/crypto/crypto_algapi.ko
description: Cryptographic algorithms API
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/net/wireless/b43/b43.ko
description: Broadcom B43 wireless driver
depends: pcmcia,mac80211,ssb,led-class,cfg80211,pcmcia_core
filename: /lib/modules/2.6.31.8-0.1-default/kernel/net/mac80211/mac80211.ko
description: IEEE 802.11 subsystem
depends: cfg80211
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/media/video/uvc/uvcvideo.ko
description: USB Video Class driver
depends: videodev,v4l1-compat
filename: /lib/modules/2.6.31.8-0.1-default/kernel/net/wireless/cfg80211.ko
description: wireless configuration support
depends: rfkill
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/leds/led-class.ko
description: LED Class Interface
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/media/video/videodev.ko
description: Device registrar for Video4Linux drivers v2
depends: i2c-core,v4l1-compat
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/media/video/v4l1-compat.ko
description: v4l(1) compatibility layer for v4l2 drivers.
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/sound/pci/hda/snd-hda-intel.ko
description: Intel HDA driver
depends: snd-pcm,snd,snd-page-alloc,snd-hda-codec
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/scsi/sr_mod.ko
description: SCSI cdrom (sr) driver
depends: cdrom
filename: /lib/modules/2.6.31.8-0.1-default/kernel/sound/pci/hda/snd-hda-codec.ko
description: HDA codec core
depends: snd-pcm,snd,snd-hwdep
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/scsi/sg.ko
description: SCSI generic (sg) driver
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/sound/core/snd-hwdep.ko
description: Hardware dependent layer
depends: snd
filename: /lib/modules/2.6.31.8-0.1-default/kernel/sound/core/snd-pcm.ko
description: Midlevel PCM code for ALSA.
depends: snd,snd-page-alloc,snd-timer
filename: /lib/modules/2.6.31.8-0.1-default/kernel/sound/core/snd-timer.ko
description: ALSA timer interface
depends: snd
filename: /lib/modules/2.6.31.8-0.1-default/kernel/sound/core/snd.ko
description: Advanced Linux Sound Architecture driver for soundcards.
description: Jack detection support for ALSA
depends: soundcore
filename: /lib/modules/2.6.31.8-0.1-default/kernel/sound/soundcore.ko
description: Core sound module
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/cdrom/cdrom.ko
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/i2c/i2c-core.ko
description: I2C-Bus main module
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/input/joydev.ko
description: Joystick device interfaces
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/ssb/ssb.ko
description: Sonics Silicon Backplane driver
depends: pcmcia_core,pcmcia
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/pcmcia/pcmcia.ko
description: PCMCIA Driver Services
depends: pcmcia_core
filename: /lib/modules/2.6.31.8-0.1-default/kernel/sound/core/snd-page-alloc.ko
description: Memory allocator for ALSA system.
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/watchdog/iTCO_wdt.ko
description: Intel TCO WatchDog Timer Driver
depends: iTCO_vendor_support
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/watchdog/iTCO_vendor_support.ko
description: Intel TCO Vendor Specific WatchDog Timer Driver Support
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/input/serio/serio_raw.ko
description: Raw serio driver
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/input/misc/pcspkr.ko
description: PC Speaker beeper driver
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/acpi/container.ko
description: ACPI container driver
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/acpi/video.ko
description: ACPI Video Driver
depends: thermal_sys,output
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/net/tg3.ko
description: Broadcom Tigon3 ethernet driver
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/bluetooth/btusb.ko
description: Generic Bluetooth USB driver ver 0.5
depends: bluetooth
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/pcmcia/pcmcia_core.ko
description: Linux Kernel Card Services
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/net/bluetooth/bluetooth.ko
description: Bluetooth Core ver 2.15
depends: rfkill
filename: /lib/modules/2.6.31.8-0.1-default/kernel/net/rfkill/rfkill.ko
description: RF switch support
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/video/output.ko
description: Display Output Switcher Lowlevel Control Abstraction
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/acpi/ac.ko
description: ACPI AC Adapter Driver
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/char/agp/intel-agp.ko
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/acpi/battery.ko
description: ACPI Battery Driver
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/platform/x86/wmi.ko
description: ACPI-WMI Mapping Driver
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/acpi/button.ko
description: ACPI Button Driver
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/ata/ata_generic.ko
description: low-level driver for generic ATA
depends: libata
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/usb/host/uhci-hcd.ko
description: USB Universal Host Controller Interface driver
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/rtc/rtc-cmos.ko
description: Driver for PC-style 'CMOS' RTCs
depends: rtc-core
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/rtc/rtc-core.ko
description: RTC class support
depends: rtc-lib
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/rtc/rtc-lib.ko
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/ata/ata_piix.ko
description: SCSI low-level driver for Intel PIIX/ICH ATA controllers
depends: libata
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/usb/host/ehci-hcd.ko
description: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/firmware/edd.ko
description: sysfs interface to BIOS EDD information
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/ata/ahci.ko
description: AHCI SATA low-level driver
depends: libata
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/ata/libata.ko
description: Library module for ATA devices
depends:
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/acpi/fan.ko
description: ACPI Fan Driver
depends: thermal_sys
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/acpi/thermal.ko
description: ACPI Thermal Zone Driver
depends: thermal_sys
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/acpi/processor.ko
description: ACPI Processor Driver
depends: thermal_sys
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/thermal/thermal_sys.ko
description: Generic thermal management sysfs support
depends: hwmon
filename: /lib/modules/2.6.31.8-0.1-default/kernel/drivers/hwmon/hwmon.ko
description: hardware monitoring sysfs/class support
depends:


Hope this will help :)

Bhaskar Chowdhury
Google Talk: unixbhaskar Skype: unixbhaskar Y! messenger: unixbhaskar
DiggLinkedinWordpressTwitterTechnoratiStumbleuponReddit

2 comments:

  1. Thanks. I found this useful, trying to suss out which LKM's are needed for a VM. Bluetooth...no.

    There is a typo in your line above. Missing single quote. Here is the line that worked for me:
    awk '{print $1}' "/proc/modules" | xargs modinfo | awk '/^(filename|desc|depends)/'

    Thanks for saving me head scratching time.
    Cheers
    Billy Baker
    SDLC Sysadmin

    ReplyDelete
  2. Thanks Billy pointing out that flaw. I have corrected it.Glad that help.

    ReplyDelete