Patch review
cover Patch review
Please review this set of patches for kirkstone and have comments back by end of day Thursday.
Passed a-full on autobuilder:
https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/3811
The following changes since commit b2d10487f80deb04a0893325a1ae79c8629a7655:
liberror-perl: Update sstate/equiv versions to clean cache (2022-06-17 05:02:15 -1000)
are available in the Git repository at:
git://git.openembedded.org/openembedded-core-contrib stable/kirkstone-nut
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=stable/kirkstone-nut
Alexander Kanavin (1):
python3: use built-in distutils for ptest, rather than setuptools'
'fork'
Davide Gardenal (1):
efivar: add musl libc compatibility
Dmitry Baryshkov (2):
linux-firmware: add support for building snapshots
linux-firmware: upgrade 20220509 -> 20220610
Marta Rybczynska (2):
cve-check: add support for Ignored CVEs oeqa/selftest/cve_check: add tests for Ignored and partial reports
Martin Jansa (1):
mesa: backport a patch to support compositors without
zwp_linux_dmabuf_v1 again
Michael Opdenacker (1):
rootfs-postcommands.bbclass: correct comments
Nick Potenski (1):
systemd: systemd-systemctl: Support instance conf files during enable
Paulo Neves (2):
python: Avoid shebang overflow on python-config.py
gtk-doc: Fix potential shebang overflow on gtkdoc-mkhtml2
Richard Purdie (2):
python3: Remove problematic paths from sysroot files
python3: Ensure stale empty python module directories don't break the
build
meta/classes/cve-check.bbclass | 43 ++--
meta/classes/rootfs-postcommands.bbclass | 8 +-
meta/lib/oeqa/selftest/cases/cve_check.py | 82 ++++++++
.../efisecdb-fix-build-with-musl-libc.patch | 184 ++++++++++++++++++
meta/recipes-bsp/efivar/efivar_38.bb | 3 +-
.../systemd/systemd-systemctl/systemctl | 14 +-
...shebang-overflow-on-python-config.py.patch | 33 ++++
.../python3/deterministic_imports.patch | 32 +++
.../recipes-devtools/python/python3/run-ptest | 2 +-
.../recipes-devtools/python/python3_3.10.4.bb | 12 +-
meta/recipes-gnome/gtk-doc/gtk-doc_1.33.2.bb | 1 +
...nd-deprecate-drm_handle_format-and-d.patch | 158 +++++++++++++++
meta/recipes-graphics/mesa/mesa.inc | 1 +
...01-Makefile-replace-mkdir-by-install.patch | 84 --------
...20220509.bb => linux-firmware_20220610.bb} | 11 +-
15 files changed, 555 insertions(+), 113 deletions(-)
create mode 100644 meta/recipes-bsp/efivar/efivar/efisecdb-fix-build-with-musl-libc.patch
create mode 100644 meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch
create mode 100644 meta/recipes-devtools/python/python3/deterministic_imports.patch
create mode 100644 meta/recipes-graphics/mesa/files/0001-Revert-egl-wayland-deprecate-drm_handle_format-and-d.patch
delete mode 100644 meta/recipes-kernel/linux-firmware/files/0001-Makefile-replace-mkdir-by-install.patch
rename meta/recipes-kernel/linux-firmware/{linux-firmware_20220509.bb => linux-firmware_20220610.bb} (99%)Signature · 1 line
2.25.1
PATCH 1/13 cve-check: add support for Ignored CVEs
From: Marta Rybczynska <[email protected]>
Ignored CVEs aren't patched, but do not apply in our configuration for some reason. Up till now they were only partially supported and reported as "Patched".
This patch adds separate reporting of Ignored CVEs. The variable CVE_CHECK_REPORT_PATCHED now manages reporting of both patched and ignored CVEs.
--- meta/classes/cve-check.bbclass | 43 ++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 13 deletions(-)
meta/classes/cve-check.bbclass +30 -13
@@ -47,7 +47,9 @@ CVE_CHECK_MANIFEST_JSON ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX CVE_CHECK_COPY_FILES ??= "1" CVE_CHECK_CREATE_MANIFEST ??= "1" +# Report Patched or Ignored CVEs CVE_CHECK_REPORT_PATCHED ??= "1" + CVE_CHECK_SHOW_WARNINGS ??= "1" # Provide text output
@@ -144,7 +146,7 @@ python do_cve_check () { bb.fatal("Failure in searching patches") ignored, patched, unpatched, status = check_cves(d, patched_cves) if patched or unpatched or (d.getVar("CVE_CHECK_COVERAGE") == "1" and status): - cve_data = get_cve_info(d, patched + unpatched) + cve_data = get_cve_info(d, patched + unpatched + ignored) cve_write_data(d, patched, unpatched, ignored, cve_data, status) else: bb.note("No CVE database found, skipping CVE check")
@@ -258,6 +260,7 @@ def check_cves(d, patched_cves): suffix = d.getVar("CVE_VERSION_SUFFIX") cves_unpatched = [] + cves_ignored = [] cves_status = [] cves_in_recipe = False # CVE_PRODUCT can contain more than one product (eg. curl/libcurl)
@@ -291,9 +294,8 @@ def check_cves(d, patched_cves): cve = cverow[0] if cve in cve_ignore: - bb.note("%s-%s has been ignored for %s" % (product, pv, cve)) - # TODO: this should be in the report as 'ignored' - patched_cves.add(cve) + bb.note("%s-%s ignores %s" % (product, pv, cve)) + cves_ignored.append(cve) continue elif cve in patched_cves: bb.note("%s has been patched" % (cve))
@@ -305,9 +307,13 @@ def check_cves(d, patched_cves): cves_in_recipe = True vulnerable = False + ignored = False + for row in conn.execute("SELECT * FROM PRODUCTS WHERE ID IS ? AND PRODUCT IS ? AND VENDOR LIKE ?", (cve, product, vendor)): (_, _, _, version_start, operator_start, version_end, operator_end) = row #bb.debug(2, "Evaluating row " + str(row)) + if cve in cve_ignore: + ignored = True if (operator_start == '=' and pv == version_start) or version_start == '-': vulnerable = True
@@ -340,13 +346,16 @@ def check_cves(d, patched_cves): vulnerable = vulnerable_start or vulnerable_end if vulnerable: - bb.note("%s-%s is vulnerable to %s" % (pn, real_pv, cve)) - cves_unpatched.append(cve) + if ignored: + bb.note("%s is ignored in %s-%s" % (cve, pn, real_pv)) + cves_ignored.append(cve) + else: + bb.note("%s-%s is vulnerable to %s" % (pn, real_pv, cve)) + cves_unpatched.append(cve) break if not vulnerable: bb.note("%s-%s is not vulnerable to %s" % (pn, real_pv, cve)) - # TODO: not patched but not vulnerable patched_cves.add(cve) if not cves_in_product:
@@ -358,7 +367,7 @@ def check_cves(d, patched_cves): if not cves_in_recipe: bb.note("No CVE records for products in recipe %s" % (pn)) - return (list(cve_ignore), list(patched_cves), cves_unpatched, cves_status) + return (list(cves_ignored), list(patched_cves), cves_unpatched, cves_status) def get_cve_info(d, cves): """
@@ -396,6 +405,8 @@ def cve_write_data_text(d, patched, unpatched, ignored, cve_data): include_layers = d.getVar("CVE_CHECK_LAYER_INCLUDELIST").split() exclude_layers = d.getVar("CVE_CHECK_LAYER_EXCLUDELIST").split() + report_all = d.getVar("CVE_CHECK_REPORT_PATCHED") == "1" + if exclude_layers and layer in exclude_layers: return
@@ -403,7 +414,7 @@ def cve_write_data_text(d, patched, unpatched, ignored, cve_data): return # Early exit, the text format does not report packages without CVEs - if not patched+unpatched: + if not patched+unpatched+ignored: return nvd_link = "https://nvd.nist.gov/vuln/detail/"
@@ -413,13 +424,16 @@ def cve_write_data_text(d, patched, unpatched, ignored, cve_data): for cve in sorted(cve_data): is_patched = cve in patched - if is_patched and (d.getVar("CVE_CHECK_REPORT_PATCHED") != "1"): + is_ignored = cve in ignored + + if (is_patched or is_ignored) and not report_all: continue + write_string += "LAYER: %s\n" % layer write_string += "PACKAGE NAME: %s\n" % d.getVar("PN") write_string += "PACKAGE VERSION: %s%s\n" % (d.getVar("EXTENDPE"), d.getVar("PV")) write_string += "CVE: %s\n" % cve - if cve in ignored: + if is_ignored: write_string += "CVE STATUS: Ignored\n" elif is_patched: write_string += "CVE STATUS: Patched\n"
@@ -496,6 +510,8 @@ def cve_write_data_json(d, patched, unpatched, ignored, cve_data, cve_status): include_layers = d.getVar("CVE_CHECK_LAYER_INCLUDELIST").split() exclude_layers = d.getVar("CVE_CHECK_LAYER_EXCLUDELIST").split() + report_all = d.getVar("CVE_CHECK_REPORT_PATCHED") == "1" + if exclude_layers and layer in exclude_layers: return
@@ -522,10 +538,11 @@ def cve_write_data_json(d, patched, unpatched, ignored, cve_data, cve_status): for cve in sorted(cve_data): is_patched = cve in patched + is_ignored = cve in ignored status = "Unpatched" - if is_patched and (d.getVar("CVE_CHECK_REPORT_PATCHED") != "1"): + if (is_patched or is_ignored) and not report_all: continue - if cve in ignored: + if is_ignored: status = "Ignored" elif is_patched: status = "Patched"
Signature · 1 line
2.25.1
PATCH 2/13 oeqa/selftest/cve_check: add tests for Ignored and partial reports
In reply to Steve SakomanFrom: Marta Rybczynska <[email protected]>
Add testcases for partial reports with CVE_CHECK_REPORT_PATCHED and Ignored CVEs.
--- meta/lib/oeqa/selftest/cases/cve_check.py | 82 +++++++++++++++++++++++ 1 file changed, 82 insertions(+)
meta/lib/oeqa/selftest/cases/cve_check.py +82 -0
@@ -117,3 +117,85 @@ CVE_CHECK_FORMAT_JSON = "1" self.assertEqual(report["version"], "1") self.assertEqual(len(report["package"]), 1) self.assertEqual(report["package"][0]["name"], recipename) + + + def test_recipe_report_json_unpatched(self): + config = """ +INHERIT += "cve-check" +CVE_CHECK_FORMAT_JSON = "1" +CVE_CHECK_REPORT_PATCHED = "0" +""" + self.write_config(config) + + vars = get_bb_vars(["CVE_CHECK_SUMMARY_DIR", "CVE_CHECK_SUMMARY_FILE_NAME_JSON"]) + summary_json = os.path.join(vars["CVE_CHECK_SUMMARY_DIR"], vars["CVE_CHECK_SUMMARY_FILE_NAME_JSON"]) + recipe_json = os.path.join(vars["CVE_CHECK_SUMMARY_DIR"], "m4-native_cve.json") + + try: + os.remove(summary_json) + os.remove(recipe_json) + except FileNotFoundError: + pass + + bitbake("m4-native -c cve_check") + + def check_m4_json(filename): + with open(filename) as f: + report = json.load(f) + self.assertEqual(report["version"], "1") + self.assertEqual(len(report["package"]), 1) + package = report["package"][0] + self.assertEqual(package["name"], "m4-native") + #m4 had only Patched CVEs, so the issues array will be empty + self.assertEqual(package["issue"], []) + + self.assertExists(summary_json) + check_m4_json(summary_json) + self.assertExists(recipe_json) + check_m4_json(recipe_json) + + + def test_recipe_report_json_ignored(self): + config = """ +INHERIT += "cve-check" +CVE_CHECK_FORMAT_JSON = "1" +CVE_CHECK_REPORT_PATCHED = "1" +""" + self.write_config(config) + + vars = get_bb_vars(["CVE_CHECK_SUMMARY_DIR", "CVE_CHECK_SUMMARY_FILE_NAME_JSON"]) + summary_json = os.path.join(vars["CVE_CHECK_SUMMARY_DIR"], vars["CVE_CHECK_SUMMARY_FILE_NAME_JSON"]) + recipe_json = os.path.join(vars["CVE_CHECK_SUMMARY_DIR"], "logrotate_cve.json") + + try: + os.remove(summary_json) + os.remove(recipe_json) + except FileNotFoundError: + pass + + bitbake("logrotate -c cve_check") + + def check_m4_json(filename): + with open(filename) as f: + report = json.load(f) + self.assertEqual(report["version"], "1") + self.assertEqual(len(report["package"]), 1) + package = report["package"][0] + self.assertEqual(package["name"], "logrotate") + found_cves = { issue["id"]: issue["status"] for issue in package["issue"]} + # m4 CVE should not be in logrotate + self.assertNotIn("CVE-2008-1687", found_cves) + # logrotate has both Patched and Ignored CVEs + self.assertIn("CVE-2011-1098", found_cves) + self.assertEqual(found_cves["CVE-2011-1098"], "Patched") + self.assertIn("CVE-2011-1548", found_cves) + self.assertEqual(found_cves["CVE-2011-1548"], "Ignored") + self.assertIn("CVE-2011-1549", found_cves) + self.assertEqual(found_cves["CVE-2011-1549"], "Ignored") + self.assertIn("CVE-2011-1550", found_cves) + self.assertEqual(found_cves["CVE-2011-1550"], "Ignored") + + self.assertExists(summary_json) + check_m4_json(summary_json) + self.assertExists(recipe_json) + check_m4_json(recipe_json)
Signature · 1 line
2.25.1
PATCH 3/13 linux-firmware: add support for building snapshots
In reply to Steve SakomanFrom: Dmitry Baryshkov <[email protected]>
In some cases it is useful to be able to test the snapshot of linux-firmware (e.g. to test if the updated firmware works on the particular hardware). Allow building the linux-firmware snapshots.
To switch to the most recent branch, add the following lines to the local.conf file:
PREFERRED_VERSION_linux-firmware = "1:20220509+git%" SRCREV:class-devupstream = "${AUTOREV}" WHENCE_CHKSUM:class-devupstream:pn-linux-firmware = "4288aad55d189fa225d492526b8406d5"
--- .../linux-firmware/linux-firmware_20220509.bb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
meta/recipes-kernel/linux-firmware/linux-firmware_20220509.bb +7 -1
@@ -69,6 +69,7 @@ LICENSE = "\ & WHENCE \ " +WHENCE_CHKSUM = "d3eb82686904888f8bbbe8d865371404" LIC_FILES_CHKSUM = "file://LICENCE.Abilis;md5=b5ee3f410780e56711ad48eadc22b8bc \ file://LICENCE.adsp_sst;md5=615c45b91a5a4a9fe046d6ab9a2df728 \ file://LICENCE.agere;md5=af0133de6b4a9b2522defd5f188afd31 \
@@ -132,7 +133,7 @@ LIC_FILES_CHKSUM = "file://LICENCE.Abilis;md5=b5ee3f410780e56711ad48eadc22b8bc \ file://LICENCE.xc4000;md5=0ff51d2dc49fce04814c9155081092f0 \ file://LICENCE.xc5000;md5=1e170c13175323c32c7f4d0998d53f66 \ file://LICENCE.xc5000c;md5=12b02efa3049db65d524aeb418dd87ca \ - file://WHENCE;md5=d3eb82686904888f8bbbe8d865371404 \ + file://WHENCE;md5=${WHENCE_CHKSUM} \ " # These are not common licenses, set NO_GENERIC_LICENSE for them
@@ -208,6 +209,11 @@ SRC_URI = "\ file://0001-Makefile-replace-mkdir-by-install.patch \ " +BBCLASSEXTEND = "devupstream:target" +SRC_URI:class-devupstream = "git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git;protocol=https;branch=main" +# Pin this to the 20220509 release, override this in local.conf +SRCREV:class-devupstream ?= "b19cbdca78ab2adfd210c91be15a22568e8b8cae" + SRC_URI[sha256sum] = "376e0b3d7b4f8aaa2abf7f5ab74803dcf14b06b94e3d841b1467cd9a2848255e" inherit allarch
Signature · 1 line
2.25.1
PATCH 4/13 linux-firmware: upgrade 20220509 -> 20220610
In reply to Steve SakomanFrom: Dmitry Baryshkov <[email protected]>
Drop 0001-Makefile-replace-mkdir-by-install.patch merged upstream.
License-Update: additional files
---
...01-Makefile-replace-mkdir-by-install.patch | 84 -------------------
...20220509.bb => linux-firmware_20220610.bb} | 5 +-
2 files changed, 2 insertions(+), 87 deletions(-)
delete mode 100644 meta/recipes-kernel/linux-firmware/files/0001-Makefile-replace-mkdir-by-install.patch
rename meta/recipes-kernel/linux-firmware/{linux-firmware_20220509.bb => linux-firmware_20220610.bb} (99%)meta/recipes-kernel/linux-firmware/files/0001-Makefile-replace-mkdir-by-install.patch deleted +0 -84
@@ -1,84 +0,0 @@ -From 71514e74f35f2b51ca24062573d6d913525b30db Mon Sep 17 00:00:00 2001 -From: Konrad Weihmann <[email protected]> -Date: Mon, 9 May 2022 12:57:57 +0200 -Subject: [PATCH] Makefile: replace mkdir by install - -mkdir -p creates paths that are bound to user's settings and therefore -can lead to different file mode bits of the base paths accross different -machines. -Use install instead, as this tool is not prone to such behavior. - -Signed-off-by: Konrad Weihmann <[email protected]> -Upstream-Status: Submitted [https://lore.kernel.org/linux-firmware/PR2PR09MB310088EA719E6D7CA5C268F1A8C69@PR2PR09MB3100.eurprd09.prod.outlook.com/] ---- - Makefile | 2 +- - carl9170fw/toolchain/Makefile | 4 ++-- - copy-firmware.sh | 6 +++--- - 3 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/Makefile b/Makefile -index e1c362f..83a0ec6 100644 ---- a/Makefile -+++ b/Makefile -@@ -9,5 +9,5 @@ check: - @./check_whence.py - - install: -- mkdir -p $(DESTDIR)$(FIRMWAREDIR) -+ install -d $(DESTDIR)$(FIRMWAREDIR) - ./copy-firmware.sh $(DESTDIR)$(FIRMWAREDIR) -diff --git a/carl9170fw/toolchain/Makefile b/carl9170fw/toolchain/Makefile -index 2b25ffe..aaea8e8 100644 ---- a/carl9170fw/toolchain/Makefile -+++ b/carl9170fw/toolchain/Makefile -@@ -46,14 +46,14 @@ src/gcc-$(GCC_VER): src/$(GCC_TAR) src/newlib-$(NEWLIB_VER) - ln -s $(BASEDIR)/src/newlib-$(NEWLIB_VER)/libgloss $@ - - binutils: src/binutils-$(BINUTILS_VER) -- mkdir -p build/binutils -+ install -d build/binutils - cd build/binutils; \ - $(BASEDIR)/$</configure --target=sh-elf --prefix=$(BASEDIR)/inst; \ - $(MAKE) -j3; \ - $(MAKE) install - - gcc: src/gcc-$(GCC_VER) binutils -- mkdir -p build/gcc -+ install -d build/gcc - cd build/gcc; \ - $(BASEDIR)/$</configure --target=sh-elf --prefix=$(BASEDIR)/inst -enable-languages=c --without-pkgversion --with-newlib; \ - $(MAKE) -j3; \ -diff --git a/copy-firmware.sh b/copy-firmware.sh -index 9b46b63..bbacb92 100755 ---- a/copy-firmware.sh -+++ b/copy-firmware.sh -@@ -34,7 +34,7 @@ done - grep '^File:' WHENCE | sed -e's/^File: *//g' -e's/"//g' | while read f; do - test -f "$f" || continue - $verbose "copying file $f" -- mkdir -p $destdir/$(dirname "$f") -+ install -d $destdir/$(dirname "$f") - cp -d "$f" $destdir/"$f" - done - -@@ -42,7 +42,7 @@ grep -E '^Link:' WHENCE | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; d - if test -L "$f"; then - test -f "$destdir/$f" && continue - $verbose "copying link $f" -- mkdir -p $destdir/$(dirname "$f") -+ install -d $destdir/$(dirname "$f") - cp -d "$f" $destdir/"$f" - - if test "x$d" != "x"; then -@@ -63,7 +63,7 @@ grep -E '^Link:' WHENCE | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; d - fi - else - $verbose "creating link $f -> $d" -- mkdir -p $destdir/$(dirname "$f") -+ install -d $destdir/$(dirname "$f") - ln -sf "$d" "$destdir/$f" - fi - done --- -2.25.1 -
meta/recipes-kernel/linux-firmware/linux-firmware_20220610.bb renamed from meta/recipes-kernel/linux-firmware/linux-firmware_20220509.bb +2 -3
@@ -69,7 +69,7 @@ LICENSE = "\ & WHENCE \ " -WHENCE_CHKSUM = "d3eb82686904888f8bbbe8d865371404" +WHENCE_CHKSUM = "385947b278a6646ae4c3d39ba8c9b1bb" LIC_FILES_CHKSUM = "file://LICENCE.Abilis;md5=b5ee3f410780e56711ad48eadc22b8bc \ file://LICENCE.adsp_sst;md5=615c45b91a5a4a9fe046d6ab9a2df728 \ file://LICENCE.agere;md5=af0133de6b4a9b2522defd5f188afd31 \
@@ -206,7 +206,6 @@ PE = "1" SRC_URI = "\ ${KERNELORG_MIRROR}/linux/kernel/firmware/${BPN}-${PV}.tar.xz \ - file://0001-Makefile-replace-mkdir-by-install.patch \ " BBCLASSEXTEND = "devupstream:target"
@@ -214,7 +213,7 @@ SRC_URI:class-devupstream = "git://git.kernel.org/pub/scm/linux/kernel/git/firmw # Pin this to the 20220509 release, override this in local.conf SRCREV:class-devupstream ?= "b19cbdca78ab2adfd210c91be15a22568e8b8cae" -SRC_URI[sha256sum] = "376e0b3d7b4f8aaa2abf7f5ab74803dcf14b06b94e3d841b1467cd9a2848255e" +SRC_URI[sha256sum] = "faf3aedf89530e61f4fa1e8c7303dead9127cc24416945647797d079feb12837" inherit allarch
Signature · 1 line
2.25.1
PATCH 5/13 python3: use built-in distutils for ptest, rather than setuptools' 'fork'
In reply to Steve SakomanFrom: Alexander Kanavin <[email protected]>
The setuptools version is now used by default when setuptools is installed, but it is incompatible with some of python's own tests.
--- meta/recipes-devtools/python/python3/run-ptest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/python/python3/run-ptest +1 -1
@@ -1,3 +1,3 @@ #!/bin/sh -python3 -m test -v | sed -u -e '/\.\.\. ok/ s/^/PASS: /g' -r -e '/\.\.\. (ERROR|FAIL)/ s/^/FAIL: /g' -e '/\.\.\. skipped/ s/^/SKIP: /g' -e 's/ \.\.\. ok//g' -e 's/ \.\.\. ERROR//g' -e 's/ \.\.\. FAIL//g' -e 's/ \.\.\. skipped//g' +SETUPTOOLS_USE_DISTUTILS=nonlocal python3 -m test -v | sed -u -e '/\.\.\. ok/ s/^/PASS: /g' -r -e '/\.\.\. (ERROR|FAIL)/ s/^/FAIL: /g' -e '/\.\.\. skipped/ s/^/SKIP: /g' -e 's/ \.\.\. ok//g' -e 's/ \.\.\. ERROR//g' -e 's/ \.\.\. FAIL//g' -e 's/ \.\.\. skipped//g'
Signature · 1 line
2.25.1
PATCH 6/13 python3: Remove problematic paths from sysroot files
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
In the native sysroot we should never have paths to the python3-native build directory. These may or may not exist at the time some dependency is building and nothing should rely upon them.
I suspect nothing is relying on this at the moment but clean up just to be sure.
The various config copies are adjusted to be modified consistently as some copies were and some were not. The Makefile has the "bad" ${B} paths replaced with a dummy placeholder too.
--- meta/recipes-devtools/python/python3_3.10.4.bb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
meta/recipes-devtools/python/python3_3.10.4.bb +7 -3
@@ -165,6 +165,9 @@ do_install:append:class-native() { # tarballs and sysroot creation. find ${D} -name *.pyc -delete + # Nothing should be looking into ${B} for python3-native + sed -i -e 's:${B}:/build/path/unavailable/:g' \ + ${D}/${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}${PYTHON_ABI}*/Makefile } do_install:append() {
@@ -175,15 +178,16 @@ do_install:append() { mkdir -p ${D}${libdir}/python-sysconfigdata sysconfigfile=`find ${D} -name _sysconfig*.py` - cp $sysconfigfile ${D}${libdir}/python-sysconfigdata/_sysconfigdata.py - sed -i \ -e "s,^ 'LIBDIR'.*, 'LIBDIR': '${STAGING_LIBDIR}'\,,g" \ -e "s,^ 'INCLUDEDIR'.*, 'INCLUDEDIR': '${STAGING_INCDIR}'\,,g" \ -e "s,^ 'CONFINCLUDEDIR'.*, 'CONFINCLUDEDIR': '${STAGING_INCDIR}'\,,g" \ -e "/^ 'INCLDIRSTOMAKE'/{N; s,/usr/include,${STAGING_INCDIR},g}" \ -e "/^ 'INCLUDEPY'/s,/usr/include,${STAGING_INCDIR},g" \ - ${D}${libdir}/python-sysconfigdata/_sysconfigdata.py + -e "s,${B},/build/path/unavailable/,g" \ + $sysconfigfile + cp $sysconfigfile ${D}${libdir}/python-sysconfigdata/_sysconfigdata.py + # Unfortunately the following pyc files are non-deterministc due to 'frozenset' # being written without strict ordering, even with PYTHONHASHSEED = 0
Signature · 1 line
2.25.1
PATCH 7/13 python3: Ensure stale empty python module directories don't break the build
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
There are two issues inside importlib. Firstly, the modules are accessed in on disk order. This means behaviour seen on one system might not reproduce on another and is a real headache.
Secondly, empty directories left behind by previous modules might be looked at. This has caused a long string of different issues for us.
As a result, patch this to a behaviour which works for us. Upstream discussion can follow later, this is breaking builds for too many people to leave unpatched.
[YOCTO #14816]
--- .../python3/deterministic_imports.patch | 32 +++++++++++++++++++ .../recipes-devtools/python/python3_3.10.4.bb | 1 + 2 files changed, 33 insertions(+) create mode 100644 meta/recipes-devtools/python/python3/deterministic_imports.patch
meta/recipes-devtools/python/python3/deterministic_imports.patch new file +32 -0
@@ -0,0 +1,32 @@ +There are two issues here. Firstly, the modules are accessed in on disk order. This +means behaviour seen on one system might not reproduce on another and is a real headache. + +Secondly, empty directories left behind by previous modules might be looked at. This +has caused a long string of different issues for us. + +As a result, patch this to a behaviour which works for us. + +Upstream-Status: Pending [need to talk to upstream to see if they'll take one or both fixes] +Signed-off-by: Richard Purdie <[email protected]> + + +Index: Python-3.10.4/Lib/importlib/metadata/__init__.py +=================================================================== +--- Python-3.10.4.orig/Lib/importlib/metadata/__init__.py ++++ Python-3.10.4/Lib/importlib/metadata/__init__.py +@@ -819,7 +819,14 @@ class Lookup: + self.infos = FreezableDefaultDict(list) + self.eggs = FreezableDefaultDict(list) + +- for child in path.children(): ++ for child in sorted(path.children()): ++ childpath = pathlib.Path(path.root, child) ++ try: ++ if childpath.is_dir() and not any(childpath.iterdir()): ++ # Empty directories aren't interesting ++ continue ++ except PermissionError: ++ continue + low = child.lower() + if low.endswith((".dist-info", ".egg-info")): + # rpartition is faster than splitext and suitable for this purpose.
meta/recipes-devtools/python/python3_3.10.4.bb +1 -0
@@ -33,6 +33,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ file://0001-sysconfig.py-use-platlibdir-also-for-purelib.patch \ file://0001-Lib-pty.py-handle-stdin-I-O-errors-same-way-as-maste.patch \ file://0001-setup.py-Do-not-detect-multiarch-paths-when-cross-co.patch \ + file://deterministic_imports.patch \ " SRC_URI:append:class-native = " \
Signature · 1 line
2.25.1
PATCH 8/13 python: Avoid shebang overflow on python-config.py
In reply to Steve SakomanFrom: Paulo Neves <[email protected]>
The native path may be too big, leading to shebang overflow. Just use the #!/usr/bin/env python3.
--- ...shebang-overflow-on-python-config.py.patch | 33 +++++++++++++++++++ .../recipes-devtools/python/python3_3.10.4.bb | 1 + 2 files changed, 34 insertions(+) create mode 100644 meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch
meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch new file +33 -0
@@ -0,0 +1,33 @@ +From f0c9dec63d452a7cd1e15ea653f4aced281f021c Mon Sep 17 00:00:00 2001 +From: Paulo Neves <[email protected]> +Date: Tue, 7 Jun 2022 16:16:41 +0200 +Subject: [PATCH 1/1] Avoid shebang overflow on python-config.py + +The whole native path may be too big, leading to shebang +overflow. Let's just use the env shebang. + +Denial reason: [1] + +Upstream-Status: Denied [distribution] + +[1] https://github.com/python/cpython/pull/93760#pullrequestreview-1005365737 +--- + Makefile.pre.in | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index f0aedb76cb58999427804255da56fa53284d7032..dd88e43114730f7681715777cc76dabb31113176 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1638,6 +1638,8 @@ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh + @ # Substitution happens here, as the completely-expanded BINDIR + @ # is not available in configure + sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py ++ @ # Otherwise we might get huge shebangs with native paths ++ sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' python-config.py + @ # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR} + LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config + @ # In OpenEmbedded, always use the python version of the script, the shell +-- +2.25.1 +
meta/recipes-devtools/python/python3_3.10.4.bb +1 -0
@@ -34,6 +34,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ file://0001-Lib-pty.py-handle-stdin-I-O-errors-same-way-as-maste.patch \ file://0001-setup.py-Do-not-detect-multiarch-paths-when-cross-co.patch \ file://deterministic_imports.patch \ + file://0001-Avoid-shebang-overflow-on-python-config.py.patch \ " SRC_URI:append:class-native = " \
Signature · 1 line
2.25.1
PATCH 9/13 efivar: add musl libc compatibility
In reply to Steve SakomanFrom: Davide Gardenal <[email protected]>
Backport patch to get efivar working with musl.
Upstream issue:
https://github.com/rhboot/efivar/issues/202
After commit meta-oe/1582f81805ee3114bc1a44bd5cf52d21f96702ca fwupd gives an error when trying to build with musl because efivar is not compatible. This fixes the issue.
--- .../efisecdb-fix-build-with-musl-libc.patch | 184 ++++++++++++++++++ meta/recipes-bsp/efivar/efivar_38.bb | 3 +- 2 files changed, 185 insertions(+), 2 deletions(-) create mode 100644 meta/recipes-bsp/efivar/efivar/efisecdb-fix-build-with-musl-libc.patch
meta/recipes-bsp/efivar/efivar/efisecdb-fix-build-with-musl-libc.patch new file +184 -0
@@ -0,0 +1,184 @@ +From cece3ffd5be2f8641eb694513f2b73e5eb97ffd3 Mon Sep 17 00:00:00 2001 +From: Natanael Copa <[email protected]> +Date: Fri, 28 Jan 2022 12:13:30 +0100 +Subject: [PATCH] efisecdb: fix build with musl libc + +Refactor code to use POSIX atexit(3) instead of the GNU specific +on_exit(3). + +Resolves: #197 +Resolves: #202 +Signed-off-by: Natanael Copa <[email protected]> + +Upstream-Status: Backport +https://github.com/rhboot/efivar/commit/cece3ffd5be2f8641eb694513f2b73e5eb97ffd3 + +Signed-off-by: Davide Gardenal <[email protected]> +--- + src/compiler.h | 2 -- + src/efisecdb.c | 68 +++++++++++++++++++------------------------------- + 2 files changed, 26 insertions(+), 44 deletions(-) + +diff --git a/src/compiler.h b/src/compiler.h +index e2f18f0b..d95fb014 100644 +--- a/src/compiler.h ++++ b/src/compiler.h +@@ -7,8 +7,6 @@ + #ifndef COMPILER_H_ + #define COMPILER_H_ + +-#include <sys/cdefs.h> +- + /* GCC version checking borrowed from glibc. */ + #if defined(__GNUC__) && defined(__GNUC_MINOR__) + # define GNUC_PREREQ(maj,min) \ +diff --git a/src/efisecdb.c b/src/efisecdb.c +index f8823737..6bd5ad90 100644 +--- a/src/efisecdb.c ++++ b/src/efisecdb.c +@@ -25,6 +25,10 @@ + extern char *optarg; + extern int optind, opterr, optopt; + ++static efi_secdb_t *secdb = NULL; ++static list_t infiles; ++static list_t actions; ++ + struct hash_param { + char *name; + efi_secdb_type_t algorithm; +@@ -187,12 +191,11 @@ add_action(list_t *list, action_type_t action_type, const efi_guid_t *owner, + } + + static void +-free_actions(int status UNUSED, void *actionsp) ++free_actions(void) + { +- list_t *actions = (list_t *)actionsp; + list_t *pos, *tmp; + +- for_each_action_safe(pos, tmp, actions) { ++ for_each_action_safe(pos, tmp, &actions) { + action_t *action = list_entry(pos, action_t, list); + + list_del(&action->list); +@@ -202,12 +205,11 @@ free_actions(int status UNUSED, void *actionsp) + } + + static void +-free_infiles(int status UNUSED, void *infilesp) ++free_infiles(void) + { +- list_t *infiles = (list_t *)infilesp; + list_t *pos, *tmp; + +- for_each_ptr_safe(pos, tmp, infiles) { ++ for_each_ptr_safe(pos, tmp, &infiles) { + ptrlist_t *entry = list_entry(pos, ptrlist_t, list); + + list_del(&entry->list); +@@ -216,27 +218,12 @@ free_infiles(int status UNUSED, void *infilesp) + } + + static void +-maybe_free_secdb(int status UNUSED, void *voidp) ++maybe_free_secdb(void) + { +- efi_secdb_t **secdbp = (efi_secdb_t **)voidp; +- +- if (secdbp == NULL || *secdbp == NULL) ++ if (secdb == NULL) + return; + +- efi_secdb_free(*secdbp); +-} +- +-static void +-maybe_do_unlink(int status, void *filep) +-{ +- char **file = (char **)filep; +- +- if (status == 0) +- return; +- if (file == NULL || *file == NULL) +- return; +- +- unlink(*file); ++ efi_secdb_free(secdb); + } + + static void +@@ -323,15 +310,6 @@ parse_input_files(list_t *infiles, char **outfile, efi_secdb_t **secdb, + return status; + } + +-/* +- * These need to be static globals so that they're not on main's stack when +- * on_exit() fires. +- */ +-static efi_secdb_t *secdb = NULL; +-static list_t infiles; +-static list_t actions; +-static char *outfile = NULL; +- + int + main(int argc, char *argv[]) + { +@@ -351,6 +329,7 @@ main(int argc, char *argv[]) + bool do_sort_data = false; + bool sort_descending = false; + int status = 0; ++ char *outfile = NULL; + + const char sopts[] = ":aAc:dfg:h:i:Lo:rs:t:v?"; + const struct option lopts[] = { +@@ -376,10 +355,9 @@ main(int argc, char *argv[]) + INIT_LIST_HEAD(&infiles); + INIT_LIST_HEAD(&actions); + +- on_exit(free_actions, &actions); +- on_exit(free_infiles, &infiles); +- on_exit(maybe_free_secdb, &secdb); +- on_exit(maybe_do_unlink, &outfile); ++ atexit(free_actions); ++ atexit(free_infiles); ++ atexit(maybe_free_secdb); + + /* + * parse the command line. +@@ -587,24 +565,30 @@ main(int argc, char *argv[]) + outfd = open(outfile, flags, 0600); + if (outfd < 0) { + char *tmpoutfile = outfile; +- if (errno == EEXIST) +- outfile = NULL; ++ if (errno != EEXIST) ++ unlink(outfile); + err(1, "could not open \"%s\"", tmpoutfile); + } + + rc = ftruncate(outfd, 0); +- if (rc < 0) ++ if (rc < 0) { ++ unlink(outfile); + err(1, "could not truncate output file \"%s\"", outfile); ++ } + + void *output; + size_t size = 0; + rc = efi_secdb_realize(secdb, &output, &size); +- if (rc < 0) ++ if (rc < 0) { ++ unlink(outfile); + secdb_err(1, "could not realize signature list"); ++ } + + rc = write(outfd, output, size); +- if (rc < 0) ++ if (rc < 0) { ++ unlink(outfile); + err(1, "could not write signature list"); ++ } + + close(outfd); + xfree(output);
meta/recipes-bsp/efivar/efivar_38.bb +1 -2
@@ -10,6 +10,7 @@ COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux" SRC_URI = "git://github.com/rhinstaller/efivar.git;branch=main;protocol=https \ file://0001-docs-do-not-build-efisecdb-manpage.patch \ file://0001-src-Makefile-build-util.c-separately-for-makeguids.patch \ + file://efisecdb-fix-build-with-musl-libc.patch \ " SRCREV = "1753149d4176ebfb2b135ac0aaf79340bf0e7a93"
@@ -36,5 +37,3 @@ BBCLASSEXTEND = "native" RRECOMMENDS:${PN}:class-target = "kernel-module-efivarfs" CLEANBROKEN = "1" -# https://github.com/rhboot/efivar/issues/202 -COMPATIBLE_HOST:libc-musl = 'null'
Signature · 1 line
2.25.1
PATCH 10/13 systemd: systemd-systemctl: Support instance conf files during enable
In reply to Steve SakomanFrom: Nick Potenski <[email protected]>
Add ability to parse instance-specific conf files when enabling an instance of a templated unit during postinstall.
--- .../systemd/systemd-systemctl/systemctl | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
meta/recipes-core/systemd/systemd-systemctl/systemctl +11 -3
@@ -11,6 +11,7 @@ import re import sys from collections import namedtuple +from itertools import chain from pathlib import Path version = 1.0
@@ -25,12 +26,16 @@ locations = list() class SystemdFile(): """Class representing a single systemd configuration file""" - def __init__(self, root, path): + def __init__(self, root, path, instance_unit_name): self.sections = dict() self._parse(root, path) dirname = os.path.basename(path.name) + ".d" for location in locations: - for path2 in sorted((root / location / "system" / dirname).glob("*.conf")): + files = (root / location / "system" / dirname).glob("*.conf") + if instance_unit_name: + inst_dirname = instance_unit_name + ".d" + files = chain(files, (root / location / "system" / inst_dirname).glob("*.conf")) + for path2 in sorted(files): self._parse(root, path2) def _parse(self, root, path):
@@ -195,8 +200,11 @@ class SystemdUnit(): # if we're enabling an instance, first extract the actual instance # then figure out what the template unit is template = re.match(r"[^@]+@(?P<instance>[^\.]*)\.", self.unit) + instance_unit_name = None if template: instance = template.group('instance') + if instance != "": + instance_unit_name = self.unit unit = re.sub(r"@[^\.]*\.", "@.", self.unit, 1) else: instance = None
@@ -208,7 +216,7 @@ class SystemdUnit(): # ignore aliases return - config = SystemdFile(self.root, path) + config = SystemdFile(self.root, path, instance_unit_name) if instance == "": try: default_instance = config.get('Install', 'DefaultInstance')[0]
Signature · 1 line
2.25.1
PATCH 11/13 gtk-doc: Fix potential shebang overflow on gtkdoc-mkhtml2
In reply to Steve SakomanFrom: Paulo Neves <[email protected]>
A native path can cause a shebang overflow on gtkdoc-mkhtml. Replace it with /usr/bin/env.
--- meta/recipes-gnome/gtk-doc/gtk-doc_1.33.2.bb | 1 + 1 file changed, 1 insertion(+)
meta/recipes-gnome/gtk-doc/gtk-doc_1.33.2.bb +1 -0
@@ -43,6 +43,7 @@ do_install:append () { ${datadir}/gtk-doc/python/gtkdoc/config.py; do sed -e 's,${RECIPE_SYSROOT_NATIVE}/usr/bin/pkg-config,${bindir}/pkg-config,' \ -e 's,${HOSTTOOLS_DIR}/python3,${bindir}/python3,' \ + -e '1s|^#!.*|#!/usr/bin/env python3|' \ -i ${D}$fn done }
Signature · 1 line
2.25.1
PATCH 12/13 rootfs-postcommands.bbclass: correct comments
In reply to Steve SakomanFrom: Michael Opdenacker <[email protected]>
--- meta/classes/rootfs-postcommands.bbclass | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
meta/classes/rootfs-postcommands.bbclass +4 -4
@@ -1,5 +1,5 @@ -# Zap the root password if debug-tweaks feature is not enabled +# Zap the root password if debug-tweaks and empty-root-password features are not enabled ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains_any("IMAGE_FEATURES", [ 'debug-tweaks', 'empty-root-password' ], "", "zap_empty_root_password; ",d)}' # Allow dropbear/openssh to accept logins from accounts with an empty password string if debug-tweaks or allow-empty-password is enabled
@@ -8,7 +8,7 @@ ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains_any("IMAGE_FEATURES", [ 'deb # Allow dropbear/openssh to accept root logins if debug-tweaks or allow-root-login is enabled ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains_any("IMAGE_FEATURES", [ 'debug-tweaks', 'allow-root-login' ], "ssh_allow_root_login; ", "",d)}' -# Enable postinst logging if debug-tweaks is enabled +# Enable postinst logging if debug-tweaks or post-install-logging is enabled ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains_any("IMAGE_FEATURES", [ 'debug-tweaks', 'post-install-logging' ], "postinst_enable_logging; ", "",d)}' # Create /etc/timestamp during image construction to give a reasonably sane default time setting
@@ -140,7 +140,7 @@ read_only_rootfs_hook () { } # -# This function is intended to disallow empty root password if 'debug-tweaks' is not in IMAGE_FEATURES. +# This function disallows empty root passwords # zap_empty_root_password () { if [ -e ${IMAGE_ROOTFS}/etc/shadow ]; then
@@ -202,7 +202,7 @@ python sort_passwd () { } # -# Enable postinst logging if debug-tweaks is enabled +# Enable postinst logging # postinst_enable_logging () { mkdir -p ${IMAGE_ROOTFS}${sysconfdir}/default
Signature · 1 line
2.25.1
PATCH 13/13 mesa: backport a patch to support compositors without zwp_linux_dmabuf_v1 again
In reply to Steve SakomanFrom: Martin Jansa <[email protected]>
* the same will be needed for kirkstone
--- ...nd-deprecate-drm_handle_format-and-d.patch | 158 ++++++++++++++++++ meta/recipes-graphics/mesa/mesa.inc | 1 + 2 files changed, 159 insertions(+) create mode 100644 meta/recipes-graphics/mesa/files/0001-Revert-egl-wayland-deprecate-drm_handle_format-and-d.patch
meta/recipes-graphics/mesa/files/0001-Revert-egl-wayland-deprecate-drm_handle_format-and-d.patch new file +158 -0
@@ -0,0 +1,158 @@ +From 7796c2c56c960ac55e49246f0349ac52539ada55 Mon Sep 17 00:00:00 2001 +From: Leandro Ribeiro <[email protected]> +Date: Sun, 10 Apr 2022 22:54:36 -0300 +Subject: [PATCH] Revert "egl/wayland: deprecate drm_handle_format() and + drm_handle_capabilities()" + +Commit af1ee8e010441f8f2ed8c77065b159652a4ac9fe dropped support to +wl_drm, as we thought that most compositors from active projects were +already supporting zwp_linux_dmabuf_v1. + +But that's not true, so revert this commit in order to give these +projects a longer transition period. + +Note that we didn't add back the support to GEM name API, and that was +on purpose. + +Signed-off-by: Leandro Ribeiro <[email protected]> +Reviewed-by: Simon Ser <[email protected]> +Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15822> + +Signed-off-by: Martin Jansa <[email protected]> +Upstream-Status: Backport [https://gitlab.freedesktop.org/mesa/mesa/-/commit/c60fea8c228ae3f32e20d6b65c473d9f04871d20] +--- + src/egl/drivers/dri2/egl_dri2.h | 1 + + src/egl/drivers/dri2/platform_wayland.c | 59 +++++++++++++++++++------ + 2 files changed, 47 insertions(+), 13 deletions(-) + +diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h +index c466ff83c53..eecb32a53fd 100644 +--- a/src/egl/drivers/dri2/egl_dri2.h ++++ b/src/egl/drivers/dri2/egl_dri2.h +@@ -283,6 +283,7 @@ struct dri2_egl_display + struct zwp_linux_dmabuf_feedback_v1 *wl_dmabuf_feedback; + struct dmabuf_feedback_format_table format_table; + bool authenticated; ++ uint32_t capabilities; + char *device_name; + #endif + +diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c +index 5ff83cce08a..843434376a7 100644 +--- a/src/egl/drivers/dri2/platform_wayland.c ++++ b/src/egl/drivers/dri2/platform_wayland.c +@@ -1343,7 +1343,7 @@ create_wl_buffer(struct dri2_egl_display *dri2_dpy, + struct dri2_egl_surface *dri2_surf, + __DRIimage *image) + { +- struct wl_buffer *ret; ++ struct wl_buffer *ret = NULL; + EGLBoolean query; + int width, height, fourcc, num_planes; + uint64_t modifier = DRM_FORMAT_MOD_INVALID; +@@ -1447,11 +1447,28 @@ create_wl_buffer(struct dri2_egl_display *dri2_dpy, + ret = zwp_linux_buffer_params_v1_create_immed(params, width, height, + fourcc, 0); + zwp_linux_buffer_params_v1_destroy(params); ++ } else { ++ struct wl_drm *wl_drm = ++ dri2_surf ? dri2_surf->wl_drm_wrapper : dri2_dpy->wl_drm; ++ int fd = -1, stride; ++ ++ if (num_planes > 1) ++ return NULL; ++ ++ query = dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_FD, &fd); ++ query &= dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_STRIDE, &stride); ++ if (!query) { ++ if (fd >= 0) ++ close(fd); ++ return NULL; ++ } + +- return ret; ++ ret = wl_drm_create_prime_buffer(wl_drm, fd, width, height, fourcc, 0, ++ stride, 0, 0, 0, 0); ++ close(fd); + } + +- return NULL; ++ return ret; + } + + static EGLBoolean +@@ -1698,16 +1715,21 @@ drm_handle_device(void *data, struct wl_drm *drm, const char *device) + static void + drm_handle_format(void *data, struct wl_drm *drm, uint32_t format) + { +- /* deprecated, as compositors already support the dma-buf protocol extension +- * and so we can rely on dmabuf_handle_modifier() to receive formats and +- * modifiers */ ++ struct dri2_egl_display *dri2_dpy = data; ++ int visual_idx = dri2_wl_visual_idx_from_fourcc(format); ++ ++ if (visual_idx == -1) ++ return; ++ ++ BITSET_SET(dri2_dpy->formats.formats_bitmap, visual_idx); + } + + static void + drm_handle_capabilities(void *data, struct wl_drm *drm, uint32_t value) + { +- /* deprecated, as compositors already support the dma-buf protocol extension +- * and so we can rely on it to create wl_buffer's */ ++ struct dri2_egl_display *dri2_dpy = data; ++ ++ dri2_dpy->capabilities = value; + } + + static void +@@ -2075,13 +2097,12 @@ dri2_initialize_wayland_drm(_EGLDisplay *disp) + wl_registry_add_listener(dri2_dpy->wl_registry, + ®istry_listener_drm, dri2_dpy); + +- /* The compositor must expose the dma-buf interface. */ +- if (roundtrip(dri2_dpy) < 0 || dri2_dpy->wl_dmabuf == NULL) ++ if (roundtrip(dri2_dpy) < 0) + goto cleanup; + + /* Get default dma-buf feedback */ +- if (zwp_linux_dmabuf_v1_get_version(dri2_dpy->wl_dmabuf) >= +- ZWP_LINUX_DMABUF_V1_GET_DEFAULT_FEEDBACK_SINCE_VERSION) { ++ if (dri2_dpy->wl_dmabuf && zwp_linux_dmabuf_v1_get_version(dri2_dpy->wl_dmabuf) >= ++ ZWP_LINUX_DMABUF_V1_GET_DEFAULT_FEEDBACK_SINCE_VERSION) { + dmabuf_feedback_format_table_init(&dri2_dpy->format_table); + dri2_dpy->wl_dmabuf_feedback = + zwp_linux_dmabuf_v1_get_default_feedback(dri2_dpy->wl_dmabuf); +@@ -2089,7 +2110,6 @@ dri2_initialize_wayland_drm(_EGLDisplay *disp) + &dmabuf_feedback_listener, dri2_dpy); + } + +- /* Receive events from the interfaces */ + if (roundtrip(dri2_dpy) < 0) + goto cleanup; + +@@ -2176,6 +2196,19 @@ dri2_initialize_wayland_drm(_EGLDisplay *disp) + + dri2_wl_setup_swap_interval(disp); + ++ if (dri2_dpy->wl_drm) { ++ /* To use Prime, we must have _DRI_IMAGE v7 at least. createImageFromFds ++ * support indicates that Prime export/import is supported by the driver. ++ * We deprecated the support to GEM names API, so we bail out if the ++ * driver does not suport Prime. */ ++ if (!(dri2_dpy->capabilities & WL_DRM_CAPABILITY_PRIME) || ++ (dri2_dpy->image->base.version < 7) || ++ (dri2_dpy->image->createImageFromFds == NULL)) { ++ _eglLog(_EGL_WARNING, "wayland-egl: display does not support prime"); ++ goto cleanup; ++ } ++ } ++ + if (dri2_dpy->is_different_gpu && + (dri2_dpy->image->base.version < 9 || + dri2_dpy->image->blitImage == NULL)) { +-- +2.35.1 +
meta/recipes-graphics/mesa/mesa.inc +1 -0
@@ -20,6 +20,7 @@ SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \ file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ file://0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch \ file://0001-util-format-Check-for-NEON-before-using-it.patch \ + file://0001-Revert-egl-wayland-deprecate-drm_handle_format-and-d.patch \ " SRC_URI[sha256sum] = "9f2b30f5276a9abaf71aafc6979685e2636189de1a87aea2c9e69744a6d0ebb9"
Signature · 1 line
2.25.1