Re: [OS-BUILD PATCH 1/3] redhat: Use kspdx-tool output for the License: field

2023-08-30 Thread Vitaly Kuznetsov (via Email Bridge)
From: Vitaly Kuznetsov on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1535110057

Added "Redistributable, no modification permitted"  back, better safe than
sorry. We may have some other firmware-looking pieces in the kernel. We need
some audit to make sure we can get rid of it, this doesn't have to be done
now, let's keep the status quo.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH 1/3] redhat: Use kspdx-tool output for the License: field

2023-08-30 Thread Vitaly Kuznetsov (via Email Bridge)
From: Vitaly Kuznetsov on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1535057039

@prarit We can add it manually, the question is how to make it a 'lesser
hack'. Unfortunately, "Redistributable, no modification permitted" is not a
valid SPDX tag so e.g. adding a file to redhat/ with

```
# SPDX-License-Identifier: Redistributable, no modification permitted
```

to make my script grab it would not be entirely correct. I can add it to
"License:" manually and then filter it out when comparing with kspdx.py output
I guess. Alternatively, we can reach out to legal asking if we really care:
while 'CONFIG_DEV_APPLETALK' is enable in Fedora (but not in RHEL),
CONFIG_COPS/CONFIG_COPS_DANYA are not but I'm not exactly sure about other
hidden gems.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH 1/3] redhat: Use kspdx-tool output for the License: field

2023-08-28 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1532361366

Let's just add it back?  @vkuznets what do you think?
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH 1/3] redhat: Use kspdx-tool output for the License: field

2023-08-28 Thread Thorsten Leemhuis (via Email Bridge)
From: Thorsten Leemhuis on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1532352259

> ongoing discussion on making the resulting list of licenses way more
readable

That would be really nice!

> My guess is that this was a leftover from the times when kernel was also
shipping firmware blobs.

Looked closer and your guess was right. But from looking at
https://bugzilla.redhat.com/show_bug.cgi?id=450492#c10 (that's a comment from
Richard Fontana) it turns out the reason why it was added does still exist, as
those files (mentioned earlier already by @hertonrk-rh) still look fishy and
we have CONFIG_DEV_APPLETALK=m.

That's why I'd say it would be better to leave the "Redistributable, no
modification permitted"; but I don't care too much: if everybody else here
things this can be ignored feel free to go ahead.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH 1/3] redhat: Use kspdx-tool output for the License: field

2023-08-25 Thread Vitaly Kuznetsov (via Email Bridge)
From: Vitaly Kuznetsov on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1529889341

Fixed, pushed, MR updated. Thanks!
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH 1/3] redhat: Use kspdx-tool output for the License: field

2023-08-25 Thread Vitaly Kuznetsov (via Email Bridge)
From: Vitaly Kuznetsov on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1529883107

Oh, this is very unfortunate and deserves an upstream discussion. Luckily,
CONFIG_COPS/CONFIG_COPS_DANYA are not enabled on our configs.

Post-MR, the list of licenses is formed from SPDX tags only. There's some code
in the kernel which still wasn't converted to SPDX but I don't think there's
much we can do about that. Fingers crossed all such code will get
converted/removed eventually.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH 1/3] redhat: Use kspdx-tool output for the License: field

2023-08-24 Thread Herton R. Krzesinski (via Email Bridge)
From: Herton R. Krzesinski on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1527728838

Well there are still firmware being included in the linux sources, one
example: ```drivers/net/appletalk/cops_ffdrv.h```

But probably cases like this should be handled upstream (moving or removing
them..., or adding a proper SPDX identifier). From the License tag I think we
need to remove the Redistributable... info since it's not a valid identifier.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH 1/3] redhat: Use kspdx-tool output for the License: field

2023-08-24 Thread Jan Stancek (via Email Bridge)
From: Jan Stancek on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1526842225

not really a big issue, I'll resolve this too - can be fixed along some more
important changes
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH 1/3] redhat: Use kspdx-tool output for the License: field

