Source archive: linux-kernel-6.18.48.tar.gz
Files in concatenation order:
linux-6.18.48/tools/usb/usbip/COPYING
linux-6.18.48/COPYING
linux-6.18.48/scripts/package/debian/copyright
linux-6.18.48/drivers/net/wireless/marvell/libertas/LICENSE
linux-6.18.48/drivers/net/LICENSE.SRC
linux-6.18.48/include/linux/license.h
linux-6.18.48/fs/jffs2/LICENCE
linux-6.18.48/Documentation/translations/it_IT/process/license-rules.rst
linux-6.18.48/Documentation/translations/zh_TW/process/license-rules.rst
linux-6.18.48/Documentation/translations/zh_CN/process/license-rules.rst
linux-6.18.48/Documentation/scsi/LICENSE.FlashPoint
linux-6.18.48/Documentation/images/COPYING-logo
linux-6.18.48/Documentation/process/license-rules.rst

		    GNU GENERAL PUBLIC LICENSE
		       Version 2, June 1991

 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
     51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

			    Preamble

  The licenses for most software are designed to take away your
freedom to share and change it.  By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users.  This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it.  (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.)  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.

  To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have.  You must make sure that they, too, receive or can get the
source code.  And you must show them these terms so they know their
rights.

  We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.

  Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software.  If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.

  Finally, any free program is threatened constantly by software
patents.  We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary.  To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.

  The precise terms and conditions for copying, distribution and
modification follow.

		    GNU GENERAL PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License.  The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language.  (Hereinafter, translation is included without limitation in
the term "modification".)  Each licensee is addressed as "you".

Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope.  The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.

  1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.

You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.

  2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

    a) You must cause the modified files to carry prominent notices
    stating that you changed the files and the date of any change.

    b) You must cause any work that you distribute or publish, that in
    whole or in part contains or is derived from the Program or any
    part thereof, to be licensed as a whole at no charge to all third
    parties under the terms of this License.

    c) If the modified program normally reads commands interactively
    when run, you must cause it, when started running for such
    interactive use in the most ordinary way, to print or display an
    announcement including an appropriate copyright notice and a
    notice that there is no warranty (or else, saying that you provide
    a warranty) and that users may redistribute the program under
    these conditions, and telling the user how to view a copy of this
    License.  (Exception: if the Program itself is interactive but
    does not normally print such an announcement, your work based on
    the Program is not required to print an announcement.)

These requirements apply to the modified work as a whole.  If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works.  But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.

Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.

In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.

  3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:

    a) Accompany it with the complete corresponding machine-readable
    source code, which must be distributed under the terms of Sections
    1 and 2 above on a medium customarily used for software interchange; or,

    b) Accompany it with a written offer, valid for at least three
    years, to give any third party, for a charge no more than your
    cost of physically performing source distribution, a complete
    machine-readable copy of the corresponding source code, to be
    distributed under the terms of Sections 1 and 2 above on a medium
    customarily used for software interchange; or,

    c) Accompany it with the information you received as to the offer
    to distribute corresponding source code.  (This alternative is
    allowed only for noncommercial distribution and only if you
    received the program in object code or executable form with such
    an offer, in accord with Subsection b above.)

The source code for a work means the preferred form of the work for
making modifications to it.  For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable.  However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.

If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.

  4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License.  Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.

  5. You are not required to accept this License, since you have not
signed it.  However, nothing else grants you permission to modify or
distribute the Program or its derivative works.  These actions are
prohibited by law if you do not accept this License.  Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.

  6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions.  You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.

  7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all.  For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.

If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.

It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices.  Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.

This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

  8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded.  In such case, this License incorporates
the limitation as if written in the body of this License.

  9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

Each version is given a distinguishing version number.  If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation.  If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.

  10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission.  For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this.  Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.

			    NO WARRANTY

  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.

  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

		     END OF TERMS AND CONDITIONS

	    How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA


Also add information on how to contact you by electronic and paper mail.

If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:

    Gnomovision version 69, Copyright (C) year  name of author
    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.

You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary.  Here is a sample; alter the names:

  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
  `Gnomovision' (which makes passes at compilers) written by James Hacker.

  <signature of Ty Coon>, 1 April 1989
  Ty Coon, President of Vice

This General Public License does not permit incorporating your program into
proprietary programs.  If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library.  If this is what you want to do, use the GNU Library General
Public License instead of this License.
The Linux Kernel is provided under:

	SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note

Being under the terms of the GNU General Public License version 2 only,
according with:

	LICENSES/preferred/GPL-2.0

With an explicit syscall exception, as stated at:

	LICENSES/exceptions/Linux-syscall-note

In addition, other licenses may also apply. Please see:

	Documentation/process/license-rules.rst

for more details.

All contributions to the Linux Kernel are subject to this COPYING file.
This is a packaged upstream version of the Linux kernel.

The sources may be found at most Linux archive sites, including:
https://www.kernel.org/pub/linux/kernel

Copyright: 1991 - 2023 Linus Torvalds and others.

The git repository for mainline kernel development is at:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; version 2 dated June, 1991.

On Debian GNU/Linux systems, the complete text of the GNU General Public
License version 2 can be found in `/usr/share/common-licenses/GPL-2'.
  Copyright (c) 2003-2006, Marvell International Ltd.
  All Rights Reserved

  This program is free software; you can redistribute it and/or modify it
  under the terms of version 2 of the GNU General Public License as
  published by the Free Software Foundation.

  This program is distributed in the hope that it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  more details.

  You should have received a copy of the GNU General Public License along with
  this program; if not, write to the Free Software Foundation, Inc., 59
  Temple Place - Suite 330, Boston, MA  02111-1307, USA.

