From: Vitaly Kuznetsov on gitlab.com Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648
Be more picky about kernel's source code licenses:
- Keep track of all currently used license in specfile template. - Add a selftest which checks all currently present license identifiers against License:.
Signed-off-by: Vitaly Kuznetsov vkuznets@redhat.com
--- redhat/scripts/kspdx-tool/kspdx.py | 231 +++++++++++++++++++++++++++++++ redhat/self-test/1007-spdx-licenses.bats | 60 ++++++++ redhat/Makefile | 10 + redhat/kernel.spec.template | 9 +- 4 files changed, 302 insertions(+), 8 deletions(-)
From: Vitaly Kuznetsov vkuznets@redhat.com
redhat: Use kspdx-tool output for the License: field
Use kspdx-tool (https://gitlab.com/vkuznets/kspdx-tool) to find all licenses in the source code and its output to the License: field of the specfile. Package the tool and its current output.
Signed-off-by: Vitaly Kuznetsov vkuznets@redhat.com
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template index blahblah..blahblah 100644 --- a/redhat/kernel.spec.template +++ b/redhat/kernel.spec.template @@ -636,7 +636,7 @@ Summary: The Linux kernel
Name: %{package_name} -License: GPLv2 and Redistributable, no modification permitted +License: ((GPL-2.0-only WITH Linux-syscall-note) OR BSD-2-Clause) AND ((GPL-2.0-only WITH Linux-syscall-note) OR BSD-3-Clause) AND ((GPL-2.0-only WITH Linux-syscall-note) OR CDDL-1.0) AND ((GPL-2.0-only WITH Linux-syscall-note) OR Linux-OpenIB) AND ((GPL-2.0-only WITH Linux-syscall-note) OR MIT) AND ((GPL-2.0-or-later WITH Linux-syscall-note) OR BSD-3-Clause) AND ((GPL-2.0-or-later WITH Linux-syscall-note) OR MIT) AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause-Clear AND GFDL-1.1-no-invariants-or-later AND GPL-1.0-or-later AND (GPL-1.0-or-later OR BSD-3-Clause) AND (GPL-1.0-or-later WITH Linux-syscall-note) AND GPL-2.0-only AND (GPL-2.0-only OR Apache-2.0) AND (GPL-2.0-only OR BSD-2-Clause) AND (GPL-2.0-only OR BSD-3-Clause) AND (GPL-2.0-only OR CDDL-1.0) AND (GPL-2.0-only OR GFDL-1.1-no-invariants-or-later) AND (GPL-2.0-only OR GFDL-1.2-no-invariants-only) AND (GPL-2.0-only WITH Linux-syscall-note) AND GPL-2.0-or-later AND (GPL-2.0-or-later OR BSD-2-Clause) AND (GPL-2.0-or-later OR BSD-3-Clause) AND (GPL-2.0-or-later OR CC-BY-4.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH Linux-syscall-note) AND ISC AND LGPL-2.0-or-later AND (LGPL-2.0-or-later OR BSD-2-Clause) AND (LGPL-2.0-or-later WITH Linux-syscall-note) AND LGPL-2.1-only AND (LGPL-2.1-only OR BSD-2-Clause) AND (LGPL-2.1-only WITH Linux-syscall-note) AND LGPL-2.1-or-later AND (LGPL-2.1-or-later WITH Linux-syscall-note) AND (Linux-OpenIB OR GPL-2.0-only) AND (Linux-OpenIB OR GPL-2.0-only OR BSD-2-Clause) AND Linux-man-pages-copyleft AND MIT AND (MIT OR Apache-2.0) AND (MIT OR GPL-2.0-only) AND (MIT OR GPL-2.0-or-later) AND (MIT OR LGPL-2.1-only) AND (MPL-1.1 OR GPL-2.0-only) AND (X11 OR GPL-2.0-only) AND (X11 OR GPL-2.0-or-later) AND Zlib AND (copyleft-next-0.3.1 OR GPL-2.0-or-later) AND (Redistributable, no modification permitted) URL: https://www.kernel.org/ Version: %{specrpmversion} Release: %{pkg_release} @@ -1069,7 +1069,6 @@ Epoch: %{gemini} %endif Summary: Performance monitoring for the Linux kernel Requires: bzip2 -License: GPLv2 %description -n perf This package contains the perf tool, which enables performance monitoring of the Linux kernel. @@ -1119,7 +1118,6 @@ This package provides debug information for the perf python bindings. %if %{with_tools} %package -n %{package_name}-tools Summary: Assortment of tools for the Linux kernel -License: GPLv2 %ifarch %{cpupowerarchs} Provides: cpupowerutils = 1:009-0.6.p1 Obsoletes: cpupowerutils < 1:009-0.6.p1 @@ -1137,14 +1135,12 @@ and the supporting documentation.
%package -n %{package_name}-tools-libs Summary: Libraries for the kernels-tools -License: GPLv2 %description -n %{package_name}-tools-libs This package contains the libraries built from the tools/ directory from the kernel source.
%package -n %{package_name}-tools-libs-devel Summary: Assortment of tools for the Linux kernel -License: GPLv2 Requires: %{package_name}-tools = %{version}-%{release} %ifarch %{cpupowerarchs} Provides: cpupowerutils-devel = 1:009-0.6.p1 @@ -1183,7 +1179,6 @@ and root causes of unexpected results.
%package -n rv Summary: RV: Runtime Verification -License: GPLv2 %description -n rv Runtime Verification (RV) is a lightweight (yet rigorous) method that complements classical exhaustive verification techniques (such as model @@ -1201,7 +1196,6 @@ analysing the logical and timing behavior of Linux.
%package -n bpftool Summary: Inspection and simple manipulation of eBPF programs and maps -License: GPLv2 Version: %{bpftoolversion} %description -n bpftool This package contains the bpftool, which allows inspection and simple @@ -1229,7 +1223,6 @@ This package provides debug information for the bpftool package.
%package selftests-internal Summary: Kernel samples and selftests -License: GPLv2 Requires: binutils, bpftool, iproute-tc, nmap-ncat, python3, fuse-libs %description selftests-internal Kernel sample programs and selftests. diff --git a/redhat/scripts/kspdx-tool/kspdx.py b/redhat/scripts/kspdx-tool/kspdx.py new file mode 100755 index blahblah..blahblah 100755 --- /dev/null +++ b/redhat/scripts/kspdx-tool/kspdx.py @@ -0,0 +1,231 @@ +#! /usr/bin/python3 + +# SPDX-License-Identifier: LGPL-2.1-or-later + +import argparse +import os +import re +import subprocess +import sys + +# Files to not search for SPDX patterns +ignored_files = [ + # license-rules.rst describe how to write SPDX-License-Identifier tags, skip it + "/process/license-rules.rst", +] + +# Generators, take the first SPDX identifier only to avoid +# parsing the code which adds 'SPDX-License-Identifier' to some +# other code. +generators = [ + "/scripts/atomic/gen-atomic-fallback.sh", + "/scripts/atomic/gen-atomic-instrumented.sh", + "/scripts/atomic/gen-atomic-long.sh", + "/tools/bpf/bpftool/gen.c", + "/tools/net/ynl/lib/nlspec.py", + "/tools/net/ynl/ynl-gen-c.py", + "/tools/testing/selftests/bpf/generate_udp_fragments.py", +] + +def run_command(cmdargs, sysexit=False, canfail=False, input=None): + res = subprocess.run(cmdargs, check=False, capture_output=True, text=True, input=input) + if res.returncode != 0 and not canfail: + print("%s returned %d, stdout: %s stderr: %s" % (res.args, res.returncode, res.stdout, res.stderr), file=sys.stderr) + if sysexit: + sys.exit(1) + else: + raise Exception("%s command failed" % cmdargs[0]) + return res + +def get_file_source(path, commit = None): + if not commit: + try: + with open(path, 'rb') as fp: + return fp.read().decode('utf-8', errors='ignore') + except Exception as e: + print("Failed to read file %s: %s" % (path, e), file=sys.stderr) + return None + else: + try: + res = run_command(['git', 'show', "%s:%s" % (commit, path)]) + return res.stdout + except Exception as e: + print("Failed to show file %s from commit %s: %s" % (path, commit, e), file=sys.stderr) + return None + +# Valid chars in SPDX tag: a-Z,0-9,-,+,_, ,\t,(,),. +spdx_pattern = re.compile(r"(?:--|*|#|//|..)\s*SPDX-License-Identifier:\s+([a-zA-Z0-9-_.\t ()+]+)") + +def get_spdx_string(fpath, commit, default, first_only=False): + content = get_file_source(fpath, commit) + if content is None: + print("Failed to get content of %s" % fpath, file=sys.stderr) + sys.exit(1) + + r = spdx_pattern.findall(content) + + if first_only: + r = r[:1] + elif len(set(r)) > 1: + print("WARNING: %s lists more than one different license, please check!" % fpath, file=sys.stderr) + + changed = True + while changed: + changed = False + for i in range(len(r)): + s = r[i] + # Remove extra spaces + s = " ".join(s.split()) + + # Remove trailing '--' (SVG) + s = re.sub("--$", "", s) + + # Make all operators uppercase + s = re.sub(' or ', ' OR ', s, flags=re.IGNORECASE) + s = re.sub(' with ', ' WITH ', s, flags=re.IGNORECASE) + s = re.sub(' and ', ' AND ', s, flags=re.IGNORECASE) + + # Drop unneded highest level parentheses + s = re.sub("^((.*))$", "\g<1>", s) + + # Drop unneeded inner parentheses when there are no spaces + s = re.sub("(([^ ]+))", "\g<1>", s) + + # (A OR B) OR C equals A OR B OR C + s = re.sub("((.*) OR (.*)) OR", "\g<1> OR \g<2> OR", s) + # A OR (B OR C) equals A OR B OR C + s = re.sub("OR ((.*) OR (.*))", "OR \g<1> OR \g<2>", s) + + # Assuming there's just one level of ORs, sort the licenses in reverse alphabetical order + # sort only when no parentheses + if s.find(' OR ') != -1 and s.find('(') == -1: + s = ' OR '.join([e.strip() for e in sorted(s.split(' OR '), reverse=True)]) + + # Split A and B into two items but make sure parenthes are balanced + and_pos = 0 + while True: + and_pos = s.find(' AND ', and_pos+1) + if and_pos > 0: + l1 = s[:and_pos] + l2 = s[and_pos+5:] + if l1.count('(') == l1.count(')') and l2.count('(') == l2.count(')'): + r.append(l2) + s = l1 + break + else: + break + + if s != r[i]: + r[i] = s + changed = True + if r == []: + r = [default] + + return r + +def convert_deprecated(license): + # Deprecated ids, see https://spdx.org/licenses/ + # GPL-1.0 equals GPL-1.0-only + license = re.sub("GPL-1.0($| )", "GPL-1.0-only\g<1>", license) + # GPL-1.0+ equals GPL-1.0-or-later + license = re.sub("GPL-1.0+($| )", "GPL-1.0-or-later\g<1>", license) + + # GPL-2.0 equals GPL-2.0-only + license = re.sub("GPL-2.0($| )", "GPL-2.0-only\g<1>", license) + # GPL-2.0+ equals GPL-2.0-or-later + license = re.sub("GPL-2.0+($| )", "GPL-2.0-or-later\g<1>", license) + + # LGPL-2.0 equals LGPL-2.0-only + license = re.sub("LGPL-2.0($| )", "LGPL-2.0-only\g<1>", license) + # LGPL-2.0+ equals LGPL-2.0-or-later + license = re.sub("LGPL-2.0+($| )", "LGPL-2.0-or-later\g<1>", license) + + # LGPL-2.1 equals LGPL-2.1-only + license = re.sub("LGPL-2.1($| )", "LGPL-2.1-only\g<1>", license) + # LGPL-2.1+ equals LGPL-2.1-or-latery + license = re.sub("LGPL-2.1+($| )", "LGPL-2.1-or-later\g<1>", license) + + # Use standard uppercase 'OR' + license = re.sub(" or ", " OR ", license) + return license + +def unique_licenses(licenses): + res = [] + for license in licenses: + license = convert_deprecated(license) + already_present = False + for existing in res: + if license.upper() == existing.upper(): + already_present = True + if already_present: + continue + res.append(license) + return sorted(res) + +def license_andlist(unique): + s = "" + for i in range(len(unique)): + # Parenthes are needed for everything but a singe item + if unique[i].find(' ') != -1 and len(unique) > 1: + s += '(' + unique[i] + ')' + else: + s += unique[i] + if i != len(unique) - 1: + s += ' AND ' + return s + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Report SPDX-License-Identifier tag for a kernel source file/directory', + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser.add_argument('path', help='Path in the source tree') + parser.add_argument('-c', '--commit', help='Inspect given commit/HEAD instead of the current state') + parser.add_argument('-d', '--default', help='Default license', default="GPL-2.0-only") + parser.add_argument('-i', '--itemized', help='Print license[s] per file', action="store_true") + parser.add_argument('-j', '--joint', help='Print a single statement for all discovered licenses', action="store_true") + args = parser.parse_args() + + if os.path.isdir(args.path) and args.commit: + print("The specified path %s is a directory and --commit was given, this is unsupported." % args.path, file=sys.stderr) + + files = [] + if os.path.isdir(args.path): + w = os.walk(args.path) + for (dpath, dnames, fnames) in w: + # Skip .git objects + if '.git' in dpath.split('/'): + continue + files.extend([dpath.rstrip('/') + '/' + fname for fname in fnames]) + else: + files = [args.path] + + licenses = [] + for fpath in files: + ignore = False + for ignored in ignored_files: + if fpath.endswith(ignored): + ignore = True + continue + if ignore: + continue + + generator = False + for ignored in generators: + if fpath.endswith(ignored): + generator = True + continue + + file_licenses = get_spdx_string(fpath, args.commit, args.default, generator) + unique = unique_licenses(file_licenses) + if not args.itemized: + licenses.extend(unique) + else: + print("%s: %s" % (fpath, license_andlist(unique))) + + if not args.itemized: + if not args.joint: + for license in sorted(set(licenses)): + print(license) + else: + print(license_andlist(sorted(set(licenses)))) + + sys.exit(0)
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648
From: Vitaly Kuznetsov vkuznets@redhat.com
redhat: Introduce "Verify SPDX-License-Identifier tags" selftest
Add a test to check that all SPDX-License-Identifier: specified licenses in the code match the License: tag in the specfile.
Signed-off-by: Vitaly Kuznetsov vkuznets@redhat.com
diff --git a/redhat/self-test/1007-spdx-licenses.bats b/redhat/self-test/1007-spdx-licenses.bats new file mode 100644 index blahblah..blahblah 100644 --- /dev/null +++ b/redhat/self-test/1007-spdx-licenses.bats @@ -0,0 +1,60 @@ +#!/usr/bin/env bats +# Purpose: This test checks SPDX-License-Identifier: tags in all source files against redhat/LICENSES. + +load test-lib.bash + +SPEC=$BATS_TEST_DIRNAME/../kernel.spec.template + +ERRMSG="ERROR: The kernel RPM spec file License: field does not match the licenses available in the source tree. +Fedora, Centos Stream, and RHEL require that the RPM License field match the licenses in the source tree. See +https://docs.fedoraproject.org/en-US/legal/license-approval/ for further information. +A list of licenses can be generated by executing the redhat/scripts/license/kspdx.py utility. New licenses can +be added to the RPM License field only if they are listed in the Allowed Licenses list +https://docs.fedoraproject.org/en-US/legal/allowed-licenses/). Licenses cannot be added if they are in the +'Not Allowed' Licenses (https://docs.fedoraproject.org/en-US/legal/not-allowed-licenses/). Licenses can be added +to the 'Allowed' or 'Not Allowed' Licenses by following the License Review Process +(https://docs.fedoraproject.org/en-US/legal/license-review-process/)." + +_verify_one_license_tag() { + if [[ $(grep -c '^License:' $SPEC) != "1" ]]; then + echo "ERROR: The specfile is supposed to have exactly one License: tag!" + return 1 + fi +} + +_verify_spdx_licenses() { + spec_licenses=`mktemp` + source_licenses=`mktemp` + grep '^License:' $SPEC | sed 's,License[[:space:]]*:[[:space:]]*,,' | sed 's, AND ,\n,g' | sed 's,^((.*))$,\1,' | sort -u > $spec_licenses + + # "Redistributable, no modification permitted" is not a valid SPDX license tag, + # it is manually added to account for the firmware shipped as part of the source + # code, see e.g. drivers/net/appletalk/cops_ffdrv.h + sed -i '/^Redistributable, no modification permitted$/d' $spec_licenses + + if ! $BATS_TEST_DIRNAME/../scripts/kspdx-tool/kspdx.py $BATS_TEST_DIRNAME/../../ > $source_licenses; then + echo "ERROR: Failed to gather SPDX-License-Identifier: information from source files!" + return 1 + fi + sort -o $source_licenses $source_licenses + if ! diff -u $spec_licenses $source_licenses; then + echo $ERRMSG + ret=1 + else + ret=0 + fi + rm -f $spec_licenses $source_licenses + return $ret +} + +@test "Verify SPDX-License-Identifier tags" { + if ! test -x $BATS_TEST_DIRNAME/../scripts/kspdx-tool/kspdx.py ; then + skip "kspdx-tool is missing" + fi + + run _verify_one_license_tag + check_status + + _verify_spdx_licenses + check_status +}
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648
From: Vitaly Kuznetsov vkuznets@redhat.com
redhat: Add dist-check-licenses target
Introduce a dedicated make target to check source code licenses without the need to run all other selftests which may be failing for some other reason.
Signed-off-by: Vitaly Kuznetsov vkuznets@redhat.com
diff --git a/redhat/Makefile b/redhat/Makefile index blahblah..blahblah 100644 --- a/redhat/Makefile +++ b/redhat/Makefile @@ -877,6 +877,13 @@ dist-self-test: dist-self-test-data: ./self-test/data/create-data.sh
+dist-check-licenses: + @if test -x /usr/bin/bats; then \ + bats $(REDHAT)/self-test/1007-spdx-licenses.bats ; \ + else \ + echo "dist-check-licenses: The bats package is not installed" ; \ + fi + dist-help: @echo 'Cleaning targets:' @echo ' dist-clean - Clean redhat/configs/ and redhat/rpm/ directories.' @@ -1000,6 +1007,9 @@ dist-full-help: @echo ' dist-os-version - Displays the current Red Hat Enterprise Linux versioni' @echo ' target used by the current branch/tree.' @echo ' dist-self-test - Runs self-tests from the redhat/self-test directory' + @echo ' dist-check-licenses - Runs license selftest checking SPDX-License-Identifier:' + @echo ' tags in all source files against `License:` field in the' + @echo ' specfile template.' @echo ''
export
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648
From: Prarit Bhargava on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1537491...
@jstancek, this was rebased. Can you re-approve?
From: Daniel P. Berrangé on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1538895...
"Redistributable, no modification permitted" is not a valid SPDX license identifier, and does not appear to be reported by the kspdx.py tool either is presumably you've manually kept this addition.
The problem is this makes the whole license tag invalid / non-compliant with Fedora's SPDX requirement.
What files is this 'redistributable....' clause referring to ? They need to be identified such that a proper SPDX license identifier can be determined.
From: Vitaly Kuznetsov on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1538899...
@berrange we added it manually, please see the thread https://gitlab.com/cki- project/kernel-ark/-/merge_requests/2648#note_1525439020
There's still some firmware in kernel, see e.g. drivers/net/appletalk/cops_ffdrv.h and its licensing is unclear.
From: Vitaly Kuznetsov on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1538906...
We may need to do a research and try to find all places with dubious licensing. In case it's just a few places like 'appletalk' example above, we may opt for disabling the related code instead of carrying 'redistributable' tag.
From: Thorsten Leemhuis on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1538924...
find all places with dubious licensing
FWIW, a relative quick and rough way to do so: check which files Linux-libre (https://www.fsfla.org/ikiwiki/selibre/linux-libre/) removes (the hard part it to ignore all the small changes to prevent the kernel from loading separately packaged firmware)
From: Daniel P. Berrangé on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1538935...
@berrange we added it manually, please see the thread !2648 (comment
1525439020)
IMHO the outcome in that thread is wrong. If there are some files the kernel hasn't annotated with SPDX tags that's fine. While it should be reported upstream, Fedora can't block on them, and needs to provide a valid SPDX identifier downstream until upstream resolves it.
The cops_ffdrv.h does have a somewhat terse bit of text that can be considered its license. It won't match any recorded SPDX identifier, but if this is reported to Fedora legal, they can likely assign a Fedora local identifier - "LicenseRef-<blah>" (see https://spdx.github.io/spdx-spec/v2-draft/other- licensing-information-detected/ for this use of local identifiers in SPDX spec).
If there is other firmware identified further LIcenseRef can be added as required.
From: Vitaly Kuznetsov on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1539028...
@knurd42 Linux-libre is a great source of information, thanks! Looking at their logs (git://linux-libre.fsfla.org/releases.git), I can see that mostly they remove mentions and loaders of non-free firmware but the code doing this is actually OK and mostly has valid SDPX tags. I'm going to run my kspdx.py against all files mentioned in the logs and see what comes out. Stay tuned!
From: Thorsten Leemhuis on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1539045...
@vkuznets yw; and yes, ignore all those removals "or mentions and loaders of non-free firmware", that's what I meant earlier.
fwiw, maybe cross-referencing with debian kernel sources might be handy as well; it at least was when I briefly looked into this years ago, as they iirc removed something linux-libre did not.
From: Vitaly Kuznetsov on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1539233...
OK, if we take Linux-libre as a source of truth, we may not have much to care about. I did the following:
1) Get all affected files from linux-libre log and check if they have a proper SPDX with kspdx.py. Filter the rest:
``` $ cat linux-libre-6.5-gnu.log | grep ':' | grep -v "VGX:Y61 sensor support" | cut -f 1 -d ':' | sort -u | while read fname; do kspdx.py -i -d NONE $fname; done | grep NONE > /tmp/nospdx
$ wc -l /tmp/nospdx 158 /tmp/nospdx
```
2) Filter out all files which have old style (non-SPDX) license identifier:
``` $ cat /tmp/nospdx | cut -f 1 -d ':' | while read fname; do if ! grep "This program is free software|Permission is hereby granted|Permission to use, copy, modify|This file is free software|General Public License|GNU General Public" $fname > /dev/null; then echo $fname; fi; done
arch/arm/boot/dts/ti/omap/am33xx-l4.dtsi arch/arm/boot/dts/ti/omap/am437x-l4.dtsi Documentation/ABI/testing/sysfs-driver-ge-achc Documentation/admin-guide/btmrvl.rst Documentation/arch/arm/ixp4xx.rst Documentation/arch/arm/keystone/knav-qmss.rst Documentation/devicetree/bindings/remoteproc/wkup_m3_rproc.txt Documentation/dontdiff Documentation/sound/alsa-configuration.rst drivers/net/appletalk/cops_ffdrv.h drivers/net/appletalk/cops_ltdrv.h drivers/net/ethernet/myricom/myri10ge/myri10ge.c drivers/net/wireless/intersil/orinoco/fw.c drivers/staging/media/atomisp/TODO README scripts/package/builddeb scripts/package/mkspec scripts/package/snapcraft.template
```
Manually check the result ``` arch/arm/boot/dts/ti/omap/am33xx-l4.dtsi arch/arm/boot/dts/ti/omap/am437x-l4.dtsi ``` No license specified but these are device trees, not firmware.
``` Documentation/ABI/testing/sysfs-driver-ge-achc Documentation/admin-guide/btmrvl.rst Documentation/arch/arm/ixp4xx.rst Documentation/arch/arm/keystone/knav-qmss.rst Documentation/devicetree/bindings/remoteproc/wkup_m3_rproc.txt Documentation/dontdiff Documentation/sound/alsa-configuration.rst ``` No license specified but nothing worrisome, just docs mentioning firmware binaries.
``` drivers/net/appletalk/cops_ffdrv.h drivers/net/appletalk/cops_ltdrv.h ``` We already know about these but even Fedora doesn't enable CONFIG_COPS/CONFIG_COPS_DAYNA
``` drivers/net/ethernet/myricom/myri10ge/myri10ge.c ``` Looks like 3-Clause BSD License.
``` drivers/net/wireless/intersil/orinoco/fw.c ``` Says "See copyright notice in main.c". main.c mentions MPL1.1 license.
``` drivers/staging/media/atomisp/TODO README ``` Can be ignored I guess.
``` scripts/package/builddeb scripts/package/mkspec scripts/package/snapcraft.template ``` Nothing to worry about.
From: Vitaly Kuznetsov on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1539237...
Bottom line: I think we can converge on removing 'redistributable' and adding a sentinel to prevent accidental CONFIG_COPS/CONFIG_COPS_DAYNA enabling in the future (like an explicitly disabled config mentioning dubious license).
@prarit @jstancek @berrange @knurd42 how does this sound?
From: Prarit Bhargava on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1539241...
Agreed, however, the purpose of this MR is to obtain a 'more correct' list of licenses in the kernel and output them in the License field of the RPMs. There are certainly going to be some cases where we're not sure what the right thing to do is, some entries that need more investigation, etc.
I don't think it's correct to compare to other distros as they may have modified licenses. The ONLY place I'm comfortable looking at as a 'source of truth' is Linus' upstream repository.
Here's my proposal: Let's remove the "Redistributable, no modification permitted" (sorry @vkuznets for reversing course on that), and add an issue to track the missing SPDX license header in the appletalk fw, as well as any other issues we find. I can coordinate with upstream to figure out what the license should be and we can pick that up as we rebase. I don't think we're doing ourselves a favor by continuing to report "GPLv2 and Redistributable, no modification permitted" because we know that is absolutely incorrect. IMO even an incremental change here would be goo.
https://gitlab.com/cki-project/kernel-ark/-/issues/131
Thoughts?
From: Prarit Bhargava on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1539242...
Bottom line: I think we can converge on removing 'redistributable' and adding
a sentinel to prevent accidental CONFIG_COPS/CONFIG_COPS_DAYNA enabling in the future (like an explicitly disabled config mentioning dubious license).
Agreed. Let's do this and move this MR forward. I'll also start a thread on LKML about the appletalk fw license.
From: Daniel P. Berrangé on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1539243...
Since we can't find anything obvious that justifies keeping 'Redistributable, no modification permitted", I agree that we should just remove it now. If someone finds something in future with an unexpected license, it is easy enough to address it at that time.
From: Prarit Bhargava on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1539248...
Daniel, the test failure instructions state:
``` ERROR: The kernel RPM spec file License: field does not match the licenses available in the source tree. Fedora, Centos Stream, and RHEL require that the RPM License field match the licenses in the source tree. See https://docs.fedoraproject.org/en-US/legal/license-approval/ for further information. A list of licenses can be generated by executing the redhat/scripts/license/kspdx.py utility. New licenses can be added to the RPM License field only if they are listed in the Allowed Licenses list https://docs.fedoraproject.org/en-US/legal/allowed-licenses/). Licenses cannot be added if they are in the 'Not Allowed' Licenses (https://docs.fedoraproject.org/en-US/legal/not- allowed-licenses/). Licenses can be added to the 'Allowed' or 'Not Allowed' Licenses by following the License Review Process (https://docs.fedoraproject.org/en-US/legal/license-review-process/)." ```
I think that is clear enough on our expectations for licensing. If we find something that doesn't line up with the Fedora Approved Licenses then we will follow the Fedora process for getting that license approved, or making sure the code is never 'compiled' into Fedora (or RHEL of course). If the License is unapproved, it also warrants a discussion with upstream on their decision to include the code.
From: Thorsten Leemhuis on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1539261...
Bottom line: I think we can converge on removing 'redistributable' [...] @knurd42 how does this sound?
Fine with me, thx for checking!
kernel@lists.fedoraproject.org