Skip to contentSkip to conversation

legal-info: license files are only known for latest versions (branch yem/legal-info-latest-only)

PATCH New Yann E. MORIN 2 participants 13 messages Feb 5, 2020 – Feb 6, 2020 Arm/Microchip (AT91) SoC support

lore
Share & tools
lore
#0 lore raw

v2 cover legal-info: license files are only known for latest versions (branch yem/legal-info-latest-only)

Hello All!

This small series restricts the check for license files hashes to the latest known versions of packages that have user-supplied arbitrary versions.

Changes v1 -> v2: (Yann)
- only check license for latest kernel version

Regards,
Yann E. MORIN.

The following changes since commit 14ff0c73899df6db0c83c5ecb8c85429df9513e8

package/elixir: new package (2020-02-05 15:37:51 +0100)

are available in the git repository at:

git://git.buildroot.org/~ymorin/git/buildroot.git

for you to fetch changes up to 76db34fbca7b956090aaf4557510cf89a3d2d72c

boot/optee-os: license files hashes only valid for latest version (2020-02-05 15:47:14 +0100)

----------------------------------------------------------------
Markus Mayer (1):
linux: license files hashes are only valid for latest known version

Yann E. MORIN (5):
package/linux-headers: license files hashes only valid for latest version boot/uboot: license files hashes only valid for latest version boot/barebox: license files hashes only valid for latest version boot/at91bootstrap3: license files hashes only valid for latest version boot/optee-os: license files hashes only valid for latest version

 boot/at91bootstrap3/at91bootstrap3.mk  |  2 ++
 boot/barebox/barebox.hash              |  7 +++++--
 boot/barebox/barebox.mk                |  2 ++
 boot/optee-os/optee-os.mk              |  2 ++
 boot/uboot/uboot.mk                    |  2 ++
 linux/linux.hash                       | 20 ++++++++++++--------
 linux/linux.mk                         |  7 ++++++-
 package/linux-headers/Config.in.host   |  6 ++++++
 package/linux-headers/linux-headers.mk |  7 ++++++-
 9 files changed, 43 insertions(+), 12 deletions(-)
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH v2 1/6 linux: license files hashes are only valid for latest known version

From: Markus Mayer <[email protected]>

The content of COPYING changed between v4.16 and v4.17. Since kernels before and after the change are supported, storing the hash for this file will cause an error during "make legal-info" when a kernel with the respective other hash is being used.

So, for the kernel, we do like we did for ATF: the license file is only listed for the latest version.

In the process, add the missing license files referenced from COPYING and align the fields to the newly spacing convention.

[yann.morin.1998 at free.fr:
- only list the licenses files for the latest version
- restore the hash for COPYING
- introduce hashes for the two new license files
- expand commit log accordingly
]

---
 linux/linux.hash | 20 ++++++++++++--------
 linux/linux.mk   |  7 ++++++-
 2 files changed, 18 insertions(+), 9 deletions(-)
linux/linux.hash +12 -8
index 510f69cf19..8082a8cfba 100644
@@ -1,11 +1,15 @@
 # From https://www.kernel.org/pub/linux/kernel/v5.x/sha256sums.asc
-sha256 945f2bf6af69eed0ac81ef75b571f37ae1e16a9bb8a2ae698a365ee3ec2c74b9  linux-5.4.17.tar.xz
+sha256  945f2bf6af69eed0ac81ef75b571f37ae1e16a9bb8a2ae698a365ee3ec2c74b9  linux-5.4.17.tar.xz
 # From https://www.kernel.org/pub/linux/kernel/v4.x/sha256sums.asc
-sha256 47e6c22722917d3609c430392b7549267c1f097ddae9dc0e7f071a6ea4c7a357  linux-4.4.212.tar.xz
-sha256 ade738a606c9b52ecf764e94b4e77116caa3a2b8abd30f4534d220ac6894be30  linux-4.9.212.tar.xz
-sha256 d88ea97993c56b1fa0b0a05061bcde476c6be4fc3bb2de8bd97a8f8ff7278249  linux-4.14.169.tar.xz
-sha256 be26156abdb38ac0576a34a235ef456bb8ca67fbbe56fc6649b8d069159f8bc4  linux-4.19.101.tar.xz
+sha256  47e6c22722917d3609c430392b7549267c1f097ddae9dc0e7f071a6ea4c7a357  linux-4.4.212.tar.xz
+sha256  ade738a606c9b52ecf764e94b4e77116caa3a2b8abd30f4534d220ac6894be30  linux-4.9.212.tar.xz
+sha256  d88ea97993c56b1fa0b0a05061bcde476c6be4fc3bb2de8bd97a8f8ff7278249  linux-4.14.169.tar.xz
+sha256  be26156abdb38ac0576a34a235ef456bb8ca67fbbe56fc6649b8d069159f8bc4  linux-4.19.101.tar.xz
 # Locally computed