Code in this directory written at the IDA Supercomputing Research Center
carries the following copyright and license.

    Copyright 1993 United States Government as represented by the
    Director, National Security Agency.  This software may be used
    and distributed according to the terms of the GNU General Public License,
    incorporated herein by reference.

    In addition to the disclaimers in the GPL, SRC expressly disclaims any
    and all warranties, expressed or implied, concerning the enclosed software.
    This software was developed at SRC for use in internal research, and the
    intent in sharing this software is to promote the productive interchange
    of ideas throughout the research community.   All software is furnished
    on an "as-is" basis.  No further updates to this software should be
    expected.  Although updates may occur, no commitment exists.
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef __LICENSE_H
#define __LICENSE_H

static inline int license_is_gpl_compatible(const char *license)
{
	return (strcmp(license, "GPL") == 0
		|| strcmp(license, "GPL v2") == 0
		|| strcmp(license, "GPL and additional rights") == 0
		|| strcmp(license, "Dual BSD/GPL") == 0
		|| strcmp(license, "Dual MIT/GPL") == 0
		|| strcmp(license, "Dual MPL/GPL") == 0);
}

#endif
The files in this directory and elsewhere which refer to this LICENCE
file are part of JFFS2, the Journalling Flash File System v2.

	Copyright © 2001-2007 Red Hat, Inc. and others

JFFS2 is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 or (at your option) any later 
version.

JFFS2 is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License along
with JFFS2; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

As a special exception, if other files instantiate templates or use
macros or inline functions from these files, or you compile these
files and link them with other works to produce a work based on these
files, these files do not by themselves cause the resulting work to be
covered by the GNU General Public License. However the source code for
these files must still be made available in accordance with section (3)
of the GNU General Public License.

This exception does not invalidate any other reasons why a work based on
this file might be covered by the GNU General Public License.

.. SPDX-License-Identifier: GPL-2.0

.. include:: ../disclaimer-ita.rst

:Original: :ref:`Documentation/process/license-rules.rst <kernel_licensing>`
:Translator: Federico Vaga <federico.vaga@vaga.pv.it>

.. _it_kernel_licensing:

Regole per licenziare il kernel Linux
=====================================

Il kernel Linux viene rilasciato sotto i termini definiti dalla seconda
versione della licenza *GNU General Public License* (GPL-2.0), di cui una
copia è disponibile nel file LICENSES/preferred/GPL-2.0; a questo si
aggiunge eccezione per le chiamate di sistema come descritto in
LICENSES/exceptions/Linux-syscall-note; tutto ciò è descritto nel file COPYING.

Questo documento fornisce una descrizione su come ogni singolo file sorgente
debba essere licenziato per far si che sia chiaro e non ambiguo. Questo non
sostituisce la licenza del kernel.

La licenza descritta nel file COPYING si applica ai sorgenti del kernel nella
loro interezza, quindi i singoli file sorgenti possono avere diverse licenze ma
devono essere compatibili con la GPL-2.0::

    GPL-1.0+  :  GNU General Public License v1.0 o successiva
    GPL-2.0+  :  GNU General Public License v2.0 o successiva
    LGPL-2.0  :  GNU Library General Public License v2
    LGPL-2.0+ :  GNU Library General Public License v2 o successiva
    LGPL-2.1  :  GNU Lesser General Public License v2.1
    LGPL-2.1+ :  GNU Lesser General Public License v2.1 o successiva

A parte questo, i singolo file possono essere forniti con una doppia licenza,
per esempio con una delle varianti compatibili della GPL e alternativamente con
una licenza permissiva come BSD, MIT eccetera.

I file d'intestazione per l'API verso lo spazio utente (UAPI) descrivono
le interfacce usate dai programmi, e per questo sono un caso speciale.
Secondo le note nel file COPYING, le chiamate di sistema sono un chiaro
confine oltre il quale non si estendono i requisiti della GPL per quei
programmi che le usano per comunicare con il kernel.  Dato che i file
d'intestazione UAPI devono poter essere inclusi nei sorgenti di un
qualsiasi programma eseguibile sul kernel Linux, questi meritano
un'eccezione documentata da una clausola speciale.

Il modo più comune per indicare la licenza dei file sorgenti è quello di
aggiungere il corrispondente blocco di testo come commento in testa a detto
file.  Per via della formattazione, dei refusi, eccetera, questi blocchi di
testo sono difficili da identificare dagli strumenti usati per verificare il
rispetto delle licenze.

Un'alternativa ai blocchi di testo è data dall'uso degli identificatori
*Software Package Data Exchange* (SPDX) in ogni file sorgente.  Gli
identificatori di licenza SPDX sono analizzabili dalle macchine e sono precisi
simboli stenografici che identificano la licenza sotto la quale viene
licenziato il file che lo include.  Gli identificatori di licenza SPDX sono
gestiti del gruppo di lavoro SPDX presso la Linux Foundation e sono stati
concordati fra i soci nell'industria, gli sviluppatori di strumenti, e i
rispettivi gruppi legali. Per maggiori informazioni, consultate
https://spdx.org/

Il kernel Linux richiede un preciso identificatore SPDX in tutti i file
sorgenti.  Gli identificatori validi verranno spiegati nella sezione
`Identificatori di licenza`_ e sono stati copiati dalla lista ufficiale di
licenze SPDX assieme al rispettivo testo come mostrato in
https://spdx.org/licenses/.

Sintassi degli identificatori di licenza
----------------------------------------

1. Posizionamento:

   L'identificativo di licenza SPDX dev'essere posizionato come prima riga
   possibile di un file che possa contenere commenti.  Per la maggior parte
   dei file questa è la prima riga, fanno eccezione gli script che richiedono
   come prima riga '#!PATH_TO_INTERPRETER'.  Per questi script l'identificativo
   SPDX finisce nella seconda riga.

|

