Skip to contentSkip to conversation

Patch review

PATCH In review Steve Sakoman 3 participants 17 messages Apr 30, 2021

lore
Share & tools
lore
#0 lore raw

cover Patch review

Please review this next set of patches for dunfell and have comments back by end of day Tuesday.

Passed a-full on autobuilder:

https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/2087

The following changes since commit 2cc9e06807026b86038db88c2175c626feadc0be:

linux-yocto/5.4: fix arm defconfig warnings (2021-04-22 06:23:22 -1000)

are available in the Git repository at:

git://git.openembedded.org/openembedded-core-contrib stable/dunfell-nut
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=stable/dunfell-nut

Alexander Kanavin (2):
oeqa: tear down oeqa decorators if one of them raises an exception in
setup
meta/lib/oeqa/core/tests/cases/timeout.py: add a testcase for the
previous fix

Diego Sueiro (1):
oeqa/selftest/bblayers: Add test case for bitbake-layers
layerindex-show-depends

Khem Raj (1):
go: Use dl.google.com for SRC_URI

Konrad Weihmann (1):
cve-update-db-native: skip on empty cpe23Uri

Marek Vasut (1):
linux-firmware: Package RSI 911x WiFi firmware

Reto Schneider (2):
license_image.bbclass: Detect broken symlinks license_image.bbclass: Fix symlink to generic license files

Richard Purdie (1):
yocto-check-layer: Avoid bug when iterating and autoadding
dependencies

Vinay Kumar (1):
Binutils: Fix CVE-2021-20197

Zhang Qiang (1):
kernel.bbclass: Configuration for environment with HOSTCXX

wangmy (1):
go: update SRC_URI to use https protocol

 meta/classes/kernel.bbclass                   |   2 +
 meta/classes/license_image.bbclass            |  20 +-
 meta/lib/oeqa/core/case.py                    |   9 +-
 meta/lib/oeqa/core/decorator/oetimeout.py     |   5 +-
 meta/lib/oeqa/core/tests/cases/timeout.py     |  13 +
 meta/lib/oeqa/core/tests/test_decorators.py   |   6 +
 meta/lib/oeqa/selftest/cases/bblayers.py      |   5 +
 .../recipes-core/meta/cve-update-db-native.bb |   7 +-
 .../binutils/binutils-2.34.inc                |   1 +
 .../binutils/binutils/CVE-2021-20197.patch    | 572 ++++++++++++++++++
 meta/recipes-devtools/go/go-common.inc        |   2 +-
 .../linux-firmware/linux-firmware_20210208.bb |  11 +
 scripts/yocto-check-layer                     |   3 +
 13 files changed, 646 insertions(+), 10 deletions(-)
 create mode 100644 meta/recipes-devtools/binutils/binutils/CVE-2021-20197.patch
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/12 Binutils: Fix CVE-2021-20197

From: Vinay Kumar <[email protected]>

Source: git://sourceware.org/git/binutils-gdb.git
Tracking -- https://sourceware.org/bugzilla/show_bug.cgi?id=26945

Backported upstream commit d3edaa91d4cf7202ec14342410194841e2f67f12 to
binutils-2.34 source, along with commit id dependencies
(8e03235147a9e774d3ba084e93c2daaa94d1cec, 365f5fb6d0f0da83817431a275e99e6f6babbe04 and 8b69e61d4be276bb862698aaafddc3e779d23c8f).

Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d3edaa91d4cf7202ec14342410194841e2f67f12]

---
 .../binutils/binutils-2.34.inc                |   1 +
 .../binutils/binutils/CVE-2021-20197.patch    | 572 ++++++++++++++++++
 2 files changed, 573 insertions(+)
 create mode 100644 meta/recipes-devtools/binutils/binutils/CVE-2021-20197.patch
meta/recipes-devtools/binutils/binutils-2.34.inc +1 -0
index f557fe970c..a586faf5ab 100644
@@ -46,5 +46,6 @@ SRC_URI = "\
      file://0001-gas-improve-reproducibility-for-stabs-debugging-data.patch \
      file://CVE-2020-16592.patch \
      file://CVE-2020-16598.patch \
+     file://CVE-2021-20197.patch \
 "
 S  = "${WORKDIR}/git"
