Licensing kernel modules
As is well known, the Linux kernel code base itself is licensed under the GNU GPL v2 (aka GPL-2.0; GPL stands for General Public License), and as far as most people are concerned will remain that way. As briefly mentioned before, in Chapter 4, Writing Your First Kernel Module – Part 1, licensing your kernel code is required and important. Let’s split up this short discussion on licensing into two portions: one, as it applies to inline kernel code (or the mainline kernel), and two, as it applies to writing third-party out-of-tree kernel modules (as many of us do).
Licensing of inline kernel code
We begin with the first, that is, inline kernel code. A key point with regard to licensing here: if your intention is to directly use Linux kernel code and/or contribute your code upstream into the mainline kernel (we cover more on this in an upcoming section), you must release the code under the same license that the Linux kernel is released under...