From bb465c2dc3f528d34617d3149d30e2fb595deb0b Mon Sep 17 00:00:00 2001
From: Alberto Pianon <pianon@array.eu>
Date: Fri, 21 Jan 2022 16:38:25 +0100
Subject: [PATCH] Change license for all 1st party patches to MIT

While Apache 2.0 license is the recommended option when choosing an open
source permissive (i.e. non-copyleft) license, such license is
incompatible with some other open source licenses (namely, GPL-2.0) so
it is not the best suited choice for patch files, since patch files are
naturally intended to modify third party code, which at times may be
subject to incompatible licenses.

Instead of checking license compatibility on a case by case basis (which
not only is time consuming, but it also a hardly maintainable/scalable
process and, most important, error-prone), a more practical approach
would be to adopt an open source license with the broadest compatibility
possible, namely, the MIT license.

Signed-off-by: Alberto Pianon <pianon@array.eu>
---
 .../bind/bind/bind-9.11.32-libunwind-header.patch             | 4 ----
 .../bind/bind/bind-9.11.32-libunwind-header.patch.license     | 2 ++
 .../busybox/busybox-1.31.1-Wformat-security.patch.license     | 2 +-
 .../recipes-core/systemd/systemd/systemd-244-musl-1.2.2.patch | 3 ---
 .../systemd/systemd/systemd-244-musl-1.2.2.patch.license      | 2 ++
 .../strace-5.5/0004-Regenerate-xlat-headers.patch.license     | 2 ++
 .../linux/linux/fix-gcc-plugins-with-gcc-11.patch.license     | 2 +-
 .../ptest-runner-fix-incorrect-allocation.patch.license       | 2 +-
 .../fix-reallocarray-check.patch.license                      | 2 +-
 .../networkmanager-1.22.10/fix-strerror_r.patch.license       | 2 +-
 ...system-changes-to-be-handled-by-yocto-recipe.patch.license | 2 ++
 ...ound-gcc9-Wformat-truncation-false-positives.patch.license | 2 ++
 .../networkmanager/fix-strerror_r.patch.license               | 2 ++
 ...uild-drop-Werror-to-avoid-compilation-breaks.patch.license | 2 ++
 ...ice-ot-client-add-needed-header-for-fd_set-c.patch.license | 2 ++
 15 files changed, 21 insertions(+), 12 deletions(-)
 create mode 100644 meta-oniro-core/recipes-connectivity/bind/bind/bind-9.11.32-libunwind-header.patch.license
 create mode 100644 meta-oniro-core/recipes-core/systemd/systemd/systemd-244-musl-1.2.2.patch.license
 create mode 100644 meta-oniro-core/recipes-devtools/strace/strace-5.5/0004-Regenerate-xlat-headers.patch.license
 create mode 100644 meta-oniro-staging/recipes-connectivity/jool/jool/0001-Build-system-changes-to-be-handled-by-yocto-recipe.patch.license
 create mode 100644 meta-oniro-staging/recipes-connectivity/mbedtls/mbedtls/0002-workaround-gcc9-Wformat-truncation-false-positives.patch.license
 create mode 100644 meta-oniro-staging/recipes-connectivity/networkmanager/networkmanager/fix-strerror_r.patch.license
 create mode 100644 meta-oniro-staging/recipes-connectivity/openthread/ot-br-posix/0001-build-drop-Werror-to-avoid-compilation-breaks.patch.license
 create mode 100644 meta-oniro-staging/recipes-connectivity/openthread/ot-br-posix/0001-web-service-ot-client-add-needed-header-for-fd_set-c.patch.license

diff --git a/meta-oniro-core/recipes-connectivity/bind/bind/bind-9.11.32-libunwind-header.patch b/meta-oniro-core/recipes-connectivity/bind/bind/bind-9.11.32-libunwind-header.patch
index 1f0401e0..5888e3be 100644
--- a/meta-oniro-core/recipes-connectivity/bind/bind/bind-9.11.32-libunwind-header.patch
+++ b/meta-oniro-core/recipes-connectivity/bind/bind/bind-9.11.32-libunwind-header.patch
@@ -1,7 +1,3 @@
-# SPDX-FileCopyrightText: Huawei Inc.
-#
-# SPDX-License-Identifier: Apache-2.0
-
 From bernhard.rosenkraenzer.ext@huawei.com Tue Jun 29 22:01:00 2021
 From: Bernhard Rosenkraenzer <bernhard.rosenkraenzer.ext@huawei.com>
 Date: Tue, 29 Jun 2021 22:01:00 +0100