2. Stile:

   L'identificativo di licenza SPDX viene aggiunto sotto forma di commento.
   Lo stile del commento dipende dal tipo di file::

      sorgenti C:	// SPDX-License-Identifier: <SPDX License Expression>
      intestazioni C:	/* 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>

   Se un particolare programma non dovesse riuscire a gestire lo stile
   principale per i commenti, allora dev'essere usato il meccanismo accettato
   dal programma.  Questo è il motivo per cui si ha "/\* \*/" nei file
   d'intestazione C.  Notammo che 'ld' falliva nell'analizzare i commenti del
   C++ nei file .lds che venivano prodotti.  Oggi questo è stato corretto,
   ma ci sono in giro ancora vecchi programmi che non sono in grado di
   gestire lo stile dei commenti del C++.

|

3. Sintassi:

   Una <espressione di licenza SPDX> può essere scritta usando l'identificatore
   SPDX della licenza come indicato nella lista di licenze SPDX, oppure la
   combinazione di due identificatori SPDX separati da "WITH" per i casi
   eccezionali. Quando si usano più licenze l'espressione viene formata da
   sottoespressioni separate dalle parole chiave "AND", "OR" e racchiuse fra
   parentesi tonde "(", ")".

   Gli identificativi di licenza per licenze come la [L]GPL che si avvalgono
   dell'opzione 'o successive' si formano aggiungendo alla fine il simbolo "+"
   per indicare l'opzione 'o successive'.::

      // SPDX-License-Identifier: GPL-2.0+
      // SPDX-License-Identifier: LGPL-2.1+

   WITH dovrebbe essere usato quando sono necessarie delle modifiche alla
   licenza.  Per esempio, la UAPI del kernel linux usa l'espressione::

      // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
      // SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note

   Altri esempi di usi di WITH all'interno del kernel sono::

      // SPDX-License-Identifier: GPL-2.0 WITH mif-exception
      // SPDX-License-Identifier: GPL-2.0+ WITH GCC-exception-2.0

   Le eccezioni si possono usare solo in combinazione con identificatori di
   licenza. Gli identificatori di licenza riconosciuti sono elencati nei
   corrispondenti file d'eccezione. Per maggiori dettagli consultate
   `Eccezioni`_ nel capitolo `Identificatori di licenza`_

   La parola chiave OR dovrebbe essere usata solo quando si usa una doppia
   licenza e solo una dev'essere scelta.  Per esempio, alcuni file dtsi sono
   disponibili con doppia licenza::

      // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause

   Esempi dal kernel di espressioni per file licenziati con doppia licenza
   sono::

      // 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

   La parola chiave AND dovrebbe essere usata quando i termini di più licenze
   si applicano ad un file. Per esempio, quando il codice viene preso da
   un altro progetto il quale da i permessi per aggiungerlo nel kernel ma
   richiede che i termini originali della licenza rimangano intatti::

      // SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) AND MIT

   Di seguito, un altro esempio dove entrambe i termini di licenza devono
   essere rispettati::

      // SPDX-License-Identifier: GPL-1.0+ AND LGPL-2.1+

Identificatori di licenza
-------------------------

Le licenze attualmente in uso, così come le licenze aggiunte al kernel, possono
essere categorizzate in:

1. _`Licenze raccomandate`:

   Ovunque possibile le licenze qui indicate dovrebbero essere usate perché
   pienamente compatibili e molto usate.  Queste licenze sono disponibile nei
   sorgenti del kernel, nella cartella::

     LICENSES/preferred/

   I file in questa cartella contengono il testo completo della licenza e i
   `Metatag`_.  Il nome di questi file è lo stesso usato come identificatore
   di licenza SPDX e che deve essere usato nei file sorgenti.

   Esempi::

     LICENSES/preferred/GPL-2.0

   Contiene il testo della seconda versione della licenza GPL e i metatag
   necessari::

     LICENSES/preferred/MIT

   Contiene il testo della licenza MIT e i metatag necessari.

   _`Metatag`:

   I seguenti metatag devono essere presenti in un file di licenza:

   - Valid-License-Identifier:

     Una o più righe che dichiarano quali identificatori di licenza sono validi
     all'interno del progetto per far riferimento alla licenza in questione.
     Solitamente, questo è un unico identificatore valido, ma per esempio le
     licenze che permettono l'opzione 'o successive' hanno due identificatori
     validi.

   - SPDX-URL:

     L'URL della pagina SPDX che contiene informazioni aggiuntive riguardanti
     la licenza.

   - Usage-Guidance:

     Testo in formato libero per dare suggerimenti agli utenti. Il testo deve
     includere degli esempi su come usare gli identificatori di licenza SPDX
     in un file sorgente in conformità con le linea guida in
     `Sintassi degli identificatori di licenza`_.

   - License-Text:

     Tutto il testo che compare dopo questa etichetta viene trattato
     come se fosse parte del testo originale della licenza.

   Esempi::

      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. Licenze deprecate:

   Questo tipo di licenze dovrebbero essere usate solo per codice già esistente
   o quando si prende codice da altri progetti.  Le licenze sono disponibili
   nei sorgenti del kernel nella cartella::

     LICENSES/deprecated/

   I file in questa cartella contengono il testo completo della licenza e i
   `Metatag`_.  Il nome di questi file è lo stesso usato come identificatore
   di licenza SPDX e che deve essere usato nei file sorgenti.

   Esempi::

     LICENSES/deprecated/ISC

   Contiene il testo della licenza Internet System Consortium e i suoi
   metatag::

     LICENSES/deprecated/GPL-1.0

   Contiene il testo della versione 1 della licenza GPL e i suoi metatag.

   Metatag:

   I metatag necessari per le 'altre' ('other') licenze sono gli stessi
   di usati per le `Licenze raccomandate`_.

   Esempio del formato del file::

      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. Solo per doppie licenze

   Queste licenze dovrebbero essere usate solamente per codice licenziato in
   combinazione con un'altra licenza che solitamente è quella preferita.
   Queste licenze sono disponibili nei sorgenti del kernel nella cartella::

     LICENSES/dual

   I file in questa cartella contengono il testo completo della rispettiva
   licenza e i suoi `Metatag`_.  I nomi dei file sono identici agli
   identificatori di licenza SPDX che dovrebbero essere usati nei file
   sorgenti.

   Esempi::

     LICENSES/dual/MPL-1.1

   Questo file contiene il testo della versione 1.1 della licenza *Mozilla
   Pulic License* e i metatag necessari::

     LICENSES/dual/Apache-2.0

   Questo file contiene il testo della versione 2.0 della licenza Apache e i
   metatag necessari.

   Metatag:

   I requisiti per le 'altre' ('*other*') licenze sono identici a quelli per le
   `Licenze raccomandate`_.

   Esempio del formato del file::

    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. _`Eccezioni`:

   Alcune licenze possono essere corrette con delle eccezioni che forniscono
   diritti aggiuntivi.  Queste eccezioni sono disponibili nei sorgenti del
   kernel nella cartella::

     LICENSES/exceptions/

   I file in questa cartella contengono il testo completo dell'eccezione e i
   `Metatag per le eccezioni`_.

   Esempi::

      LICENSES/exceptions/Linux-syscall-note

   Contiene la descrizione dell'eccezione per le chiamate di sistema Linux
   così come documentato nel file COPYING del kernel Linux; questo viene usato
   per i file d'intestazione per la UAPI.  Per esempio
   /\* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note \*/::

      LICENSES/exceptions/GCC-exception-2.0

   Contiene la 'eccezione di linking' che permette di collegare qualsiasi
   binario, indipendentemente dalla sua licenza, con un compilato il cui file
   sorgente è marchiato con questa eccezione. Questo è necessario per creare
   eseguibili dai sorgenti che non sono compatibili con la GPL.

   _`Metatag per le eccezioni`:

   Un file contenente un'eccezione deve avere i seguenti metatag:

   - SPDX-Exception-Identifier:

     Un identificatore d'eccezione che possa essere usato in combinazione con
     un identificatore di licenza SPDX.

   - SPDX-URL:

     L'URL della pagina SPDX che contiene informazioni aggiuntive riguardanti
     l'eccezione.

   - SPDX-Licenses:

     Una lista di licenze SPDX separate da virgola, che possono essere usate
     con l'eccezione.

   - Usage-Guidance:

     Testo in formato libero per dare suggerimenti agli utenti. Il testo deve
     includere degli esempi su come usare gli identificatori di licenza SPDX
     in un file sorgente in conformità con le linea guida in
     `Sintassi degli identificatori di licenza`_.

   - Exception-Text:

     Tutto il testo che compare dopo questa etichetta viene trattato
     come se fosse parte del testo originale della licenza.

   Esempi::

      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

