【Linux开发】如何查看Linux kernel的内置模块驱动列表和进程ID

标签:【Linux开发】



命令:

cat /lib/modules/$(uname -r)/modules.builtin


列举出的列表如下:

kernel/kernel/configs.ko
kernel/fs/binfmt_misc.ko
kernel/fs/binfmt_script.ko
kernel/fs/mbcache.ko
kernel/fs/cramfs/cramfs.ko
kernel/fs/ext2/ext2.ko
kernel/fs/ext3/ext3.ko
kernel/fs/ext4/ext4.ko
kernel/fs/fat/fat.ko
kernel/fs/fat/vfat.ko
kernel/fs/fat/msdos.ko
kernel/fs/jbd/jbd.ko
kernel/fs/jbd2/jbd2.ko
kernel/fs/jffs2/jffs2.ko
kernel/fs/lockd/lockd.ko
kernel/fs/nfs/nfs.ko
kernel/fs/nfs/nfsv2.ko
kernel/fs/nfs/nfsv3.ko
kernel/fs/nfs/nfsv4.ko
kernel/fs/nfs_common/nfs_acl.ko
kernel/fs/nls/nls_base.ko
kernel/fs/nls/nls_cp437.ko
kernel/fs/nls/nls_iso8859-1.ko
kernel/fs/quota/quota_v2.ko
kernel/fs/quota/quota_tree.ko
kernel/fs/ubifs/ubifs.ko
kernel/crypto/crypto.ko
kernel/crypto/crypto_wq.ko
kernel/crypto/crypto_algapi.ko
kernel/crypto/aead.ko
kernel/crypto/crypto_blkcipher.ko
kernel/crypto/chainiv.ko
kernel/crypto/eseqiv.ko
kernel/crypto/crypto_hash.ko
kernel/crypto/pcompress.ko
kernel/crypto/cryptomgr.ko
kernel/crypto/hmac.ko
kernel/crypto/md5.ko
kernel/crypto/sha1_generic.ko
kernel/crypto/sha256_generic.ko
kernel/crypto/sha512_generic.ko
kernel/crypto/ecb.ko
kernel/crypto/des_generic.ko
kernel/crypto/aes_generic.ko
kernel/crypto/arc4.ko
kernel/crypto/deflate.ko
kernel/crypto/michael_mic.ko
kernel/crypto/crc32c.ko
kernel/crypto/crct10dif_common.ko
kernel/crypto/crct10dif_generic.ko
kernel/crypto/lzo.ko
kernel/crypto/rng.ko
kernel/crypto/krng.ko
kernel/crypto/af_alg.ko
kernel/crypto/algif_hash.ko
kernel/crypto/algif_skcipher.ko
kernel/block/deadline-iosched.ko
kernel/block/cfq-iosched.ko
kernel/drivers/ata/libata.ko
kernel/drivers/ata/ahci_platform.ko
kernel/drivers/ata/libahci.ko
kernel/drivers/ata/sata_ti.ko
kernel/drivers/base/firmware_class.ko
kernel/drivers/base/regmap/regmap-i2c.ko
kernel/drivers/base/regmap/regmap-mmio.ko
kernel/drivers/block/brd.ko
kernel/drivers/block/loop.ko
kernel/drivers/bus/omap-ocp2scp.ko
kernel/drivers/bus/omap_l3_smx.ko
kernel/drivers/bus/omap_l3_noc.ko
kernel/drivers/char/hw_random/rng-core.ko
kernel/drivers/char/hw_random/omap-rng.ko
kernel/drivers/connector/cn.ko
kernel/drivers/cpufreq/cpufreq_stats.ko
kernel/drivers/cpufreq/cpufreq_performance.ko
kernel/drivers/cpufreq/cpufreq_powersave.ko
kernel/drivers/cpufreq/cpufreq_userspace.ko
kernel/drivers/cpufreq/cpufreq_ondemand.ko
kernel/drivers/cpufreq/cpufreq_conservative.ko
kernel/drivers/cpufreq/freq_table.ko
kernel/drivers/cpufreq/cpufreq-cpu0.ko
kernel/drivers/crypto/omap-sham.ko
kernel/drivers/crypto/omap-aes.ko
kernel/drivers/crypto/omap-des.ko
kernel/drivers/dma/virt-dma.ko
kernel/drivers/dma/omap-dma.ko
kernel/drivers/dma/cppi41.ko
kernel/drivers/extcon/of_extcon.ko
kernel/drivers/extcon/extcon-class.ko
kernel/drivers/extcon/extcon-palmas.ko
kernel/drivers/extcon/extcon-gpio-usbvid.ko
kernel/drivers/gpio/gpio-pca953x.ko
kernel/drivers/gpio/gpio-pcf857x.ko
kernel/drivers/gpio/gpio-twl4030.ko
kernel/drivers/hid/hid.ko
kernel/drivers/hid/hid-generic.ko
kernel/drivers/hid/usbhid/usbhid.ko
kernel/drivers/hwmon/hwmon.ko
kernel/drivers/i2c/i2c-core.ko
kernel/drivers/i2c/i2c-dev.ko
kernel/drivers/i2c/busses/i2c-omap.ko
kernel/drivers/input/input-core.ko
kernel/drivers/input/matrix-keymap.ko
kernel/drivers/input/mousedev.ko
kernel/drivers/input/joydev.ko
kernel/drivers/input/evdev.ko
kernel/drivers/input/keyboard/atkbd.ko
kernel/drivers/input/keyboard/gpio_keys.ko
kernel/drivers/input/keyboard/matrix_keypad.ko
kernel/drivers/input/keyboard/twl4030_keypad.ko
kernel/drivers/input/misc/twl4030-pwrbutton.ko
kernel/drivers/input/misc/uinput.ko
kernel/drivers/input/mouse/psmouse.ko
kernel/drivers/input/touchscreen/ads7846.ko
kernel/drivers/input/touchscreen/atmel_mxt_ts.ko
kernel/drivers/input/touchscreen/ti_am335x_tsc.ko
kernel/drivers/input/serio/serio.ko
kernel/drivers/input/serio/serport.ko
kernel/drivers/input/serio/libps2.ko
kernel/drivers/leds/led-class.ko
kernel/drivers/leds/leds-gpio.ko
kernel/drivers/leds/trigger/ledtrig-timer.ko
kernel/drivers/leds/trigger/ledtrig-oneshot.ko
kernel/drivers/leds/trigger/ledtrig-heartbeat.ko
kernel/drivers/leds/trigger/ledtrig-backlight.ko
kernel/drivers/leds/trigger/ledtrig-gpio.ko
kernel/drivers/leds/trigger/ledtrig-default-on.ko
kernel/drivers/mailbox/omap-mailbox.ko
kernel/drivers/mailbox/mailbox_omap2.ko
kernel/drivers/media/media.ko
kernel/drivers/media/i2c/ov2659.ko
kernel/drivers/media/platform/ti-vpfe/vpfe_capture.ko
kernel/drivers/media/platform/ti-vpfe/am437x_isif.ko
kernel/drivers/media/v4l2-core/videodev.ko
kernel/drivers/media/v4l2-core/v4l2-common.ko
kernel/drivers/media/v4l2-core/v4l2-dv-timings.ko
kernel/drivers/media/v4l2-core/videobuf2-core.ko
kernel/drivers/media/v4l2-core/videobuf2-memops.ko
kernel/drivers/media/v4l2-core/videobuf2-dma-contig.ko
kernel/drivers/mfd/ti_am335x_tscadc.ko
kernel/drivers/mfd/tps65217.ko
kernel/drivers/mfd/mfd-core.ko
kernel/drivers/misc/eeprom/eeprom_93cx6.ko
kernel/drivers/misc/ti-st/st_drv.ko
kernel/drivers/mmc/card/mmc_block.ko
kernel/drivers/mmc/card/sdio_uart.ko
kernel/drivers/mmc/core/mmc_core.ko
kernel/drivers/mmc/host/omap.ko
kernel/drivers/mmc/host/omap_hsmmc.ko
kernel/drivers/mtd/mtd.ko
kernel/drivers/mtd/ofpart.ko
kernel/drivers/mtd/cmdlinepart.ko
kernel/drivers/mtd/mtd_blkdevs.ko
kernel/drivers/mtd/mtdblock.ko
kernel/drivers/mtd/mtdoops.ko
kernel/drivers/mtd/chips/chipreg.ko
kernel/drivers/mtd/chips/cfi_probe.ko
kernel/drivers/mtd/chips/cfi_util.ko
kernel/drivers/mtd/chips/cfi_cmdset_0001.ko
kernel/drivers/mtd/chips/gen_probe.ko
kernel/drivers/mtd/devices/m25p80.ko
kernel/drivers/mtd/devices/elm.ko
kernel/drivers/mtd/nand/nand.ko
kernel/drivers/mtd/nand/nand_ecc.ko
kernel/drivers/mtd/nand/nand_ids.ko
kernel/drivers/mtd/nand/omap2.ko
kernel/drivers/mtd/ubi/ubi.ko
kernel/drivers/net/mii.ko
kernel/drivers/net/ethernet/micrel/ks8851.ko
kernel/drivers/net/ethernet/micrel/ks8851_mll.ko
kernel/drivers/net/ethernet/smsc/smc91x.ko
kernel/drivers/net/ethernet/smsc/smsc911x.ko
kernel/drivers/net/ethernet/ti/davinci_mdio.ko
kernel/drivers/net/ethernet/ti/davinci_cpdma.ko
kernel/drivers/net/ethernet/ti/ti_cpsw.ko
kernel/drivers/net/phy/libphy.ko
kernel/drivers/net/phy/smsc.ko
kernel/drivers/net/phy/at803x.ko
kernel/drivers/net/usb/asix.ko
kernel/drivers/net/usb/ax88179_178a.ko
kernel/drivers/net/usb/cdc_ether.ko
kernel/drivers/net/usb/r815x.ko
kernel/drivers/net/usb/smsc95xx.ko
kernel/drivers/net/usb/net1080.ko
kernel/drivers/net/usb/cdc_subset.ko
kernel/drivers/net/usb/zaurus.ko
kernel/drivers/net/usb/usbnet.ko
kernel/drivers/net/usb/cdc_ncm.ko
kernel/drivers/of/of_mdio.ko
kernel/drivers/of/of_pci.ko
kernel/drivers/of/of_pci_irq.ko
kernel/drivers/phy/phy-core.ko
kernel/drivers/phy/phy-omap-control.ko
kernel/drivers/phy/phy-omap-usb2.ko
kernel/drivers/phy/phy-omap-pipe3.ko
kernel/drivers/pinctrl/pinctrl-single.ko
kernel/drivers/pps/pps_core.ko
kernel/drivers/ptp/ptp.ko
kernel/drivers/pwm/pwm-tiecap.ko
kernel/drivers/pwm/pwm-tiehrpwm.ko
kernel/drivers/regulator/fixed.ko
kernel/drivers/regulator/palmas-regulator.ko
kernel/drivers/regulator/pbias-regulator.ko
kernel/drivers/regulator/tps65023-regulator.ko
kernel/drivers/regulator/tps6507x-regulator.ko
kernel/drivers/regulator/tps65217-regulator.ko
kernel/drivers/regulator/tps65218-regulator.ko
kernel/drivers/regulator/tps65910-regulator.ko
kernel/drivers/regulator/twl-regulator.ko
kernel/drivers/regulator/ti-avs-class0-regulator.ko
kernel/drivers/rtc/rtc-omap.ko
kernel/drivers/rtc/rtc-palmas.ko
kernel/drivers/rtc/rtc-twl.ko
kernel/drivers/scsi/scsi_mod.ko
kernel/drivers/scsi/sd_mod.ko
kernel/drivers/spi/spi-omap2-mcspi.ko
kernel/drivers/spi/spi-ti-qspi.ko
kernel/drivers/thermal/thermal_sys.ko
kernel/drivers/thermal/ti-soc-thermal/ti-soc-thermal.ko
kernel/drivers/tty/serial/serial_core.ko
kernel/drivers/tty/serial/omap-serial.ko
kernel/drivers/tty/serial/8250/8250.ko
kernel/drivers/tty/serial/8250/8250_pci.ko
kernel/drivers/usb/usb-common.ko
kernel/drivers/usb/class/cdc-wdm.ko
kernel/drivers/usb/core/usbcore.ko
kernel/drivers/usb/gadget/udc-core.ko
kernel/drivers/usb/host/ehci-hcd.ko
kernel/drivers/usb/host/ehci-pci.ko
kernel/drivers/usb/host/ehci-omap.ko
kernel/drivers/usb/host/xhci-hcd.ko
kernel/drivers/usb/mon/usbmon.ko
kernel/drivers/usb/phy/phy-generic.ko
kernel/drivers/usb/phy/phy-am335x-control.ko
kernel/drivers/usb/phy/phy-am335x.ko
kernel/drivers/usb/storage/usb-storage.ko
kernel/drivers/video/fb.ko
kernel/drivers/video/cfbfillrect.ko
kernel/drivers/video/cfbcopyarea.ko
kernel/drivers/video/cfbimgblt.ko
kernel/drivers/video/da8xx-fb.ko
kernel/drivers/video/da8xx-tda998x-hdmi.ko
kernel/drivers/video/backlight/lcd.ko
kernel/drivers/video/backlight/platform_lcd.ko
kernel/drivers/video/backlight/backlight.ko
kernel/drivers/video/backlight/generic_bl.ko
kernel/drivers/video/backlight/pwm_bl.ko
kernel/drivers/video/console/fbcon.ko
kernel/drivers/video/console/bitblit.ko
kernel/drivers/video/console/softcursor.ko
kernel/drivers/video/console/tileblit.ko
kernel/drivers/video/console/fbcon_rotate.ko
kernel/drivers/video/console/fbcon_cw.ko
kernel/drivers/video/console/fbcon_ud.ko
kernel/drivers/video/console/fbcon_ccw.ko
kernel/drivers/video/omap2/displays-new/encoder-tfp410.ko
kernel/drivers/video/omap2/displays-new/encoder-tpd12s015.ko
kernel/drivers/video/omap2/displays-new/dra-evm-encoder-tpd12s015.ko
kernel/drivers/video/omap2/displays-new/encoder-sil9022.ko
kernel/drivers/video/omap2/displays-new/connector-dvi.ko
kernel/drivers/video/omap2/displays-new/connector-hdmi.ko
kernel/drivers/video/omap2/displays-new/panel-dpi.ko
kernel/drivers/video/omap2/displays-new/panel-tfcs9700.ko
kernel/drivers/video/omap2/dss/omapdss.ko
kernel/drivers/video/omap2/omapfb/omapfb.ko
kernel/drivers/w1/wire.ko
kernel/drivers/watchdog/omap_wdt.ko
kernel/drivers/watchdog/twl4030_wdt.ko
kernel/arch/arm/oprofile/oprofile.ko
kernel/net/8021q/vlan_core.ko
kernel/net/8021q/8021q.ko
kernel/net/dns_resolver/dns_resolver.ko
kernel/net/ipv4/tcp_cubic.ko
kernel/net/key/af_key.ko
kernel/net/packet/af_packet.ko
kernel/net/rfkill/rfkill.ko
kernel/net/sunrpc/sunrpc.ko
kernel/net/sunrpc/auth_gss/auth_rpcgss.ko
kernel/net/unix/unix.ko
kernel/net/xfrm/xfrm_algo.ko
kernel/net/xfrm/xfrm_user.ko
kernel/lib/bitrev.ko
kernel/lib/crc-ccitt.ko
kernel/lib/crc16.ko
kernel/lib/crc-t10dif.ko
kernel/lib/crc-itu-t.ko
kernel/lib/crc32.ko
kernel/lib/crc7.ko
kernel/lib/libcrc32c.ko
kernel/lib/bch.ko
kernel/lib/oid_registry.ko
kernel/lib/fonts/font.ko
kernel/lib/lzo/lzo_compress.ko
kernel/lib/lzo/lzo_decompress.ko
kernel/lib/zlib_deflate/zlib_deflate.ko
kernel/lib/zlib_inflate/zlib_inflate.ko