diff --git a/meta-oniro-core/recipes-connectivity/bind/bind/bind-9.11.32-libunwind-header.patch.license b/meta-oniro-core/recipes-connectivity/bind/bind/bind-9.11.32-libunwind-header.patch.license
new file mode 100644
index 00000000..993c9890
--- /dev/null
+++ b/meta-oniro-core/recipes-connectivity/bind/bind/bind-9.11.32-libunwind-header.patch.license
@@ -0,0 +1,2 @@
+# SPDX-FileCopyrightText: Huawei Inc.
+# SPDX-License-Identifier: MIT
\ No newline at end of file
diff --git a/meta-oniro-core/recipes-core/busybox/busybox/busybox-1.31.1-Wformat-security.patch.license b/meta-oniro-core/recipes-core/busybox/busybox/busybox-1.31.1-Wformat-security.patch.license
index 2a2d9f5d..d7427ed5 100644
--- a/meta-oniro-core/recipes-core/busybox/busybox/busybox-1.31.1-Wformat-security.patch.license
+++ b/meta-oniro-core/recipes-core/busybox/busybox/busybox-1.31.1-Wformat-security.patch.license
@@ -1,2 +1,2 @@
 # SPDX-FileCopyrightText: Huawei Inc.
-# SPDX-License-Identifier: Apache-2.0
+# SPDX-License-Identifier: MIT
diff --git a/meta-oniro-core/recipes-core/systemd/systemd/systemd-244-musl-1.2.2.patch b/meta-oniro-core/recipes-core/systemd/systemd/systemd-244-musl-1.2.2.patch
index 6019916c..1b83ff78 100644
--- a/meta-oniro-core/recipes-core/systemd/systemd/systemd-244-musl-1.2.2.patch
+++ b/meta-oniro-core/recipes-core/systemd/systemd/systemd-244-musl-1.2.2.patch
@@ -1,6 +1,3 @@
-SPDX-FileCopyrightText: Huawei Inc.
-SPDX-License-Identifier: Apache-2.0
-
 From bernhard.rosenkraenzer.ext@huawei.com Tue Jul 13 04:09:16 2021
 From: Bernhard Rosenkraenzer <bernhard.rosenkraenzer.ext@huawei.com>
 Date: Tue, 13 Jul 2021 04:09:16 +0100
diff --git a/meta-oniro-core/recipes-core/systemd/systemd/systemd-244-musl-1.2.2.patch.license b/meta-oniro-core/recipes-core/systemd/systemd/systemd-244-musl-1.2.2.patch.license
new file mode 100644
index 00000000..993c9890
--- /dev/null
+++ b/meta-oniro-core/recipes-core/systemd/systemd/systemd-244-musl-1.2.2.patch.license
@@ -0,0 +1,2 @@
+# SPDX-FileCopyrightText: Huawei Inc.
+# SPDX-License-Identifier: MIT
\ No newline at end of file
diff --git a/meta-oniro-core/recipes-devtools/strace/strace-5.5/0004-Regenerate-xlat-headers.patch.license b/meta-oniro-core/recipes-devtools/strace/strace-5.5/0004-Regenerate-xlat-headers.patch.license
new file mode 100644
index 00000000..993c9890
--- /dev/null
+++ b/meta-oniro-core/recipes-devtools/strace/strace-5.5/0004-Regenerate-xlat-headers.patch.license
@@ -0,0 +1,2 @@
+# SPDX-FileCopyrightText: Huawei Inc.
+# SPDX-License-Identifier: MIT
\ No newline at end of file
diff --git a/meta-oniro-core/recipes-kernel/linux/linux/fix-gcc-plugins-with-gcc-11.patch.license b/meta-oniro-core/recipes-kernel/linux/linux/fix-gcc-plugins-with-gcc-11.patch.license
index 98a0b3f4..a24394e7 100644
--- a/meta-oniro-core/recipes-kernel/linux/linux/fix-gcc-plugins-with-gcc-11.patch.license
+++ b/meta-oniro-core/recipes-kernel/linux/linux/fix-gcc-plugins-with-gcc-11.patch.license
@@ -1,3 +1,3 @@
 # SPDX-FileCopyrightText: Huawei Inc.
 #
-# SPDX-License-Identifier: Apache-2.0
+# SPDX-License-Identifier: MIT
diff --git a/meta-oniro-core/recipes-support/ptest-runner/ptest-runner/ptest-runner-fix-incorrect-allocation.patch.license b/meta-oniro-core/recipes-support/ptest-runner/ptest-runner/ptest-runner-fix-incorrect-allocation.patch.license
index 2a2d9f5d..d7427ed5 100644
--- a/meta-oniro-core/recipes-support/ptest-runner/ptest-runner/ptest-runner-fix-incorrect-allocation.patch.license
+++ b/meta-oniro-core/recipes-support/ptest-runner/ptest-runner/ptest-runner-fix-incorrect-allocation.patch.license
@@ -1,2 +1,2 @@
 # SPDX-FileCopyrightText: Huawei Inc.
-# SPDX-License-Identifier: Apache-2.0
+# SPDX-License-Identifier: MIT
diff --git a/meta-oniro-staging/dynamic-layers/meta-networking/recipes-connectivity/networkmanager/networkmanager-1.22.10/fix-reallocarray-check.patch.license b/meta-oniro-staging/dynamic-layers/meta-networking/recipes-connectivity/networkmanager/networkmanager-1.22.10/fix-reallocarray-check.patch.license
index 98a0b3f4..a24394e7 100644
--- a/meta-oniro-staging/dynamic-layers/meta-networking/recipes-connectivity/networkmanager/networkmanager-1.22.10/fix-reallocarray-check.patch.license
+++ b/meta-oniro-staging/dynamic-layers/meta-networking/recipes-connectivity/networkmanager/networkmanager-1.22.10/fix-reallocarray-check.patch.license
@@ -1,3 +1,3 @@
 # SPDX-FileCopyrightText: Huawei Inc.
 #