meta/recipes-devtools/binutils/binutils/CVE-2021-20197.patch new file +572 -0

572 lines not on this page · raw message

Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/12 cve-update-db-native: skip on empty cpe23Uri

In reply to Steve Sakoman

From: Konrad Weihmann <[email protected]>

Recently an entry in the NVD DB appeared that looks like that {'vulnerable': True, 'cpe_name': []}.
As besides all the vulnerable flag no data is present we would get a KeyError exception on acccess.
Use get method on dictionary and return if no meta data is present Also quit if the length of the array after splitting is less than 6

(cherry picked from commit 00ce2796d97de2bc376b038d0ea7969088791d34)
---
 meta/recipes-core/meta/cve-update-db-native.bb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
meta/recipes-core/meta/cve-update-db-native.bb +6 -1
index 5d9fb59cbc..e86c69803f 100644
@@ -132,7 +132,12 @@ def parse_node_and_insert(c, node, cveId):
         for cpe in node.get('cpe_match', ()):
             if not cpe['vulnerable']:
                 return
-            cpe23 = cpe['cpe23Uri'].split(':')
+            cpe23 = cpe.get('cpe23Uri')
+            if not cpe23:
+                return
+            cpe23 = cpe23.split(':')
+            if len(cpe23) < 6:
+                return
             vendor = cpe23[3]
             product = cpe23[4]
             version = cpe23[5]
Signature · 1 line
2.25.1
#3 lore raw

PATCH 3/12 oeqa/selftest/bblayers: Add test case for bitbake-layers layerindex-show-depends

In reply to Steve Sakoman

From: Diego Sueiro <[email protected]>

(cherry picked from commit 80090c31164d62a169431ab71c4aaee5475b6f40)
---
 meta/lib/oeqa/selftest/cases/bblayers.py | 5 +++++
 1 file changed, 5 insertions(+)
meta/lib/oeqa/selftest/cases/bblayers.py +5 -0
index f131d9856c..7d74833f61 100644
@@ -12,6 +12,11 @@ from oeqa.selftest.case import OESelftestTestCase
 
 class BitbakeLayers(OESelftestTestCase):
 
+    def test_bitbakelayers_layerindexshowdepends(self):
+        result = runCmd('bitbake-layers layerindex-show-depends meta-poky')
+        find_in_contents = re.search("openembedded-core", result.output)
+        self.assertTrue(find_in_contents, msg = "openembedded-core should have been listed at this step. bitbake-layers layerindex-show-depends meta-poky output: %s" % result.output)
+
     def test_bitbakelayers_showcrossdepends(self):
         result = runCmd('bitbake-layers show-cross-depends')
         self.assertIn('aspell', result.output)
Signature · 1 line
2.25.1
#4 lore raw

PATCH 4/12 oeqa: tear down oeqa decorators if one of them raises an exception in setup

In reply to Steve Sakoman

From: Alexander Kanavin <[email protected]>

Some of the decorators need proper cleanup, such as OETimeout
which sets a signal handler that needs to be cleared via teardown. If this is not done then the signal gets called later with unpredictable effects.

This can be seen if there's a test that is skipped via a decorator and sets a timeout at the same time: the timeout isn't cleared, and is invoked later in a completely unrelated context. The test case for this is added in the next commit.

(cherry picked from commit f42a08e1aabf1ca57e0c09d69fb69cc717c7f156)
---
 meta/lib/oeqa/core/case.py                | 9 +++++++--
 meta/lib/oeqa/core/decorator/oetimeout.py | 5 +++--
 2 files changed, 10 insertions(+), 4 deletions(-)
meta/lib/oeqa/core/case.py +7 -2
index aae451fef2..bc4446a938 100644
@@ -43,8 +43,13 @@ class OETestCase(unittest.TestCase):
         clss.tearDownClassMethod()
 
     def _oeSetUp(self):
