Skip to contentSkip to conversation

review request

PATCH New Anuj Mittal 1 participant 16 messages May 12, 2021

lore
Share & tools
lore
#3 lore raw

PATCH 3/15 oeqa/qemurunner: Fix binary vs str issue

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

The recent logging changes for qemurunner showed up as errors on the autobuilder where decode couldn't be called on the returned string. Since the code returns binary data, return b'' instead of '' to match to avoid tracebacks.

One of these cases was newly added, copied from the other which has been there for a long time, always broken.

(cherry picked from commit b8995b27db265b0a0b2d2ca595915f70f9f96e07)
---
 meta/lib/oeqa/utils/qemurunner.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/lib/oeqa/utils/qemurunner.py +2 -2
index 84f7c5e76d..526b493669 100644
@@ -650,7 +650,7 @@ class LoggingThread(threading.Thread):
             data = self.readsock.recv(count)
         except socket.error as e:
             if e.errno == errno.EAGAIN or e.errno == errno.EWOULDBLOCK:
-                return ''
+                return b''
             else:
                 raise
 
@@ -663,7 +663,7 @@ class LoggingThread(threading.Thread):
             # until qemu exits.
             if not self.canexit:
                 raise Exception("Console connection closed unexpectedly")
-            return ''
+            return b''
 
         return data
 
Signature · 1 line
2.31.1
#0 lore raw

cover review request

Please review these changes for hardknott. No problems while testing on autobuilder.

Thanks,

Anuj

The following changes since commit d5d88c2293e8ebc958d1bce9af8f796024443be9:

libevent: Increase ptest timing tolerance 50 ms -> 100 ms (2021-05-07 08:51:54 +0800)

are available in the Git repository at:

git://push.openembedded.org/openembedded-core-contrib anujm/hardknott

Alexander Kanavin (1):
linux-firmware: upgrade 20210208 -> 20210315

Anuj Mittal (1):
lsb-release: fix reproducibility failure

Bruce Ashfield (1):
linux-yocto/5.4: qemuppc32: reduce serial shutdown issues

Chen Qi (1):
db: update CVE_PRODUCT

Kai Kang (1):
grub2.inc: remove '-O2' from CFLAGS

Michael Opdenacker (1):
sanity.bbclass: mention CONNECTIVITY_CHECK_URIS in network failure
message

Peter Kjellerstedt (1):
libcap: Configure Make variables correctly without a horrible hack

Richard Purdie (4):
oeqa/qemurunner: Improve logging thread exit handling for qemu
shutdown test
oeqa/qemurunner: Fix binary vs str issue
oeqa/qemurunner: Improve handling of run_serial for shutdown commands
puzzles: Upstream changed to main branch for development

Romain Naour (1):
dejagnu: needs expect at runtime

Vinícius Ossanes Aquino (1):
lttng-modules: backport patches to fix build against 5.12+ kernel

Yann Dirson (1):
linux-firmware: include all relevant files in -bcm4356

zhengruoqin (1):
ruby: upgrade 3.0.0 -> 3.0.1

 meta/classes/sanity.bbclass                   |   9 +-
 meta/lib/oeqa/selftest/cases/runqemu.py       |   9 +-
 meta/lib/oeqa/utils/qemurunner.py             |  21 +-
 meta/recipes-bsp/grub/grub2.inc               |   2 +
 .../recipes-devtools/dejagnu/dejagnu_1.6.2.bb |   1 +
 .../ruby/{ruby_3.0.0.bb => ruby_3.0.1.bb}     |   2 +-
 .../help2man-reproducibility.patch            |  27 ++
 meta/recipes-extended/lsb/lsb-release_1.4.bb  |   1 +
 ...20210208.bb => linux-firmware_20210315.bb} |   8 +-
 .../linux/linux-yocto-rt_5.4.bb               |   2 +-
 .../linux/linux-yocto-tiny_5.4.bb             |   2 +-
 meta/recipes-kernel/linux/linux-yocto_5.4.bb  |   2 +-
 ...block-add-a-disk_uevent-helper-v5.12.patch | 305 ++++++++++++++++++
 ...block-add-a-disk_uevent-helper-v5.12.patch |  48 +++
 ...free-event-name-mismatching-with-pro.patch |  71 ++++
 .../lttng/lttng-modules_2.12.5.bb             |   3 +
 meta/recipes-sato/puzzles/puzzles_git.bb      |   2 +-
 meta/recipes-support/db/db_5.3.28.bb          |   2 +-
 meta/recipes-support/libcap/libcap_2.48.bb    |  21 +-
 19 files changed, 504 insertions(+), 34 deletions(-)
 rename meta/recipes-devtools/ruby/{ruby_3.0.0.bb => ruby_3.0.1.bb} (97%)
 create mode 100644 meta/recipes-extended/lsb/lsb-release/help2man-reproducibility.patch
 rename meta/recipes-kernel/linux-firmware/{linux-firmware_20210208.bb => linux-firmware_20210315.bb} (99%)
 create mode 100644 meta/recipes-kernel/lttng/lttng-modules/0005-fix-block-add-a-disk_uevent-helper-v5.12.patch
 create mode 100644 meta/recipes-kernel/lttng/lttng-modules/0006-fix-backport-block-add-a-disk_uevent-helper-v5.12.patch
 create mode 100644 meta/recipes-kernel/lttng/lttng-modules/0007-fix-mm-tracing-kfree-event-name-mismatching-with-pro.patch
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/15 sanity.bbclass: mention CONNECTIVITY_CHECK_URIS in network failure message

From: Michael Opdenacker <[email protected]>

This expands the error message when a network failure is detected. It happens that some ISPs or networks block the default example.com domain. Therefore, instead of disabling network access, it lets the user know how to modify the test URL.

(cherry picked from commit 62c94bb925543c1e1c5af3c751913d9f06d9597d)
---
 meta/classes/sanity.bbclass | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
