^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) .. _development_process_intro:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) Introduction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) ============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) Executive summary
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) -----------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) The rest of this section covers the scope of the kernel development process
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) and the kinds of frustrations that developers and their employers can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) encounter there. There are a great many reasons why kernel code should be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) merged into the official ("mainline") kernel, including automatic
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) availability to users, community support in many forms, and the ability to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) influence the direction of kernel development. Code contributed to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) Linux kernel must be made available under a GPL-compatible license.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) :ref:`development_process` introduces the development process, the kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) release cycle, and the mechanics of the merge window. The various phases in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) the patch development, review, and merging cycle are covered. There is some
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) discussion of tools and mailing lists. Developers wanting to get started
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) with kernel development are encouraged to track down and fix bugs as an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) initial exercise.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) :ref:`development_early_stage` covers early-stage project planning, with an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) emphasis on involving the development community as soon as possible.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) :ref:`development_coding` is about the coding process; several pitfalls which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) have been encountered by other developers are discussed. Some requirements for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) patches are covered, and there is an introduction to some of the tools
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) which can help to ensure that kernel patches are correct.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) :ref:`development_posting` talks about the process of posting patches for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) review. To be taken seriously by the development community, patches must be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) properly formatted and described, and they must be sent to the right place.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) Following the advice in this section should help to ensure the best
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) possible reception for your work.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) :ref:`development_followthrough` covers what happens after posting patches; the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) job is far from done at that point. Working with reviewers is a crucial part
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) of the development process; this section offers a number of tips on how to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) avoid problems at this important stage. Developers are cautioned against
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) assuming that the job is done when a patch is merged into the mainline.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) :ref:`development_advancedtopics` introduces a couple of "advanced" topics:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) managing patches with git and reviewing patches posted by others.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) :ref:`development_conclusion` concludes the document with pointers to sources
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) for more information on kernel development.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) What this document is about
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) ---------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) The Linux kernel, at over 8 million lines of code and well over 1000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) contributors to each release, is one of the largest and most active free
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) software projects in existence. Since its humble beginning in 1991, this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) kernel has evolved into a best-of-breed operating system component which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) runs on pocket-sized digital music players, desktop PCs, the largest
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) supercomputers in existence, and all types of systems in between. It is a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) robust, efficient, and scalable solution for almost any situation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) With the growth of Linux has come an increase in the number of developers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) (and companies) wishing to participate in its development. Hardware
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) vendors want to ensure that Linux supports their products well, making
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) those products attractive to Linux users. Embedded systems vendors, who
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) use Linux as a component in an integrated product, want Linux to be as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) capable and well-suited to the task at hand as possible. Distributors and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) other software vendors who base their products on Linux have a clear
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) interest in the capabilities, performance, and reliability of the Linux
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) kernel. And end users, too, will often wish to change Linux to make it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) better suit their needs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) One of the most compelling features of Linux is that it is accessible to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) these developers; anybody with the requisite skills can improve Linux and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) influence the direction of its development. Proprietary products cannot
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) offer this kind of openness, which is a characteristic of the free software
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) process. But, if anything, the kernel is even more open than most other
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) free software projects. A typical three-month kernel development cycle can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) involve over 1000 developers working for more than 100 different companies
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) (or for no company at all).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) Working with the kernel development community is not especially hard. But,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) that notwithstanding, many potential contributors have experienced
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) difficulties when trying to do kernel work. The kernel community has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) evolved its own distinct ways of operating which allow it to function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) smoothly (and produce a high-quality product) in an environment where
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) thousands of lines of code are being changed every day. So it is not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) surprising that Linux kernel development process differs greatly from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) proprietary development methods.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) The kernel's development process may come across as strange and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) intimidating to new developers, but there are good reasons and solid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) experience behind it. A developer who does not understand the kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) community's ways (or, worse, who tries to flout or circumvent them) will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) have a frustrating experience in store. The development community, while
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) being helpful to those who are trying to learn, has little time for those
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) who will not listen or who do not care about the development process.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) It is hoped that those who read this document will be able to avoid that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) frustrating experience. There is a lot of material here, but the effort
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) involved in reading it will be repaid in short order. The development
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) community is always in need of developers who will help to make the kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) better; the following text should help you - or those who work for you -
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) join our community.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) Credits
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) -------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) This document was written by Jonathan Corbet, corbet@lwn.net. It has been
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) improved by comments from Johannes Berg, James Berry, Alex Chiang, Roland
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) Dreier, Randy Dunlap, Jake Edge, Jiri Kosina, Matt Mackall, Arthur Marsh,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) Amanda McPherson, Andrew Morton, Andrew Price, Tsugikazu Shibata, and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) Jochen Voß.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) This work was supported by the Linux Foundation; thanks especially to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) Amanda McPherson, who saw the value of this effort and made it all happen.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) The importance of getting code into the mainline
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) ------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) Some companies and developers occasionally wonder why they should bother
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) learning how to work with the kernel community and get their code into the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) mainline kernel (the "mainline" being the kernel maintained by Linus
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) Torvalds and used as a base by Linux distributors). In the short term,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) contributing code can look like an avoidable expense; it seems easier to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) just keep the code separate and support users directly. The truth of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) matter is that keeping code separate ("out of tree") is a false economy.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) As a way of illustrating the costs of out-of-tree code, here are a few
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) relevant aspects of the kernel development process; most of these will be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) discussed in greater detail later in this document. Consider:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) - Code which has been merged into the mainline kernel is available to all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) Linux users. It will automatically be present on all distributions which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) enable it. There is no need for driver disks, downloads, or the hassles
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) of supporting multiple versions of multiple distributions; it all just
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) works, for the developer and for the user. Incorporation into the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) mainline solves a large number of distribution and support problems.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) - While kernel developers strive to maintain a stable interface to user
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) space, the internal kernel API is in constant flux. The lack of a stable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) internal interface is a deliberate design decision; it allows fundamental
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) improvements to be made at any time and results in higher-quality code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) But one result of that policy is that any out-of-tree code requires
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) constant upkeep if it is to work with new kernels. Maintaining
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) out-of-tree code requires significant amounts of work just to keep that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) code working.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) Code which is in the mainline, instead, does not require this work as the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) result of a simple rule requiring any developer who makes an API change
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) to also fix any code that breaks as the result of that change. So code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) which has been merged into the mainline has significantly lower
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) maintenance costs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) - Beyond that, code which is in the kernel will often be improved by other
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) developers. Surprising results can come from empowering your user
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) community and customers to improve your product.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) - Kernel code is subjected to review, both before and after merging into
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) the mainline. No matter how strong the original developer's skills are,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) this review process invariably finds ways in which the code can be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) improved. Often review finds severe bugs and security problems. This is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) especially true for code which has been developed in a closed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) environment; such code benefits strongly from review by outside
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) developers. Out-of-tree code is lower-quality code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) - Participation in the development process is your way to influence the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) direction of kernel development. Users who complain from the sidelines
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) are heard, but active developers have a stronger voice - and the ability
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) to implement changes which make the kernel work better for their needs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) - When code is maintained separately, the possibility that a third party
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) will contribute a different implementation of a similar feature always
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) exists. Should that happen, getting your code merged will become much
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) harder - to the point of impossibility. Then you will be faced with the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) unpleasant alternatives of either (1) maintaining a nonstandard feature
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) out of tree indefinitely, or (2) abandoning your code and migrating your
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) users over to the in-tree version.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) - Contribution of code is the fundamental action which makes the whole
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) process work. By contributing your code you can add new functionality to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) the kernel and provide capabilities and examples which are of use to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) other kernel developers. If you have developed code for Linux (or are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) thinking about doing so), you clearly have an interest in the continued
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) success of this platform; contributing code is one of the best ways to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) help ensure that success.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) All of the reasoning above applies to any out-of-tree kernel code,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) including code which is distributed in proprietary, binary-only form.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) There are, however, additional factors which should be taken into account
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) before considering any sort of binary-only kernel code distribution. These
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) include:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) - The legal issues around the distribution of proprietary kernel modules
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) are cloudy at best; quite a few kernel copyright holders believe that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) most binary-only modules are derived products of the kernel and that, as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) a result, their distribution is a violation of the GNU General Public
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) license (about which more will be said below). Your author is not a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) lawyer, and nothing in this document can possibly be considered to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) legal advice. The true legal status of closed-source modules can only be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) determined by the courts. But the uncertainty which haunts those modules
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) is there regardless.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) - Binary modules greatly increase the difficulty of debugging kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) problems, to the point that most kernel developers will not even try. So
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) the distribution of binary-only modules will make it harder for your
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) users to get support from the community.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) - Support is also harder for distributors of binary-only modules, who must
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) provide a version of the module for every distribution and every kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) version they wish to support. Dozens of builds of a single module can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) be required to provide reasonably comprehensive coverage, and your users
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) will have to upgrade your module separately every time they upgrade their
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) kernel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) - Everything that was said above about code review applies doubly to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) closed-source code. Since this code is not available at all, it cannot
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) have been reviewed by the community and will, beyond doubt, have serious
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) problems.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) Makers of embedded systems, in particular, may be tempted to disregard much
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) of what has been said in this section in the belief that they are shipping
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) a self-contained product which uses a frozen kernel version and requires no
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) more development after its release. This argument misses the value of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) widespread code review and the value of allowing your users to add
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) capabilities to your product. But these products, too, have a limited
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) commercial life, after which a new version must be released. At that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) point, vendors whose code is in the mainline and well maintained will be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) much better positioned to get the new product ready for market quickly.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) Licensing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) ---------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) Code is contributed to the Linux kernel under a number of licenses, but all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) code must be compatible with version 2 of the GNU General Public License
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) (GPLv2), which is the license covering the kernel distribution as a whole.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) In practice, that means that all code contributions are covered either by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) GPLv2 (with, optionally, language allowing distribution under later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) versions of the GPL) or the three-clause BSD license. Any contributions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) which are not covered by a compatible license will not be accepted into the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) kernel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) Copyright assignments are not required (or requested) for code contributed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) to the kernel. All code merged into the mainline kernel retains its
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) original ownership; as a result, the kernel now has thousands of owners.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) One implication of this ownership structure is that any attempt to change
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) the licensing of the kernel is doomed to almost certain failure. There are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) few practical scenarios where the agreement of all copyright holders could
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) be obtained (or their code removed from the kernel). So, in particular,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) there is no prospect of a migration to version 3 of the GPL in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) foreseeable future.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) It is imperative that all code contributed to the kernel be legitimately
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) free software. For that reason, code from anonymous (or pseudonymous)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) contributors will not be accepted. All contributors are required to "sign
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) off" on their code, stating that the code can be distributed with the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) kernel under the GPL. Code which has not been licensed as free software by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) its owner, or which risks creating copyright-related problems for the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) kernel (such as code which derives from reverse-engineering efforts lacking
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) proper safeguards) cannot be contributed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) Questions about copyright-related issues are common on Linux development
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) mailing lists. Such questions will normally receive no shortage of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) answers, but one should bear in mind that the people answering those
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) questions are not lawyers and cannot provide legal advice. If you have
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) legal questions relating to Linux source code, there is no substitute for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) talking with a lawyer who understands this field. Relying on answers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) obtained on technical mailing lists is a risky affair.