mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-05-16 22:38:59 +00:00
The test is currently not hooked up, but it pulls the latest 4.9.x kernel image, builds a simple kernel module against it and then creates a test package containing the kernel module and a shell script. The shell script prints out the 'modinfo' and then tries to 'insmod' the module. It checks the output of 'dmesg' of the load succeeded. Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
23 lines
452 B
C
23 lines
452 B
C
/*
|
|
* A simple Hello World kernel module
|
|
*/
|
|
#include <linux/module.h>
|
|
#include <linux/kernel.h>
|
|
|
|
int init_hello(void)
|
|
{
|
|
printk(KERN_INFO "Hello LinuxKit\n");
|
|
return 0;
|
|
}
|
|
|
|
void exit_hello(void)
|
|
{
|
|
printk(KERN_INFO "Goodbye LinuxKit.\n");
|
|
}
|
|
|
|
module_init(init_hello);
|
|
module_exit(exit_hello);
|
|
MODULE_AUTHOR("Rolf Neugebauer <rolf.neugebauer@docker.com>");
|
|
MODULE_LICENSE("GPL");
|
|
MODULE_DESCRIPTION("A simple Hello World kernel module for testing");
|