meta/classes/sanity.bbclass +6 -3
index 14ffac0bf2..a2ac4eeb80 100644
@@ -392,9 +392,12 @@ def check_connectivity(d):
             msg = data.getVar('CONNECTIVITY_CHECK_MSG') or ""
             if len(msg) == 0:
                 msg = "%s.\n" % err
-                msg += "    Please ensure your host's network is configured correctly,\n"
-                msg += "    or set BB_NO_NETWORK = \"1\" to disable network access if\n"
-                msg += "    all required sources are on local disk.\n"
+                msg += "    Please ensure your host's network is configured correctly.\n"
+                msg += "    If your ISP or network is blocking the above URL,\n"
+                msg += "    try with another domain name, for example by setting:\n"
+                msg += "    CONNECTIVITY_CHECK_URIS = \"https://www.yoctoproject.org/\""
+                msg += "    You could also set BB_NO_NETWORK = \"1\" to disable network\n"
+                msg += "    access if all required sources are on local disk.\n"
             retval = msg
 
     return retval
Signature · 1 line
2.31.1
#2 lore raw

PATCH 2/15 oeqa/qemurunner: Improve logging thread exit handling for qemu shutdown test

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

Rather than totally disabling the logging, inform it we're about to exit so we can log messages over the exit cleanly too. This aids debugging. It also avoids a race where the logging handler could still error whilst shutting down.

Also remove a race window by notificing the handler of the shutdown first, before triggering it. This removes a race window I watched in local testing.

(cherry picked from commit 0e19f31a1005f94105e1cef252abfffcef2aafad)
---
 meta/lib/oeqa/selftest/cases/runqemu.py |  9 ++++-----
 meta/lib/oeqa/utils/qemurunner.py       | 12 +++++++++++-
 2 files changed, 15 insertions(+), 6 deletions(-)
meta/lib/oeqa/selftest/cases/runqemu.py +4 -5
index 7e676bcb41..da22f77b27 100644
@@ -163,12 +163,11 @@ class QemuTest(OESelftestTestCase):
         bitbake(cls.recipe)
 
     def _start_qemu_shutdown_check_if_shutdown_succeeded(self, qemu, timeout):
+        # Allow the runner's LoggingThread instance to exit without errors
+        # (such as the exception "Console connection closed unexpectedly")
+        # as qemu will disappear when we shut it down
+        qemu.runner.allowexit()
         qemu.run_serial("shutdown -h now")
-        # Stop thread will stop the LoggingThread instance used for logging
-        # qemu through serial console, stop thread will prevent this code
-        # from facing exception (Console connection closed unexpectedly)
-        # when qemu was shutdown by the above shutdown command
-        qemu.runner.stop_thread()
         time_track = 0
         try:
             while True:
meta/lib/oeqa/utils/qemurunner.py +11 -1
index 278904ba0b..84f7c5e76d 100644
@@ -471,6 +471,10 @@ class QemuRunner:
             self.thread.stop()
             self.thread.join()
 
+    def allowexit(self):
+        if self.thread:
+            self.thread.allowexit()
+
     def restart(self, qemuparams = None):
         self.logger.warning("Restarting qemu process")
         if self.runqemu.poll() is None:
@@ -564,6 +568,7 @@ class LoggingThread(threading.Thread):
         self.logger = logger
         self.readsock = None
         self.running = False
+        self.canexit = False
 
         self.errorevents = select.POLLERR | select.POLLHUP | select.POLLNVAL
         self.readevents = select.POLLIN | select.POLLPRI
@@ -597,6 +602,9 @@ class LoggingThread(threading.Thread):
         self.close_ignore_error(self.writepipe)
         self.running = False
 
+    def allowexit(self):
+        self.canexit = True
+
     def eventloop(self):
         poll = select.poll()
         event_read_mask = self.errorevents | self.readevents
@@ -653,7 +661,9 @@ class LoggingThread(threading.Thread):
             # happened. But for this code it counts as an
             # error since the connection shouldn't go away
             # until qemu exits.
-            raise Exception("Console connection closed unexpectedly")
+            if not self.canexit:
+                raise Exception("Console connection closed unexpectedly")
+            return ''
 
         return data
 
Signature · 1 line
2.31.1
#4 lore raw

PATCH 4/15 oeqa/qemurunner: Improve handling of run_serial for shutdown commands

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

When running a shutdown command, the serial port can close without the command returning. This is seen as the socket being readable but having no data. Change the way this case is handled in the code to avoid tracebacks.

(cherry picked from commit 396a3ba884820d040c91f7592daf20ac28c49b5d)
---
 meta/lib/oeqa/utils/qemurunner.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
meta/lib/oeqa/utils/qemurunner.py +6 -1
index 526b493669..a0f17d557b 100644
@@ -71,6 +71,8 @@ class QemuRunner:
         self.monitorpipe = None
 
         self.logger = logger
+        # Whether we're expecting an exit and should show related errors
+        self.canexit = False
 
         # Enable testing other OS's
         # Set commands for target communication, and default to Linux ALWAYS
@@ -472,6 +474,7 @@ class QemuRunner:
             self.thread.join()
 
     def allowexit(self):
+        self.canexit = True
         if self.thread:
             self.thread.allowexit()
 
@@ -530,7 +533,9 @@ class QemuRunner:
                     if re.search(self.boot_patterns['search_cmd_finished'], data):
                         break
                 else:
-                    raise Exception("No data on serial console socket")
+                    if self.canexit:
+                        return (1, "")
+                    raise Exception("No data on serial console socket, connection closed?")
 
         if data:
             if raw:
Signature · 1 line
2.31.1
#5 lore raw

PATCH 5/15 db: update CVE_PRODUCT

In reply to Anuj Mittal

From: Chen Qi <[email protected]>

Update CVE_PRODUCT to also include 'berkeley_db'. For example, CVE-2020-2981 uses 'berkeley_db'.