Per ogni identificatore di licenza SPDX e per le eccezioni dev'esserci un file
nella sotto-cartella LICENSES.  Questo è necessario per permettere agli
strumenti di effettuare verifiche (come checkpatch.pl), per avere le licenze
disponibili per la lettura e per estrarre i diritti dai sorgenti, così come
raccomandato da diverse organizzazioni FOSS, per esempio l'`iniziativa FSFE
REUSE <https://reuse.software/>`_.

_`MODULE_LICENSE`
-----------------

   I moduli del kernel necessitano di un'etichetta MODULE_LICENSE(). Questa
   etichetta non sostituisce le informazioni sulla licenza del codice sorgente
   (SPDX-License-Identifier) né fornisce informazioni che esprimono o
   determinano l'esatta licenza sotto la quale viene rilasciato.

   Il solo scopo di questa etichetta è quello di fornire sufficienti
   informazioni al caricatore di moduli del kernel, o agli strumenti in spazio
   utente, per capire se il modulo è libero o proprietario.

   Le stringe di licenza valide per MODULE_LICENSE() sono:

    ============================= =============================================
    "GPL"			  Il modulo è licenziato con la GPL versione 2.
				  Questo non fa distinzione fra GPL'2.0-only o
				  GPL-2.0-or-later. L'esatta licenza può essere
				  determinata solo leggendo i corrispondenti
				  file sorgenti.

    "GPL v2"			  Stesso significato di "GPL". Esiste per
				  motivi storici.

    "GPL and additional rights"   Questa è una variante che esiste per motivi
				  storici che indica che i sorgenti di un
				  modulo sono rilasciati sotto una variante
				  della licenza GPL v2 e quella MIT. Per favore
				  non utilizzatela per codice nuovo.

    "Dual MIT/GPL"		  Questo è il modo corretto per esprimere il
				  il fatto che il modulo è rilasciato con
				  doppia licenza a scelta fra: una variante
				  della GPL v2 o la licenza MIT.

    "Dual BSD/GPL"		  Questo modulo è rilasciato con doppia licenza
				  a scelta fra: una variante della GPL v2 o la
				  licenza BSD. La variante esatta della licenza
				  BSD può essere determinata solo attraverso i
				  corrispondenti file sorgenti.

    "Dual MPL/GPL"		  Questo modulo è rilasciato con doppia licenza
				  a scelta fra: una variante della GPL v2 o la
				  Mozilla Public License (MPL). La variante
				  esatta della licenza MPL può essere
				  determinata solo attraverso i corrispondenti
				  file sorgenti.

    "Proprietary"		  Questo modulo è rilasciato con licenza
				  proprietaria. Questa stringa è solo per i
				  moduli proprietari di terze parti e non può
				  essere usata per quelli che risiedono nei
				  sorgenti del kernel. I moduli etichettati in
				  questo modo stanno contaminando il kernel e
				  gli viene assegnato un flag 'P'; quando
				  vengono caricati, il caricatore di moduli del
				  kernel si rifiuterà di collegare questi
				  moduli ai simboli che sono stati esportati
				  con EXPORT_SYMBOL_GPL().

    ============================= =============================================
