[OE-core] [PATCH v2 1/2] license_image.bbclass: Detect broken symlinks

2021-04-26 Thread Reto Schneider
From: Reto Schneider 

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

Signed-off-by: Reto Schneider 
---
Version 2: No changes

 meta/classes/license_image.bbclass | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/meta/classes/license_image.bbclass 
b/meta/classes/license_image.bbclass
index c96b032ebd..b9a0f2359b 100644
--- a/meta/classes/license_image.bbclass
+++ b/meta/classes/license_image.bbclass
@@ -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}')
@@ -104,8 +106,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])
@@ -267,3 +268,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"
-- 
2.29.2


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#151022): 
https://lists.openembedded.org/g/openembedded-core/message/151022
Mute This Topic: https://lists.openembedded.org/mt/82389805/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH v2 2/2] license_image.bbclass: Fix symlink to generic license files

2021-04-26 Thread Reto Schneider
From: Reto Schneider 

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].

Signed-off-by: Reto Schneider 
---
Version 2: Fix link to commit

 meta/classes/license_image.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/classes/license_image.bbclass 
b/meta/classes/license_image.bbclass
index b9a0f2359b..73cebb4d55 100644
--- a/meta/classes/license_image.bbclass
+++ b/meta/classes/license_image.bbclass
@@ -144,12 +144,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
-- 
2.29.2


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#151021): 
https://lists.openembedded.org/g/openembedded-core/message/151021
Mute This Topic: https://lists.openembedded.org/mt/82389804/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH 1/2] license_image.bbclass: Detect broken symlinks

2021-04-26 Thread Reto Schneider
From: Reto Schneider 

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

Signed-off-by: Reto Schneider 
---
 meta/classes/license_image.bbclass | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/meta/classes/license_image.bbclass 
b/meta/classes/license_image.bbclass
index c96b032ebd..b9a0f2359b 100644
--- a/meta/classes/license_image.bbclass
+++ b/meta/classes/license_image.bbclass
@@ -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}')
@@ -104,8 +106,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])
@@ -267,3 +268,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"
-- 
2.29.2


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#151019): 
https://lists.openembedded.org/g/openembedded-core/message/151019
Mute This Topic: https://lists.openembedded.org/mt/8236/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH 2/2] license_image.bbclass: Fix symlink to generic license files

2021-04-26 Thread Reto Schneider
From: Reto Schneider 

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

Fixes commit 70fe71dd18ea675f35581db4a61fda137f8bf
[license_image.bbclass: use canonical name for license files].

Signed-off-by: Reto Schneider 
---
 meta/classes/license_image.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/classes/license_image.bbclass 
b/meta/classes/license_image.bbclass
index b9a0f2359b..73cebb4d55 100644
--- a/meta/classes/license_image.bbclass
+++ b/meta/classes/license_image.bbclass
@@ -144,12 +144,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
-- 
2.29.2


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#151020): 
https://lists.openembedded.org/g/openembedded-core/message/151020
Mute This Topic: https://lists.openembedded.org/mt/8237/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] cve-check: How to convert to JUnit?

2019-03-06 Thread Reto Schneider
Hi

I would like to convert the files generated by the cve-check class to
the JUnit format so that I can use the findings in my CI (Bamboo).

Does anyone know a tool which does it?

Kind regards,
Reto



0x9D090A915B7B8BD1.asc
Description: application/pgp-keys


0x9D090A915B7B8BD1.asc
Description: application/pgp-keys
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] kernel-uimage.bbclass: Dependency on u-boot-mkimage-native for all uImages

2018-09-18 Thread Reto Schneider
From: Reto Schneider 

u-boot-mkimage-native is needed to build any type of uImages, be it
the uImage target itself or for example uImage.lzma. The dependency
however gets only added when at least one of KERNEL_IMAGETYPE and
KERNEL_ALT_IMAGETYPE is exactly uImage. Building uImage.bin and uImage.lzma is
not possible this way.

This patch adds a dependency to u-boot-mkimage-native for all imagetypes which
contains the string uImage.

Signed-off-by: Reto Schneider 
---
 meta/classes/kernel-uimage.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/kernel-uimage.bbclass 
b/meta/classes/kernel-uimage.bbclass
index 1d8656e76e..c2de6bb40d 100644
--- a/meta/classes/kernel-uimage.bbclass
+++ b/meta/classes/kernel-uimage.bbclass
@@ -1,7 +1,7 @@
 inherit kernel-uboot
 
 python __anonymous () {
-if "uImage" in (d.getVar('KERNEL_IMAGETYPES') or "").split():
+if "uImage" in d.getVar('KERNEL_IMAGETYPES'):
 depends = d.getVar("DEPENDS")
 depends = "%s u-boot-mkimage-native" % depends
 d.setVar("DEPENDS", depends)
-- 
2.11.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core