我得到了内核模块的.o和.ko版本。如何确定编译时所针对的Linux内核的版本?
最佳答案
对不起的
从https://unix.stackexchange.com/questions/195241/is-there-a-way-to-determine-what-kernel-version-a-kernel-module-was-compiled-aga
执行命令modinfo <kernel_module_name>
并查找vermagic
shw@shw:/tmp # modinfo btrfs
filename: /lib/modules/3.13.0-36-generic/kernel/fs/btrfs/btrfs.ko
license: GPL
alias: devname:btrfs-control
alias: char-major-10-234
alias: fs-btrfs srcversion: EA2C07F0B841AE2A6D8F91F
depends: libcrc32c,raid6_pq,xor
intree: Y
**vermagic: 3.13.0-36-generic SMP mod_unload modversions 686** <==
signer: Magrathea: Glacier signing key
sig_key: FF:9A:DA:11:B8:55:51:6A:72:98:65:9D:4E:3F:BB:76:C5:4A:D3:30
sig_hashalgo: sha512