.. SPDX-License-Identifier: GPL-2.0

.. include:: ../disclaimer-zh_TW.rst

:Original: :ref:`Documentation/process/license-rules.rst <kernel_licensing>`
:Translator: Alex Shi <alex.shi@linux.alibaba.com>
             Hu Haowen <2023002089@link.tyut.edu.cn>

.. _tw_kernel_licensing:

Linux內核許可規則
=================

Linux內核根據LICENSES/preferred/GPL-2.0中提供的GNU通用公共許可證版本2
（GPL-2.0）的條款提供，並在LICENSES/exceptions/Linux-syscall-note中顯式
描述了例外的系統調用，如COPYING文件中所述。

此文檔文件提供瞭如何對每個源文件進行註釋以使其許可證清晰明確的說明。
它不會取代內核的許可證。

內核源代碼作爲一個整體適用於COPYING文件中描述的許可證，但是單個源文件可以
具有不同的與GPL-20兼容的許可證::

    GPL-1.0+ : GNU通用公共許可證v1.0或更高版本
    GPL-2.0+ : GNU通用公共許可證v2.0或更高版本
    LGPL-2.0 : 僅限GNU庫通用公共許可證v2
    LGPL-2.0+: GNU 庫通用公共許可證v2或更高版本
    LGPL-2.1 : 僅限GNU寬通用公共許可證v2.1
    LGPL-2.1+: GNU寬通用公共許可證v2.1或更高版本

除此之外，個人文件可以在雙重許可下提供，例如一個兼容的GPL變體，或者BSD，
MIT等許可。

用戶空間API（UAPI）頭文件描述了用戶空間程序與內核的接口，這是一種特殊情況。
根據內核COPYING文件中的註釋，syscall接口是一個明確的邊界，它不會將GPL要求
擴展到任何使用它與內核通信的軟件。由於UAPI頭文件必須包含在創建在Linux內核
上運行的可執行文件的任何源文件中，因此此例外必須記錄在特別的許可證表述中。

表達源文件許可證的常用方法是將匹配的樣板文本添加到文件的頂部註釋中。由於
格式，拼寫錯誤等，這些“樣板”很難通過那些在上下文中使用的驗證許可證合規性
的工具。

樣板文本的替代方法是在每個源文件中使用軟件包數據交換（SPDX）許可證標識符。
SPDX許可證標識符是機器可解析的，並且是用於提供文件內容的許可證的精確縮寫。
SPDX許可證標識符由Linux 基金會的SPDX 工作組管理，並得到了整個行業，工具
供應商和法律團隊的合作伙伴的一致同意。有關詳細信息，請參閱
https://spdx.org/

Linux內核需要所有源文件中的精確SPDX標識符。內核中使用的有效標識符在
`許可標識符`_ 一節中進行了解釋，並且已可以在
https://spdx.org/licenses/ 上的官方SPDX許可證列表中檢索，並附帶許可證
文本。

許可標識符語法
--------------

1.安置:

   內核文件中的SPDX許可證標識符應添加到可包含註釋的文件中的第一行。對於大多
   數文件，這是第一行，除了那些在第一行中需要'#!PATH_TO_INTERPRETER'的腳本。
   對於這些腳本，SPDX標識符進入第二行。

|

2. 風格:

   SPDX許可證標識符以註釋的形式添加。註釋樣式取決於文件類型::

      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>

   如果特定工具無法處理標準註釋樣式，則應使用工具接受的相應註釋機制。這是在
   C 頭文件中使用“/\*\*/”樣式註釋的原因。過去在使用生成的.lds文件中觀察到
   構建被破壞，其中'ld'無法解析C++註釋。現在已經解決了這個問題，但仍然有較
   舊的彙編程序工具無法處理C++樣式的註釋。

|

3. 句法:

   <SPDX許可證表達式>是SPDX許可證列表中的SPDX短格式許可證標識符，或者在許可
   證例外適用時由“WITH”分隔的兩個SPDX短格式許可證標識符的組合。當應用多個許
   可證時，表達式由分隔子表達式的關鍵字“AND”，“OR”組成，並由“（”，“）”包圍。

   帶有“或更高”選項的[L]GPL等許可證的許可證標識符通過使用“+”來表示“或更高”
   選項來構建。::

      // SPDX-License-Identifier: GPL-2.0+
      // SPDX-License-Identifier: LGPL-2.1+

   當需要修正的許可證時，應使用WITH。 例如，linux內核UAPI文件使用表達式::

      // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
      // SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note

   其它在內核中使用WITH例外的事例如下::

      // SPDX-License-Identifier: GPL-2.0 WITH mif-exception
      // SPDX-License-Identifier: GPL-2.0+ WITH GCC-exception-2.0

   例外只能與特定的許可證標識符一起使用。有效的許可證標識符列在異常文本文件
   的標記中。有關詳細信息，請參閱 `許可標識符`_ 一章中的 `例外`_ 。

   如果文件是雙重許可且只選擇一個許可證，則應使用OR。例如，一些dtsi文件在雙
   許可下可用::

      // 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

   如果文件具有多個許可證，其條款全部適用於使用該文件，則應使用AND。例如，
   如果代碼是從另一個項目繼承的，並且已經授予了將其放入內核的權限，但原始
   許可條款需要保持有效::

      // SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) AND MIT

   另一個需要遵守兩套許可條款的例子是::

      // SPDX-License-Identifier: GPL-1.0+ AND LGPL-2.1+

許可標識符
----------

當前使用的許可證以及添加到內核的代碼許可證可以分解爲：

