mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-25 19:21:35 +01:00
bring a minimal buildroot kernel modules example to life
More importantly, to make modules_install on the Linux kernel build.
This commit is contained in:
19
buildroot_packages/kernel_modules/buildroot_hello.c
Normal file
19
buildroot_packages/kernel_modules/buildroot_hello.c
Normal file
@@ -0,0 +1,19 @@
|
||||
/* https://github.com/cirosantilli/linux-kernel-module-cheat#getting-started-natively */
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
|
||||
static int myinit(void)
|
||||
{
|
||||
pr_info("init buildroot\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void myexit(void)
|
||||
{
|
||||
pr_info("exit buildroot\n");
|
||||
}
|
||||
|
||||
module_init(myinit)
|
||||
module_exit(myexit)
|
||||
MODULE_LICENSE("GPL");
|
||||
Reference in New Issue
Block a user