这里面我要找的实际上是:

kernel/drivers/media/i2c/ov2659.ko


查看进程ID:

root@am437x-evm:~# ps
PID USER VSZ STAT COMMAND
1 root 1324 S init [5]
2 root 0 SW [kthreadd]
3 root 0 SW [ksoftirqd/0]
5 root 0 SW< [kworker/0:0H]
6 root 0 SW [kworker/u2:0]
7 root 0 SW< [khelper]
8 root 0 SW [kdevtmpfs]
9 root 0 SW [kworker/u2:1]
49 root 0 SW [kworker/0:1]
265 root 0 SW< [writeback]
267 root 0 SW< [bioset]
269 root 0 SW< [kblockd]
361 root 0 SW< [ata_sff]
371 root 0 SW [khubd]
480 root 0 SW< [rpciod]
495 root 0 SW [kswapd0]
496 root 0 SW [fsnotify_mark]
497 root 0 SW< [nfsiod]
498 root 0 SW< [crypto]
575 root 0 SW< [OMAP UART0]
652 root 0 SW [spi32766]
735 root 0 SW< [kpsmoused]
765 root 0 SW [irq/262-mmc1]
793 root 0 SW [mmcqd/0]
794 root 0 SW [mmcqd/0boot0]
799 root 0 SW [mmcqd/0boot1]
833 root 0 SW< [deferwq]
834 root 0 SW [irq/102-44e0b00]
843 root 0 SW [irq/39-tps65218]
864 root 0 SW [irq/103-4802a00]
880 root 0 SW [mmcqd/1]
902 root 0 SW< [kworker/0:1H]
903 root 0 SW [kworker/0:2]
904 root 0 SW [jbd2/mmcblk0p2-]
905 root 0 SW< [ext4-rsv-conver]
936 root 2620 S /lib/udev/udevd -d
1280 root 0 SW< [cryptodev_queue]
1394 root 1836 S udhcpc -R -n -p /var/run/udhcpc.eth0.pid -i eth0
1414 messageb 2304 S /usr/bin/dbus-daemon --system
1428 root 2016 S /usr/sbin/dropbear -r /etc/dropbear/dropbear_rsa_hos
1431 root 1836 S /usr/sbin/telnetd
1442 root 1836 S /sbin/syslogd -n -O /var/log/messages
1443 root 1836 S /sbin/klogd -n
1447 nobody 2256 S /usr/sbin/thttpd -d /srv/www -p 8080
1486 root 0 SW< [pvr_timer]
1508 root 0 SW< [pvr_workqueue]
1512 root 2888 S /usr/sbin/lighttpd -f /etc/lighttpd.conf
1594 root 2672 S -sh
1595 root 1572 S /sbin/getty 38400 tty1
1598 root 2616 S /lib/udev/udevd -d
1602 root 2616 S /lib/udev/udevd -d
1603 root 2444 S /usr/sbin/dropbear -r /etc/dropbear/dropbear_rsa_hos
1612 root 2212 S sh -c test -f /etc/profile && . /etc/profile;test -f
1620 root 36588 R /home/root//v4lCameraGui2 -qws
1871 root 2124 R ps
root@am437x-evm:~# kill 1620


通过上面的方法可以在shell中关闭掉某一个进程。



2016-08-26 15:58

张朋艺 pyzhangBIT2010@126.com