(cherry picked from commit ad799b109716ccd2f44dcf7a6a4cfcbd622ea661)
---
 meta/recipes-support/db/db_5.3.28.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-support/db/db_5.3.28.bb +1 -1
index 9cb57e6a53..b2ae98f05c 100644
@@ -15,7 +15,7 @@ HOMEPAGE = "https://www.oracle.com/database/technologies/related/berkeleydb.html
 LICENSE = "Sleepycat"
 RCONFLICTS_${PN} = "db3"
 
-CVE_PRODUCT = "oracle_berkeley_db"
+CVE_PRODUCT = "oracle_berkeley_db berkeley_db"
 CVE_VERSION = "11.2.${PV}"
 
 PR = "r1"
Signature · 1 line
2.31.1
#6 lore raw

PATCH 6/15 linux-firmware: upgrade 20210208 -> 20210315

In reply to Anuj Mittal

From: Alexander Kanavin <[email protected]>

License-Update: additional firmware files, version changes

(cherry picked from commit 2f10b9dbb4fb8ccb9a427883370fbbeb6f394551)
---
 ...{linux-firmware_20210208.bb => linux-firmware_20210315.bb} | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename meta/recipes-kernel/linux-firmware/{linux-firmware_20210208.bb => linux-firmware_20210315.bb} (99%)
meta/recipes-kernel/linux-firmware/linux-firmware_20210315.bb renamed from meta/recipes-kernel/linux-firmware/linux-firmware_20210208.bb +2 -2
similarity index 99%
rename from meta/recipes-kernel/linux-firmware/linux-firmware_20210208.bb
rename to meta/recipes-kernel/linux-firmware/linux-firmware_20210315.bb
index 78856cbf66..eb4ef51a3a 100644
@@ -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=ef0565762eac313c409567b59dff00b2 \
+                    file://WHENCE;md5=e21a8cbddc1612bce56f06fe154a0743 \
                     "
 
 # 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] = "1bcb1a3944c361507754a7d26ccff40ffc28d1fb93bce711d67da26b33e785b7"
+SRC_URI[sha256sum] = "a2348f03492713dca9aef202496c6e58f5e63ee5bec6a7bdfcf8b18ce7155e70"
 
 inherit allarch
 
Signature · 1 line
2.31.1
#7 lore raw

PATCH 7/15 linux-yocto/5.4: qemuppc32: reduce serial shutdown issues

In reply to Anuj Mittal

From: Bruce Ashfield <[email protected]>

Integrating the following commit(s) to linux-yocto/5.4:

    qemuppc32: reduce serial issues seen on shutdown

    Richard reported:

    We've been seeing a lot of the qemuppc shutdown issue and I decided to
    look into it. The really worrying thing looking at the logs locally is the
    serial ports are showing irq issues and becoming disabled as nobody would
    handle them.

    Errors like:

       [    9.194886] irq 36: nobody cared (try booting with the "irqpoll" option)
       [    9.198712] CPU: 0 PID: 127 Comm: bootlogd Not tainted
       [    9.202283] Call Trace:
       [    9.205611] [d1005f00] [c00a0da8] __report_bad_irq+0x50/0x138 (unreliable)
       [    9.209347] [d1005f30] [c00a0cc0] note_interrupt+0x324/0x378
       [    9.212855] [d1005f70] [c009d138] handle_irq_event+0xe8/0x104
       [    9.216353] [d1005fa0] [c00a1d9c] handle_fasteoi_irq+0xc0/0x29c
       [    9.219960] [d1005fc0] [c009b798] generic_handle_irq+0x40/0x5c
       [    9.223496] [d1005fd0] [c00075d0] __do_irq+0x58/0x188
       [    9.226948] [d1005ff0] [c0010040] call_do_irq+0x20/0x38
       [    9.230391] [d29eda60] [c0007788] do_IRQ+0x88/0xfc
       [    9.233860] [d29eda90] [c0016454] ret_from_except+0x0/0x14
       [    9.237288] --- interrupt: 501 at __setup_irq+0x3c4/0x838
       [    9.237288]     LR = __setup_irq+0x790/0x838
       [    9.244155] [d29edb88] [c009f0a4] request_threaded_irq+0x114/0x1c8
       [    9.247672] [d29edbb8] [c07a5a18] pmz_startup+0x17c/0x32c
       [    9.251203] [d29edbd8] [c07a1140] uart_port_startup+0x184/0x2f8
       [    9.254651] [d29edc08] [c07a1974] uart_port_activate+0x78/0xf4
       [    9.258141] [d29edc28] [c07839f8] tty_port_open+0xd4/0x170
       [    9.261579] [d29edc58] [c079db74] uart_open+0x2c/0x48
       [    9.265116] [d29edc68] [c077a288] tty_open+0x168/0x640
       [    9.268574] [d29edcd8] [c0280be8] chrdev_open+0x138/0x2a4
       [    9.272123] [d29edd18] [c027421c] do_dentry_open+0x228/0x410
       [    9.275643] [d29edd48] [c028e9f4] path_openat+0xb04/0xf28
       [    9.279184] [d29eddd8] [c02917e4] do_filp_open+0x120/0x164
       [    9.282535] [d29ede98] [c0276238] do_sys_openat2+0xd8/0x19c
       [    9.285790] [d29edee8] [c0276574] sys_openat+0x88/0xdc
       [    9.289096] [d29edf38] [c00160d8] ret_from_syscall+0x0/0x34
       [    9.292620] --- interrupt: c01 at 0xfec3738
       [    9.292620]     LR = 0xfec36e0
       [    9.299035] handlers:
       [    9.302312] [<7f7f7da8>] pmz_interrupt
       [    9.305541] Disabling IRQ #36

    (and the irqpoll option does not help)

    This is problematic as the shutdown test uses the serial interface to
    shut down the system. If the serial interface fails to login or run the command,
    game over for the test.

    CONFIG_SERIAL_PMACZILOG_CONSOLE complicates that handling, but doesn't provide
    any output or capabilities that we need. So we disable it here, and
    reduce the chances of issues during shutdown.
