요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
SPDX identifier 위치와 comment 형식
license-rules.rst:58-90Identifier는 comment를 쓸 수 있는 첫 줄에 둔다. Interpreter shebang이 필요한 script만 두 번째 줄에 둔다. File type과 tool parser가 이해하는 comment 문법을 사용한다.
// SPDX-License-Identifier: GPL-2.0 /* C source, DTS */
/* SPDX-License-Identifier: GPL-2.0 */ /* C header, ASM */
# SPDX-License-Identifier: GPL-2.0 # script
.. SPDX-License-Identifier: GPL-2.0 # reStructuredText
WITH, OR, AND와 or-later
license-rules.rst:93-149| 연산자 | 의미 | 예 |
|---|---|---|
| + | 해당 version 또는 이후 version | GPL-2.0+, LGPL-2.1+ |
| WITH | 특정 license에 허용된 exception을 적용 | GPL-2.0 WITH Linux-syscall-note |
| OR | Dual license 중 하나를 선택할 수 있음 | GPL-2.0 OR BSD-3-Clause |
| AND | 두 license 조건을 모두 지켜야 함 | (GPL-2.0 WITH Linux-syscall-note) AND MIT |
복합 expression은 parenthesis로 범위를 명확히 한다. Exception은 아무 license에나 붙일 수 없고 exception file의 SPDX-Licenses metatag에 허용된 identifier와만 조합한다.
Preferred, deprecated와 dual-only license
license-rules.rst:151-330LICENSES/preferred에는 새 code에 우선 사용할 완전 호환·광범위 사용 license를 둔다. LICENSES/deprecated는 기존 code 유지 또는 다른 project에서 import할 때만 쓰고 새 code에는 권장하지 않는다. LICENSES/dual은 GPL-compatible preferred license와 OR로 dual-license할 때만 사용할 수 있는 license다.
각 license file 이름은 source에서 쓰는 SPDX identifier와 같고 Valid-License-Identifier, SPDX-URL, Usage-Guidance, License-Text metatag를 갖는다. 'or later'처럼 한 text에 여러 valid identifier가 있을 수 있다.
예를 들어 MPL-1.1은 GPLv2와 호환되지 않으므로 단독으로 새 kernel code에 쓸 수 없고 GPLv2-compatible license와 OR로 결합한 dual-license에서만 사용할 수 있다.
License exception file
license-rules.rst:333-423LICENSES/exceptions에는 원 license에 추가 권리를 주는 exception text를 둔다. Linux-syscall-note는 UAPI header를 non-GPL userspace application이 include할 수 있게 하고, GCC-exception-2.0은 GCC runtime에서 import한 compiled code와 다른 license binary의 linking을 허용한다.
Exception file은 SPDX-Exception-Identifier, SPDX-URL, 함께 쓸 수 있는 SPDX-Licenses 목록, Usage-Guidance와 Exception-Text를 포함한다. Kernel에서 사용하는 모든 identifier와 exception은 LICENSES subtree에 대응 file이 있어야 checkpatch와 compliance tool이 검증하고 source 자체에서 text를 추출할 수 있다.
MODULE_LICENSE는 source license를 대신하지 않는다
license-rules.rst:425-484Loadable module은 MODULE_LICENSE() tag도 필요하지만 이것은 SPDX source license의 대체가 아니며 정확한 법적 license를 결정하지 않는다. Module loader와 userspace tool에 free software인지 proprietary인지 알리는 운영상 표식이다.
| 문자열 | Loader 관점의 의미 |
|---|---|
| GPL, GPL v2 | GPLv2-compatible module. only와 or-later 차이는 source SPDX에서 확인한다. |
| Dual MIT/GPL | GPLv2 variant 또는 MIT 중 선택 가능한 dual license |
| Dual BSD/GPL | GPLv2 variant 또는 source에 적힌 BSD variant 중 선택 |
| Dual MPL/GPL | GPLv2 variant 또는 source에 적힌 MPL variant 중 선택 |
| Proprietary | GPLv2와 호환되지 않는 외부 module |
Proprietary module을 load하면 kernel에 P taint가 생기고 loader는 EXPORT_SYMBOL_GPL symbol과 link하지 않는다. In-tree source에는 Proprietary MODULE_LICENSE를 사용할 수 없다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
.. _kernel_licensing:
Linux kernel licensing rules
============================
The Linux Kernel is provided under the terms of the GNU General Public
License version 2 only (GPL-2.0), as provided in LICENSES/preferred/GPL-2.0,
with an explicit syscall exception described in
LICENSES/exceptions/Linux-syscall-note, as described in the COPYING file.
This documentation file provides a description of how each source file
should be annotated to make its license clear and unambiguous.
It doesn't replace the Kernel's license.
The license described in the COPYING file applies to the kernel source
as a whole, though individual source files can have a different license
which is required to be compatible with the GPL-2.0::
GPL-1.0+ : GNU General Public License v1.0 or later
GPL-2.0+ : GNU General Public License v2.0 or later
LGPL-2.0 : GNU Library General Public License v2 only
LGPL-2.0+ : GNU Library General Public License v2 or later
LGPL-2.1 : GNU Lesser General Public License v2.1 only
LGPL-2.1+ : GNU Lesser General Public License v2.1 or later
Aside from that, individual files can be provided under a dual license,
e.g. one of the compatible GPL variants and alternatively under a
permissive license like BSD, MIT etc.
The User-space API (UAPI) header files, which describe the interface of
user-space programs to the kernel are a special case. According to the
note in the kernel COPYING file, the syscall interface is a clear boundary,
which does not extend the GPL requirements to any software which uses it to
communicate with the kernel. Because the UAPI headers must be includable
into any source files which create an executable running on the Linux
kernel, the exception must be documented by a special license expression.
The common way of expressing the license of a source file is to add the
matching boilerplate text into the top comment of the file. Due to
formatting, typos etc. these "boilerplates" are hard to validate for
tools which are used in the context of license compliance.
An alternative to boilerplate text is the use of Software Package Data
Exchange (SPDX) license identifiers in each source file. SPDX license
identifiers are machine parsable and precise shorthands for the license
under which the content of the file is contributed. SPDX license
identifiers are managed by the SPDX Workgroup at the Linux Foundation and
have been agreed on by partners throughout the industry, tool vendors, and
legal teams. For further information see https://spdx.org/
The Linux kernel requires the precise SPDX identifier in all source files.
The valid identifiers used in the kernel are explained in the section
`License identifiers`_ and have been retrieved from the official SPDX
license list at https://spdx.org/licenses/ along with the license texts.
License identifier syntax
-------------------------
1. Placement:
The SPDX license identifier in kernel files shall be added at the first
possible line in a file which can contain a comment. For the majority
of files this is the first line, except for scripts which require the
'#!PATH_TO_INTERPRETER' in the first line. For those scripts the SPDX
identifier goes into the second line.
|
2. Style:
The SPDX license identifier is added in form of a comment. The comment
style depends on the file type::
C source: // SPDX-License-Identifier: <SPDX License Expression>
C header: /* SPDX-License-Identifier: <SPDX License Expression> */
ASM: /* SPDX-License-Identifier: <SPDX License Expression> */
scripts: # SPDX-License-Identifier: <SPDX License Expression>
.rst: .. SPDX-License-Identifier: <SPDX License Expression>
.dts{i}: // SPDX-License-Identifier: <SPDX License Expression>
If a specific tool cannot handle the standard comment style, then the
appropriate comment mechanism which the tool accepts shall be used. This
is the reason for having the "/\* \*/" style comment in C header
files. There was build breakage observed with generated .lds files where
'ld' failed to parse the C++ comment. This has been fixed by now, but
there are still older assembler tools which cannot handle C++ style
comments.
|
3. Syntax:
A <SPDX License Expression> is either an SPDX short form license
identifier found on the SPDX License List, or the combination of two
SPDX short form license identifiers separated by "WITH" when a license
exception applies. When multiple licenses apply, an expression consists
of keywords "AND", "OR" separating sub-expressions and surrounded by
"(", ")" .
License identifiers for licenses like [L]GPL with the 'or later' option
are constructed by using a "+" for indicating the 'or later' option.::
// SPDX-License-Identifier: GPL-2.0+
// SPDX-License-Identifier: LGPL-2.1+
WITH should be used when there is a modifier to a license needed.
For example, the linux kernel UAPI files use the expression::
// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
// SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note
Other examples using WITH exceptions found in the kernel are::
// SPDX-License-Identifier: GPL-2.0 WITH mif-exception
// SPDX-License-Identifier: GPL-2.0+ WITH GCC-exception-2.0
Exceptions can only be used with particular License identifiers. The
valid License identifiers are listed in the tags of the exception text
file. For details see the point `Exceptions`_ in the chapter `License
identifiers`_.
OR should be used if the file is dual licensed and only one license is
to be selected. For example, some dtsi files are available under dual
licenses::
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
Examples from the kernel for license expressions in dual licensed files::
// SPDX-License-Identifier: GPL-2.0 OR MIT
// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
// SPDX-License-Identifier: GPL-2.0 OR Apache-2.0
// SPDX-License-Identifier: GPL-2.0 OR MPL-1.1
// SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR MIT
// SPDX-License-Identifier: GPL-1.0+ OR BSD-3-Clause OR OpenSSL
AND should be used if the file has multiple licenses whose terms all
apply to use the file. For example, if code is inherited from another
project and permission has been given to put it in the kernel, but the
original license terms need to remain in effect::
// SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) AND MIT
Another other example where both sets of license terms need to be
adhered to is::
// SPDX-License-Identifier: GPL-1.0+ AND LGPL-2.1+
License identifiers
-------------------
The licenses currently used, as well as the licenses for code added to the
kernel, can be broken down into:
1. _`Preferred licenses`:
Whenever possible these licenses should be used as they are known to be
fully compatible and widely used. These licenses are available from the
directory::
LICENSES/preferred/
in the kernel source tree.
The files in this directory contain the full license text and
`Metatags`_. The file names are identical to the SPDX license
identifier which shall be used for the license in source files.
Examples::
LICENSES/preferred/GPL-2.0
Contains the GPL version 2 license text and the required metatags::
LICENSES/preferred/MIT
Contains the MIT license text and the required metatags
_`Metatags`:
The following meta tags must be available in a license file:
- Valid-License-Identifier:
One or more lines which declare which License Identifiers are valid
inside the project to reference this particular license text. Usually
this is a single valid identifier, but e.g. for licenses with the 'or
later' options two identifiers are valid.
- SPDX-URL:
The URL of the SPDX page which contains additional information related
to the license.
- Usage-Guidance:
Freeform text for usage advice. The text must include correct examples
for the SPDX license identifiers as they should be put into source
files according to the `License identifier syntax`_ guidelines.
- License-Text:
All text after this tag is treated as the original license text
File format examples::
Valid-License-Identifier: GPL-2.0
Valid-License-Identifier: GPL-2.0+
SPDX-URL: https://spdx.org/licenses/GPL-2.0.html
Usage-Guide:
To use this license in source code, put one of the following SPDX
tag/value pairs into a comment according to the placement
guidelines in the licensing rules documentation.
For 'GNU General Public License (GPL) version 2 only' use:
SPDX-License-Identifier: GPL-2.0
For 'GNU General Public License (GPL) version 2 or any later version' use:
SPDX-License-Identifier: GPL-2.0+
License-Text:
Full license text
::
SPDX-License-Identifier: MIT
SPDX-URL: https://spdx.org/licenses/MIT.html
Usage-Guide:
To use this license in source code, put the following SPDX
tag/value pair into a comment according to the placement
guidelines in the licensing rules documentation.
SPDX-License-Identifier: MIT
License-Text:
Full license text
|
2. Deprecated licenses:
These licenses should only be used for existing code or for importing
code from a different project. These licenses are available from the
directory::
LICENSES/deprecated/
in the kernel source tree.
The files in this directory contain the full license text and
`Metatags`_. The file names are identical to the SPDX license
identifier which shall be used for the license in source files.
Examples::
LICENSES/deprecated/ISC
Contains the Internet Systems Consortium license text and the required
metatags::
LICENSES/deprecated/GPL-1.0
Contains the GPL version 1 license text and the required metatags.
Metatags:
The metatag requirements for 'other' licenses are identical to the
requirements of the `Preferred licenses`_.
File format example::
Valid-License-Identifier: ISC
SPDX-URL: https://spdx.org/licenses/ISC.html
Usage-Guide:
Usage of this license in the kernel for new code is discouraged
and it should solely be used for importing code from an already
existing project.
To use this license in source code, put the following SPDX
tag/value pair into a comment according to the placement
guidelines in the licensing rules documentation.
SPDX-License-Identifier: ISC
License-Text:
Full license text
|
3. Dual Licensing Only
These licenses should only be used to dual license code with another
license in addition to a preferred license. These licenses are available
from the directory::
LICENSES/dual/
in the kernel source tree.
The files in this directory contain the full license text and
`Metatags`_. The file names are identical to the SPDX license
identifier which shall be used for the license in source files.
Examples::
LICENSES/dual/MPL-1.1
Contains the Mozilla Public License version 1.1 license text and the
required metatags::
LICENSES/dual/Apache-2.0
Contains the Apache License version 2.0 license text and the required
metatags.
Metatags:
The metatag requirements for 'other' licenses are identical to the
requirements of the `Preferred licenses`_.
File format example::
Valid-License-Identifier: MPL-1.1
SPDX-URL: https://spdx.org/licenses/MPL-1.1.html
Usage-Guide:
Do NOT use. The MPL-1.1 is not GPL2 compatible. It may only be used for
dual-licensed files where the other license is GPL2 compatible.
If you end up using this it MUST be used together with a GPL2 compatible
license using "OR".
To use the Mozilla Public License version 1.1 put the following SPDX
tag/value pair into a comment according to the placement guidelines in
the licensing rules documentation:
SPDX-License-Identifier: MPL-1.1
License-Text:
Full license text
|
4. _`Exceptions`:
Some licenses can be amended with exceptions which grant certain rights
which the original license does not. These exceptions are available
from the directory::
LICENSES/exceptions/
in the kernel source tree. The files in this directory contain the full
exception text and the required `Exception Metatags`_.
Examples::
LICENSES/exceptions/Linux-syscall-note
Contains the Linux syscall exception as documented in the COPYING
file of the Linux kernel, which is used for UAPI header files.
e.g. /\* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note \*/::
LICENSES/exceptions/GCC-exception-2.0
Contains the GCC 'linking exception' which allows to link any binary
independent of its license against the compiled version of a file marked
with this exception. This is required for creating runnable executables
from source code which is not compatible with the GPL.
_`Exception Metatags`:
The following meta tags must be available in an exception file:
- SPDX-Exception-Identifier:
One exception identifier which can be used with SPDX license
identifiers.
- SPDX-URL:
The URL of the SPDX page which contains additional information related
to the exception.
- SPDX-Licenses:
A comma separated list of SPDX license identifiers for which the
exception can be used.
- Usage-Guidance:
Freeform text for usage advice. The text must be followed by correct
examples for the SPDX license identifiers as they should be put into
source files according to the `License identifier syntax`_ guidelines.
- Exception-Text:
All text after this tag is treated as the original exception text
File format examples::
SPDX-Exception-Identifier: Linux-syscall-note
SPDX-URL: https://spdx.org/licenses/Linux-syscall-note.html
SPDX-Licenses: GPL-2.0, GPL-2.0+, GPL-1.0+, LGPL-2.0, LGPL-2.0+, LGPL-2.1, LGPL-2.1+
Usage-Guidance:
This exception is used together with one of the above SPDX-Licenses
to mark user-space API (uapi) header files so they can be included
into non GPL compliant user-space application code.
To use this exception add it with the keyword WITH to one of the
identifiers in the SPDX-Licenses tag:
SPDX-License-Identifier: <SPDX-License> WITH Linux-syscall-note
Exception-Text:
Full exception text
::
SPDX-Exception-Identifier: GCC-exception-2.0
SPDX-URL: https://spdx.org/licenses/GCC-exception-2.0.html
SPDX-Licenses: GPL-2.0, GPL-2.0+
Usage-Guidance:
The "GCC Runtime Library exception 2.0" is used together with one
of the above SPDX-Licenses for code imported from the GCC runtime
library.
To use this exception add it with the keyword WITH to one of the
identifiers in the SPDX-Licenses tag:
SPDX-License-Identifier: <SPDX-License> WITH GCC-exception-2.0
Exception-Text:
Full exception text
All SPDX license identifiers and exceptions must have a corresponding file
in the LICENSES subdirectories. This is required to allow tool
verification (e.g. checkpatch.pl) and to have the licenses ready to read
and extract right from the source, which is recommended by various FOSS
organizations, e.g. the `FSFE REUSE initiative <https://reuse.software/>`_.
_`MODULE_LICENSE`
-----------------
Loadable kernel modules also require a MODULE_LICENSE() tag. This tag is
neither a replacement for proper source code license information
(SPDX-License-Identifier) nor in any way relevant for expressing or
determining the exact license under which the source code of the module
is provided.
The sole purpose of this tag is to provide sufficient information
whether the module is free software or proprietary for the kernel
module loader and for user space tools.
The valid license strings for MODULE_LICENSE() are:
============================= =============================================
"GPL" Module is licensed under GPL version 2. This
does not express any distinction between
GPL-2.0-only or GPL-2.0-or-later. The exact
license information can only be determined
via the license information in the
corresponding source files.
"GPL v2" Same as "GPL". It exists for historic
reasons.
"GPL and additional rights" Historical variant of expressing that the
module source is dual licensed under a
GPL v2 variant and MIT license. Please do
not use in new code.
"Dual MIT/GPL" The correct way of expressing that the
module is dual licensed under a GPL v2
variant or MIT license choice.
"Dual BSD/GPL" The module is dual licensed under a GPL v2
variant or BSD license choice. The exact
variant of the BSD license can only be
determined via the license information
in the corresponding source files.
"Dual MPL/GPL" The module is dual licensed under a GPL v2
variant or Mozilla Public License (MPL)
choice. The exact variant of the MPL
license can only be determined via the
license information in the corresponding
source files.
"Proprietary" The module is under a proprietary license.
"Proprietary" is to be understood only as
"The license is not compatible to GPLv2".
This string is solely for non-GPL2 compatible
third party modules and cannot be used for
modules which have their source code in the
kernel tree. Modules tagged that way are
tainting the kernel with the 'P' flag when
loaded and the kernel module loader refuses
to link such modules against symbols which
are exported with EXPORT_SYMBOL_GPL().
============================= =============================================
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Linux kernel license와 개별 source file
1-38Linux kernel 전체는 COPYING file에 설명된 대로 LICENSES/preferred/GPL-2.0의 GNU General Public License version 2 only(GPL-2.0) 조건과 LICENSES/exceptions/Linux-syscall-note의 명시적 syscall exception에 따라 제공된다.
이 문서는 각 source file의 license를 명확하고 모호하지 않게 표시하는 방법을 설명하며 kernel 자체 license를 대체하지 않는다. COPYING의 license는 kernel source 전체에 적용되지만 개별 source file은 GPL-2.0과 호환되는 다른 license를 가질 수 있다.
| 식별자 | 원문에서 설명하는 license |
|---|---|
| GPL-1.0+ | GNU General Public License v1.0 or later |
| GPL-2.0+ | GNU General Public License v2.0 or later |
| LGPL-2.0 | GNU Library General Public License v2 only |
| LGPL-2.0+ | GNU Library General Public License v2 or later |
| LGPL-2.1 | GNU Lesser General Public License v2.1 only |
| LGPL-2.1+ | GNU Lesser General Public License v2.1 or later |
개별 file은 호환되는 GPL variant 하나와 BSD·MIT 같은 permissive license를 선택지로 함께 제공하는 dual license를 사용할 수도 있다.
User-space program과 kernel 사이 interface를 기술하는 User-space API(UAPI) header는 특별한 경우다. COPYING의 note에 따르면 syscall interface는 명확한 경계이며, 이를 통해 kernel과 통신하는 software에 GPL 요구 사항이 확장되지 않는다. UAPI header는 Linux kernel에서 실행될 executable을 만드는 어떤 source file에도 include될 수 있어야 하므로 이 exception을 특별한 license expression으로 문서화해야 한다.
Boilerplate 대신 SPDX identifier를 사용하는 이유
40-56Source file의 license를 표현하는 전통적인 방법은 file 첫 comment에 해당 boilerplate text를 넣는 것이다. 하지만 formatting 차이와 오타 때문에 license compliance 도구가 이런 boilerplate를 검증하기 어렵다.
대안은 각 source file에 Software Package Data Exchange(SPDX) license identifier를 사용하는 것이다. SPDX identifier는 machine이 parse할 수 있고, file content가 어떤 license로 기여되었는지 정확하고 짧게 나타낸다. Linux Foundation의 SPDX Workgroup이 관리하며 산업계 partner, tool vendor와 legal team 사이에 합의된 체계다.
Linux kernel은 모든 source file에 정확한 SPDX identifier를 요구한다. Kernel에서 유효한 identifier는 이 문서의 License identifiers 절에 설명되어 있으며 license text와 함께 official SPDX license list에서 가져온 것이다.
Identifier 위치와 file type별 comment 형식
58-89Kernel file의 SPDX license identifier는 comment를 넣을 수 있는 가장 첫 line에 둔다. 대부분 file에서는 첫 line이다. 첫 line에 #!PATH_TO_INTERPRETER가 필요한 script는 SPDX identifier를 두 번째 line에 둔다.
C source: // SPDX-License-Identifier: <SPDX License Expression>
C header: /* SPDX-License-Identifier: <SPDX License Expression> */
ASM: /* SPDX-License-Identifier: <SPDX License Expression> */
scripts: # SPDX-License-Identifier: <SPDX License Expression>
.rst: .. SPDX-License-Identifier: <SPDX License Expression>
.dts{i}: // SPDX-License-Identifier: <SPDX License Expression>
특정 tool이 표준 comment style을 처리하지 못하면 그 tool이 허용하는 comment mechanism을 사용한다. C header에 /* */ style을 쓰는 이유도 여기에 있다. 과거 generated .lds file에서 ld가 C++ comment를 parse하지 못해 build가 깨진 적이 있다. 그 문제는 수정되었지만 C++ style comment를 처리하지 못하는 오래된 assembler tool이 아직 남아 있다.
SPDX expression 문법: +, WITH, OR, AND
93-149SPDX License Expression은 SPDX License List의 short-form license identifier 하나이거나, exception이 적용될 때 두 identifier를 WITH로 결합한 형태다. 여러 license가 함께 적용되면 AND 또는 OR keyword로 sub-expression을 나누고 필요에 따라 괄호로 묶는다.
or later를 나타내는 +
// SPDX-License-Identifier: GPL-2.0+
// SPDX-License-Identifier: LGPL-2.1+
[L]GPL에서 해당 version 이후도 허용하는 or later option은 identifier 뒤에 +를 붙여 나타낸다.
License modifier를 결합하는 WITH
// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
// SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note
// SPDX-License-Identifier: GPL-2.0 WITH mif-exception
// SPDX-License-Identifier: GPL-2.0+ WITH GCC-exception-2.0
License에 modifier가 필요하면 WITH를 사용한다. Linux kernel UAPI file은 Linux-syscall-note를 결합한다. Exception은 아무 license에나 붙일 수 없으며 exception text file의 tag에 나열된 license identifier하고만 사용할 수 있다.
선택 가능한 dual license의 OR
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
// SPDX-License-Identifier: GPL-2.0 OR MIT
// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
// SPDX-License-Identifier: GPL-2.0 OR Apache-2.0
// SPDX-License-Identifier: GPL-2.0 OR MPL-1.1
// SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR MIT
// SPDX-License-Identifier: GPL-1.0+ OR BSD-3-Clause OR OpenSSL
File이 dual licensed되어 있고 사용자가 그중 하나를 선택할 수 있다면 OR를 사용한다. 일부 dtsi file이 이 형태로 제공된다.
모든 조건이 동시에 적용되는 AND
// SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) AND MIT
// SPDX-License-Identifier: GPL-1.0+ AND LGPL-2.1+
File 사용에 여러 license 조건이 모두 적용되면 AND를 사용한다. 다른 project에서 code를 가져오면서 kernel에 넣을 permission을 받았지만 original license 조건도 계속 유효한 경우가 예다.
Preferred license와 license-file metatag
151-235현재 사용 중인 license와 새로 kernel에 추가되는 code의 license는 여러 category로 나뉜다. 가능한 경우 완전한 compatibility가 알려져 있고 널리 사용되는 preferred license를 선택해야 한다. 이 file들은 kernel source tree의 LICENSES/preferred/ 아래에 있으며 full license text와 metatag를 포함한다. Filename은 source file에서 사용할 SPDX license identifier와 같다.
- LICENSES/preferred/GPL-2.0: GPL version 2 license text와 필수 metatag
- LICENSES/preferred/MIT: MIT license text와 필수 metatag
| Metatag | 의미 |
|---|---|
| Valid-License-Identifier | Project에서 이 license text를 가리키는 데 유효한 identifier. 보통 하나지만 or later option이면 두 identifier가 유효할 수 있다. |
| SPDX-URL | 해당 license의 추가 정보를 담은 SPDX page URL |
| Usage-Guidance | 사용 지침을 담는 freeform text. License identifier syntax 지침에 맞는 정확한 source-file 예제를 포함해야 한다. |
| License-Text | 이 tag 뒤의 모든 text를 original license text로 취급한다. |
Valid-License-Identifier: GPL-2.0
Valid-License-Identifier: GPL-2.0+
SPDX-URL: https://spdx.org/licenses/GPL-2.0.html
Usage-Guide:
To use this license in source code, put one of the following SPDX
tag/value pairs into a comment according to the placement
guidelines in the licensing rules documentation.
For 'GNU General Public License (GPL) version 2 only' use:
SPDX-License-Identifier: GPL-2.0
For 'GNU General Public License (GPL) version 2 or any later version' use:
SPDX-License-Identifier: GPL-2.0+
License-Text:
Full license text
SPDX-License-Identifier: MIT
SPDX-URL: https://spdx.org/licenses/MIT.html
Usage-Guide:
To use this license in source code, put the following SPDX
tag/value pair into a comment according to the placement
guidelines in the licensing rules documentation.
SPDX-License-Identifier: MIT
License-Text:
Full license text
위 metatag 이름과 예제의 Usage-Guide 표기는 Linux v6.18.37 원문을 그대로 보존했다.
Deprecated license
237-280Deprecated license는 기존 code 또는 다른 project의 code를 import할 때만 사용해야 한다. Kernel source tree의 LICENSES/deprecated/ 아래에 full license text와 metatag가 있으며 filename은 source file에서 사용할 SPDX identifier와 같다.
- LICENSES/deprecated/ISC: Internet Systems Consortium license text와 필수 metatag
- LICENSES/deprecated/GPL-1.0: GPL version 1 license text와 필수 metatag
Metatag 요구 사항은 preferred license와 동일하다. ISC 예제는 새 kernel code에 이 license를 사용하는 것을 권장하지 않으며 이미 존재하는 project에서 code를 가져올 때만 사용하라고 명시한다.
Valid-License-Identifier: ISC
SPDX-URL: https://spdx.org/licenses/ISC.html
Usage-Guide:
Usage of this license in the kernel for new code is discouraged
and it should solely be used for importing code from an already
existing project.
To use this license in source code, put the following SPDX
tag/value pair into a comment according to the placement
guidelines in the licensing rules documentation.
SPDX-License-Identifier: ISC
License-Text:
Full license text
Dual Licensing Only category
284-329이 category의 license는 preferred license와 함께 code를 dual license할 때만 사용해야 한다. File은 LICENSES/dual/ 아래에 있고 full license text와 metatag를 포함하며 filename은 source에서 사용할 SPDX identifier와 같다.
- LICENSES/dual/MPL-1.1: Mozilla Public License version 1.1 text와 필수 metatag
- LICENSES/dual/Apache-2.0: Apache License version 2.0 text와 필수 metatag
Metatag 요구 사항은 preferred license와 동일하다. MPL-1.1은 GPL2 compatible하지 않으므로 단독으로 사용해서는 안 된다. 다른 license가 GPL2 compatible한 dual-licensed file에서만 사용할 수 있으며 반드시 OR로 결합해야 한다.
Valid-License-Identifier: MPL-1.1
SPDX-URL: https://spdx.org/licenses/MPL-1.1.html
Usage-Guide:
Do NOT use. The MPL-1.1 is not GPL2 compatible. It may only be used for
dual-licensed files where the other license is GPL2 compatible.
If you end up using this it MUST be used together with a GPL2 compatible
license using "OR".
To use the Mozilla Public License version 1.1 put the following SPDX
tag/value pair into a comment according to the placement guidelines in
the licensing rules documentation:
SPDX-License-Identifier: MPL-1.1
License-Text:
Full license text
License exception과 exception metatag
333-423일부 license는 original license가 주지 않는 특정 권리를 부여하는 exception으로 수정할 수 있다. Exception file은 LICENSES/exceptions/ 아래에 있으며 full exception text와 필수 exception metatag를 포함한다.
- LICENSES/exceptions/Linux-syscall-note: Linux kernel COPYING에 설명된 syscall exception이며 UAPI header에 사용한다. 예: /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
- LICENSES/exceptions/GCC-exception-2.0: GCC linking exception. 표시된 file의 compiled version과 binary license에 관계없이 link할 수 있게 하며 GPL과 호환되지 않는 source로 runnable executable을 만드는 데 필요하다.
| Exception metatag | 의미 |
|---|---|
| SPDX-Exception-Identifier | SPDX license identifier와 결합할 수 있는 exception identifier 하나 |
| SPDX-URL | 해당 exception 추가 정보를 담은 SPDX page URL |
| SPDX-Licenses | 이 exception을 사용할 수 있는 SPDX license identifier의 comma-separated list |
| Usage-Guidance | 사용 지침과 License identifier syntax에 맞는 정확한 source-file 예제 |
| Exception-Text | 이 tag 뒤의 모든 text를 original exception text로 취급 |
SPDX-Exception-Identifier: Linux-syscall-note
SPDX-URL: https://spdx.org/licenses/Linux-syscall-note.html
SPDX-Licenses: GPL-2.0, GPL-2.0+, GPL-1.0+, LGPL-2.0, LGPL-2.0+, LGPL-2.1, LGPL-2.1+
Usage-Guidance:
This exception is used together with one of the above SPDX-Licenses
to mark user-space API (uapi) header files so they can be included
into non GPL compliant user-space application code.
To use this exception add it with the keyword WITH to one of the
identifiers in the SPDX-Licenses tag:
SPDX-License-Identifier: <SPDX-License> WITH Linux-syscall-note
Exception-Text:
Full exception text
SPDX-Exception-Identifier: GCC-exception-2.0
SPDX-URL: https://spdx.org/licenses/GCC-exception-2.0.html
SPDX-Licenses: GPL-2.0, GPL-2.0+
Usage-Guidance:
The "GCC Runtime Library exception 2.0" is used together with one
of the above SPDX-Licenses for code imported from the GCC runtime
library.
To use this exception add it with the keyword WITH to one of the
identifiers in the SPDX-Licenses tag:
SPDX-License-Identifier: <SPDX-License> WITH GCC-exception-2.0
Exception-Text:
Full exception text
모든 SPDX license identifier와 exception에는 LICENSES 하위 directory에 대응하는 file이 있어야 한다. 그래야 checkpatch.pl 같은 도구가 검증할 수 있고, 여러 FOSS organization이 권장하는 대로 source에서 license를 바로 읽고 추출할 수 있다.
MODULE_LICENSE()의 제한된 역할
425-484Loadable kernel module에는 MODULE_LICENSE() tag도 필요하다. 이 tag는 정확한 source code license 정보인 SPDX-License-Identifier를 대체하지 않으며 module source가 제공되는 정확한 license를 표현하거나 판정하는 수단도 아니다.
MODULE_LICENSE()의 유일한 목적은 kernel module loader와 user-space tool이 module이 free software인지 proprietary인지 판단하는 데 필요한 최소 정보를 제공하는 것이다.
| MODULE_LICENSE string | 의미 |
|---|---|
| "GPL" | GPL version 2 module. GPL-2.0-only와 GPL-2.0-or-later를 구분하지 않으며 정확한 license는 source file의 license 정보로만 판정한다. |
| "GPL v2" | "GPL"과 같고 역사적인 이유로 존재한다. |
| "GPL and additional rights" | GPL v2 variant와 MIT dual license를 나타내던 역사적 표현. 새 code에서는 사용하지 않는다. |
| "Dual MIT/GPL" | GPL v2 variant 또는 MIT 중 선택 가능한 dual license의 올바른 표현 |
| "Dual BSD/GPL" | GPL v2 variant 또는 BSD 중 선택. 정확한 BSD variant는 source file의 license 정보로 판정한다. |
| "Dual MPL/GPL" | GPL v2 variant 또는 MPL 중 선택. 정확한 MPL variant는 source file의 license 정보로 판정한다. |
| "Proprietary" | GPLv2 compatible하지 않은 third-party module. Kernel tree 안의 source module에는 사용할 수 없다. |
"Proprietary"는 오직 license가 GPLv2와 compatible하지 않다는 의미로 이해해야 한다. 이 tag의 module을 load하면 kernel에 P taint flag가 설정되고 module loader는 EXPORT_SYMBOL_GPL()로 export된 symbol에 해당 module을 link하는 것을 거부한다.
Kernel 전체 license와 개별 file
license-rules.rst:5-56Linux kernel 전체는 COPYING과 LICENSES/preferred/GPL-2.0에 정의된 GPL version 2 only로 제공되며 명시적인 Linux syscall exception이 있다. 개별 source file은 GPL-2.0과 호환되는 다른 license 또는 GPL-compatible license와 BSD·MIT 같은 permissive license의 dual-license를 사용할 수 있다.
UAPI header는 userspace program이 include하므로 특별하다. Syscall interface는 GPL requirement가 userspace software로 확장되지 않는 명확한 경계이고, header에는 Linux-syscall-note exception을 포함한 expression으로 이를 표시한다.
긴 boilerplate text는 typo와 formatting 차이 때문에 자동 compliance 검증이 어렵다. Kernel은 machine-readable하고 정확한 SPDX-License-Identifier를 모든 source file에 요구한다.