nixpkgs/nixos/tests/kernel-generic/hello-world-src/hello.c
Elliot Berman fa533ecbdf
nixos: tests: kernel-generic: Add kernelPackagesExtensions test
Extend kernelPackages using kernelPackagesExtensions by adding a simple
"hello world" kernel module. Ensure it is loaded and the "Hello world!"
printk appears in dmesg.
2025-10-03 09:58:42 -07:00

19 lines
267 B
C

// SPDX-License-Identifier: MIT
#include <linux/module.h>
#include <linux/printk.h>
static int hello(void)
{
pr_info("Hello world!");
return 0;
}
module_init(hello);
static void goodbye(void)
{
pr_info("Goodbye");
}
module_exit(goodbye);
MODULE_LICENSE("MIT");