Linux内核的许可证规则及其标注随着版本的升级越来越规范,也越来越要求方便工具进行检查。我列举了linux内核4.16之前的某一版、4.16版和最新的5.18版内核许可证信息,对Linux内核的许可证规则及其标注进行说明。
一、linux内核4.16之前的开源许可证信息   
    在linux内核4.14根目录下的COPYING文件中列出了系统调用例外(system calls exception)和GPLv2。
  NOTE! This copyright does *not* cover user programs that use kernel
 services by normal system calls - this is merely considered normal use
 of the kernel, and does *not* fall under the heading of "derived work".
 Also note that the GPL below is copyrighted by the Free Software
 Foundation, but the instance of code that it refers to (the Linux
 kernel) is copyrighted by me and others who actually wrote it.

 Also note that the only valid version of the GPL as far as the kernel
 is concerned is _this_ particular version of the license (ie v2, not
 v2.2 or v3.x or whatever), unless explicitly otherwise stated.

			Linus Torvalds

----------------------------------------

		    GNU GENERAL PUBLIC LICENSE
		       Version 2, June 1991

 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
                       51 Franklin St, 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.

			   

    典型的文件级许可证声明,例如linux-4.14.275\ipc\mq_sysctl.c文件中:

/*
 *  Copyright (C) 2007 IBM Corporation
 *
 *  Author: Cedric Le Goater <clg@fr.ibm.com>
 *
 *  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 of the
 *  License.
 */

#include <linux/nsproxy.h>
#include <linux/ipc_namespace.h>
#include <linux/sysctl.h>

 二、从linux内核4.16开始的开源许可证

    linux内核4.16根目录下的COPYING文件与4.14相同文件内容保持一致,但从linux内核4.16开始根目录下开始有/LICENSES文件夹,在文件夹的许可证中除许可证原文,还说明了如何使用spdx标准标注此许可证。
    以linux内核4.16为例下面有prefered、exceptions和other三个文件夹,更详细的规定了linux内核的许可及其标注规则。

1、prefered文件夹
   在prefered的文件夹中有GPL-2.0、LGPL2.0、LGPL2.1、MIT、BSD-2-Clause、BSD-3-Clause、BSD-3-Clause-Clear7个开源许可证文件,在每个许可证文件最开始,列出如何在linux源代码中标注许可证的使用指导,例如GPL-2.0文件中

 2、exception文件夹

    在exception文件夹中有Linux-syscall-note文件

       此文件相对于4.16以前的linux系统调用例外多出了使用指导(Usage-Guide),特别说明此例外许可用于标注用户空间API头文件,以便非GPL兼容的用户空间应用代码包含这些API头文件。而以前linux系统调用例外许可特别说明了例外的系统调用不包括heading(文件头、头文件)的衍生作品。

3、other文件夹

在other文件夹中还存在两个文件:GPL-1.0和MPL-1.1,为不建议的许可证。

GPL-1.0文件指出新的代码不能再使用该许可证,对已存在的代码需要有“or any later version”以便兼容目前项目的GPLv2许可证。

​下篇请参见Linux内核开源许可证信息及其标注(下)_yupengipr的博客-CSDN博客

Logo

更多推荐