1. _`優先許可`:

   應儘可能使用這些許可證，因爲它們已知完全兼容並廣泛使用。這些許可證在內核
   目錄::

      LICENSES/preferred/

   此目錄中的文件包含完整的許可證文本和 `元標記`_ 。文件名與SPDX許可證標識
   符相同，後者應用於源文件中的許可證。

   例如::

      LICENSES/preferred/GPL-2.0

   包含GPLv2許可證文本和所需的元標籤::

      LICENSES/preferred/MIT

   包含MIT許可證文本和所需的元標記

   _`元標記`:

   許可證文件中必須包含以下元標記：

   - Valid-License-Identifier:

     一行或多行, 聲明那些許可標識符在項目內有效, 以引用此特定許可的文本。通
     常這是一個有效的標識符，但是例如對於帶有'或更高'選項的許可證，兩個標識
     符都有效。

   - SPDX-URL:

     SPDX頁面的URL，其中包含與許可證相關的其他信息.

   - Usage-Guidance:

     使用建議的自由格式文本。該文本必須包含SPDX許可證標識符的正確示例，因爲
     它們應根據 `許可標識符語法`_ 指南放入源文件中。

   - 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

|

2. 不推薦的許可證:

   這些許可證只應用於現有代碼或從其他項目導入代碼。這些許可證在內核目錄::

      LICENSES/other/

   此目錄中的文件包含完整的許可證文本和 `元標記`_ 。文件名與SPDX許可證標識
   符相同，後者應用於源文件中的許可證。

   例如::

      LICENSES/other/ISC

   包含國際系統聯合許可文本和所需的元標籤::

      LICENSES/other/ZLib

   包含ZLIB許可文本和所需的元標籤.

   元標籤:

   “其他”許可證的元標籤要求與 `優先許可`_ 的要求相同。

   文件格式示例::

      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. _`例外`:

   某些許可證可以修改，並允許原始許可證不具有的某些例外權利。這些例外在
   內核目錄::

      LICENSES/exceptions/

   此目錄中的文件包含完整的例外文本和所需的 `例外元標記`_ 。

   例如::

      LICENSES/exceptions/Linux-syscall-note

   包含Linux內核的COPYING文件中記錄的Linux系統調用例外，該文件用於UAPI
   頭文件。例如::

      LICENSES/exceptions/GCC-exception-2.0

   包含GCC'鏈接例外'，它允許獨立於其許可證的任何二進制文件與標記有此例外的
   文件的編譯版本鏈接。這是從GPL不兼容源代碼創建可運行的可執行文件所必需的。

   _`例外元標記`:

   以下元標記必須在例外文件中可用：

   - SPDX-Exception-Identifier:

     一個可與SPDX許可證標識符一起使用的例外標識符。

   - SPDX-URL:

     SPDX頁面的URL，其中包含與例外相關的其他信息。

   - SPDX-Licenses:

     以逗號分隔的例外可用的SPDX許可證標識符列表。

   - Usage-Guidance:

     使用建議的自由格式文本。必須在文本後面加上SPDX許可證標識符的正確示例，
     因爲它們應根據 `許可標識符語法`_ 指南放入源文件中。

   - 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許可證標識符和例外都必須在LICENSES子目錄中具有相應的文件。這是允許
工具驗證（例如checkpatch.pl）以及準備好從源讀取和提取許可證所必需的, 這是
各種FOSS組織推薦的，例如 `FSFE REUSE initiative <https://reuse.software/>`_.

_`模塊許可`
-----------------

   可加載內核模塊還需要MODULE_LICENSE（）標記。此標記既不替代正確的源代碼
   許可證信息（SPDX-License-Identifier），也不以任何方式表示或確定提供模塊
   源代碼的確切許可證。

   此標記的唯一目的是提供足夠的信息，該模塊是否是自由軟件或者是內核模塊加
   載器和用戶空間工具的專有模塊。

   MODULE_LICENSE（）的有效許可證字符串是:

    ============================= =============================================
    "GPL"			  模塊是根據GPL版本2許可的。這並不表示僅限於
                                  GPL-2.0或GPL-2.0或更高版本之間的任何區別。
                                  最正確許可證信息只能通過相應源文件中的許可證
                                  信息來確定

    "GPL v2"			  和"GPL"相同，它的存在是因爲歷史原因。

    "GPL and additional rights"   表示模塊源在GPL v2變體和MIT許可下雙重許可的
                                  歷史變體。請不要在新代碼中使用。

    "Dual MIT/GPL"		  表達該模塊在GPL v2變體或MIT許可證選擇下雙重
                                  許可的正確方式。

    "Dual BSD/GPL"		  該模塊根據GPL v2變體或BSD許可證選擇進行雙重
                                  許可。 BSD許可證的確切變體只能通過相應源文件
                                  中的許可證信息來確定。

    "Dual MPL/GPL"		  該模塊根據GPL v2變體或Mozilla Public License
                                  （MPL）選項進行雙重許可。 MPL許可證的確切變體
                                  只能通過相應的源文件中的許可證信息來確定。

    "Proprietary"		  該模塊屬於專有許可。此字符串僅用於專有的第三
                                  方模塊，不能用於在內核樹中具有源代碼的模塊。
                                  以這種方式標記的模塊在加載時會使用'P'標記污
                                  染內核，並且內核模塊加載器拒絕將這些模塊鏈接
                                  到使用EXPORT_SYMBOL_GPL（）導出的符號。
    ============================= =============================================


.. SPDX-License-Identifier: GPL-2.0

.. include:: ../disclaimer-zh_CN.rst

:Original: :ref:`Documentation/process/license-rules.rst <kernel_licensing>`
:Translator: Alex Shi <alex.shi@linux.alibaba.com>

.. _cn_kernel_licensing:

Linux内核许可规则
=================

Linux内核根据LICENSES/preferred/GPL-2.0中提供的GNU通用公共许可证版本2
（GPL-2.0）的条款提供，并在LICENSES/exceptions/Linux-syscall-note中显式
描述了例外的系统调用，如COPYING文件中所述。

此文档文件提供了如何对每个源文件进行注释以使其许可证清晰明确的说明。
它不会取代内核的许可证。

