book@100ask:~$ sudo apt-get install linux-headers-$(uname -r) [sudo] password for book: Reading package lists... Done Building dependency tree Reading state information... Done linux-headers-5.4.0-91-generic is already the newest version (5.4.0-91.102~18.04.1). linux-headers-5.4.0-91-generic set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 246 not upgraded.
安装成功后在/ls/modules里面会多出了相应的文件夹,里面装了相关的文件
1 2
book@100ask:~$ ls /lib/modules 4.18.0-15-generic 5.4.0-90-generic 5.4.0-91-generic
比如5.4.0.91这个内核版本,里面有这些文件:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
book@100ask:/lib/modules/5.4.0-91-generic$ ls -lA total 5804 lrwxrwxrwx 1 root root 39 Nov 11 08:48 build -> /usr/src/linux-headers-5.4.0-91-generic drwxr-xr-x 2 root root 4096 Nov 11 08:48 initrd drwxr-xr-x 17 root root 4096 Dec 11 21:53 kernel -rw-r--r-- 1 root root 1400153 Dec 11 21:53 modules.alias -rw-r--r-- 1 root root 1376983 Dec 11 21:53 modules.alias.bin -rw-r--r-- 1 root root 8105 Nov 11 08:48 modules.builtin -rw-r--r-- 1 root root 10257 Dec 11 21:53 modules.builtin.bin -rw-r--r-- 1 root root 63546 Nov 11 08:48 modules.builtin.modinfo -rw-r--r-- 1 root root 610120 Dec 11 21:53 modules.dep -rw-r--r-- 1 root root 852703 Dec 11 21:53 modules.dep.bin -rw-r--r-- 1 root root 330 Dec 11 21:53 modules.devname -rw-r--r-- 1 root root 219972 Nov 11 08:48 modules.order -rw-r--r-- 1 root root 947 Dec 11 21:53 modules.softdep -rw-r--r-- 1 root root 614790 Dec 11 21:53 modules.symbols -rw-r--r-- 1 root root 747885 Dec 11 21:53 modules.symbols.bin drwxr-xr-x 3 root root 4096 Dec 11 21:53 vdso
/* These are for everybody (although not all archs will actually discard it in modules) */ #define __init __section(.init.text) __cold __latent_entropy __noinitretpoline #define __initdata __section(.init.data) #define __initconst __section(.init.rodata) #define __exitdata __section(.exit.data) #define __exit_call __used __section(.exitcall.exit)