-        for d in self.decorators:
-            d.setUpDecorator()
+        try:
+            for d in self.decorators:
+                d.setUpDecorator()
+        except:
+            for d in self.decorators:
+                d.tearDownDecorator()
+            raise
         self.setUpMethod()
 
     def _oeTearDown(self):
meta/lib/oeqa/core/decorator/oetimeout.py +3 -2
index df90d1c798..5e6873ad48 100644
@@ -24,5 +24,6 @@ class OETimeout(OETestDecorator):
 
     def tearDownDecorator(self):
         signal.alarm(0)
-        signal.signal(signal.SIGALRM, self.alarmSignal)
-        self.logger.debug("Removed SIGALRM handler")
+        if hasattr(self, 'alarmSignal'):
+            signal.signal(signal.SIGALRM, self.alarmSignal)
+            self.logger.debug("Removed SIGALRM handler")
Signature · 1 line
2.25.1
#5 lore raw

PATCH 5/12 meta/lib/oeqa/core/tests/cases/timeout.py: add a testcase for the previous fix

In reply to Steve Sakoman

From: Alexander Kanavin <[email protected]>

This is the sequence that didn't properly operate:

- a test case that skips and isn't executed
- a second test case that is skipped via a dependency decorator, and sets a timeout
- a third test case that takes longer than the timeout from the second test case

Without the fix, the timeout is not cleared, and the third test case is erroneously aborted. With the fix, the timeout is cleared and the third test case is able to complete.

(cherry picked from commit 54ef07a9aa1af8f41cfb9a4802929c918efc43c8)
---
 meta/lib/oeqa/core/tests/cases/timeout.py   | 13 +++++++++++++
 meta/lib/oeqa/core/tests/test_decorators.py |  6 ++++++
 2 files changed, 19 insertions(+)
meta/lib/oeqa/core/tests/cases/timeout.py +13 -0
index 5dfecc7b7c..69cf969a67 100644
@@ -8,6 +8,7 @@ from time import sleep
 
 from oeqa.core.case import OETestCase
 from oeqa.core.decorator.oetimeout import OETimeout
+from oeqa.core.decorator.depends import OETestDepends
 
 class TimeoutTest(OETestCase):
 
@@ -19,3 +20,15 @@ class TimeoutTest(OETestCase):
     def testTimeoutFail(self):
         sleep(2)
         self.assertTrue(True, msg='How is this possible?')
+
+
+    def testTimeoutSkip(self):
+        self.skipTest("This test needs to be skipped, so that testTimeoutDepends()'s OETestDepends kicks in")
+
+    @OETestDepends(["timeout.TimeoutTest.testTimeoutSkip"])
+    @OETimeout(3)
+    def testTimeoutDepends(self):
+        self.assertTrue(False, msg='How is this possible?')
+
+    def testTimeoutUnrelated(self):
+        sleep(6)
meta/lib/oeqa/core/tests/test_decorators.py +6 -0
index b798bf7d33..5095f39948 100755
@@ -133,5 +133,11 @@ class TestTimeoutDecorator(TestBase):
         msg = "OETestTimeout didn't restore SIGALRM"
         self.assertIs(alarm_signal, signal.getsignal(signal.SIGALRM), msg=msg)
 
+    def test_timeout_cancel(self):
+        tests = ['timeout.TimeoutTest.testTimeoutSkip', 'timeout.TimeoutTest.testTimeoutDepends', 'timeout.TimeoutTest.testTimeoutUnrelated']
+        msg = 'Unrelated test failed to complete'
+        tc = self._testLoader(modules=self.modules, tests=tests)
+        self.assertTrue(tc.runTests().wasSuccessful(), msg=msg)
+
 if __name__ == '__main__':
     unittest.main()
Signature · 1 line
2.25.1
#6 lore raw

PATCH 6/12 go: update SRC_URI to use https protocol

In reply to Steve Sakoman

From: wangmy <[email protected]>

