SeedLabs Firewall Lab: Implement a Simple Kernel Module, 构建内核模块失败
SeedLabs Firewall Lab: Implement a Simple Kernel Module, failure to build a kernel module
我正在执行 3.1 任务 1.A 中的步骤:实施简单内核模块:
https://seedsecuritylabs.org/Labs_20.04/Files/Firewall/Firewall.pdf
在我 运行 make 命令之前一切都很好。 hello.ko 文件没有生成,我不知道出了什么问题。
make -C /lib/modules/5.11.0-38-generic/build M=/home/seed/Downloads/Labsetup/Files/kernel_module modules
make[1]: Entering directory '/usr/src/linux-headers-5.11.0-38-generic'
CC [M] /home/seed/Downloads/Labsetup/Files/kernel_module/hello.o
MODPOST /home/seed/Downloads/Labsetup/Files/kernel_module/Module.symvers
ERROR: modpost: missing MODULE_LICENSE() in /home/seed/Downloads/Labsetup/Files/kernel_module/hello.o
make[2]: *** [scripts/Makefile.modpost:124: /home/seed/Downloads/Labsetup/Files/kernel_module/Module.symvers] Error 1
make[2]: *** Deleting file '/home/seed/Downloads/Labsetup/Files/kernel_module/Module.symvers'
make[1]: *** [Makefile:1753: modules] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.11.0-38-generic'
make: *** [Makefile:4: all] Error 2
ERROR: modpost: missing MODULE_LICENSE() in /home/seed/Downloads/Labsetup/Files/kernel_module/hello.o
您必须在 hello.c
中添加许可证。
例如
MODULE_LICENSE("GPL");
我正在执行 3.1 任务 1.A 中的步骤:实施简单内核模块: https://seedsecuritylabs.org/Labs_20.04/Files/Firewall/Firewall.pdf 在我 运行 make 命令之前一切都很好。 hello.ko 文件没有生成,我不知道出了什么问题。
make -C /lib/modules/5.11.0-38-generic/build M=/home/seed/Downloads/Labsetup/Files/kernel_module modules
make[1]: Entering directory '/usr/src/linux-headers-5.11.0-38-generic'
CC [M] /home/seed/Downloads/Labsetup/Files/kernel_module/hello.o
MODPOST /home/seed/Downloads/Labsetup/Files/kernel_module/Module.symvers
ERROR: modpost: missing MODULE_LICENSE() in /home/seed/Downloads/Labsetup/Files/kernel_module/hello.o
make[2]: *** [scripts/Makefile.modpost:124: /home/seed/Downloads/Labsetup/Files/kernel_module/Module.symvers] Error 1
make[2]: *** Deleting file '/home/seed/Downloads/Labsetup/Files/kernel_module/Module.symvers'
make[1]: *** [Makefile:1753: modules] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.11.0-38-generic'
make: *** [Makefile:4: all] Error 2
ERROR: modpost: missing MODULE_LICENSE() in /home/seed/Downloads/Labsetup/Files/kernel_module/hello.o
您必须在 hello.c
中添加许可证。
例如
MODULE_LICENSE("GPL");