(cherry picked from commit 42355cb73049ee7a4af0f539a2a5b7d4ee1abc65)
---
 meta/recipes-kernel/linux/linux-yocto-rt_5.4.bb   | 2 +-
 meta/recipes-kernel/linux/linux-yocto-tiny_5.4.bb | 2 +-
 meta/recipes-kernel/linux/linux-yocto_5.4.bb      | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
meta/recipes-kernel/linux/linux-yocto-rt_5.4.bb +1 -1
index 939bef0ca9..f82c6b335b 100644
@@ -12,7 +12,7 @@ python () {
 }
 
 SRCREV_machine ?= "b62ae8bedb024e67e7c5cda51840454a4170c858"
-SRCREV_meta ?= "cf20a3c44f5ef181b16ed80e9c2683f76b1ead20"
+SRCREV_meta ?= "b89df7433ea8124d3092805391b78808df4147a7"
 
 SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;branch=${KBRANCH};name=machine \
            git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.4;destsuffix=${KMETA}"
meta/recipes-kernel/linux/linux-yocto-tiny_5.4.bb +1 -1
index e3750dd7f1..1c3fe73ae5 100644
@@ -17,7 +17,7 @@ KCONF_BSP_AUDIT_LEVEL = "2"
 
 SRCREV_machine_qemuarm ?= "80bd6016a9bdaed4b66ddffffa8c8e62d7c1f8a6"
 SRCREV_machine ?= "ea7a54fa402727f3c4bc4a1904d4a9590e7c8b85"
-SRCREV_meta ?= "cf20a3c44f5ef181b16ed80e9c2683f76b1ead20"
+SRCREV_meta ?= "b89df7433ea8124d3092805391b78808df4147a7"
 
 PV = "${LINUX_VERSION}+git${SRCPV}"
 
meta/recipes-kernel/linux/linux-yocto_5.4.bb +1 -1
index 38404a1935..5245530229 100644
@@ -21,7 +21,7 @@ SRCREV_machine_qemux86 ?= "ea7a54fa402727f3c4bc4a1904d4a9590e7c8b85"
 SRCREV_machine_qemux86-64 ?= "ea7a54fa402727f3c4bc4a1904d4a9590e7c8b85"
 SRCREV_machine_qemumips64 ?= "b36d79d6f2aaf9dadec352f611e7b9becf2b9a55"
 SRCREV_machine ?= "ea7a54fa402727f3c4bc4a1904d4a9590e7c8b85"
-SRCREV_meta ?= "cf20a3c44f5ef181b16ed80e9c2683f76b1ead20"
+SRCREV_meta ?= "b89df7433ea8124d3092805391b78808df4147a7"
 
 # remap qemuarm to qemuarma15 for the 5.4 kernel
 # KMACHINE_qemuarm ?= "qemuarma15"
Signature · 1 line
2.31.1
#8 lore raw

PATCH 8/15 lttng-modules: backport patches to fix build against 5.12+ kernel

In reply to Anuj Mittal

From: Vinícius Ossanes Aquino <[email protected]>

Add the following patches from stable-2.12 branch of lttng repository to fix errors when building lttng-modules against 5.12+ kernel since they are not present on the release 2.12.5:

- 17cd2dc9 fix: block: add a disk_uevent helper (v5.12)
- 127135b6 fix backport: block: add a disk_uevent helper (v5.12)
- 853d5903 fix: mm, tracing: kfree event name mismatching with provider kmem (v5.12)

(cherry picked from commit 2538ba2b3490e3599d9ccd637aa8486ea428f1b0)
---
 ...block-add-a-disk_uevent-helper-v5.12.patch | 305 ++++++++++++++++++
 ...block-add-a-disk_uevent-helper-v5.12.patch |  48 +++
 ...free-event-name-mismatching-with-pro.patch |  71 ++++
 .../lttng/lttng-modules_2.12.5.bb             |   3 +
 4 files changed, 427 insertions(+)
 create mode 100644 meta/recipes-kernel/lttng/lttng-modules/0005-fix-block-add-a-disk_uevent-helper-v5.12.patch
 create mode 100644 meta/recipes-kernel/lttng/lttng-modules/0006-fix-backport-block-add-a-disk_uevent-helper-v5.12.patch
 create mode 100644 meta/recipes-kernel/lttng/lttng-modules/0007-fix-mm-tracing-kfree-event-name-mismatching-with-pro.patch