2023-08-24 Thread Jan Stancek (via Email Bridge)
From: Jan Stancek on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1526841131

ok, since it seems unlikely, I'm going to resolve this thread, I opened you
first issue :-) https://gitlab.com/vkuznets/kspdx-tool/-/issues/1
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH 1/3] redhat: Use kspdx-tool output for the License: field

2023-08-24 Thread Vitaly Kuznetsov (via Email Bridge)
From: Vitaly Kuznetsov on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1526606091

Indeed!
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH 1/3] redhat: Use kspdx-tool output for the License: field

2023-08-24 Thread Vitaly Kuznetsov (via Email Bridge)
From: Vitaly Kuznetsov on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1526605878

Not that it is not allowed, just not present in the source :-)

There's code to drop unneeded highest level parentheses so e.g.
`(GPL-2.0-only)` becomes `GPL-2.0-only`, it can certainly be improved to cover
this case, i.e. `(everythin-without-spaces)` == `everything-without-spaces`.

FWIW, I have a repo for kspdx-tool here: https://gitlab.com/vkuznets/kspdx-
tool and in the MR it's just a copy.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH 1/3] redhat: Use kspdx-tool output for the License: field

2023-08-24 Thread Jan Stancek (via Email Bridge)
From: Jan Stancek on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1526334920

This `pass` looks redundant
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH 1/3] redhat: Use kspdx-tool output for the License: field

2023-08-24 Thread Jan Stancek (via Email Bridge)
From: Jan Stancek on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1526318798

Should these replacements also match deprecated licenses that end with ')'? Or
is my format not allowed?
```
]$ cat test/test.c
// SPDX-License-Identifier: GPL-2.0 OR (GPL-1.0)
$ ./redhat/scripts/kspdx-tool/kspdx.py ./test --joint
GPL-2.0-only OR (GPL-1.0)
```
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH 1/3] redhat: Use kspdx-tool output for the License: field

2023-08-24 Thread Vitaly Kuznetsov (via Email Bridge)
From: Vitaly Kuznetsov on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1526314134

FWIW, there's an ongoing discussion on making the resulting list of licenses
way more readable by ignoring dual licensing, e.g. if a file is licensed under
"(GPL-2.0-only WITH Linux-syscall-note) OR BSD-2-Clause" we can pick the less
permissive "GPL-2.0-only WITH Linux-syscall-note" from the two.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH 1/3] redhat: Use kspdx-tool output for the License: field

2023-08-24 Thread Vitaly Kuznetsov (via Email Bridge)
From: Vitaly Kuznetsov on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1526295217

Yes, this is intentional. I (and the script which actually builds the
'License:' field now) didn't find anything under 'Redistributable' in the
kernel. My guess is that this was a leftover from the times when kernel was
also shipping firmware blobs. This is gone since 2017 with

```
commit 5620a0d1aacd554ebebcff373e31107bb1ef7769
Author: Greg Kroah-Hartman 
Date:   Thu Sep 14 14:23:01 2017 -0700

firmware: delete in-kernel firmware
```
with all blobs moving to 'linux-firmware'.

Secure Boot, as far as I understand, shouldn't have anything to do with
licensing.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCH 1/3] redhat: Use kspdx-tool output for the License: field

2023-08-23 Thread Thorsten Leemhuis (via Email Bridge)
From: Thorsten Leemhuis on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2648#note_1525439020

The "and Redistributable, no modification permitted" seems to be dropped (or
easy to miss in this noisy License tag). Is this international?

I wonder why it's there in the fist place. I think it was added when Secure
Boot was implemented, but maybe my mind is going off the rails here.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


[OS-BUILD PATCH 1/3] redhat: Use kspdx-tool output for the License: field

2023-08-23 Thread Vitaly Kuznetsov (via Email Bridge)
From: Vitaly Kuznetsov 

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 

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
@@ -635,7 +635,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 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 Linux-OpenIB) AND (GPL-2.0-only 
OR MIT) AND (GPL-2.0-only OR X11) 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 MIT) 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 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)
 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,224 @@
+#! /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.r