(cherry picked from commit 2a1eb731ed3bcb049192550e362b771c3a9ea6eb)
---
 meta/recipes-devtools/go/go-common.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/go/go-common.inc +1 -1
index f18d928c70..39a681a712 100644
@@ -14,7 +14,7 @@ LICENSE = "BSD-3-Clause"
 
 inherit goarch
 
-SRC_URI = "http://golang.org/dl/go${PV}.src.tar.gz;name=main"
+SRC_URI = "https://golang.org/dl/go${PV}.src.tar.gz;name=main"
 S = "${WORKDIR}/go"
 B = "${S}"
 UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.src\.tar"
Signature · 1 line
2.25.1
#7 lore raw

PATCH 7/12 go: Use dl.google.com for SRC_URI

In reply to Steve Sakoman

From: Khem Raj <[email protected]>

golang.org/dl is resolving to this anyway

(cherry picked from commit 8470e38ac1d9f9bb6d8a4ee43724af452d080057)
---
 meta/recipes-devtools/go/go-common.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/go/go-common.inc +1 -1
index 39a681a712..c368b95b69 100644
@@ -14,7 +14,7 @@ LICENSE = "BSD-3-Clause"
 
 inherit goarch
 
-SRC_URI = "https://golang.org/dl/go${PV}.src.tar.gz;name=main"
+SRC_URI = "https://dl.google.com/go/go${PV}.src.tar.gz;name=main"
 S = "${WORKDIR}/go"
 B = "${S}"
 UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.src\.tar"
Signature · 1 line
2.25.1
#8 lore raw

Re: [OE-core][dunfell 07/12] go: Use dl.google.com for SRC_URI

Quoted 28 lines · Steve Sakoman

From: Khem Raj <[email protected]>

golang.org/dl is resolving to this anyway

(cherry picked from commit 8470e38ac1d9f9bb6d8a4ee43724af452d080057)

---
 meta/recipes-devtools/go/go-common.inc | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/go/go-common.inc +0 -0
index 39a681a712..c368b95b69 100644
@@ -14,7 +14,7 @@ LICENSE = "BSD-3-Clause"

 inherit goarch

meta/recipes-devtools/go/go-common.inc +1 -1
-SRC_URI = "https://golang.org/dl/go${PV}.src.tar.gz;name=main"
+SRC_URI = "https://dl.google.com/go/go${PV}.src.tar.gz;name=main"
Quoted 3 lines

 S = "${WORKDIR}/go"
 B = "${S}"
 UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.src\.tar"

We are seeing autobuilder issues with some go downloads which we may want to resolve before merging this.

Cheers,

Richard

#9 lore raw

Re: [OE-core][dunfell 07/12] go: Use dl.google.com for SRC_URI

Quoted 28 lines · Richard Purdie
Quoted 26 lines · Steve Sakoman

From: Khem Raj <[email protected]>

golang.org/dl is resolving to this anyway

(cherry picked from commit 8470e38ac1d9f9bb6d8a4ee43724af452d080057)
---
 meta/recipes-devtools/go/go-common.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/go/go-common.inc +0 -0
index 39a681a712..c368b95b69 100644
@@ -14,7 +14,7 @@ LICENSE = "BSD-3-Clause"
 
 
 
 
 inherit goarch
 
 
Quoted 9 lines

meta/recipes-devtools/go/go-common.inc LICENSE = "BSD-3-Clause" · line 20

Quoted 5 lines
meta/recipes-devtools/go/go-common.inc +1 -1
-SRC_URI = "https://golang.org/dl/go${PV}.src.tar.gz;name=main"
+SRC_URI = "https://dl.google.com/go/go${PV}.src.tar.gz;name=main"
 S = "${WORKDIR}/go"
 B = "${S}"
 UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.src\.tar"

We are seeing autobuilder issues with some go downloads which we may want to resolve before merging this.

OK, haven't seen those with dunfell but will drop this patch from the pull request and monitor master for resolution.

Steve

#10 lore raw

Re: [OE-core][dunfell 07/12] go: Use dl.google.com for SRC_URI