meta/recipes-kernel/lttng/lttng-modules/0005-fix-block-add-a-disk_uevent-helper-v5.12.patch new file +305 -0
new file mode 100644
index 0000000000..3a2280ccdc
@@ -0,0 +1,305 @@
+From 17cd2dc91cb82ed342b0da699f2b1a70c1bf6a03 Mon Sep 17 00:00:00 2001
+From: Michael Jeanson <[email protected]>
+Date: Mon, 15 Mar 2021 14:54:02 -0400
+Subject: [PATCH 2/4] fix: block: add a disk_uevent helper (v5.12)
+
+See upstream commit:
+
+  commit bc359d03c7ec1bf3b86d03bafaf6bbb21e6414fd
+  Author: Christoph Hellwig <[email protected]>
+  Date:   Sun Jan 24 11:02:39 2021 +0100
+
+    block: add a disk_uevent helper
+
+    Add a helper to call kobject_uevent for the disk and all partitions, and
+    unexport the disk_part_iter_* helpers that are now only used in the core
+    block code.
+
+Upstream-status: Backport [2.12.6]
+
+Change-Id: If6e8797049642ab382d5699660ee1dd734e92c90
+Signed-off-by: Michael Jeanson <[email protected]>
+Signed-off-by: Mathieu Desnoyers <[email protected]>
+---
+ Makefile               |   1 +
+ lttng-statedump-impl.c |  34 +++++++++----
+ src/wrapper/genhd.c    | 111 +++++++++++++++++++++++++++++++++++++++++
+ wrapper/genhd.h        |  62 +++++++++++++++++++++++
+ 4 files changed, 198 insertions(+), 10 deletions(-)
+ create mode 100644 src/wrapper/genhd.c
+
+diff --git a/Makefile b/Makefile
+index a9aff3f1..34043cfb 100644
+--- a/Makefile
++++ b/Makefile
+@@ -80,6 +80,7 @@ ifneq ($(KERNELRELEASE),)
+                         wrapper/kallsyms.o \
+                         wrapper/irqdesc.o \
+                         wrapper/fdtable.o \
++                        wrapper/genhd.o \
+                         lttng-wrapper-impl.o
+ 
+   ifneq ($(CONFIG_HAVE_SYSCALL_TRACEPOINTS),)
+diff --git a/lttng-statedump-impl.c b/lttng-statedump-impl.c
+index 60b937c9..5511c7e8 100644
+--- a/lttng-statedump-impl.c
++++ b/lttng-statedump-impl.c
+@@ -250,13 +250,17 @@ int lttng_enumerate_block_devices(struct lttng_session *session)
+ 	struct device_type *ptr_disk_type;
+ 	struct class_dev_iter iter;
+ 	struct device *dev;
++	int ret = 0;
+ 
+ 	ptr_block_class = wrapper_get_block_class();
+-	if (!ptr_block_class)
+-		return -ENOSYS;
++	if (!ptr_block_class) {
++		ret = -ENOSYS;
++		goto end;
++	}
+ 	ptr_disk_type = wrapper_get_disk_type();
+ 	if (!ptr_disk_type) {
+-		return -ENOSYS;
++		ret = -ENOSYS;
++		goto end;
+ 	}
+ 	class_dev_iter_init(&iter, ptr_block_class, NULL, ptr_disk_type);
+ 	while ((dev = class_dev_iter_next(&iter))) {
+@@ -272,22 +276,32 @@ int lttng_enumerate_block_devices(struct lttng_session *session)
+ 		    (disk->flags & GENHD_FL_SUPPRESS_PARTITION_INFO))
+ 			continue;
+ 
+-		disk_part_iter_init(&piter, disk, DISK_PITER_INCL_PART0);
+-		while ((part = disk_part_iter_next(&piter))) {
++		/*
++		 * The original 'disk_part_iter_init' returns void, but our
++		 * wrapper can fail to lookup the original symbol.
++		 */
++		if (wrapper_disk_part_iter_init(&piter, disk, DISK_PITER_INCL_PART0) < 0) {
++			ret = -ENOSYS;
++			goto iter_exit;
++		}
++
++		while ((part = wrapper_disk_part_iter_next(&piter))) {
+ 			char name_buf[BDEVNAME_SIZE];
+ 
+ 			if (lttng_get_part_name(disk, part, name_buf) == -ENOSYS) {
+-				disk_part_iter_exit(&piter);
+-				class_dev_iter_exit(&iter);
+-				return -ENOSYS;
++				wrapper_disk_part_iter_exit(&piter);
++				ret = -ENOSYS;
++				goto iter_exit;
+ 			}
+ 			trace_lttng_statedump_block_device(session,
+ 					lttng_get_part_devt(part), name_buf);
+ 		}
+-		disk_part_iter_exit(&piter);
++		wrapper_disk_part_iter_exit(&piter);
+ 	}
++iter_exit:
+ 	class_dev_iter_exit(&iter);
+-	return 0;
++end:
++	return ret;
+ }
+ 
+ #ifdef CONFIG_INET
+diff --git a/src/wrapper/genhd.c b/src/wrapper/genhd.c
+new file mode 100644
+index 00000000..a5a6c410
+--- /dev/null
++++ b/src/wrapper/genhd.c
+@@ -0,0 +1,111 @@
++/* SPDX-License-Identifier: (GPL-2.0-only OR LGPL-2.1-only)
++ *
++ * wrapper/genhd.c
++ *
++ * Wrapper around disk_part_iter_(init|next|exit). Using KALLSYMS to get the
++ * addresses when available, else we need to have a kernel that exports this
++ * function to GPL modules. This export was removed in 5.12.
++ *
++ * Copyright (C) 2021 Michael Jeanson <[email protected]>
++ */
++
++#include <lttng/kernel-version.h>
++#include <linux/module.h>
++#include <wrapper/genhd.h>
++
++#if (defined(CONFIG_KALLSYMS) && \
++	(LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,12,0)))
++
++#include <wrapper/kallsyms.h>
++
++static
++void (*disk_part_iter_init_sym)(struct disk_part_iter *piter, struct gendisk *disk,
++			unsigned int flags);
++
++static
++LTTNG_DISK_PART_TYPE *(*disk_part_iter_next_sym)(struct disk_part_iter *piter);
++
++static
++void (*disk_part_iter_exit_sym)(struct disk_part_iter *piter);
++
++/*
++ * This wrapper has an 'int' return type instead of the original 'void', to be
++ * able to report the symbol lookup failure to the caller.
++ *
++ * Return 0 on success, -1 on error.
++ */
++int wrapper_disk_part_iter_init(struct disk_part_iter *piter, struct gendisk *disk,
++                          unsigned int flags)
++{
++	if (!disk_part_iter_init_sym)
++		disk_part_iter_init_sym = (void *) kallsyms_lookup_funcptr("disk_part_iter_init");
++
++	if (disk_part_iter_init_sym) {
++		disk_part_iter_init_sym(piter, disk, flags);
++	} else {
++		printk_once(KERN_WARNING "LTTng: disk_part_iter_init symbol lookup failed.\n");
++		return -1;
++	}
++	return 0;
++}
++EXPORT_SYMBOL_GPL(wrapper_disk_part_iter_init);
++
++LTTNG_DISK_PART_TYPE *wrapper_disk_part_iter_next(struct disk_part_iter *piter)
++{
++	if (!disk_part_iter_next_sym)
++		disk_part_iter_next_sym = (void *) kallsyms_lookup_funcptr("disk_part_iter_next");
++
++	if (disk_part_iter_next_sym) {
++		return disk_part_iter_next_sym(piter);
++	} else {
++		printk_once(KERN_WARNING "LTTng: disk_part_iter_next symbol lookup failed.\n");
++		return NULL;
++	}
++}
++EXPORT_SYMBOL_GPL(wrapper_disk_part_iter_next);
++
++/*
++ * We don't return an error on symbol lookup failure here because there is
++ * nothing the caller can do to cleanup the iterator.
++ */
++void wrapper_disk_part_iter_exit(struct disk_part_iter *piter)
++{
++	if (!disk_part_iter_exit_sym)
++		disk_part_iter_exit_sym = (void *) kallsyms_lookup_funcptr("disk_part_iter_exit");
++
++	if (disk_part_iter_exit_sym) {
++		disk_part_iter_exit_sym(piter);
++	} else {
++		printk_once(KERN_WARNING "LTTng: disk_part_iter_exit symbol lookup failed.\n");
++	}
++}
++EXPORT_SYMBOL_GPL(wrapper_disk_part_iter_exit);
++
++#else
++
++/*
++ * This wrapper has an 'int' return type instead of the original 'void', so the
++ * kallsyms variant can report the symbol lookup failure to the caller.
++ *
++ * This variant always succeeds and returns 0.
++ */
++int wrapper_disk_part_iter_init(struct disk_part_iter *piter, struct gendisk *disk,
++                          unsigned int flags)
++{
++	disk_part_iter_init(piter, disk, flags);
++	return 0;
++}
++EXPORT_SYMBOL_GPL(wrapper_disk_part_iter_init);
++
++LTTNG_DISK_PART_TYPE *wrapper_disk_part_iter_next(struct disk_part_iter *piter)
++{
++	return disk_part_iter_next(piter);
++}
++EXPORT_SYMBOL_GPL(wrapper_disk_part_iter_next);
++
++void wrapper_disk_part_iter_exit(struct disk_part_iter *piter)
++{
++	disk_part_iter_exit(piter);
++}
++EXPORT_SYMBOL_GPL(wrapper_disk_part_iter_exit);
++#endif
+diff --git a/wrapper/genhd.h b/wrapper/genhd.h
+index 98feb57b..6bae239d 100644
+--- a/wrapper/genhd.h
++++ b/wrapper/genhd.h
+@@ -13,6 +13,13 @@
+ #define _LTTNG_WRAPPER_GENHD_H
+ 
+ #include <linux/genhd.h>
++#include <lttng/kernel-version.h>
++
++#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0))
++#define LTTNG_DISK_PART_TYPE struct block_device
++#else
++#define LTTNG_DISK_PART_TYPE struct hd_struct
++#endif
+ 
+ #ifdef CONFIG_KALLSYMS_ALL
+ 
+@@ -94,4 +101,59 @@ struct device_type *wrapper_get_disk_type(void)
+ 
+ #endif
+ 
++/*
++ * This wrapper has an 'int' return type instead of the original 'void', to be
++ * able to report the symbol lookup failure to the caller.
++ *
++ * Return 0 on success, -1 on error.
++ */
++int wrapper_disk_part_iter_init(struct disk_part_iter *piter, struct gendisk *disk,
++                          unsigned int flags);
++LTTNG_DISK_PART_TYPE *wrapper_disk_part_iter_next(struct disk_part_iter *piter);
++void wrapper_disk_part_iter_exit(struct disk_part_iter *piter);
++
++/*
++ * Canary function to check for 'disk_part_iter_init()' at compile time.
++ *
++ * From 'include/linux/genhd.h':
++ *
++ *   extern void disk_part_iter_init(struct disk_part_iter *piter,
++ *                                   struct gendisk *disk, unsigned int flags);
++ *
++ */
++static inline
++void __canary__disk_part_iter_init(struct disk_part_iter *piter, struct gendisk *disk,
++		unsigned int flags)
++{
++	disk_part_iter_init(piter, disk, flags);
++}
++
++/*
++ * Canary function to check for 'disk_part_iter_next()' at compile time.
++ *
++ * From 'include/linux/genhd.h':
++ *
++ *   struct block_device *disk_part_iter_next(struct disk_part_iter *piter);
++ *
++ */
++static inline
++LTTNG_DISK_PART_TYPE *__canary__disk_part_iter_next(struct disk_part_iter *piter)
++{
++	return disk_part_iter_next(piter);
++}
++
++/*
++ * Canary function to check for 'disk_part_iter_exit()' at compile time.
++ *
++ * From 'include/linux/genhd.h':
++ *
++ *   extern void disk_part_iter_exit(struct disk_part_iter *piter);
++ *
++ */
++static inline
++void __canary__disk_part_iter_exit(struct disk_part_iter *piter)
++{
++	return disk_part_iter_exit(piter);
++}
++
+ #endif /* _LTTNG_WRAPPER_GENHD_H */
+-- 
+2.25.1
+
meta/recipes-kernel/lttng/lttng-modules/0006-fix-backport-block-add-a-disk_uevent-helper-v5.12.patch new file +48 -0

