Patch review
PATCH 1/12 grub: fix CVE-2020-14372 and CVE-2020-27779
In reply to Steve SakomanFrom: Marta Rybczynska <[email protected]>
Fix issues with grub in secure boot mode where an attacker could circumvent secure boot by using acpi and cutmem commands. Also include patches fixing similar issues.
Most patches are backported directly from grub. One patch (no-insmod-on-sb.patch) comes from Debian, as the upstream implementation is too complicated to backport.
CVE-2020-14372 description (from NVD [1]):
A flaw was found in grub2 in versions prior to 2.06, where it incorrectly enables the usage of the ACPI command when Secure Boot is enabled. This flaw allows an attacker with privileged access to craft a Secondary System Description Table (SSDT) containing code to overwrite the Linux kernel lockdown variable content directly into memory. The table is further loaded and executed by the kernel, defeating its Secure Boot lockdown and allowing the attacker to load unsigned code. The highest threat from this vulnerability is to data confidentiality and integrity, as well as system availability.
CVE-2020-27779 description (from NVD [2]):
A flaw was found in grub2 in versions prior to 2.06. The cutmem command does not honor secure boot locking allowing an privileged attacker to remove address ranges from memory creating an opportunity to circumvent SecureBoot protections after proper triage about grub's memory layout. The highest threat from this vulnerability is to data confidentiality and integrity as well as system availability.
[1] https://nvd.nist.gov/vuln/detail/CVE-2020-14372
[2] https://nvd.nist.gov/vuln/detail/CVE-2020-27779
--- .../grub/files/CVE-2020-14372.patch | 76 +++ .../grub/files/CVE-2020-14372_1.patch | 130 ++++++ .../grub/files/CVE-2020-14372_2.patch | 431 ++++++++++++++++++ .../grub/files/CVE-2020-14372_3.patch | 57 +++ .../grub/files/CVE-2020-14372_4.patch | 52 +++ .../grub/files/CVE-2020-14372_5.patch | 158 +++++++ .../grub/files/CVE-2020-27779.patch | 70 +++ .../grub/files/CVE-2020-27779_2.patch | 105 +++++ .../grub/files/CVE-2020-27779_3.patch | 37 ++ .../grub/files/CVE-2020-27779_4.patch | 35 ++ .../grub/files/CVE-2020-27779_5.patch | 62 +++ .../grub/files/CVE-2020-27779_6.patch | 61 +++ .../grub/files/CVE-2020-27779_7.patch | 65 +++ .../grub/files/no-insmod-on-sb.patch | 107 +++++ meta/recipes-bsp/grub/grub2.inc | 14 + 15 files changed, 1460 insertions(+) create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-14372.patch create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-14372_1.patch create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-14372_2.patch create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-14372_3.patch create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-14372_4.patch create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-14372_5.patch create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-27779.patch create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-27779_2.patch create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-27779_3.patch create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-27779_4.patch create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-27779_5.patch create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-27779_6.patch create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-27779_7.patch create mode 100644 meta/recipes-bsp/grub/files/no-insmod-on-sb.patch
meta/recipes-bsp/grub/files/CVE-2020-14372.patch new file +76 -0
@@ -0,0 +1,76 @@ +From 0d237c0b90f0c6d4a3662c569b2371ae3ed69574 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas <[email protected]> +Date: Mon, 28 Sep 2020 20:08:41 +0200 +Subject: [PATCH] acpi: Don't register the acpi command when locked down +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The command is not allowed when lockdown is enforced. Otherwise an +attacker can instruct the GRUB to load an SSDT table to overwrite +the kernel lockdown configuration and later load and execute +unsigned code. + +Fixes: CVE-2020-14372 + +Reported-by: Máté Kukri <[email protected]> +Signed-off-by: Javier Martinez Canillas <[email protected]> +Reviewed-by: Daniel Kiper <[email protected]> + +Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=3e8e4c0549240fa209acffceb473e1e509b50c95] +CVE: CVE-2020-14372 +Signed-off-by: Marta Rybczynska <[email protected]> +--- + docs/grub.texi | 5 +++++ + grub-core/commands/acpi.c | 15 ++++++++------- + 2 files changed, 13 insertions(+), 7 deletions(-) + +diff --git a/docs/grub.texi b/docs/grub.texi +index 0786427..47ac7ff 100644 +--- a/docs/grub.texi ++++ b/docs/grub.texi +@@ -3986,6 +3986,11 @@ Normally, this command will replace the Root System Description Pointer + (RSDP) in the Extended BIOS Data Area to point to the new tables. If the + @option{--no-ebda} option is used, the new tables will be known only to + GRUB, but may be used by GRUB's EFI emulation. ++ ++Note: The command is not allowed when lockdown is enforced (@pxref{Lockdown}). ++ Otherwise an attacker can instruct the GRUB to load an SSDT table to ++ overwrite the kernel lockdown configuration and later load and execute ++ unsigned code. + @end deffn + + +diff --git a/grub-core/commands/acpi.c b/grub-core/commands/acpi.c +index 5a1499a..1215f2a 100644 +--- a/grub-core/commands/acpi.c ++++ b/grub-core/commands/acpi.c +@@ -27,6 +27,7 @@ + #include <grub/mm.h> + #include <grub/memory.h> + #include <grub/i18n.h> ++#include <grub/lockdown.h> + + #ifdef GRUB_MACHINE_EFI + #include <grub/efi/efi.h> +@@ -775,13 +776,13 @@ static grub_extcmd_t cmd; + + GRUB_MOD_INIT(acpi) + { +- cmd = grub_register_extcmd ("acpi", grub_cmd_acpi, 0, +- N_("[-1|-2] [--exclude=TABLE1,TABLE2|" +- "--load-only=TABLE1,TABLE2] FILE1" +- " [FILE2] [...]"), +- N_("Load host ACPI tables and tables " +- "specified by arguments."), +- options); ++ cmd = grub_register_extcmd_lockdown ("acpi", grub_cmd_acpi, 0, ++ N_("[-1|-2] [--exclude=TABLE1,TABLE2|" ++ "--load-only=TABLE1,TABLE2] FILE1" ++ " [FILE2] [...]"), ++ N_("Load host ACPI tables and tables " ++ "specified by arguments."), ++ options); + } + + GRUB_MOD_FINI(acpi)
meta/recipes-bsp/grub/files/CVE-2020-14372_1.patch new file +130 -0
130 lines not on this page · raw message
meta/recipes-bsp/grub/files/CVE-2020-14372_2.patch new file +431 -0
431 lines not on this page · raw message
meta/recipes-bsp/grub/files/CVE-2020-14372_3.patch new file +57 -0
57 lines not on this page · raw message
meta/recipes-bsp/grub/files/CVE-2020-14372_4.patch new file +52 -0
52 lines not on this page · raw message
meta/recipes-bsp/grub/files/CVE-2020-14372_5.patch new file +158 -0
158 lines not on this page · raw message
meta/recipes-bsp/grub/files/CVE-2020-27779.patch new file +70 -0
70 lines not on this page · raw message
meta/recipes-bsp/grub/files/CVE-2020-27779_2.patch new file +105 -0
105 lines not on this page · raw message
meta/recipes-bsp/grub/files/CVE-2020-27779_3.patch new file +37 -0
@@ -0,0 +1,37 @@ +From e4f5c16f76e137b3beb6b61a6d2435e54fcb495c Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas <[email protected]> +Date: Wed, 24 Feb 2021 22:59:59 +0100 +Subject: [PATCH] commands/setpci: Restrict setpci command when locked down + +This command can set PCI devices register values, which makes it dangerous +in a locked down configuration. Restrict it so can't be used on this setup. + +Signed-off-by: Javier Martinez Canillas <[email protected]> +Reviewed-by: Daniel Kiper <[email protected]> + +Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=58b77d4069823b44c5fa916fa8ddfc9c4cd51e02] +CVE: CVE-2020-27779 +Signed-off-by: Marta Rybczynska <[email protected]> +--- + grub-core/commands/setpci.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/grub-core/commands/setpci.c b/grub-core/commands/setpci.c +index d5bc97d..fa2ba7d 100644 +--- a/grub-core/commands/setpci.c ++++ b/grub-core/commands/setpci.c +@@ -329,10 +329,10 @@ static grub_extcmd_t cmd; + + GRUB_MOD_INIT(setpci) + { +- cmd = grub_register_extcmd ("setpci", grub_cmd_setpci, 0, +- N_("[-s POSITION] [-d DEVICE] [-v VAR] " +- "REGISTER[=VALUE[:MASK]]"), +- N_("Manipulate PCI devices."), options); ++ cmd = grub_register_extcmd_lockdown ("setpci", grub_cmd_setpci, 0, ++ N_("[-s POSITION] [-d DEVICE] [-v VAR] " ++ "REGISTER[=VALUE[:MASK]]"), ++ N_("Manipulate PCI devices."), options); + } + + GRUB_MOD_FINI(setpci)
meta/recipes-bsp/grub/files/CVE-2020-27779_4.patch new file +35 -0
@@ -0,0 +1,35 @@ +From 7949671de268ba3116d113778e5d770574e9f9e3 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas <[email protected]> +Date: Wed, 24 Feb 2021 12:59:29 +0100 +Subject: [PATCH] commands/hdparm: Restrict hdparm command when locked down + +The command can be used to get/set ATA disk parameters. Some of these can +be dangerous since change the disk behavior. Restrict it when locked down. + +Signed-off-by: Javier Martinez Canillas <[email protected]> +Reviewed-by: Daniel Kiper <[email protected]> + +Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=5c97492a29c6063567b65ed1a069f5e6f4e211f0] +CVE: CVE-2020-27779 +Signed-off-by: Marta Rybczynska <[email protected]> +--- + grub-core/commands/hdparm.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/grub-core/commands/hdparm.c b/grub-core/commands/hdparm.c +index d3fa966..2e2319e 100644 +--- a/grub-core/commands/hdparm.c ++++ b/grub-core/commands/hdparm.c +@@ -436,9 +436,9 @@ static grub_extcmd_t cmd; + + GRUB_MOD_INIT(hdparm) + { +- cmd = grub_register_extcmd ("hdparm", grub_cmd_hdparm, 0, +- N_("[OPTIONS] DISK"), +- N_("Get/set ATA disk parameters."), options); ++ cmd = grub_register_extcmd_lockdown ("hdparm", grub_cmd_hdparm, 0, ++ N_("[OPTIONS] DISK"), ++ N_("Get/set ATA disk parameters."), options); + } + + GRUB_MOD_FINI(hdparm)
meta/recipes-bsp/grub/files/CVE-2020-27779_5.patch new file +62 -0
62 lines not on this page · raw message
meta/recipes-bsp/grub/files/CVE-2020-27779_6.patch new file +61 -0
61 lines not on this page · raw message
meta/recipes-bsp/grub/files/CVE-2020-27779_7.patch new file +65 -0
65 lines not on this page · raw message
meta/recipes-bsp/grub/files/no-insmod-on-sb.patch new file +107 -0
107 lines not on this page · raw message
meta/recipes-bsp/grub/grub2.inc +14 -0
@@ -31,6 +31,20 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \ file://CVE-2020-15706-script-Avoid-a-use-after-free-when-redefining-a-func.patch \ file://CVE-2020-15707-linux-Fix-integer-overflows-in-initrd-size-handling.patch \ file://determinism.patch \ + file://no-insmod-on-sb.patch \ + file://CVE-2020-14372_1.patch \ + file://CVE-2020-14372_2.patch \ + file://CVE-2020-14372_3.patch \ + file://CVE-2020-14372_4.patch \ + file://CVE-2020-14372_5.patch \ + file://CVE-2020-14372.patch \ + file://CVE-2020-27779.patch \ + file://CVE-2020-27779_2.patch \ + file://CVE-2020-27779_3.patch \ + file://CVE-2020-27779_4.patch \ + file://CVE-2020-27779_5.patch \ + file://CVE-2020-27779_6.patch \ + file://CVE-2020-27779_7.patch \ " SRC_URI[md5sum] = "5ce674ca6b2612d8939b9e6abed32934" SRC_URI[sha256sum] = "f10c85ae3e204dbaec39ae22fa3c5e99f0665417e91c2cb49b7e5031658ba6ea"
Signature · 1 line
2.25.1
cover Patch review
Please review this set of patches for dunfell and have comments back by end of day Tuesday.
Passed a-full on auto builder:
https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/3096
with the exception of a known intermmitent autobuilder issue on oe-selftest-fedora, which passed on subsequent retest:
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/3004
The following changes since commit 1ab7aee542589f6b6c76f8515b4230ce870a8678:
selftest: skip virgl test on fedora 34 entirely (2021-12-23 06:21:37 -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 (1):
lib/oe/reproducible: correctly set .git location when recursively
looking for git repos
Marek Vasut (1):
weston: Backport patches to always activate the top-level surface
Marta Rybczynska (1):
grub: fix CVE-2020-14372 and CVE-2020-27779
Richard Purdie (4):
openssl: Add reproducibility fix oeqa/selftest/bbtests: Use YP sources mirror instead of GNU oeqa/selftest/tinfoil: Update to use test command
scripts: Update to use exec_module() instead of load_module()
Steve Sakoman (3):
libpcre2: update SRC_URI
selftest: skip virgl test on fedora 35
asciidoc: properly detect and compare Python versions >= 3.10
Tim Orling (1):
scripts/buildhistory-diff: drop use of distutils
wangmy (1):
linux-firmware: upgrade 20211027 -> 20211216
meta/lib/oe/reproducible.py | 2 +-
meta/lib/oeqa/selftest/cases/bbtests.py | 2 +-
meta/lib/oeqa/selftest/cases/runtime_test.py | 2 +
meta/lib/oeqa/selftest/cases/tinfoil.py | 6 +-
.../grub/files/CVE-2020-14372.patch | 76 +++
.../grub/files/CVE-2020-14372_1.patch | 130 ++++++
.../grub/files/CVE-2020-14372_2.patch | 431 ++++++++++++++++++
.../grub/files/CVE-2020-14372_3.patch | 57 +++
.../grub/files/CVE-2020-14372_4.patch | 52 +++
.../grub/files/CVE-2020-14372_5.patch | 158 +++++++
.../grub/files/CVE-2020-27779.patch | 70 +++
.../grub/files/CVE-2020-27779_2.patch | 105 +++++
.../grub/files/CVE-2020-27779_3.patch | 37 ++
.../grub/files/CVE-2020-27779_4.patch | 35 ++
.../grub/files/CVE-2020-27779_5.patch | 62 +++
.../grub/files/CVE-2020-27779_6.patch | 61 +++
.../grub/files/CVE-2020-27779_7.patch | 65 +++
.../grub/files/no-insmod-on-sb.patch | 107 +++++
meta/recipes-bsp/grub/grub2.inc | 14 +
.../openssl/openssl/reproducibility.patch | 22 +
.../openssl/openssl_1.1.1l.bb | 1 +
.../asciidoc/detect-python-version.patch | 42 ++
.../asciidoc/asciidoc_8.6.9.bb | 3 +-
...move-no-op-de-activation-of-the-xdg-.patch | 32 ++
...name-gain-lose-keyboard-focus-to-act.patch | 57 +++
...bed-keyboard-focus-handle-code-when-.patch | 99 ++++
meta/recipes-graphics/wayland/weston_8.0.0.bb | 3 +
...20211027.bb => linux-firmware_20211216.bb} | 4 +-
.../recipes-support/libpcre/libpcre2_10.34.bb | 2 +-
scripts/buildhistory-diff | 5 -
scripts/lib/scriptutils.py | 7 +-
scripts/lib/wic/pluginbase.py | 8 +-
32 files changed, 1739 insertions(+), 18 deletions(-)
create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-14372.patch
create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-14372_1.patch
create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-14372_2.patch
create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-14372_3.patch
create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-14372_4.patch
create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-14372_5.patch
create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-27779.patch
create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-27779_2.patch
create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-27779_3.patch
create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-27779_4.patch
create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-27779_5.patch
create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-27779_6.patch
create mode 100644 meta/recipes-bsp/grub/files/CVE-2020-27779_7.patch
create mode 100644 meta/recipes-bsp/grub/files/no-insmod-on-sb.patch
create mode 100644 meta/recipes-connectivity/openssl/openssl/reproducibility.patch
create mode 100644 meta/recipes-extended/asciidoc/asciidoc/detect-python-version.patch
create mode 100644 meta/recipes-graphics/wayland/weston/0002-desktop-shell-Remove-no-op-de-activation-of-the-xdg-.patch
create mode 100644 meta/recipes-graphics/wayland/weston/0003-desktop-shell-Rename-gain-lose-keyboard-focus-to-act.patch
create mode 100644 meta/recipes-graphics/wayland/weston/0004-desktop-shell-Embed-keyboard-focus-handle-code-when-.patch
rename meta/recipes-kernel/linux-firmware/{linux-firmware_20211027.bb => linux-firmware_20211216.bb} (99%)Signature · 1 line
2.25.1
PATCH 2/12 linux-firmware: upgrade 20211027 -> 20211216
From: wangmy <[email protected]>
License-Update: version of license file updated.
---
...{linux-firmware_20211027.bb => linux-firmware_20211216.bb} | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
rename meta/recipes-kernel/linux-firmware/{linux-firmware_20211027.bb => linux-firmware_20211216.bb} (99%)meta/recipes-kernel/linux-firmware/linux-firmware_20211216.bb renamed from meta/recipes-kernel/linux-firmware/linux-firmware_20211027.bb +2 -2
@@ -132,7 +132,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=d627873bd934d7c52b2c8191304a8eb7 \ + file://WHENCE;md5=79f477f9d53eedee5a65b45193785963 \ " # These are not common licenses, set NO_GENERIC_LICENSE for them
@@ -205,7 +205,7 @@ PE = "1" SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/firmware/${BPN}-${PV}.tar.xz" -SRC_URI[sha256sum] = "bc2657dd8eb82386a9a7ec6df9ccf31c32c7e9073c05d37786c1edc273f9440a" +SRC_URI[sha256sum] = "eeddb4e6bef31fd1a3757f12ccc324929bbad97855c0b9ec5ed780f74de1837d" inherit allarch
Signature · 1 line
2.25.1
PATCH 3/12 libpcre2: update SRC_URI
In reply to Steve SakomanVersion 10.34 tarball is no longer available at current URL, use downloads.yoctoproject.org mirror instead
--- meta/recipes-support/libpcre/libpcre2_10.34.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-support/libpcre/libpcre2_10.34.bb +1 -1
@@ -10,7 +10,7 @@ SECTION = "devel" LICENSE = "BSD-3-Clause" LIC_FILES_CHKSUM = "file://LICENCE;md5=b1588d3bb4cb0e1f5a597d908f8c5b37" -SRC_URI = "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-${PV}/pcre2-${PV}.tar.bz2 \ +SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/pcre2-${PV}.tar.bz2 \ file://pcre-cross.patch \ "
Signature · 1 line
2.25.1
PATCH 4/12 openssl: Add reproducibility fix
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
When the date rolled from one year to another, it highlighted a reproducibility issue in openssl. Patch a workaround for this to avoid autobuilder failures.
--- .../openssl/openssl/reproducibility.patch | 22 +++++++++++++++++++ .../openssl/openssl_1.1.1l.bb | 1 + 2 files changed, 23 insertions(+) create mode 100644 meta/recipes-connectivity/openssl/openssl/reproducibility.patch
meta/recipes-connectivity/openssl/openssl/reproducibility.patch new file +22 -0
@@ -0,0 +1,22 @@ +Using localtime() means the output can depend on the timezone of the build machine. +Using gmtime() is safer. For complete reproducibility use SOURCE_DATE_EPOCH if set. + +Signed-off-by: Richard Purdie <[email protected]> +Upstream-Status: Pending [should be suitable] + +Index: openssl-3.0.1/apps/progs.pl +=================================================================== +--- openssl-3.0.1.orig/apps/progs.pl ++++ openssl-3.0.1/apps/progs.pl +@@ -21,7 +21,10 @@ die "Unrecognised option, must be -C or + my %commands = (); + my $cmdre = qr/^\s*int\s+([a-z_][a-z0-9_]*)_main\(\s*int\s+argc\s*,/; + my $apps_openssl = shift @ARGV; +-my $YEAR = [localtime()]->[5] + 1900; ++my $YEAR = [gmtime()]->[5] + 1900; ++if (defined($ENV{SOURCE_DATE_EPOCH}) && $ENV{SOURCE_DATE_EPOCH} !~ /\D/) { ++ $YEAR = [gmtime($ENV{SOURCE_DATE_EPOCH})]->[5] + 1900; ++} + + # because the program apps/openssl has object files as sources, and + # they then have the corresponding C files as source, we need to chain
meta/recipes-connectivity/openssl/openssl_1.1.1l.bb +1 -0
@@ -17,6 +17,7 @@ SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \ file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \ file://afalg.patch \ file://reproducible.patch \ + file://reproducibility.patch \ " SRC_URI_append_class-nativesdk = " \
Signature · 1 line
2.25.1
PATCH 5/12 oeqa/selftest/bbtests: Use YP sources mirror instead of GNU
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
The gnu sources server has been known to disappear. Use the YP sources mirror instead. If that breaks, the autobuilder is broken anyway. This should reduce test failures from upstream network issues.
--- meta/lib/oeqa/selftest/cases/bbtests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oeqa/selftest/cases/bbtests.py +1 -1
@@ -157,7 +157,7 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\" """) self.track_for_cleanup(os.path.join(self.builddir, "download-selftest")) - data = 'SRC_URI = "${GNU_MIRROR}/aspell/aspell-${PV}.tar.gz;downloadfilename=test-aspell.tar.gz"' + data = 'SRC_URI = "https://downloads.yoctoproject.org/mirror/sources/aspell-${PV}.tar.gz;downloadfilename=test-aspell.tar.gz"' self.write_recipeinc('aspell', data) result = bitbake('-f -c fetch aspell', ignore_status=True) self.delete_recipeinc('aspell')
Signature · 1 line
2.25.1
PATCH 6/12 oeqa/selftest/tinfoil: Update to use test command
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
We've had IO load issues on the autobuilder with this test. Avoid those by using a specilised test command instead.
--- meta/lib/oeqa/selftest/cases/tinfoil.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
meta/lib/oeqa/selftest/cases/tinfoil.py +3 -3
@@ -94,14 +94,13 @@ class TinfoilTests(OESelftestTestCase): pass pattern = 'conf' - res = tinfoil.run_command('findFilesMatchingInDir', pattern, 'conf/machine') + res = tinfoil.run_command('testCookerCommandEvent', pattern) self.assertTrue(res) eventreceived = False commandcomplete = False start = time.time() # Wait for maximum 60s in total so we'd detect spurious heartbeat events for example - # The test is IO load sensitive too while (not (eventreceived == True and commandcomplete == True) and (time.time() - start < 60)): # if we received both events (on let's say a good day), we are done
@@ -111,7 +110,8 @@ class TinfoilTests(OESelftestTestCase): commandcomplete = True elif isinstance(event, bb.event.FilesMatchingFound): self.assertEqual(pattern, event._pattern) - self.assertIn('qemuarm.conf', event._matches) + self.assertIn('A', event._matches) + self.assertIn('B', event._matches) eventreceived = True elif isinstance(event, logging.LogRecord): continue
Signature · 1 line
2.25.1
PATCH 7/12 weston: Backport patches to always activate the top-level surface
In reply to Steve SakomanFrom: Marek Vasut <[email protected]>
In case the device has only touchscreen input device and no keyboard or mouse, the top level surface is never activated. The behavior differs from a device which has a keyboard (or gpio-keys, or even uinput-emulated keyboard), where callchain activate()->weston_view_activate()->weston_seat_set_keyboard_focus()-> weston_keyboard_set_focus()->wl_signal_emit(&keyboard->focus_signal, keyboard)-> handle_keyboard_focus()->weston_desktop_surface_set_activated(..., true); sets the top level surface as activated. On device with touchscreen, the above is never called, hence the top level surface is never activated. Add explicit weston_desktop_surface_set_activated(shsurf->desktop_surface, true); into activate() to always active the top level surface.
This fixes at least two known issues on such devices:
- Wayland terminal cursor is an empty bar (full bar with keyboard present)
- Chromium dropdown menus are randomly placed (they are placed correctly when keyboard is present, because then chromium can find the activated top level surface)
--- ...move-no-op-de-activation-of-the-xdg-.patch | 32 ++++++ ...name-gain-lose-keyboard-focus-to-act.patch | 57 +++++++++++ ...bed-keyboard-focus-handle-code-when-.patch | 99 +++++++++++++++++++ meta/recipes-graphics/wayland/weston_8.0.0.bb | 3 + 4 files changed, 191 insertions(+) create mode 100644 meta/recipes-graphics/wayland/weston/0002-desktop-shell-Remove-no-op-de-activation-of-the-xdg-.patch create mode 100644 meta/recipes-graphics/wayland/weston/0003-desktop-shell-Rename-gain-lose-keyboard-focus-to-act.patch create mode 100644 meta/recipes-graphics/wayland/weston/0004-desktop-shell-Embed-keyboard-focus-handle-code-when-.patch
meta/recipes-graphics/wayland/weston/0002-desktop-shell-Remove-no-op-de-activation-of-the-xdg-.patch new file +32 -0
@@ -0,0 +1,32 @@ +From 5c74a0640e873694bf60a88eceb21f664cb4b8f7 Mon Sep 17 00:00:00 2001 +From: Marius Vlad <[email protected]> +Date: Fri, 5 Mar 2021 20:03:49 +0200 +Subject: [PATCH 2/5] desktop-shell: Remove no-op de-activation of the xdg + top-level surface + +The shsurf is calloc'ed so the surface count is always 0. Not only +that but the surface is not set as active by default, so there's no +need to de-activate it. + +Upstream-Status: Backport [05bef4c18a3e82376a46a4a28d978389c4c0fd0f] +Signed-off-by: Marius Vlad <[email protected]> +--- + desktop-shell/shell.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c +index 442a625f..3791be25 100644 +--- a/desktop-shell/shell.c ++++ b/desktop-shell/shell.c +@@ -2427,8 +2427,6 @@ desktop_surface_added(struct weston_desktop_surface *desktop_surface, + wl_list_init(&shsurf->children_link); + + weston_desktop_surface_set_user_data(desktop_surface, shsurf); +- weston_desktop_surface_set_activated(desktop_surface, +- shsurf->focus_count > 0); + } + + static void +-- +2.34.1 +
meta/recipes-graphics/wayland/weston/0003-desktop-shell-Rename-gain-lose-keyboard-focus-to-act.patch new file +57 -0
57 lines not on this page · raw message
meta/recipes-graphics/wayland/weston/0004-desktop-shell-Embed-keyboard-focus-handle-code-when-.patch new file +99 -0
99 lines not on this page · raw message
meta/recipes-graphics/wayland/weston_8.0.0.bb +3 -0
@@ -12,6 +12,9 @@ SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ file://systemd-notify.weston-start \ file://xwayland.weston-start \ file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \ + file://0002-desktop-shell-Remove-no-op-de-activation-of-the-xdg-.patch \ + file://0003-desktop-shell-Rename-gain-lose-keyboard-focus-to-act.patch \ + file://0004-desktop-shell-Embed-keyboard-focus-handle-code-when-.patch \ " SRC_URI[md5sum] = "53e4810d852df0601d01fd986a5b22b3" SRC_URI[sha256sum] = "7518b49b2eaa1c3091f24671bdcc124fd49fc8f1af51161927afa4329c027848"
Signature · 1 line
2.25.1
PATCH 8/12 scripts/buildhistory-diff: drop use of distutils
In reply to Steve SakomanFrom: Tim Orling <[email protected]>
The use of distutils.version.LooseVersion to check for GitPython > 0.3.1 is not really needed anymore since any supported distribution has at least 1.0.0 (centos-7 via epel7, debian-9, ubuntu-16.04)
If we want to reinstate this check, alternatives would be to require python3-packaging on all hosts and use packaging.version.Version or use an imported LooseVersion in bb.version.
[YOCTO #14610]
--- scripts/buildhistory-diff | 5 ----- 1 file changed, 5 deletions(-)
scripts/buildhistory-diff +0 -5
@@ -11,7 +11,6 @@ import sys import os import argparse -from distutils.version import LooseVersion # Ensure PythonGit is installed (buildhistory_analysis needs it) try:
@@ -71,10 +70,6 @@ def main(): parser = get_args_parser() args = parser.parse_args() - if LooseVersion(git.__version__) < '0.3.1': - sys.stderr.write("Version of GitPython is too old, please install GitPython (python-git) 0.3.1 or later in order to use this script\n") - sys.exit(1) - if len(args.revisions) > 2: sys.stderr.write('Invalid argument(s) specified: %s\n\n' % ' '.join(args.revisions[2:])) parser.print_help()
Signature · 1 line
2.25.1
PATCH 9/12 selftest: skip virgl test on fedora 35
In reply to Steve SakomanThis test will fail any time the host has libdrm > 2.4.107
--- meta/lib/oeqa/selftest/cases/runtime_test.py | 2 ++ 1 file changed, 2 insertions(+)
meta/lib/oeqa/selftest/cases/runtime_test.py +2 -0
@@ -183,6 +183,8 @@ class TestImage(OESelftestTestCase): self.skipTest('virgl isn\'t working with Centos 8') if distro and distro == 'fedora-34': self.skipTest('virgl isn\'t working with Fedora 34') + if distro and distro == 'fedora-35': + self.skipTest('virgl isn\'t working with Fedora 35') if distro and distro == 'opensuseleap-15.0': self.skipTest('virgl isn\'t working with Opensuse 15.0')
Signature · 1 line
2.25.1
PATCH 10/12 scripts: Update to use exec_module() instead of load_module()
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
This is deprecated in python 3.12 and Fedora 35 is throwing warnings so move to the new functions.
--- scripts/lib/scriptutils.py | 7 +++++-- scripts/lib/wic/pluginbase.py | 8 ++++++-- 2 files changed, 11 insertions(+), 4 deletions(-)
scripts/lib/scriptutils.py +5 -2
@@ -18,7 +18,8 @@ import sys import tempfile import threading import importlib -from importlib import machinery +import importlib.machinery +import importlib.util class KeepAliveStreamHandler(logging.StreamHandler): def __init__(self, keepalive=True, **kwargs):
@@ -82,7 +83,9 @@ def load_plugins(logger, plugins, pluginpath): logger.debug('Loading plugin %s' % name) spec = importlib.machinery.PathFinder.find_spec(name, path=[pluginpath] ) if spec: - return spec.loader.load_module() + mod = importlib.util.module_from_spec(spec) + spec.loader.exec_module(mod) + return mod def plugin_name(filename): return os.path.splitext(os.path.basename(filename))[0]
scripts/lib/wic/pluginbase.py +6 -2
@@ -9,9 +9,11 @@ __all__ = ['ImagerPlugin', 'SourcePlugin'] import os import logging +import types from collections import defaultdict -from importlib.machinery import SourceFileLoader +import importlib +import importlib.util from wic import WicError from wic.misc import get_bitbake_var
@@ -54,7 +56,9 @@ class PluginMgr: mname = fname[:-3] mpath = os.path.join(ppath, fname) logger.debug("loading plugin module %s", mpath) - SourceFileLoader(mname, mpath).load_module() + spec = importlib.util.spec_from_file_location(mname, mpath) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) return PLUGINS.get(ptype)
Signature · 1 line
2.25.1
PATCH 11/12 lib/oe/reproducible: correctly set .git location when recursively looking for git repos
In reply to Steve SakomanFrom: Alexander Kanavin <[email protected]>
--- meta/lib/oe/reproducible.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oe/reproducible.py +1 -1
@@ -41,7 +41,7 @@ def find_git_folder(d, sourcedir): for root, dirs, files in os.walk(workdir, topdown=True): dirs[:] = [d for d in dirs if d not in exclude] if '.git' in dirs: - return root + return os.path.join(root, ".git") bb.warn("Failed to find a git repository in WORKDIR: %s" % workdir) return None
Signature · 1 line
2.25.1
PATCH 12/12 asciidoc: properly detect and compare Python versions >= 3.10
In reply to Steve Sakomanasciidoc.py cannot properly detect versions of Python >= 3.10
Backport patch from upstream to correct this:
https://github.com/asciidoc-py/asciidoc-py/commit/44d2d6095246124c024230f89c1029794491839f
Fixed upstream in version 9.04, so this patch is not required in master.
--- .../asciidoc/detect-python-version.patch | 42 +++++++++++++++++++ .../asciidoc/asciidoc_8.6.9.bb | 3 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-extended/asciidoc/asciidoc/detect-python-version.patch
meta/recipes-extended/asciidoc/asciidoc/detect-python-version.patch new file +42 -0
@@ -0,0 +1,42 @@ +From 44d2d6095246124c024230f89c1029794491839f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <[email protected]> +Date: Fri, 30 Oct 2020 15:10:35 +0100 +Subject: [PATCH] Properly detect and compare Python version 3.10+ (#151) + +Upstream commit: https://github.com/asciidoc-py/asciidoc-py/commit/44d2d6095246124c024230f89c1029794491839f + +Slightly modified to cleanly apply to asciidoc 8.6.9: +- VERSION and MIN_PYTHON_VERSION changed to reflect values in 8.6.9 +- line numbers corrected to eliminate offset warnings + +Upstream-Status: Backport +Signed-off-by: Steve Sakoman <[email protected]> + +--- + asciidoc.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/asciidoc.py b/asciidoc.py +index f960e7d8..42868c4b 100755 +--- a/asciidoc.py ++++ b/asciidoc.py +@@ -30,7 +30,7 @@ + # Used by asciidocapi.py # + VERSION = '8.6.10' # See CHANGELOG file for version history. + +-MIN_PYTHON_VERSION = '3.4' # Require this version of Python or better. ++MIN_PYTHON_VERSION = (3, 4) # Require this version of Python or better. + + # --------------------------------------------------------------------------- + # Program constants. +@@ -4704,8 +4704,8 @@ def init(self, cmd): + directory. + cmd is the asciidoc command or asciidoc.py path. + """ +- if float(sys.version[:3]) < float(MIN_PYTHON_VERSION): +- message.stderr('FAILED: Python %s or better required' % MIN_PYTHON_VERSION) ++ if sys.version_info[:2] < MIN_PYTHON_VERSION: ++ message.stderr('FAILED: Python %d.%d or better required' % MIN_PYTHON_VERSION) + sys.exit(1) + if not os.path.exists(cmd): + message.stderr('FAILED: Missing asciidoc command: %s' % cmd)
meta/recipes-extended/asciidoc/asciidoc_8.6.9.bb +2 -1
@@ -9,7 +9,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \ file://COPYRIGHT;md5=029ad5428ba5efa20176b396222d4069" SRC_URI = "git://github.com/asciidoc/asciidoc-py3;protocol=https;branch=main \ - file://auto-catalogs.patch" + file://auto-catalogs.patch \ + file://detect-python-version.patch" SRCREV = "618f6e6f6b558ed1e5f2588cd60a5a6b4f881ca0" PV .= "+py3-git${SRCPV}"
Signature · 1 line
2.25.1