I'm using a centos 8. I made a module where every time the module goes up it prints "Hello World" and every time the module goes down it prints "Goodbye".How do I make the module load automatically during boot?
#include <linux/module.h> #include <linux/kernel.h> int init_module(void){ printk("Hello world\n"); return 0;}void cleanup_module(void){ printk(KERN_INFO "Goodbye\n"); }module_init(init_module);module_exit(cleanup_module);
The name of this file is mymodule.c .
(I have seen other posts here about this but they do not explain where I place my module, and what I record in a configuration file). So I would love an explanation, thank you very much