48 lines not on this page · raw message

meta/recipes-kernel/lttng/lttng-modules/0007-fix-mm-tracing-kfree-event-name-mismatching-with-pro.patch new file +71 -0

71 lines not on this page · raw message

meta/recipes-kernel/lttng/lttng-modules_2.12.5.bb +3 -0
index 5b05c644a6..1a01cb0c01 100644
@@ -15,6 +15,9 @@ SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \
            file://0002-Fix-filter-interpreter-early-exits-on-uninitialized-.patch  \
            file://0003-fix-mm-tracing-record-slab-name-for-kmem_cache_free-.patch \
            file://0004-Fix-kretprobe-null-ptr-deref-on-session-destroy.patch \
+           file://0005-fix-block-add-a-disk_uevent-helper-v5.12.patch \
+           file://0006-fix-backport-block-add-a-disk_uevent-helper-v5.12.patch \
+           file://0007-fix-mm-tracing-kfree-event-name-mismatching-with-pro.patch \
            "
 
 SRC_URI[sha256sum] = "c4d1a1b42c728e37b6b7947ae16563a011c4b297311aa04d56f9a1791fb5a30a"
Signature · 1 line
2.31.1
#9 lore raw

PATCH 9/15 libcap: Configure Make variables correctly without a horrible hack