Quoted 40 lines · Steve Sakoman
Quoted 28 lines · Richard Purdie
Quoted 26 lines · Steve Sakoman

From: Khem Raj <[email protected]>

golang.org/dl is resolving to this anyway

(cherry picked from commit 8470e38ac1d9f9bb6d8a4ee43724af452d080057)

---
 meta/recipes-devtools/go/go-common.inc | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/go/go-common.inc +0 -0
index 39a681a712..c368b95b69 100644
@@ -14,7 +14,7 @@ LICENSE = "BSD-3-Clause"
 
 
 
 

 inherit goarch

Quoted 9 lines
Quoted 5 lines
meta/recipes-devtools/go/go-common.inc +1 -1
-SRC_URI = "https://golang.org/dl/go${PV}.src.tar.gz;name=main"
+SRC_URI = "https://dl.google.com/go/go${PV}.src.tar.gz;name=main"

 S = "${WORKDIR}/go"
 B = "${S}"
 UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.src\.tar"

We are seeing autobuilder issues with some go downloads which we may want to resolve before merging this.

Quoted 2 lines

OK, haven't seen those with dunfell but will drop this patch from the pull request and monitor master for resolution.

It is this and the https change earlier in your series. It could just be some corrupt files in DL_DIR but I'd be happier we get this resolved there first.

Cheers,

Richard

#11 lore raw

Re: [OE-core][dunfell 07/12] go: Use dl.google.com for SRC_URI

Quoted 41 lines · Richard Purdie
Quoted 40 lines · Steve Sakoman
Quoted 37 lines · Richard Purdie
Quoted 21 lines · Steve Sakoman

From: Khem Raj <[email protected]>

golang.org/dl is resolving to this anyway

(cherry picked from commit 8470e38ac1d9f9bb6d8a4ee43724af452d080057)
---
  meta/recipes-devtools/go/go-common.inc | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/go/go-common.inc +0 -0
index 39a681a712..c368b95b69 100644
@@ -14,7 +14,7 @@ LICENSE = "BSD-3-Clause"
 
 
 
 

meta/recipes-devtools/go/go-common.inc LICENSE = "BSD-3-Clause" · line 20

Quoted 10 lines
meta/recipes-devtools/go/go-common.inc +1 -1
  inherit goarch
 
 
 
 
-SRC_URI = "https://golang.org/dl/go${PV}.src.tar.gz;name=main"
+SRC_URI = "https://dl.google.com/go/go${PV}.src.tar.gz;name=main"
  S = "${WORKDIR}/go"
  B = "${S}"
  UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.src\.tar"

We are seeing autobuilder issues with some go downloads which we may want to resolve before merging this.

Quoted 6 lines
Quoted 2 lines

OK, haven't seen those with dunfell but will drop this patch from the pull request and monitor master for resolution.

It is this and the https change earlier in your series. It could just be some corrupt files in DL_DIR but I'd be happier we get this resolved there first.

https change is still good, but this change perhaps is not required. for master/hardknott we will get it fixed once we cleanup downloads mirror.

Quoted 8 lines

Cheers,

Richard

#12 lore raw

PATCH 8/12 kernel.bbclass: Configuration for environment with HOSTCXX

In reply to Steve Sakoman

From: Zhang Qiang <[email protected]>

When compiling xilinx-zynq board linux-kernel-dev(v5.8) if "GCC_PLUGINS=y", The following error will appear:

"HOSTCXX -fPIC scripts/gcc-plugins/arm_ssp_per_task_plugin.o fatal error: gmp.h: No such file or directory"

the GCC_PLUGINS depend on return result of gcc-plugin.sh execution however in gcc-plugin.sh use HOSTCC to detect the feature of GNU extension of gcc, this will result that HOSTCC can compile the file successfully, but HOSTCXX is used in the actual compilation process.

---
 meta/classes/kernel.bbclass | 2 ++
 1 file changed, 2 insertions(+)
meta/classes/kernel.bbclass +2 -0
index 83a574efcd..22b1224d79 100644
@@ -194,6 +194,8 @@ UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}"
 KERNEL_EXTRA_ARGS ?= ""
 
 EXTRA_OEMAKE = " HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}""
