Martin Roth has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36175 )
Change subject: util/lint: Update license header text for SPDX headers. ......................................................................
util/lint: Update license header text for SPDX headers.
Signed-off-by: Martin Roth martin@coreboot.org Change-Id: I07a7ca408ac8563e03e189d05ef7729dfb6fc24e --- M util/lint/lint-000-license-headers 1 file changed, 13 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/75/36175/1
diff --git a/util/lint/lint-000-license-headers b/util/lint/lint-000-license-headers index 9b3553b..db4390a 100755 --- a/util/lint/lint-000-license-headers +++ b/util/lint/lint-000-license-headers @@ -62,6 +62,8 @@ cmos.default\ "
+HEADER_TEXT="license header" + #space separated list of directories to test if [ "$1" = "" ]; then HEADER_DIRS="src util" @@ -69,6 +71,11 @@ HEADER_DIRS="$1" fi
+if [ "$2" = "SPDX_ONLY" ]; then +SPDX_ONLY=1 +HEADER_TEXT="SPDX identifer" +fi + LC_ALL=C export LC_ALL
#get initial list from git, removing HEADER_EXCLUDED files. @@ -96,6 +103,10 @@ }
#search the files for license headers +check_for_license 'SPDX-License-Identifier: *GPL-2.0-or-later' +check_for_license 'SPDX-License-Identifier: *GPL-2.0-only' + +if [ ! "${SPDX_ONLY}" = "1" ]; then check_for_license "under the terms of the GNU General Public License" \ "WITHOUT ANY WARRANTY" check_for_license 'IS PROVIDED .*"AS IS"' @@ -106,13 +117,13 @@ check_for_license 'THE AUTHORS DISCLAIM.*ALL WARRANTIES WITH REGARD TO THIS SOFTWARE' check_for_license 'No license required' check_for_license 'GNU Lesser General Public' -check_for_license 'SPDX-License-Identifier:.*GPL-2.0-or-later' +fi
for file in $headerlist; do # Verify the file exists, and has content that requires a header # This assumes that a file that has 4 lines or fewer is not notable # enough to require a license. if [ -f "$file" ] && [ "$(wc -l < "$file")" -gt 4 ]; then - echo "$file has no recognized license header." + echo "$file has no recognized ${HEADER_TEXT}." fi done
Werner Zeh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36175 )
Change subject: util/lint: Update license header text for SPDX headers. ......................................................................
Patch Set 1: Code-Review+1
(2 comments)
https://review.coreboot.org/c/coreboot/+/36175/1/util/lint/lint-000-license-... File util/lint/lint-000-license-headers:
https://review.coreboot.org/c/coreboot/+/36175/1/util/lint/lint-000-license-... PS1, Line 106: SPDX-License-Identifier: *GPL-2.0-or-later I guess we would like to use literally the same text in all our source files. Ss why do you need the * here? Do you expect that the text will vary? Or have I got it wrong?
https://review.coreboot.org/c/coreboot/+/36175/1/util/lint/lint-000-license-... PS1, Line 107: *GPL-2.0-only same here
David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36175 )
Change subject: util/lint: Update license header text for SPDX headers. ......................................................................
Patch Set 1: Code-Review-1
(1 comment)
minor nit
https://review.coreboot.org/c/coreboot/+/36175/1/util/lint/lint-000-license-... File util/lint/lint-000-license-headers:
https://review.coreboot.org/c/coreboot/+/36175/1/util/lint/lint-000-license-... PS1, Line 76: HEADER_TEXT="SPDX identifer" indent?
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36175 )
Change subject: util/lint: Update license header text for SPDX headers. ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36175/1/util/lint/lint-000-license-... File util/lint/lint-000-license-headers:
https://review.coreboot.org/c/coreboot/+/36175/1/util/lint/lint-000-license-... PS1, Line 106: SPDX-License-Identifier: *GPL-2.0-or-later
I guess we would like to use literally the same text in all our source files. […]
The * is saying 0 or more spaces. I think I put it in mostly by habit, although it is included in the pre-existing SPDX header check that I moved (while saying that anything could go there). I don't think the spacing matters, but I have no issue changing it to a single space.
Hello Werner Zeh, David Hendricks, build bot (Jenkins), Patrick Georgi,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/36175
to look at the new patch set (#2).
Change subject: util/lint: Update license header text for SPDX headers. ......................................................................
util/lint: Update license header text for SPDX headers.
In preparation to update to SPDX license headers, add identifiers for the licenses seen in the coreboot project and create a command line parameter allowing only SPDX license identifiers to be detected.
Here are example locations of these licenses: Apache-2.0 - src/soc/sifive BSD-3-Clause - Throughout coreboot & libpayload source GPL-2.0-only - Throughout coreboot source GPL-2.0-or-later - Throughout coreboot source GPL-3.0-only - util/amdtools GPL-3.0-or-later - src/lib/[gcov/libgcov/gnat] ISC - src/lib/ubsan.c, soc/qualcomm/ipq806x/include/soc/gsbi.h, others MIT - soc/nvidia/tegra210/mipi_dsi.c, files in mainboard/cavium/ X11 - include/device/drm_dp_helper.h, drivers/aspeed/common/ast_tables.h
Signed-off-by: Martin Roth martin@coreboot.org Change-Id: I07a7ca408ac8563e03e189d05ef7729dfb6fc24e --- M util/lint/lint-000-license-headers 1 file changed, 20 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/75/36175/2
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36175 )
Change subject: util/lint: Update license header text for SPDX headers. ......................................................................
Patch Set 2:
(3 comments)
https://review.coreboot.org/c/coreboot/+/36175/1/util/lint/lint-000-license-... File util/lint/lint-000-license-headers:
https://review.coreboot.org/c/coreboot/+/36175/1/util/lint/lint-000-license-... PS1, Line 76: HEADER_TEXT="SPDX identifer"
indent?
Done
https://review.coreboot.org/c/coreboot/+/36175/1/util/lint/lint-000-license-... PS1, Line 106: SPDX-License-Identifier: *GPL-2.0-or-later
The * is saying 0 or more spaces. […]
Done
https://review.coreboot.org/c/coreboot/+/36175/1/util/lint/lint-000-license-... PS1, Line 107: *GPL-2.0-only
same here
Done
David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36175 )
Change subject: util/lint: Update license header text for SPDX headers. ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36175/2/util/lint/lint-000-license-... File util/lint/lint-000-license-headers:
https://review.coreboot.org/c/coreboot/+/36175/2/util/lint/lint-000-license-... PS2, Line 117: check_for_license "under the terms of the GNU General Public License" \ Should these also be indented now that they are in an if-statement?
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36175 )
Change subject: util/lint: Update license header text for SPDX headers. ......................................................................
Patch Set 3:
(2 comments)
https://review.coreboot.org/c/coreboot/+/36175/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/36175/3//COMMIT_MSG@16 PS3, Line 16: GPL-2.0-only - Throughout coreboot source : GPL-2.0-or-later - Throughout coreboot source : GPL-3.0-only - util/amdtools : GPL-3.0-or-later - src/lib/[gcov/libgcov/gnat] not related to this patch but is this actually ok? GLP2 only is not compatible with GPL3 afaik.
https://review.coreboot.org/c/coreboot/+/36175/3/util/lint/lint-000-license-... File util/lint/lint-000-license-headers:
https://review.coreboot.org/c/coreboot/+/36175/3/util/lint/lint-000-license-... PS3, Line 106: check_for_license 'SPDX-License-Identifier: Apache-2.0' : check_for_license 'SPDX-License-Identifier: BSD-3-Clause' : check_for_license 'SPDX-License-Identifier: GPL-2.0-only' : check_for_license 'SPDX-License-Identifier: GPL-2.0-or-later' : check_for_license 'SPDX-License-Identifier: GPL-3.0-only' : check_for_license 'SPDX-License-Identifier: GPL-3.0-or-later' : check_for_license 'SPDX-License-Identifier: ISC' : check_for_license 'SPDX-License-Identifier: MIT' : check_for_license 'SPDX-License-Identifier: X11' Don't we want compatible licenses depending on the 'project'. e.g. coreboot itself needs GPL2 compatible. libpayload is X11? etc?
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36175 )
Change subject: util/lint: Update license header text for SPDX headers. ......................................................................
Patch Set 3: Code-Review+1
(2 comments)
https://review.coreboot.org/c/coreboot/+/36175/3/util/lint/lint-000-license-... File util/lint/lint-000-license-headers:
https://review.coreboot.org/c/coreboot/+/36175/3/util/lint/lint-000-license-... PS3, Line 76: identifer identifier
https://review.coreboot.org/c/coreboot/+/36175/3/util/lint/lint-000-license-... PS3, Line 106: check_for_license 'SPDX-License-Identifier: Apache-2.0' : check_for_license 'SPDX-License-Identifier: BSD-3-Clause' : check_for_license 'SPDX-License-Identifier: GPL-2.0-only' : check_for_license 'SPDX-License-Identifier: GPL-2.0-or-later' : check_for_license 'SPDX-License-Identifier: GPL-3.0-only' : check_for_license 'SPDX-License-Identifier: GPL-3.0-or-later' : check_for_license 'SPDX-License-Identifier: ISC' : check_for_license 'SPDX-License-Identifier: MIT' : check_for_license 'SPDX-License-Identifier: X11'
Probably, however that will require extensive refactoring of this script to look at projects individ […]
Also, ISC, MIT and X11 are also permissible in coreboot for imported code (they're GPL-compatible), and libpayload already contains some GPL'd drivers (in principle hidden behind a Kconfig flag, not sure if that's 100% accurate).
So any effort to make license tests per-project is really orthogonal to what this change is doing.
Hello Werner Zeh, David Hendricks, build bot (Jenkins), Patrick Georgi,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/36175
to look at the new patch set (#4).
Change subject: util/lint: Update license header text for SPDX headers. ......................................................................
util/lint: Update license header text for SPDX headers.
In preparation to update to SPDX license headers, add identifiers for the licenses seen in the coreboot project and create a command line parameter allowing only SPDX license identifiers to be detected.
Here are example locations of these licenses: Apache-2.0 - src/soc/sifive BSD-3-Clause - Throughout coreboot & libpayload source GPL-2.0-only - Throughout coreboot source GPL-2.0-or-later - Throughout coreboot source GPL-3.0-only - util/amdtools GPL-3.0-or-later - src/lib/[gcov/libgcov/gnat] ISC - src/lib/ubsan.c, soc/qualcomm/ipq806x/include/soc/gsbi.h, others MIT - soc/nvidia/tegra210/mipi_dsi.c, files in mainboard/cavium/ X11 - include/device/drm_dp_helper.h, drivers/aspeed/common/ast_tables.h
Signed-off-by: Martin Roth martin@coreboot.org Change-Id: I07a7ca408ac8563e03e189d05ef7729dfb6fc24e --- M util/lint/lint-000-license-headers 1 file changed, 20 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/75/36175/4
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36175 )
Change subject: util/lint: Update license header text for SPDX headers. ......................................................................
Patch Set 4:
(3 comments)
https://review.coreboot.org/c/coreboot/+/36175/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/36175/3//COMMIT_MSG@16 PS3, Line 16: GPL-2.0-only - Throughout coreboot source : GPL-2.0-or-later - Throughout coreboot source : GPL-3.0-only - util/amdtools : GPL-3.0-or-later - src/lib/[gcov/libgcov/gnat]
I think so, under the runtime library exception (cited in the comment of libgcov.c). […]
Right. I'll work to make that clear in the checker later.
https://review.coreboot.org/c/coreboot/+/36175/3/util/lint/lint-000-license-... File util/lint/lint-000-license-headers:
https://review.coreboot.org/c/coreboot/+/36175/3/util/lint/lint-000-license-... PS3, Line 76: identifer
identifier
Done
https://review.coreboot.org/c/coreboot/+/36175/3/util/lint/lint-000-license-... PS3, Line 106: check_for_license 'SPDX-License-Identifier: Apache-2.0' : check_for_license 'SPDX-License-Identifier: BSD-3-Clause' : check_for_license 'SPDX-License-Identifier: GPL-2.0-only' : check_for_license 'SPDX-License-Identifier: GPL-2.0-or-later' : check_for_license 'SPDX-License-Identifier: GPL-3.0-only' : check_for_license 'SPDX-License-Identifier: GPL-3.0-or-later' : check_for_license 'SPDX-License-Identifier: ISC' : check_for_license 'SPDX-License-Identifier: MIT' : check_for_license 'SPDX-License-Identifier: X11'
Also, ISC, MIT and X11 are also permissible in coreboot for imported code (they're GPL-compatible), […]
After this goes in, I'll work on refactoring it to make sure that the licenses that aren't compatible with GPL-V2 are contained in certain folders.
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36175 )
Change subject: util/lint: Update license header text for SPDX headers. ......................................................................
Patch Set 4: Code-Review+2
Reindent on the non-SPDX variant tests is pending, but other than that, LGTM
Werner Zeh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36175 )
Change subject: util/lint: Update license header text for SPDX headers. ......................................................................
Patch Set 4: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/36175/4/util/lint/lint-000-license-... File util/lint/lint-000-license-headers:
https://review.coreboot.org/c/coreboot/+/36175/4/util/lint/lint-000-license-... PS4, Line 117: check_for_license "under the terms of the GNU General Public License" \ : "WITHOUT ANY WARRANTY" : check_for_license 'IS PROVIDED .*"AS IS"' : check_for_license 'IS DISTRIBUTED .*"AS IS"' : check_for_license "IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE" : check_for_license '"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES' : check_for_license 'assumes any liability or responsibility for the use' : check_for_license 'THE AUTHORS DISCLAIM.*ALL WARRANTIES WITH REGARD TO THIS SOFTWARE' : check_for_license 'No license required' : check_for_license 'GNU Lesser General Public' These lines could be intended as they are now part of the if[]..fi condition. But I do not have a strong feeling, just if you like it.
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36175 )
Change subject: util/lint: Update license header text for SPDX headers. ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36175/4/util/lint/lint-000-license-... File util/lint/lint-000-license-headers:
https://review.coreboot.org/c/coreboot/+/36175/4/util/lint/lint-000-license-... PS4, Line 117: check_for_license "under the terms of the GNU General Public License" \ : "WITHOUT ANY WARRANTY" : check_for_license 'IS PROVIDED .*"AS IS"' : check_for_license 'IS DISTRIBUTED .*"AS IS"' : check_for_license "IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE" : check_for_license '"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES' : check_for_license 'assumes any liability or responsibility for the use' : check_for_license 'THE AUTHORS DISCLAIM.*ALL WARRANTIES WITH REGARD TO THIS SOFTWARE' : check_for_license 'No license required' : check_for_license 'GNU Lesser General Public'
These lines could be intended as they are now part of the if[]..fi condition. […]
Ack
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36175 )
Change subject: util/lint: Update license header text for SPDX headers. ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36175/2/util/lint/lint-000-license-... File util/lint/lint-000-license-headers:
https://review.coreboot.org/c/coreboot/+/36175/2/util/lint/lint-000-license-... PS2, Line 117: check_for_license "under the terms of the GNU General Public License" \
Should these also be indented now that they are in an if-statement?
probably should, but they're on the way out anyway.
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/36175 )
Change subject: util/lint: Update license header text for SPDX headers. ......................................................................
util/lint: Update license header text for SPDX headers.
In preparation to update to SPDX license headers, add identifiers for the licenses seen in the coreboot project and create a command line parameter allowing only SPDX license identifiers to be detected.
Here are example locations of these licenses: Apache-2.0 - src/soc/sifive BSD-3-Clause - Throughout coreboot & libpayload source GPL-2.0-only - Throughout coreboot source GPL-2.0-or-later - Throughout coreboot source GPL-3.0-only - util/amdtools GPL-3.0-or-later - src/lib/[gcov/libgcov/gnat] ISC - src/lib/ubsan.c, soc/qualcomm/ipq806x/include/soc/gsbi.h, others MIT - soc/nvidia/tegra210/mipi_dsi.c, files in mainboard/cavium/ X11 - include/device/drm_dp_helper.h, drivers/aspeed/common/ast_tables.h
Signed-off-by: Martin Roth martin@coreboot.org Change-Id: I07a7ca408ac8563e03e189d05ef7729dfb6fc24e Reviewed-on: https://review.coreboot.org/c/coreboot/+/36175 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Patrick Georgi pgeorgi@google.com Reviewed-by: Werner Zeh werner.zeh@siemens.com --- M util/lint/lint-000-license-headers 1 file changed, 20 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved Werner Zeh: Looks good to me, approved
diff --git a/util/lint/lint-000-license-headers b/util/lint/lint-000-license-headers index 9b3553b..88e15ec 100755 --- a/util/lint/lint-000-license-headers +++ b/util/lint/lint-000-license-headers @@ -62,6 +62,8 @@ cmos.default\ "
+HEADER_TEXT="license header" + #space separated list of directories to test if [ "$1" = "" ]; then HEADER_DIRS="src util" @@ -69,6 +71,11 @@ HEADER_DIRS="$1" fi
+if [ "$2" = "SPDX_ONLY" ]; then + SPDX_ONLY=1 + HEADER_TEXT="SPDX identifier" +fi + LC_ALL=C export LC_ALL
#get initial list from git, removing HEADER_EXCLUDED files. @@ -96,6 +103,17 @@ }
#search the files for license headers +check_for_license 'SPDX-License-Identifier: Apache-2.0' +check_for_license 'SPDX-License-Identifier: BSD-3-Clause' +check_for_license 'SPDX-License-Identifier: GPL-2.0-only' +check_for_license 'SPDX-License-Identifier: GPL-2.0-or-later' +check_for_license 'SPDX-License-Identifier: GPL-3.0-only' +check_for_license 'SPDX-License-Identifier: GPL-3.0-or-later' +check_for_license 'SPDX-License-Identifier: ISC' +check_for_license 'SPDX-License-Identifier: MIT' +check_for_license 'SPDX-License-Identifier: X11' + +if [ ! "${SPDX_ONLY}" = "1" ]; then check_for_license "under the terms of the GNU General Public License" \ "WITHOUT ANY WARRANTY" check_for_license 'IS PROVIDED .*"AS IS"' @@ -106,13 +124,13 @@ check_for_license 'THE AUTHORS DISCLAIM.*ALL WARRANTIES WITH REGARD TO THIS SOFTWARE' check_for_license 'No license required' check_for_license 'GNU Lesser General Public' -check_for_license 'SPDX-License-Identifier:.*GPL-2.0-or-later' +fi
for file in $headerlist; do # Verify the file exists, and has content that requires a header # This assumes that a file that has 4 lines or fewer is not notable # enough to require a license. if [ -f "$file" ] && [ "$(wc -l < "$file")" -gt 4 ]; then - echo "$file has no recognized license header." + echo "$file has no recognized ${HEADER_TEXT}." fi done