In reply to Anuj Mittal

From: Peter Kjellerstedt <[email protected]>

Occasionally, the build would fail with:

make[2]: execvp: mkdir: Argument list too long

This turned out to be due to a hacky solution used in the recipe to modify the Makefile, which resulted in one more $(BUILD_CFLAGS) being added to the immediately expanded BUILD_CFLAGS Make variable each time do_configure was executed. After a couple of times, this lead to an environment with a 140 kB BUILD_CFLAGS when mkdir should execute, which resulted in the E2BIG.

(cherry picked from commit 116e6b61c585c6f0f7ae6f010bd490bb39914348)
---
 meta/recipes-support/libcap/libcap_2.48.bb | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)
meta/recipes-support/libcap/libcap_2.48.bb +8 -13
index a12738d63a..2f83acf966 100644
@@ -20,15 +20,6 @@ UPSTREAM_CHECK_URI = "https://www.kernel.org/pub/linux/libs/security/linux-privs
 
 inherit lib_package
 
-# do NOT pass target cflags to host compilations
-#
-do_configure() {
-	# libcap uses := for compilers, fortunately, it gives us a hint
-	# on what should be replaced with ?=
-	sed -e 's,:=,?=,g' -i Make.Rules
-	sed -e 's,^BUILD_CFLAGS ?= ,BUILD_CFLAGS := $(BUILD_CFLAGS) ,' -i Make.Rules
-}
-
 PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
 PACKAGECONFIG_class-native ??= ""
 
@@ -44,11 +35,15 @@ EXTRA_OEMAKE = " \
 
 EXTRA_OEMAKE_append_class-target = " SYSTEM_HEADERS=${STAGING_INCDIR}"
 