-# SPDX-License-Identifier: Apache-2.0
+# SPDX-License-Identifier: MIT
diff --git a/meta-oniro-staging/dynamic-layers/meta-networking/recipes-connectivity/networkmanager/networkmanager-1.22.10/fix-strerror_r.patch.license b/meta-oniro-staging/dynamic-layers/meta-networking/recipes-connectivity/networkmanager/networkmanager-1.22.10/fix-strerror_r.patch.license
index 98a0b3f4..a24394e7 100644
--- a/meta-oniro-staging/dynamic-layers/meta-networking/recipes-connectivity/networkmanager/networkmanager-1.22.10/fix-strerror_r.patch.license
+++ b/meta-oniro-staging/dynamic-layers/meta-networking/recipes-connectivity/networkmanager/networkmanager-1.22.10/fix-strerror_r.patch.license
@@ -1,3 +1,3 @@
 # SPDX-FileCopyrightText: Huawei Inc.
 #
-# SPDX-License-Identifier: Apache-2.0
+# SPDX-License-Identifier: MIT
diff --git a/meta-oniro-staging/recipes-connectivity/jool/jool/0001-Build-system-changes-to-be-handled-by-yocto-recipe.patch.license b/meta-oniro-staging/recipes-connectivity/jool/jool/0001-Build-system-changes-to-be-handled-by-yocto-recipe.patch.license
new file mode 100644
index 00000000..993c9890
--- /dev/null
+++ b/meta-oniro-staging/recipes-connectivity/jool/jool/0001-Build-system-changes-to-be-handled-by-yocto-recipe.patch.license
@@ -0,0 +1,2 @@
+# SPDX-FileCopyrightText: Huawei Inc.
+# SPDX-License-Identifier: MIT
\ No newline at end of file
diff --git a/meta-oniro-staging/recipes-connectivity/mbedtls/mbedtls/0002-workaround-gcc9-Wformat-truncation-false-positives.patch.license b/meta-oniro-staging/recipes-connectivity/mbedtls/mbedtls/0002-workaround-gcc9-Wformat-truncation-false-positives.patch.license
new file mode 100644
index 00000000..993c9890
--- /dev/null
+++ b/meta-oniro-staging/recipes-connectivity/mbedtls/mbedtls/0002-workaround-gcc9-Wformat-truncation-false-positives.patch.license
@@ -0,0 +1,2 @@
+# SPDX-FileCopyrightText: Huawei Inc.
+# SPDX-License-Identifier: MIT
\ No newline at end of file
diff --git a/meta-oniro-staging/recipes-connectivity/networkmanager/networkmanager/fix-strerror_r.patch.license b/meta-oniro-staging/recipes-connectivity/networkmanager/networkmanager/fix-strerror_r.patch.license
new file mode 100644
index 00000000..993c9890
--- /dev/null
+++ b/meta-oniro-staging/recipes-connectivity/networkmanager/networkmanager/fix-strerror_r.patch.license
@@ -0,0 +1,2 @@
+# SPDX-FileCopyrightText: Huawei Inc.
+# SPDX-License-Identifier: MIT
\ No newline at end of file
diff --git a/meta-oniro-staging/recipes-connectivity/openthread/ot-br-posix/0001-build-drop-Werror-to-avoid-compilation-breaks.patch.license b/meta-oniro-staging/recipes-connectivity/openthread/ot-br-posix/0001-build-drop-Werror-to-avoid-compilation-breaks.patch.license
new file mode 100644
index 00000000..993c9890
--- /dev/null
+++ b/meta-oniro-staging/recipes-connectivity/openthread/ot-br-posix/0001-build-drop-Werror-to-avoid-compilation-breaks.patch.license
@@ -0,0 +1,2 @@
+# SPDX-FileCopyrightText: Huawei Inc.
+# SPDX-License-Identifier: MIT
\ No newline at end of file
diff --git a/meta-oniro-staging/recipes-connectivity/openthread/ot-br-posix/0001-web-service-ot-client-add-needed-header-for-fd_set-c.patch.license b/meta-oniro-staging/recipes-connectivity/openthread/ot-br-posix/0001-web-service-ot-client-add-needed-header-for-fd_set-c.patch.license
new file mode 100644
index 00000000..993c9890
--- /dev/null
+++ b/meta-oniro-staging/recipes-connectivity/openthread/ot-br-posix/0001-web-service-ot-client-add-needed-header-for-fd_set-c.patch.license
@@ -0,0 +1,2 @@
+# SPDX-FileCopyrightText: Huawei Inc.
+# SPDX-License-Identifier: MIT
\ No newline at end of file
-- 
GitLab