License Terms

Linux is licensed with the GNU ``General Public License'' (GPL), a document devised for the GNU project by the Free Software Foundation. The GPL allows anybody to redistribute, and also sell, a GPL’d product, as long as the recipient is allowed to rebuild an exact copy of the binary files from source. Additionally, any software product derived from a GPL’d product must be released under the GPL.

The main goal of such a licence is to allow the growth of knowledge by permitting everybody to modify programs at will; at the same time, people selling software to the public can still do their job. Despite this simple objective, there’s an ongoing discussion about the GPL and its use. If you want to read the license, you can find it in several places in your system, including the directory /usr/src/linux, as a file called COPYING.

As far as third-party and custom modules are concerned, they’re not part of the Linux kernel, and thus you’re not forced to license them under the GPL. A module uses the kernel through a well-defined interface, but is not part of it, similar to the way user programs use the kernel through system calls.

In brief, if your code goes in the kernel, you must use the GPL as soon as you release the code. Although personal use of your changes doesn’t force the GPL on, if you distribute your code you must include the source code in the distribution—people acquiring your package must be allowed to rebuild the binary at will. If you write a module, on the other hand, you are allowed to distribute it in binary form. However, this is not always practical, as modules should in general be recompiled for each kernel version that they will be linked with (as explained in Chapter 2, in the section Section 2.2.1, and Chapter 11, in the section Section 11.2). The common objection to binary distribution of modules is that a module embeds code defined or declared in the kernel headers; this objection doesn’t apply, however, because header files are part of the public interface of the kernel, and thus are not subject to licensing.

As far as this book is concerned, most of the code is freely redistributable, either in source or binary form, and neither O’Reilly & Associates nor I retain any license on any derived works. All the programs are available through FTP from ftp://ftp.ora.com/pub/examples/linux/drivers/, and the exact licence terms are stated in the file LICENSE in the same directory.

When sample programs include parts of the kernel code, the GPL applies: the text accompanying source code is very clear about that. This only happens for a pair of source files that are very minor to the topic of this book.

Get Linux Device Drivers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.