+EXTRA_OEMAKE += " HOSTCXX="${BUILD_CXX} ${BUILD_CXXFLAGS} ${BUILD_LDFLAGS}""
+
 KERNEL_ALT_IMAGETYPE ??= ""
 
 copy_initramfs() {
Signature · 1 line
2.25.1
#13 lore raw

PATCH 9/12 yocto-check-layer: Avoid bug when iterating and autoadding dependencies

In reply to Steve Sakoman

From: Richard Purdie <[email protected]>

If iterating a layer with multiple components and auto-adding dependencies the tests can break since layers are never removed and order isn't guaranteed to account for that.

Fix this by resetting the layer list back to the original list each time before auto-adding the dependencies in each case.

This fixes scanning of meta-openembedded in particular where the sublayers may not be added in order of minimal dependency.

(cherry picked from commit bf1b467dacf345379cd5d84a1c9b3b0d844d5c91)
---
 scripts/yocto-check-layer | 3 +++
 1 file changed, 3 insertions(+)
scripts/yocto-check-layer +3 -0
index b7c83c8b54..deba3cb4f8 100755
@@ -138,6 +138,9 @@ def main():
                 layer['type'] == LayerType.ERROR_BSP_DISTRO:
             continue
 
+        # Reset to a clean backup copy for each run
+        shutil.copyfile(bblayersconf + '.backup', bblayersconf)
+
         if check_bblayers(bblayersconf, layer['path'], logger):
             logger.info("%s already in %s. To capture initial signatures, layer under test should not present "
                "in BBLAYERS. Please remove %s from BBLAYERS." % (layer['name'], bblayersconf, layer['name']))
Signature · 1 line
2.25.1
#14 lore raw

PATCH 10/12 linux-firmware: Package RSI 911x WiFi firmware

In reply to Steve Sakoman

From: Marek Vasut <[email protected]>

The RSI 911x WiFi firmware is already part of the linux-firmware repository, package it to make it easily available.

Cc Richard Purdie <[email protected]>
Cc Steve Sakoman <[email protected]>
(cherry picked from commit cc44b71f6ea68ca0f483d635df7dc7b9905b1593)
---
 .../linux-firmware/linux-firmware_20210208.bb         | 11 +++++++++++
 1 file changed, 11 insertions(+)
meta/recipes-kernel/linux-firmware/linux-firmware_20210208.bb +11 -0
index 78856cbf66..a751b92a2f 100644
@@ -229,6 +229,7 @@ PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
              ${PN}-sd8887 ${PN}-sd8897 ${PN}-sd8997 ${PN}-usb8997 \
              ${PN}-ti-connectivity-license ${PN}-wlcommon ${PN}-wl12xx ${PN}-wl18xx \
              ${PN}-vt6656-license ${PN}-vt6656 \
+             ${PN}-rs9113 ${PN}-rs9116 \
              ${PN}-rtl-license ${PN}-rtl8188 ${PN}-rtl8192cu ${PN}-rtl8192ce ${PN}-rtl8192su ${PN}-rtl8723 ${PN}-rtl8821 \
              ${PN}-rtl8168 \
              ${PN}-cypress-license \
@@ -529,6 +530,16 @@ RDEPENDS_${PN}-nvidia-gpu += "${PN}-nvidia-license"
 RDEPENDS_${PN}-nvidia-tegra += "${PN}-nvidia-license"
 RDEPENDS_${PN}-nvidia-tegra-k1 += "${PN}-nvidia-license"
 
+# For RSI RS911x WiFi
+LICENSE_${PN}-rs9113 = "WHENCE"
+LICENSE_${PN}-rs9116 = "WHENCE"
+
+FILES_${PN}-rs9113 = " ${nonarch_base_libdir}/firmware/rsi/rs9113*.rps "
+FILES_${PN}-rs9116 = " ${nonarch_base_libdir}/firmware/rsi/rs9116*.rps "
+
+RDEPENDS_${PN}-rs9113 += "${PN}-whence-license"
+RDEPENDS_${PN}-rs9116 += "${PN}-whence-license"
+
 # For rtl
 LICENSE_${PN}-rtl8188 = "Firmware-rtlwifi_firmware"
 LICENSE_${PN}-rtl8192cu = "Firmware-rtlwifi_firmware"
Signature · 1 line
2.25.1
#15 lore raw

PATCH 11/12 license_image.bbclass: Detect broken symlinks

In reply to Steve Sakoman

From: Reto Schneider <[email protected]>

Find and report symlinks which point to a non-existing file.

(cherry picked from commit 81809a1ffe67aade1b2ed66fe95044ffbf7d3df8)
---
 meta/classes/license_image.bbclass | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
meta/classes/license_image.bbclass +13 -2
index a69cc5f065..cfb0606da9 100644
@@ -1,3 +1,5 @@
+ROOTFS_LICENSE_DIR = "${IMAGE_ROOTFS}/usr/share/common-licenses"
+
 python write_package_manifest() {
     # Get list of installed packages
     license_image_dir = d.expand('${LICENSE_DIRECTORY}/${IMAGE_NAME}')
@@ -105,8 +107,7 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True):
     copy_lic_manifest = d.getVar('COPY_LIC_MANIFEST')
     copy_lic_dirs = d.getVar('COPY_LIC_DIRS')
     if rootfs and copy_lic_manifest == "1":
-        rootfs_license_dir = os.path.join(d.getVar('IMAGE_ROOTFS'), 
-                                'usr', 'share', 'common-licenses')
+        rootfs_license_dir = d.getVar('ROOTFS_LICENSE_DIR')
         bb.utils.mkdirhier(rootfs_license_dir)
         rootfs_license_manifest = os.path.join(rootfs_license_dir,
                 os.path.split(license_manifest)[1])
@@ -256,3 +257,13 @@ python do_populate_lic_deploy() {
 addtask populate_lic_deploy before do_build after do_image_complete
 do_populate_lic_deploy[recrdeptask] += "do_populate_lic do_deploy"
 
+python license_qa_dead_symlink() {
+    import os
+
+    for root, dirs, files in os.walk(d.getVar('ROOTFS_LICENSE_DIR')):
+        for file in files:
+            full_path = root + "/" + file
+            if os.path.islink(full_path) and not os.path.exists(full_path):
+                bb.error("broken symlink: " + full_path)
+}
+IMAGE_QA_COMMANDS += "license_qa_dead_symlink"
Signature · 1 line
2.25.1
#16 lore raw

PATCH 12/12 license_image.bbclass: Fix symlink to generic license files

In reply to Steve Sakoman

From: Reto Schneider <[email protected]>

Link to the canonical filename of a license as only this one exists.

Fixes commit 670fe71dd18ea675f35581db4a61fda137f8bf00 [license_image.bbclass: use canonical name for license files].

(cherry picked from commit 64b1ba978e079c345e1f7fbd1bf44052fc3dd857)
---
 meta/classes/license_image.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta/classes/license_image.bbclass +3 -2
index cfb0606da9..1396a95f47 100644
@@ -145,12 +145,13 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True):
                             continue
 
                         # Make sure we use only canonical name for the license file
-                        rootfs_license = os.path.join(rootfs_license_dir, "generic_%s" % generic_lic)
+                        generic_lic_file = "generic_%s" % generic_lic
+                        rootfs_license = os.path.join(rootfs_license_dir, generic_lic_file)
                         if not os.path.exists(rootfs_license):
                             oe.path.copyhardlink(pkg_license, rootfs_license)
 
                         if not os.path.exists(pkg_rootfs_license):
-                            os.symlink(os.path.join('..', lic), pkg_rootfs_license)
+                            os.symlink(os.path.join('..', generic_lic_file), pkg_rootfs_license)
                     else:
                         if (oe.license.license_ok(canonical_license(d,
                                 lic), bad_licenses) == False or
Signature · 1 line
2.25.1