-sha256 18f9ddba0b777d1942d6c81877ba97c4bcd08488e2c409e57dcce866b9de5fc2  linux-cip-4.19.98-cip19.tar.gz
-sha256 7d5aeb67da41dc66ef28621ef994ef4403e8b1f5c3df38b1843da20972444280  linux-cip-4.19.98-cip19-rt7.tar.gz
-sha256 ee5808b032a67f587d3541099d46de34f5bec8cd5976114ba07f1299ee6001ff  COPYING
+sha256  18f9ddba0b777d1942d6c81877ba97c4bcd08488e2c409e57dcce866b9de5fc2  linux-cip-4.19.98-cip19.tar.gz
+sha256  7d5aeb67da41dc66ef28621ef994ef4403e8b1f5c3df38b1843da20972444280  linux-cip-4.19.98-cip19-rt7.tar.gz
+
+# Licenses hashes
+sha256  ee5808b032a67f587d3541099d46de34f5bec8cd5976114ba07f1299ee6001ff  COPYING
+sha256  f6b78c087c3ebdf0f3c13415070dd480a3f35d8fc76f3d02180a407c1c812f79  LICENSES/preferred/GPL-2.0
+sha256  8e378ab93586eb55135d3bc119cce787f7324f48394777d00c34fa3d0be3303f  LICENSES/exceptions/Linux-syscall-note
linux/linux.mk +6 -1
index 9a2f63d4df..bf308b807a 100644
@@ -6,7 +6,12 @@
 
 LINUX_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
 LINUX_LICENSE = GPL-2.0
-LINUX_LICENSE_FILES = COPYING
+ifeq ($(BR2_LINUX_KERNEL_LATEST_VERSION),y)
+LINUX_LICENSE_FILES = \
+	COPYING \
+	LICENSES/preferred/GPL-2.0 \
+	LICENSES/exceptions/Linux-syscall-note
+endif
 
 define LINUX_HELP_CMDS
 	@echo '  linux-menuconfig       - Run Linux kernel menuconfig'
Signature · 1 line
2.20.1
#2 lore raw

PATCH v2 1/6 linux: license files hashes are only valid for latest known version

Quoted 14 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

From: Markus Mayer <[email protected]>
The content of COPYING changed between v4.16 and v4.17. Since kernels before and after the change are supported, storing the hash for this file will cause an error during "make legal-info" when a kernel with the respective other hash is being used.

So, for the kernel, we do like we did for ATF: the license file is only listed for the latest version.

In the process, add the missing license files referenced from COPYING and align the fields to the newly spacing convention.

Quoted 8 lines

[yann.morin.1998 at free.fr:
- only list the licenses files for the latest version
- restore the hash for COPYING
- introduce hashes for the two new license files
- expand commit log accordingly
]

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH v2 2/6 package/linux-headers: license files hashes only valid for latest version

In reply to Yann E. MORIN

Like we did on the previous commit, change linux-headers to only check the license hashes for the latest known version.

To simplify the test, we introduce an intermediate, blind option that get selected by the two latest versions.

---
 package/linux-headers/Config.in.host   | 6 ++++++
 package/linux-headers/linux-headers.mk | 7 ++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)
package/linux-headers/Config.in.host +6 -0
index 9f46a1052b..7a68ab7492 100644
@@ -25,6 +25,7 @@ choice
 config BR2_KERNEL_HEADERS_AS_KERNEL
 	bool "Same as kernel being built"
 	depends on BR2_LINUX_KERNEL
+	select BR2_KERNEL_HEADERS_LATEST if BR2_LINUX_KERNEL_LATEST_VERSION
 
 config BR2_KERNEL_HEADERS_4_4
 	bool "Linux 4.4.x kernel headers"
@@ -52,6 +53,7 @@ config BR2_KERNEL_HEADERS_4_19
 config BR2_KERNEL_HEADERS_5_4
 	bool "Linux 5.4.x kernel headers"
 	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_4
+	select BR2_KERNEL_HEADERS_LATEST
 
 config BR2_KERNEL_HEADERS_VERSION
 	bool "Manually specified Linux version"
@@ -83,6 +85,10 @@ config BR2_KERNEL_HEADERS_CUSTOM_GIT
 
 endchoice
 
+# Select this for the latest kernel headers ersion (for licenses hashes)
+config BR2_KERNEL_HEADERS_LATEST
+	bool
+
 config BR2_DEFAULT_KERNEL_VERSION
 	string "linux version"
 	depends on BR2_KERNEL_HEADERS_VERSION