内核源代码作为一个整体适用于COPYING文件中描述的许可证，但是单个源文件可以
具有不同的与GPL-20兼容的许可证::

    GPL-1.0+ : GNU通用公共许可证v1.0或更高版本
    GPL-2.0+ : GNU通用公共许可证v2.0或更高版本
    LGPL-2.0 : 仅限GNU库通用公共许可证v2
    LGPL-2.0+: GNU 库通用公共许可证v2或更高版本
    LGPL-2.1 : 仅限GNU宽通用公共许可证v2.1
    LGPL-2.1+: GNU宽通用公共许可证v2.1或更高版本

除此之外，个人文件可以在双重许可下提供，例如一个兼容的GPL变体，或者BSD，
MIT等许可。

用户空间API（UAPI）头文件描述了用户空间程序与内核的接口，这是一种特殊情况。
根据内核COPYING文件中的注释，syscall接口是一个明确的边界，它不会将GPL要求
扩展到任何使用它与内核通信的软件。由于UAPI头文件必须包含在创建在Linux内核
上运行的可执行文件的任何源文件中，因此此例外必须记录在特别的许可证表述中。

表达源文件许可证的常用方法是将匹配的样板文本添加到文件的顶部注释中。由于
格式，拼写错误等，这些“样板”很难通过那些在上下文中使用的验证许可证合规性
的工具。

样板文本的替代方法是在每个源文件中使用软件包数据交换（SPDX）许可证标识符。
SPDX许可证标识符是机器可解析的，并且是用于提供文件内容的许可证的精确缩写。
SPDX许可证标识符由Linux 基金会的SPDX 工作组管理，并得到了整个行业，工具
供应商和法律团队的合作伙伴的一致同意。有关详细信息，请参阅
https://spdx.org/

Linux内核需要所有源文件中的精确SPDX标识符。内核中使用的有效标识符在
`许可标识符`_ 一节中进行了解释，并且已可以在
https://spdx.org/licenses/ 上的官方SPDX许可证列表中检索，并附带许可证
文本。

许可标识符语法
--------------

1.安置:

   内核文件中的SPDX许可证标识符应添加到可包含注释的文件中的第一行。对于大多
   数文件，这是第一行，除了那些在第一行中需要'#!PATH_TO_INTERPRETER'的脚本。
   对于这些脚本，SPDX标识符进入第二行。

|

2. 风格:

   SPDX许可证标识符以注释的形式添加。注释样式取决于文件类型::

      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>

   如果特定工具无法处理标准注释样式，则应使用工具接受的相应注释机制。这是在
   C 头文件中使用“/\*\*/”样式注释的原因。过去在使用生成的.lds文件中观察到
   构建被破坏，其中'ld'无法解析C++注释。现在已经解决了这个问题，但仍然有较
   旧的汇编程序工具无法处理C++样式的注释。

|

3. 句法:

   <SPDX许可证表达式>是SPDX许可证列表中的SPDX短格式许可证标识符，或者在许可
   证例外适用时由“WITH”分隔的两个SPDX短格式许可证标识符的组合。当应用多个许
   可证时，表达式由分隔子表达式的关键字“AND”，“OR”组成，并由“（”，“）”包围。

   带有“或更高”选项的[L]GPL等许可证的许可证标识符通过使用“+”来表示“或更高”
   选项来构建。::

      // SPDX-License-Identifier: GPL-2.0+
      // SPDX-License-Identifier: LGPL-2.1+

   当需要修正的许可证时，应使用WITH。 例如，linux内核UAPI文件使用表达式::

      // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
      // SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note

   其它在内核中使用WITH例外的事例如下::

      // SPDX-License-Identifier: GPL-2.0 WITH mif-exception
      // SPDX-License-Identifier: GPL-2.0+ WITH GCC-exception-2.0

   例外只能与特定的许可证标识符一起使用。有效的许可证标识符列在异常文本文件
   的标记中。有关详细信息，请参阅 `许可标识符`_ 一章中的 `例外`_ 。

   如果文件是双重许可且只选择一个许可证，则应使用OR。例如，一些dtsi文件在双
   许可下可用::

      // 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

   如果文件具有多个许可证，其条款全部适用于使用该文件，则应使用AND。例如，
   如果代码是从另一个项目继承的，并且已经授予了将其放入内核的权限，但原始
   许可条款需要保持有效::

      // SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) AND MIT

   另一个需要遵守两套许可条款的例子是::

      // SPDX-License-Identifier: GPL-1.0+ AND LGPL-2.1+

许可标识符
----------

当前使用的许可证以及添加到内核的代码许可证可以分解为：

1. _`优先许可`:

   应尽可能使用这些许可证，因为它们已知完全兼容并广泛使用。这些许可证在内核
   目录::

      LICENSES/preferred/

   此目录中的文件包含完整的许可证文本和 `元标记`_ 。文件名与SPDX许可证标识
   符相同，后者应用于源文件中的许可证。

   例如::

      LICENSES/preferred/GPL-2.0

   包含GPLv2许可证文本和所需的元标签::

      LICENSES/preferred/MIT

   包含MIT许可证文本和所需的元标记

   _`元标记`:

   许可证文件中必须包含以下元标记：

   - Valid-License-Identifier:

     一行或多行, 声明那些许可标识符在项目内有效, 以引用此特定许可的文本。通
     常这是一个有效的标识符，但是例如对于带有'或更高'选项的许可证，两个标识
     符都有效。

   - SPDX-URL:

     SPDX页面的URL，其中包含与许可证相关的其他信息.

   - Usage-Guidance:

     使用建议的自由格式文本。该文本必须包含SPDX许可证标识符的正确示例，因为
     它们应根据 `许可标识符语法`_ 指南放入源文件中。

   - 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

|

