mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 10:15:57 +01:00
Then inside, split packages/lkmc into kernel_modules and userland, to keep userland out of the kernel_modules parent path, which makes no sense. Copy built modules and userland to the output rootfs overlay. Document Linux distro tradeoffs.
22 lines
379 B
C
22 lines
379 B
C
/* https://github.com/cirosantilli/linux-kernel-module-cheat#kernel-panic-and-oops */
|
|
|
|
#include <linux/module.h>
|
|
#include <linux/kernel.h>
|
|
|
|
static int myinit(void)
|
|
{
|
|
pr_info("panic myinit\n");
|
|
panic("hello panic");
|
|
pr_info("panic after\n");
|
|
return 0;
|
|
}
|
|
|
|
static void myexit(void)
|
|
{
|
|
pr_info("panic myexit\n");
|
|
}
|
|
|
|
module_init(myinit)
|
|
module_exit(myexit)
|
|
MODULE_LICENSE("GPL");
|