package/linux-headers/linux-headers.mk +6 -1
index 676c8c44ea..2b7879c62f 100644
@@ -91,7 +91,12 @@ endif
 LINUX_HEADERS_DL_SUBDIR = linux
 
 LINUX_HEADERS_LICENSE = GPL-2.0
-LINUX_HEADERS_LICENSE_FILES = COPYING
+ifeq ($(BR2_KERNEL_HEADERS_LATEST),y)
+LINUX_HEADERS_LICENSE_FILES = \
+	COPYING \
+	LICENSES/preferred/GPL-2.0 \
+	LICENSES/exceptions/Linux-syscall-note
+endif
 
 LINUX_HEADERS_INSTALL_STAGING = YES
 
Signature · 1 line
2.20.1
#4 lore raw

PATCH v2 2/6 package/linux-headers: license files hashes only valid for latest version

Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

Like we did on the previous commit, change linux-headers to only check the license hashes for the latest known version.

To simplify the test, we introduce an intermediate, blind option that get selected by the two latest versions.

It is not really for the TWO latest versions, just the two ways we have of using the latest kernel headers.

Quoted 29 lines
---
 package/linux-headers/Config.in.host   | 6 ++++++
 package/linux-headers/linux-headers.mk | 7 ++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)
package/linux-headers/Config.in.host +2 -0
index 9f46a1052b..7a68ab7492 100644
@@ -25,6 +25,7 @@ choice
 config BR2_KERNEL_HEADERS_AS_KERNEL
 	bool "Same as kernel being built"
 	depends on BR2_LINUX_KERNEL
+	select BR2_KERNEL_HEADERS_LATEST if BR2_LINUX_KERNEL_LATEST_VERSION
 
 config BR2_KERNEL_HEADERS_4_4
 	bool "Linux 4.4.x kernel headers"
@@ -52,6 +53,7 @@ config BR2_KERNEL_HEADERS_4_19
 config BR2_KERNEL_HEADERS_5_4
 	bool "Linux 5.4.x kernel headers"
 	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_4
+	select BR2_KERNEL_HEADERS_LATEST
 
 config BR2_KERNEL_HEADERS_VERSION
 	bool "Manually specified Linux version"

package/linux-headers/Config.in.host config BR2_KERNEL_HEADERS_CUSTOM_GIT · line 88

Quoted 4 lines
package/linux-headers/Config.in.host +1 -0
@@ -83,6 +85,10 @@ config BR2_KERNEL_HEADERS_CUSTOM_GIT
 
 endchoice
 
+# Select this for the latest kernel headers ersion (for licenses hashes)

s/ersion/version/

Fixed that and reworded the commit message a bit and committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw

PATCH v2 3/6 boot/uboot: license files hashes only valid for latest version

In reply to Yann E. MORIN

We can only know the path to the license files for the known version. For custom, older or newer, versions may change, or may be moved around.

So, do for U-Boot as was done for ATF, linux, and linu-headers, and only define the list of license files for the latest version.

---
 boot/uboot/uboot.mk | 2 ++
 1 file changed, 2 insertions(+)
boot/uboot/uboot.mk +2 -0
index 1f444351d7..2bfa50779b 100644
@@ -8,7 +8,9 @@ UBOOT_VERSION = $(call qstrip,$(BR2_TARGET_UBOOT_VERSION))
 UBOOT_BOARD_NAME = $(call qstrip,$(BR2_TARGET_UBOOT_BOARDNAME))
 
 UBOOT_LICENSE = GPL-2.0+
+ifeq ($(BR2_TARGET_UBOOT_LATEST_VERSION),y)
 UBOOT_LICENSE_FILES = Licenses/gpl-2.0.txt
+endif
 
 UBOOT_INSTALL_IMAGES = YES
 
Signature · 1 line
2.20.1
#6 lore raw

PATCH v2 3/6 boot/uboot: license files hashes only valid for latest version

Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

We can only know the path to the license files for the known version. For custom, older or newer, versions may change, or may be moved around.

It is not only the path, but also the content (hash), so I slightly reworded this and committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#7 lore raw

PATCH v2 4/6 boot/barebox: license files hashes only valid for latest version

In reply to Yann E. MORIN

We can only know the path to the license files for the known version. For custom, older or newer, versions may change, or may be moved around.

So, do for U-Boot as was done for ATF, linux, and linux-headers, and only define the list of license files for the latest version.

Add the hash for that license file, and align hashes to the new spacing convention.

---
 boot/barebox/barebox.hash | 7 +++++--
 boot/barebox/barebox.mk   | 2 ++
 2 files changed, 7 insertions(+), 2 deletions(-)
boot/barebox/barebox.hash +5 -2
index 42561ea571..64fec919b8 100644
@@ -1,5 +1,8 @@
 # From https://www.barebox.org/download/barebox-2019.12.0.tar.bz2.md5
