Whenever it comes to quick-and-dirty testing of what can (or cannot) be done in the Linux kernel, I find myself searching for the boilerplate of a loadable kernel module and the list of Debian packages that must be installed for an out-of-tree compilation. Finally, I am tired of that: here is the script that does everything for me.
The script, kernel-module.sh checks for the presence of required Debian packages and initiates installation of the missing ones with apt-get install and then creates a directory with a Makefile and a C source file for the module, ready for compilation.
The invocation is as simple as
sh kernel-module.sh the-name-of-the-module
There are two things to note:
Vadim Penzin, September 21st, 2015
I hereby place this article into the public domain.
I publish this information in the hope that it will be useful, but without ANY WARRANTY.
You are responsible for any and all consequences that may arise as the result of using this information.