2. 不推荐的许可证:

   这些许可证只应用于现有代码或从其他项目导入代码。这些许可证在内核目录::

      LICENSES/other/

   此目录中的文件包含完整的许可证文本和 `元标记`_ 。文件名与SPDX许可证标识
   符相同，后者应用于源文件中的许可证。

   例如::

      LICENSES/other/ISC

   包含国际系统联合许可文本和所需的元标签::

      LICENSES/other/ZLib

   包含ZLIB许可文本和所需的元标签.

   元标签:

   “其他”许可证的元标签要求与 `优先许可`_ 的要求相同。

   文件格式示例::

      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. _`例外`:

   某些许可证可以修改，并允许原始许可证不具有的某些例外权利。这些例外在
   内核目录::

      LICENSES/exceptions/

   此目录中的文件包含完整的例外文本和所需的 `例外元标记`_ 。

   例如::

      LICENSES/exceptions/Linux-syscall-note

   包含Linux内核的COPYING文件中记录的Linux系统调用例外，该文件用于UAPI
   头文件。例如::

      LICENSES/exceptions/GCC-exception-2.0

   包含GCC'链接例外'，它允许独立于其许可证的任何二进制文件与标记有此例外的
   文件的编译版本链接。这是从GPL不兼容源代码创建可运行的可执行文件所必需的。

   _`例外元标记`:

   以下元标记必须在例外文件中可用：

   - SPDX-Exception-Identifier:

     一个可与SPDX许可证标识符一起使用的例外标识符。

   - SPDX-URL:

     SPDX页面的URL，其中包含与例外相关的其他信息。

   - SPDX-Licenses:

     以逗号分隔的例外可用的SPDX许可证标识符列表。

   - Usage-Guidance:

     使用建议的自由格式文本。必须在文本后面加上SPDX许可证标识符的正确示例，
     因为它们应根据 `许可标识符语法`_ 指南放入源文件中。

   - 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许可证标识符和例外都必须在LICENSES子目录中具有相应的文件。这是允许
工具验证（例如checkpatch.pl）以及准备好从源读取和提取许可证所必需的, 这是
各种FOSS组织推荐的，例如 `FSFE REUSE initiative <https://reuse.software/>`_.

_`模块许可`
-----------------

   可加载内核模块还需要MODULE_LICENSE（）标记。此标记既不替代正确的源代码
   许可证信息（SPDX-License-Identifier），也不以任何方式表示或确定提供模块
   源代码的确切许可证。

   此标记的唯一目的是提供足够的信息，该模块是否是自由软件或者是内核模块加
   载器和用户空间工具的专有模块。

   MODULE_LICENSE（）的有效许可证字符串是:

    ============================= =============================================
    "GPL"			  模块是根据GPL版本2许可的。这并不表示仅限于
                                  GPL-2.0或GPL-2.0或更高版本之间的任何区别。
                                  最正确许可证信息只能通过相应源文件中的许可证
                                  信息来确定

    "GPL v2"			  和"GPL"相同，它的存在是因为历史原因。

    "GPL and additional rights"   表示模块源在GPL v2变体和MIT许可下双重许可的
                                  历史变体。请不要在新代码中使用。

    "Dual MIT/GPL"		  表达该模块在GPL v2变体或MIT许可证选择下双重
                                  许可的正确方式。

    "Dual BSD/GPL"		  该模块根据GPL v2变体或BSD许可证选择进行双重
                                  许可。 BSD许可证的确切变体只能通过相应源文件
                                  中的许可证信息来确定。

    "Dual MPL/GPL"		  该模块根据GPL v2变体或Mozilla Public License
                                  （MPL）选项进行双重许可。 MPL许可证的确切变体
                                  只能通过相应的源文件中的许可证信息来确定。

    "Proprietary"		  该模块属于专有许可。此字符串仅用于专有的第三
                                  方模块，不能用于在内核树中具有源代码的模块。
                                  以这种方式标记的模块在加载时会使用'P'标记污
                                  染内核，并且内核模块加载器拒绝将这些模块链接
                                  到使用EXPORT_SYMBOL_GPL（）导出的符号。
    ============================= =============================================

                     FlashPoint Driver Developer's Kit
                                Version 1.0

                   Copyright 1995-1996 by Mylex Corporation
                            All Rights Reserved

This program is free software; you may redistribute and/or modify it under
the terms of either:

    a) the GNU General Public License as published by the Free Software
    Foundation; either version 2, or (at your option) any later version,

    or

    b) the "BSD-style License" included below.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.  See either the GNU General Public
License or the BSD-style License below for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.

The BSD-style License is as follows:

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

1. Redistributions of source code must retain this LICENSE.FlashPoint
   file, without modification, this list of conditions, and the following
   disclaimer.  The following copyright notice must appear immediately at
   the beginning of all source files:

        Copyright 1995-1996 by Mylex Corporation.  All Rights Reserved

        This file is available under both the GNU General Public License
        and a BSD-style copyright; see LICENSE.FlashPoint for details.

2. Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the distribution.

3. The name of Mylex Corporation may not be used to endorse or promote
   products derived from this software without specific prior written
   permission.

THIS SOFTWARE IS PROVIDED BY MYLEX CORP. ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
This is the full-colour version of the currently unofficial Linux logo
("currently unofficial" just means that there has been no paperwork and
that I have not really announced it yet).  It was created by Larry Ewing,
and is freely usable as long as you acknowledge Larry as the original
artist. 

Note that there are black-and-white versions of this available that
scale down to smaller sizes and are better for letterheads or whatever
you want to use it for: for the full range of logos take a look at
Larry's web-page:

	https://www.isc.tamu.edu/~lewing/linux/

The SVG version was re-illustrated in vector by Garrett LeSage and
refined and cleaned up by IFo Hancroft. It is also freely usable
as long as you acknowledge Larry, Garrett and IFo as above.

There are also black-and-white and inverted vector versions at
Garrett's repository:

	https://github.com/garrett/Tux
.. 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().
    ============================= =============================================