-md5 2d25158ccffaa843c9e4943bbe820ce2 barebox-2019.12.0.tar.bz2
+md5  2d25158ccffaa843c9e4943bbe820ce2  barebox-2019.12.0.tar.bz2
 
 # Locally calculated
-sha256 fb77afc5c1a9783b8e1a9bb6c617973f5c0ed4c6f8e079f96cb7e7e0818a7a90 barebox-2019.12.0.tar.bz2
+sha256  fb77afc5c1a9783b8e1a9bb6c617973f5c0ed4c6f8e079f96cb7e7e0818a7a90  barebox-2019.12.0.tar.bz2
+
+# License files, locally computed
+sha256  ab1122aa9f9073ad1ec824edcd970b16a6a7881a34a18fd56c080debb2dca5d4  COPYING
boot/barebox/barebox.mk +2 -0
index 52178d89c8..f11f9950d1 100644
@@ -33,7 +33,9 @@ endif
 
 $(1)_DEPENDENCIES = host-lzop
 $(1)_LICENSE = GPL-2.0 with exceptions
+ifeq ($(BR2_TARGET_BAREBOX_LATEST_VERSION),y)
 $(1)_LICENSE_FILES = COPYING
+endif
 
 $(1)_CUSTOM_EMBEDDED_ENV_PATH = $$(call qstrip,$$(BR2_TARGET_$(1)_CUSTOM_EMBEDDED_ENV_PATH))
 
Signature · 1 line
2.20.1
#8 lore raw

PATCH v2 4/6 boot/barebox: license files hashes only valid for latest version

Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

We can only know the path to the license files for the known version. For custom, older or newer, versions may change, or may be moved around.

So, do for U-Boot as was done for ATF, linux, and linux-headers, and

s/U-Boot/Barebox/ ;)

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#9 lore raw

PATCH v2 5/6 boot/at91bootstrap3: license files hashes only valid for latest version

In reply to Yann E. MORIN

We can only know the path to the license files for the known version. For custom, older or newer, versions may change, or may be moved around.

So, do for at91bootstrap3 as was done for other packages in the recent past, and only define the list of license files for the latest version.

---
 boot/at91bootstrap3/at91bootstrap3.mk | 2 ++
 1 file changed, 2 insertions(+)
boot/at91bootstrap3/at91bootstrap3.mk +2 -0
index 48c3a918a1..5cf865c681 100644
@@ -20,7 +20,9 @@ AT91BOOTSTRAP3_SITE = $(call github,linux4sam,at91bootstrap,$(AT91BOOTSTRAP3_VER
 endif
 
 AT91BOOTSTRAP3_LICENSE = Atmel License
+ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_LATEST_VERSION),y)
 AT91BOOTSTRAP3_LICENSE_FILES = main.c
+endif
 
 AT91BOOTSTRAP3_INSTALL_IMAGES = YES
 AT91BOOTSTRAP3_INSTALL_TARGET = NO
Signature · 1 line
2.20.1
#10 lore raw

PATCH v2 5/6 boot/at91bootstrap3: license files hashes only valid for latest version

Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

We can only know the path to the license files for the known version. For custom, older or newer, versions may change, or may be moved around.

Quoted 6 lines

So, do for at91bootstrap3 as was done for other packages in the recent past, and only define the list of license files for the latest version.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#11 lore raw

PATCH v2 6/6 boot/optee-os: license files hashes only valid for latest version

In reply to Yann E. MORIN

We can only know the path to the license files for the known version. For custom, older or newer, versions may change, or may be moved around.

So, do for optee-os as was done for other packages in the recent past, and only define the list of license files for the latest version.

---
 boot/optee-os/optee-os.mk | 2 ++
 1 file changed, 2 insertions(+)
boot/optee-os/optee-os.mk +2 -0
index bedde85212..acdb25b479 100644
@@ -6,7 +6,9 @@
 
 OPTEE_OS_VERSION = $(call qstrip,$(BR2_TARGET_OPTEE_OS_VERSION))
 OPTEE_OS_LICENSE = BSD-2-Clause
+ifeq ($(BR2_TARGET_OPTEE_OS_LATEST),y)
 OPTEE_OS_LICENSE_FILES = LICENSE
+endif
 
 OPTEE_OS_INSTALL_STAGING = YES
 OPTEE_OS_INSTALL_IMAGES = YES
Signature · 1 line
2.20.1
#12 lore raw

PATCH v2 6/6 boot/optee-os: license files hashes only valid for latest version

Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

We can only know the path to the license files for the known version. For custom, older or newer, versions may change, or may be moved around.

Quoted 6 lines

So, do for optee-os as was done for other packages in the recent past, and only define the list of license files for the latest version.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard