Linux kernel - Загрузка и выгрузка драйверов

ls /lib/modules/$(uname -r) build modules.alias modules.builtin modules.dep modules.devname modules.softdep modules.symbols.bin kernel modules.alias.bin modules.builtin.bin modules.dep.bin modules.order modules.symbols source

Драйверы

$ ls /lib/modules/$(uname -r)/kernel/drivers/ acpi bluetooth dax firewire hv infiniband media mmc nvme platform scsi thermal uwb w1 ata cdrom dca firmware hwmon input memstick mtd nvmem power spi thunderbolt vfio watchdog atm char devfreq gpio hwtracing isdn message net parport powercap ssb tty vhost xen bcma cpufreq dma gpu i2c leds mfd nfc pci pps staging uio video block crypto edac hid iio md misc nvdimm pcmcia ptp target usb virtio

Описание драйвера

$ modinfo acpi filename: /lib/modules/4.11.0-2-amd64/kernel/drivers/cpufreq/acpi-cpufreq.ko alias: acpi license: GPL description: ACPI Processor P-States Driver author: Paul Diefenbaugh, Dominik Brodowski alias: cpu:type:x86,ven*fam*mod*:feature:*00E8* alias: cpu:type:x86,ven*fam*mod*:feature:*0016* alias: acpi*:ACPI0007:* alias: acpi*:LNXCPU:* depends: intree: Y vermagic: 4.11.0-2-amd64 SMP mod_unload modversions parm: acpi_pstate_strict:value 0 or non-zero. non-zero -> strict ACPI checks are performed during frequency changes. (uint)

Загрузка драйвера

$ modprobe foo

С проверкой

$ modprobe -v foo

Выгрузка драйвера

$ modprobe -r foo $ rmmod foo

Список загруженых драйверов

$ lsmod Module Size Used by ufs 73728 0 qnx4 16384 0 hfsplus 102400 0 hfs 57344 0 minix 36864 0 ntfs 98304 0 vfat 20480 0 msdos 20480 0 fat 65536 2 msdos,vfat jfs 180224 0 xfs 1175552 0 fuse 98304 3 iptable_filter 16384 0 ip_tables 24576 1 iptable_filter x_tables 36864 2 ip_tables,iptable_filter binfmt_misc 20480 1 nfsd 335872 2 auth_rpcgss 61440 1 nfsd oid_registry 16384 1 auth_rpcgss nfs_acl 16384 1 nfsd nfs 245760 0 lockd 90112 2 nfsd,nfs grace 16384 2 nfsd,lockd fscache 61440 1 nfs sunrpc 331776 6 auth_rpcgss,nfsd,nfs_acl,lockd,nfs dm_crypt 28672 0 dm_mod 114688 1 dm_crypt hp_wmi 16384 0 sparse_keymap 16384 1 hp_wmi ppdev 20480 0 iTCO_wdt 16384 0 rfkill 24576 1 hp_wmi snd_hda_codec_analog 16384 1 iTCO_vendor_support 16384 1 iTCO_wdt snd_hda_codec_generic 69632 1 snd_hda_codec_analog i915 1257472 1 drm_kms_helper 143360 1 i915 evdev 24576 11 coretemp 16384 0 parport_pc 28672 0 drm 344064 3 i915,drm_kms_helper sg 32768 0 serio_raw 16384 0 snd_hda_intel 36864 0 snd_hda_codec 126976 3 snd_hda_intel,snd_hda_codec_analog,snd_hda_codec_generic snd_hda_core 77824 4 snd_hda_intel,snd_hda_codec,snd_hda_codec_analog,snd_hda_codec_generic pcspkr 16384 0 snd_hwdep 16384 1 snd_hda_codec lpc_ich 24576 0 snd_pcm 102400 3 snd_hda_intel,snd_hda_codec,snd_hda_core mfd_core 16384 1 lpc_ich i2c_algo_bit 16384 1 i915 shpchp 36864 0 mei_me 40960 0 mei 102400 1 mei_me snd_timer 32768 1 snd_pcm parport 49152 2 parport_pc,ppdev snd 77824 7 snd_hda_intel,snd_hwdep,snd_hda_codec,snd_hda_codec_analog,snd_timer,snd_hda_codec_generic,snd_pcm wmi 16384 1 hp_wmi soundcore 16384 1 snd video 40960 1 i915 button 16384 1 i915 acpi_cpufreq 20480 0 ext4 589824 1 crc16 16384 1 ext4 jbd2 106496 1 ext4 fscrypto 28672 1 ext4 ecb 16384 0 crypto_simd 16384 0 cryptd 24576 1 crypto_simd glue_helper 16384 0 aes_x86_64 20480 1 mbcache 16384 1 ext4 btrfs 1077248 0 raid10 49152 0 raid456 126976 0 async_raid6_recov 20480 1 raid456 async_memcpy 16384 2 raid456,async_raid6_recov async_pq 16384 2 raid456,async_raid6_recov async_xor 16384 3 async_pq,raid456,async_raid6_recov async_tx 16384 5 async_xor,async_pq,raid456,async_memcpy,async_raid6_recov xor 24576 2 async_xor,btrfs raid6_pq 114688 4 async_pq,btrfs,raid456,async_raid6_recov libcrc32c 16384 2 xfs,raid456 crc32c_generic 16384 2 raid1 40960 0 raid0 20480 0 multipath 16384 0 linear 16384 0 md_mod 135168 6 raid1,raid10,multipath,linear,raid0,raid456 sd_mod 49152 3 uas 24576 0 usb_storage 69632 1 uas ata_generic 16384 0 psmouse 131072 0 ata_piix 36864 2 libata 237568 2 ata_piix,ata_generic scsi_mod 217088 5 sd_mod,usb_storage,libata,uas,sg floppy 69632 0 uhci_hcd 45056 0 e1000e 241664 0 ptp 20480 1 e1000e pps_core 16384 1 ptp ehci_pci 16384 0 ehci_hcd 81920 1 ehci_pci usbcore 245760 5 usb_storage,ehci_hcd,uhci_hcd,uas,ehci_pci usb_common 16384 1 usbcore