-# these are present in the libcap defaults, so include in our CFLAGS too
-CFLAGS += "-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
-
 do_compile() {
-	oe_runmake ${PACKAGECONFIG_CONFARGS}
+	unset CFLAGS BUILD_CFLAGS
+	oe_runmake \
+		${PACKAGECONFIG_CONFARGS} \
+		AR="${AR}" \
+		CC="${CC}" \
+		RANLIB="${RANLIB}" \
+		COPTS="${CFLAGS}" \
+		BUILD_COPTS="${BUILD_CFLAGS}"
 }
 
 do_install() {
Signature · 1 line
2.31.1
#10 lore raw

PATCH 10/15 dejagnu: needs expect at runtime

In reply to Anuj Mittal

From: Romain Naour <[email protected]>

runtest return an error due to missing expect on the target. Add expect as runtime dependency.

(cherry picked from commit d9a3a08edc1efcbe7b02e80be98370792d3c6cc2)
---
 meta/recipes-devtools/dejagnu/dejagnu_1.6.2.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-devtools/dejagnu/dejagnu_1.6.2.bb +1 -0
index 0a007bb2cd..ce242c3593 100644
@@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 SECTION = "devel"
 
 DEPENDS += "expect-native"
+RDEPENDS_${PN} = "expect"
 
 inherit autotools
 
Signature · 1 line
2.31.1
#11 lore raw

PATCH 11/15 grub2.inc: remove '-O2' from CFLAGS

In reply to Anuj Mittal

From: Kai Kang <[email protected]>

It fails to boot grub after upgrade grub to 2.06. According to description in

https://bugzilla.yoctoproject.org/show_bug.cgi?id=14367

it is introduced by a commit to fix CVE. So remove option '-O2' from CFLAGS rather than revert the commit to avoid the failure.

[YOCTO #14367]

CC Tony Battersby <[email protected]>
(cherry picked from commit 69805629b8f47fd46a37b7c5cc435982e2ac3d1d)
---
 meta/recipes-bsp/grub/grub2.inc | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-bsp/grub/grub2.inc +2 -0
index 590deb8d92..6de683ee1c 100644
@@ -49,6 +49,8 @@ GRUBPLATFORM ??= "pc"
 
 inherit autotools gettext texinfo pkgconfig
 
+CFLAGS_remove = "-O2"
+
 EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} \
                 --disable-grub-mkfont \
                 --program-prefix="" \
Signature · 1 line
2.31.1
#12 lore raw

PATCH 12/15 ruby: upgrade 3.0.0 -> 3.0.1

In reply to Anuj Mittal

From: zhengruoqin <[email protected]>

(cherry picked from commit b6949a028fd31bd04ed0478fb34a58b971f31e1f)
---
 meta/recipes-devtools/ruby/{ruby_3.0.0.bb => ruby_3.0.1.bb} | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename meta/recipes-devtools/ruby/{ruby_3.0.0.bb => ruby_3.0.1.bb} (97%)
meta/recipes-devtools/ruby/ruby_3.0.1.bb renamed from meta/recipes-devtools/ruby/ruby_3.0.0.bb +1 -1
similarity index 97%
rename from meta/recipes-devtools/ruby/ruby_3.0.0.bb
rename to meta/recipes-devtools/ruby/ruby_3.0.1.bb
index 28e12c3cd7..944cb81c1d 100644
@@ -8,7 +8,7 @@ SRC_URI += " \
            file://0001-template-Makefile.in-do-not-write-host-cross-cc-item.patch \
            "
 
-SRC_URI[sha256sum] = "a13ed141a1c18eb967aac1e33f4d6ad5f21be1ac543c344e0d6feeee54af8e28"
+SRC_URI[sha256sum] = "369825db2199f6aeef16b408df6a04ebaddb664fb9af0ec8c686b0ce7ab77727"
 
 PACKAGECONFIG ??= ""
 PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
Signature · 1 line
2.31.1
#13 lore raw

PATCH 13/15 lsb-release: fix reproducibility failure

In reply to Anuj Mittal

Make sure help2man output is reproducible. Fixes:

| .\"·DO·NOT·MODIFY·THIS·FILE!··It·was·generated·by·help2man·1.022.	.\"·DO·NOT·MODIFY·THIS·FILE!··It·was·generated·by·help2man·1.022.
| .TH·FSG·"1"·"April·2021"·"FSG·lsb_release·v1.4"·FSG	.TH·FSG·"1"·"May·2021"·"FSG·lsb_release·v1.4"·FSG
| .SH·NAME	3 	.SH·NAME
(cherry picked from commit 49371207a7f1fe3d3feb7b8b9aabb62b43ae34d1)
---
 .../help2man-reproducibility.patch            | 27 +++++++++++++++++++
 meta/recipes-extended/lsb/lsb-release_1.4.bb  |  1 +
 2 files changed, 28 insertions(+)
 create mode 100644 meta/recipes-extended/lsb/lsb-release/help2man-reproducibility.patch
meta/recipes-extended/lsb/lsb-release/help2man-reproducibility.patch new file +27 -0
new file mode 100644
index 0000000000..f32cd18370
@@ -0,0 +1,27 @@
+lsb-release maintains it's own copy of help2man. Include the support
+for specifying SOURCE_DATE_EPOCH from upstream.
+
+Upstream-Status: Pending
+
+Signed-off-by: Anuj Mittal <[email protected]>
+
+diff --git a/help2man b/help2man
+index 13015c2..63439db 100755
+--- a/help2man
++++ b/help2man
+@@ -173,7 +173,14 @@ my ($help_text, $version_text) = map {
+ 	or die "$this_program: can't get `--$_' info from $ARGV[0]\n"
+ } qw(help), $opt_version_key;
+ 
+-my $date = strftime "%B %Y", localtime;
++my $epoch_secs = time;
++if (exists $ENV{SOURCE_DATE_EPOCH} and $ENV{SOURCE_DATE_EPOCH} =~ /^(\d+)$/)
++{
++    $epoch_secs = $1;
++    $ENV{TZ} = 'UTC0';
++}
++
++my $date = strftime "%B %Y", localtime $epoch_secs;
+ (my $program = $ARGV[0]) =~ s!.*/!!;
+ my $package = $program;
+ my $version;
meta/recipes-extended/lsb/lsb-release_1.4.bb +1 -0
index 3e8f7a13ec..bafc18fcc0 100644
@@ -11,6 +11,7 @@ LIC_FILES_CHKSUM = "file://README;md5=12da544b1a3a5a1795a21160b49471cf"
 SRC_URI = "${SOURCEFORGE_MIRROR}/project/lsb/lsb_release/1.4/lsb-release-1.4.tar.gz \
            file://0001-fix-lsb_release-to-work-with-busybox-head-and-find.patch \
            file://0001-Remove-timestamp-from-manpage.patch \
+           file://help2man-reproducibility.patch \
            "
 
 SRC_URI[md5sum] = "30537ef5a01e0ca94b7b8eb6a36bb1e4"
Signature · 1 line
2.31.1
#14 lore raw

PATCH 14/15 linux-firmware: include all relevant files in -bcm4356

In reply to Anuj Mittal

From: Yann Dirson <[email protected]>

This currently catches the .clb_blob and .vamrs,rock960.txt, and other .txt files may come in future upstream releases.

(cherry picked from commit e332738a8aae0914c58b40faae8b9d7a82fd6a95)
---
 meta/recipes-kernel/linux-firmware/linux-firmware_20210315.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-kernel/linux-firmware/linux-firmware_20210315.bb +2 -2
index eb4ef51a3a..bd1f177209 100644
@@ -645,8 +645,8 @@ FILES_${PN}-bcm43455 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43455-sdio.
 "
 FILES_${PN}-bcm4350c2 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4350c2-pcie.bin"
 FILES_${PN}-bcm4350 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4350-pcie.bin"
-FILES_${PN}-bcm4356 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4356-sdio.bin \
-  ${nonarch_base_libdir}/firmware/cypress/cyfmac4356-sdio.bin \
+FILES_${PN}-bcm4356 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4356-sdio.* \
+  ${nonarch_base_libdir}/firmware/cypress/cyfmac4356-sdio.* \
 "
 FILES_${PN}-bcm43569 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43569.bin"
 FILES_${PN}-bcm43570 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43570-pcie.bin \
Signature · 1 line
2.31.1
#15 lore raw

PATCH 15/15 puzzles: Upstream changed to main branch for development

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

(cherry picked from commit 943402b25212408a4ddcfa8a146b645509e138dd)
---
 meta/recipes-sato/puzzles/puzzles_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-sato/puzzles/puzzles_git.bb +1 -1
index 16a08585cc..a1788cf684 100644
@@ -9,7 +9,7 @@ DEPENDS = "libxt"
 # The libxt requires x11 in DISTRO_FEATURES
 REQUIRED_DISTRO_FEATURES = "x11"
 
-SRC_URI = "git://git.tartarus.org/simon/puzzles.git \
+SRC_URI = "git://git.tartarus.org/simon/puzzles.git;branch=main \
            file://fix-compiling-failure-with-option-g-O.patch \
            file://0001-palisade-Fix-warnings-with-clang-on-arm.patch \
            file://0001-Use-Wno-error-format-overflow-if-the-compiler-suppor.patch \
Signature · 1 line
2.31.1