master: subtree updates oct 12 2023

poky: e444d2bed0..8d0ba08aa6:
  Alassane Yattara (1):
        bitbake: toaster: Monitoring - implement Django logging system

  Alexander Kanavin (1):
        nghttp2: update 1.56.0 -> 1.57.0

  Alexis Lothoré (2):
        oeqa/utils/gitarchive: fix tag pattern searching
        oeqa/utils/gitarchive: ensure tag matches regex before getting its fields

  Andreas Cord-Landwehr (1):
        wayland: consider pkgconfig sysroot for pkgdatadir

  André Draszik (1):
        wic: fix a typo in help output

  Archana Polampalli (1):
        gstreamer: upgrade 1.22.5 -> 1.22.6

  Bruce Ashfield (1):
        linux-yocto/6.5: integrate fixes for sanity issues

  Chris Laplante (1):
        recipetool/create_buildsys_python: use importlib instead of imp

  Daniel McGregor (2):
        meson: upgrade 1.2.1 -> 1.2.2
        libtirpc: conditionally enable gssapi

  Daniel Semkowicz (3):
        uboot-extlinux-config.bbclass: Remove repeated space character
        uboot-extlinux-config.bbclass: Uppercase "menu title" entry
        uboot-extlinux-config.bbclass: Add menu title configuration

  Fabio Estevam (1):
        u-boot: Upgrade to 2023.10

  Fahad Arslan (1):
        linux-firmware: create separate package for cirrus and cnm firmwares

  Jermain Horsman (1):
        scripts/oe-setup-layers: Update how to determine if directory is git repo

  Jose Quaresma (4):
        curl: 8.3.0 -> 8.4.0
        go: update 1.20.7 -> 1.20.8
        go: update 1.20.8 -> 1.20.9
        go: update 1.20.9 -> 1.20.10

  Joshua Watt (6):
        bitbake: hashserv: Add remove API
        bitbake: bitbake-hashclient: Add remove subcommand
        bitbake: hashserv: Extend get_outhash API to optionally include unihash
        bitbake: hashserv: Add API to clean unused entries
        bitbake: bitbake-hashclient: Add clean-unused subcommand
        overview: Add note about non-reproducibility side effects

  Julien Stephan (4):
        bitbake.conf: include bblock.conf
        sstatesig: add a new info level for SIGGEN_LOCKEDSIGS_TASKSIG_CHECK
        scripts/bblock: add a script to lock/unlock recipes
        oeqa/selftest/bblock: add self test for bblock tool

  Khem Raj (1):
        python3-docutils: Rename utilities to their canonical names

  Lee Chee Yang (1):
        migration-guides: add release notes for 4.0.13

  Marcus Flyckt (1):
        devtool/upgrade: check all git config locations

  Markus Volk (2):
        mesa: Upgrade 23.1.8 -> 23.2.1
        gtk: Upgrade 4.12.1 -> 4.12.3

  Marlon Rodriguez Garcia (1):
        bitbake: toaster: update selenium version and code syntax

  Martijn de Gouw (1):
        busybox: Set PATH in syslog initscript

  Michael Opdenacker (1):
        ref-manual: releases.svg: Scarthgap is now version 5.0

  Mikko Rapeli (2):
        qemurunner.py: detect login prompt without without utf-8 conversion
        openssh: drop sudo from ptest dependencies

  Peter Kjellerstedt (4):
        externalsrc.bbclass: Support specifying patterns in CONFIGURE_FILES
        autotools.bbclass: Add *.m4 to CONFIGURE_FILES
        packages.bbclass: Correct the check for conflicts with renamed packages
        cmake.bbclass: Add *.cmake to CONFIGURE_FILES

  Quentin Schulz (1):
        uboot-extlinux-config.bbclass: fix missed override syntax migration

  Randy MacLeod (1):
        strace: skip so_peerpidfd test

  Rasmus Villemoes (1):
        openssh: update sshd_check_keys script to make use of 'sshd -G'

  Richard Purdie (14):
        wic: Add console parameters to qemux86 canned-wks
        qemurunner: Skip conversion from/to binary data for logfile
        qemurunner: Use backslashreplace with utf8 to make invalid characters clear
        qemurunner: Log the second serial console as well as the first
        qemurunner: Show both the login console log and all logging upon failure
        oeqa/concurrencytest: Remove invalid buffering option
        bitbake: selftest/fetch: Ensure top level directory timestamp doesn't break test
        cryptodev: Update to latest git for 6.5 kernel fixes
        qemux86/qemuarm: Drop kernel version overrides
        oeqa/qemurunner: Add newlines serial workaround
        runqemu/qemurunner: Use nodelay with tcp serial connections
        oeqa/qemurunner: Add extra logging when console doesn't appear
        poky/poky-tiny: Switch to the 6.5 kernel
        oeqa/qemurunner: Ensure we retry after BrokenPipeError

  Ross Burton (12):
        python3-numpy: remove obsolete reproducible workaround
        libx11: upgrade to 1.8.7
        libxpm: upgrade to 3.5.17
        qemuboot: reduce default size of software I/O translation buffer
        sysvinit-initab: rewrite loop to generate inittab
        ttyrun: add new recipe
        sysvinit-inittab: use ttyrun to run getty only if the terminal exists
        busybox: use ttyrun to run getty only if the terminal exists
        oeqa/selftest: don't skip test_read_only_image on qemuarm64
        meta/conf/machine: remove SERIAL_CONSOLES_CHECK
        busybox-inittab: fix console handling
        oeqa/runtime/_qemutiny: rewrite test to be functional

  Sundeep KOKKONDA (1):
        rust: reproducibility issue fix

  Trevor Gamblin (1):
        dev-manual: fix testimage usage instructions

  Yogita Urade (1):
        qemu: fix CVE-2023-42467

meta-openembedded: ea42cec2ec..62039a2c33:
  Ahmad Fatoum (1):
        signing.bbclass: don't export OPENSSL environment variables globally

  Beniamin Sandu (1):
        libnet: upgrade version v1.2 -> v1.3

  Benjamin Bara (1):
        libvpx: upgrade 1.13.0 -> 1.13.1

  Chen Qi (1):
        libblockdev: fix QA error in case of multilib

  Christophe Vu-Brugier (3):
        libnvme: upgrade 1.5 -> 1.6
        nvme-cli: upgrade 2.5 -> 2.6
        libnvme: apply patch already upstream to fix build with musl

  Clément Péron (1):
        Revert "protobuf: stage protoc binary to sysroot"

  Daniel Klauer (1):
        graphviz: Fix build to not use $prefix as search dir

  Denys Zagorui (1):
        libbpf: add arm, powerpc and mips64 to COMPATIBLE_HOST

  Fabien Thomas (8):
        meta-filesystems/layer.conf : Add meta-networking dependency
        Add static-passwd and static-group files
        Add static-passwd and static-group files
        Add static-passwd and static-group files
        Add static-passwd and static-group files
        Add static-passwd and static-group files
        Add static-passwd and static-group files
        Add static-passwd and static-group files

  Gianfranco Costamagna (6):
        dlt-daemon: Make it work without systemd
        dlt-daemon: Enable experimental coredumphandler feature
        dlt-daemon: update patch 544.patch
        dlt-daemon: do not disable dlt-system build when systemd is set to off
        dlt-daemon: Add an additional fix for non-systemd builds
        cpprestsdk: fix typo in comment, tag is actually 2.0.18

  Jeffrey Pautler (1):
        bolt: change product name used for CVE checking

  Joe Slater (1):
        nginx: add configure option

  Johannes Kauffmann (1):
        open62541: add Backport status and link to patch

  Jörg Sommer (1):
        collectd: Use https in SRC_URI, add HOMEPAGE

  Khem Raj (16):
        python3-pyroute2: Add missing dependency on sqlite3 for ptests
        python3-pylint: Upgrade to 3.0.0
        python3-lz4: use python3-unittest-automake-output
        minicoredumber: Fix ptest reporting
        images: Inherit from core-image-base
        images: Delete layer specific base images
        images: Rename <layer>-image to <layer>-image-all
        images: Rename ptest images to rhyme with oe-core ptest images
        ptest-image: Switch to using core-image-minimal
        stressapptest: Upgrade to 1.0.11 release
        klibc: Upgrade to 2.0.13 release
        libnvme: Fix test builds on musl
        kernel-selftest: Build bpf tests again
        ptest-packagelists-meta-oe: Add kernel-selftest to x86/x86-64 images
        kernel-selftest: Copy the .config from kernel build
        kernel-selftest: Use clang options when clang is available

  Markus Volk (3):
        pugixml: Update 1.13 -> 1.14
        pipewire: Upgrade 0.3.80 -> 0.3.81
        gnome-control-center: Fix polkit gettext issue

  Martin Jansa (1):
        opencv: Fix build with protobuf v22 and dnn enabled

  Mickael RAMILISON (1):
        python3-rapidjson: add ptest

  Pawel Langowski (1):
        recipes-connectivity: Add tayga recipe

  Philip-Dylan Gleonec (1):
        cukinia: Fix license field

  Thomas Roos (1):
        python3-boto3, python3-botocore: remove recipes

  Tom Hochstein (1):
        libcamera: Avoid build break in signature recalculation

meta-arm: 95789365f7..e914891eee:
  Jon Mason (1):
        arm-bsp/u-boot: add recipe for 2023.07.02

meta-security: aca6d4a9e7..3f7d40b0fc:
  Rasmus Villemoes (3):
        fail2ban: add systemd support
        fail2ban: change sqlite3 dependency to python3-sqlite3
        fail2ban: add useful recommendations
Change-Id: I93672642f4e0392adc6223fdc4e073910b817bc9
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/poky/meta/lib/oe/sstatesig.py b/poky/meta/lib/oe/sstatesig.py
index 633a0fd..5bf1697 100644
--- a/poky/meta/lib/oe/sstatesig.py
+++ b/poky/meta/lib/oe/sstatesig.py
@@ -104,6 +104,8 @@
         self.lockedhashfn = {}
         self.machine = data.getVar("MACHINE")
         self.mismatch_msgs = []
+        self.mismatch_number = 0
+        self.lockedsigs_msgs = ""
         self.unlockedrecipes = (data.getVar("SIGGEN_UNLOCKED_RECIPES") or
                                 "").split()
         self.unlockedrecipes = { k: "" for k in self.unlockedrecipes }
@@ -187,6 +189,7 @@
                 #bb.warn("Using %s %s %s" % (recipename, task, h))
 
                 if h != h_locked and h_locked != unihash:
+                    self.mismatch_number += 1
                     self.mismatch_msgs.append('The %s:%s sig is computed to be %s, but the sig is locked to %s in %s'
                                           % (recipename, task, h, h_locked, var))
 
@@ -267,6 +270,15 @@
         warn_msgs = []
         error_msgs = []
         sstate_missing_msgs = []
+        info_msgs = None
+
+        if self.lockedsigs:
+            if len(self.lockedsigs) > 10:
+                self.lockedsigs_msgs = "There are %s recipes with locked tasks (%s task(s) have non matching signature)" % (len(self.lockedsigs), self.mismatch_number)
+            else:
+                self.lockedsigs_msgs = "The following recipes have locked tasks:"
+                for pn in self.lockedsigs:
+                    self.lockedsigs_msgs += " %s" % (pn)
 
         for tid in sq_data['hash']:
             if tid not in found:
@@ -279,7 +291,9 @@
                                                % (pn, taskname, sq_data['hash'][tid]))
 
         checklevel = d.getVar("SIGGEN_LOCKEDSIGS_TASKSIG_CHECK")
-        if checklevel == 'warn':
+        if checklevel == 'info':
+            info_msgs = self.lockedsigs_msgs
+        if checklevel == 'warn' or checklevel == 'info':
             warn_msgs += self.mismatch_msgs
         elif checklevel == 'error':
             error_msgs += self.mismatch_msgs
@@ -290,6 +304,8 @@
         elif checklevel == 'error':
             error_msgs += sstate_missing_msgs
 
+        if info_msgs:
+            bb.note(info_msgs)
         if warn_msgs:
             bb.warn("\n".join(warn_msgs))
         if error_msgs:
diff --git a/poky/meta/lib/oeqa/core/utils/concurrencytest.py b/poky/meta/lib/oeqa/core/utils/concurrencytest.py
index 5e20b0e..d10f8f7 100644
--- a/poky/meta/lib/oeqa/core/utils/concurrencytest.py
+++ b/poky/meta/lib/oeqa/core/utils/concurrencytest.py
@@ -264,7 +264,7 @@
             ourpid = os.getpid()
             try:
                 newbuilddir = None
-                stream = os.fdopen(c2pwrite, 'wb', 1)
+                stream = os.fdopen(c2pwrite, 'wb')
                 os.close(c2pread)
 
                 (builddir, newbuilddir) = suite.setupfunc("-st-" + str(ourpid), selftestdir, process_suite)
@@ -309,7 +309,7 @@
             os._exit(0)
         else:
             os.close(c2pwrite)
-            stream = os.fdopen(c2pread, 'rb', 1)
+            stream = os.fdopen(c2pread, 'rb')
             # Collect stdout/stderr into an io buffer
             output = io.BytesIO()
             testserver = ProtocolTestCase(stream, passthrough=output)
diff --git a/poky/meta/lib/oeqa/runtime/cases/_qemutiny.py b/poky/meta/lib/oeqa/runtime/cases/_qemutiny.py
index 14ff8b9..816fd4a 100644
--- a/poky/meta/lib/oeqa/runtime/cases/_qemutiny.py
+++ b/poky/meta/lib/oeqa/runtime/cases/_qemutiny.py
@@ -5,10 +5,15 @@
 #
 
 from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.target.qemu import OEQemuTarget
 
 class QemuTinyTest(OERuntimeTestCase):
 
     def test_boot_tiny(self):
-        status, output = self.target.run_serial('uname -a')
-        msg = "Cannot detect poky tiny boot!"
-        self.assertTrue("yocto-tiny" in output, msg)
+        # Until the target has explicit run_serial support, check that the
+        # target is the qemu runner
+        if isinstance(self.target, OEQemuTarget):
+            status, output = self.target.runner.run_serial('uname -a')
+            self.assertIn("Linux", output)
+        else:
+            self.skipTest("Target %s is not OEQemuTarget" % self.target)
diff --git a/poky/meta/lib/oeqa/selftest/cases/bblock.py b/poky/meta/lib/oeqa/selftest/cases/bblock.py
new file mode 100644
index 0000000..2b62d2a
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/bblock.py
@@ -0,0 +1,203 @@
+#
+# Copyright (c) 2023 BayLibre, SAS
+# Author: Julien Stepahn <jstephan@baylibre.com>
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+import os
+import re
+import bb.tinfoil
+
+import oeqa.utils.ftools as ftools
+from oeqa.utils.commands import runCmd, get_bb_var, get_bb_vars, bitbake
+
+from oeqa.selftest.case import OESelftestTestCase
+
+
+class BBLock(OESelftestTestCase):
+    @classmethod
+    def setUpClass(cls):
+        super(BBLock, cls).setUpClass()
+        cls.lockfile = cls.builddir + "/conf/bblock.conf"
+
+    def unlock_recipes(self, recipes=None, tasks=None):
+        cmd = "bblock -r "
+        if recipes:
+            cmd += " ".join(recipes)
+        if tasks:
+            cmd += " -t " + ",".join(tasks)
+        result = runCmd(cmd)
+
+        if recipes:
+            # ensure all signatures are removed from lockfile
+            contents = ftools.read_file(self.lockfile)
+            for recipe in recipes:
+                for task in tasks:
+                    find_in_contents = re.search(
+                        'SIGGEN_LOCKEDSIGS_.+\s\+=\s"%s:%s:.*"' % (recipe, task),
+                        contents,
+                    )
+                    self.assertFalse(
+                        find_in_contents,
+                        msg="%s:%s should not be present into bblock.conf anymore"
+                        % (recipe, task),
+                    )
+                self.assertExists(self.lockfile)
+        else:
+            self.assertNotExists(self.lockfile)
+
+    def lock_recipes(self, recipes, tasks=None):
+        cmd = "bblock " + " ".join(recipes)
+        if tasks:
+            cmd += " -t " + ",".join(tasks)
+
+        result = runCmd(cmd)
+
+        self.assertExists(self.lockfile)
+
+        # ensure all signatures are added to lockfile
+        contents = ftools.read_file(self.lockfile)
+        for recipe in recipes:
+            if tasks:
+                for task in tasks:
+                    find_in_contents = re.search(
+                        'SIGGEN_LOCKEDSIGS_.+\s\+=\s"%s:%s:.*"' % (recipe, task),
+                        contents,
+                    )
+                    self.assertTrue(
+                        find_in_contents,
+                        msg="%s:%s was not added into bblock.conf. bblock output: %s"
+                        % (recipe, task, result.output),
+                    )
+
+    def modify_tasks(self, recipes, tasks):
+        task_append = ""
+        for recipe in recipes:
+            bb_vars = get_bb_vars(["PV"], recipe)
+            recipe_pv = bb_vars["PV"]
+            recipe_append_file = recipe + "_" + recipe_pv + ".bbappend"
+
+            os.mkdir(os.path.join(self.testlayer_path, "recipes-test", recipe))
+            recipe_append_path = os.path.join(
+                self.testlayer_path, "recipes-test", recipe, recipe_append_file
+            )
+
+            for task in tasks:
+                task_append += "%s:append() {\n#modify task hash \n}\n" % task
+            ftools.write_file(recipe_append_path, task_append)
+            self.add_command_to_tearDown(
+                "rm -rf %s" % os.path.join(self.testlayer_path, "recipes-test", recipe)
+            )
+
+    def test_lock_single_recipe_single_task(self):
+        recipes = ["quilt"]
+        tasks = ["do_compile"]
+        self._run_test(recipes, tasks)
+
+    def test_lock_single_recipe_multiple_tasks(self):
+        recipes = ["quilt"]
+        tasks = ["do_compile", "do_install"]
+        self._run_test(recipes, tasks)
+
+    def test_lock_single_recipe_all_tasks(self):
+        recipes = ["quilt"]
+        self._run_test(recipes, None)
+
+    def test_lock_multiple_recipe_single_task(self):
+        recipes = ["quilt", "bc"]
+        tasks = ["do_compile"]
+        self._run_test(recipes, tasks)
+
+    def test_lock_architecture_specific(self):
+        # unlock all recipes and ensure no bblock.conf file exist
+        self.unlock_recipes()
+
+        recipes = ["quilt"]
+        tasks = ["do_compile"]
+
+        # lock quilt's do_compile task for another machine
+        if self.td["MACHINE"] == "qemux86-64":
+            machine = "qemuarm"
+        else:
+            machine = "qemux86-64"
+
+        self.write_config('MACHINE = "%s"\n' % machine)
+
+        self.lock_recipes(recipes, tasks)
+
+        self.write_config('MACHINE = "%s"\n' % self.td["MACHINE"])
+        # modify quilt's do_compile task
+        self.modify_tasks(recipes, tasks)
+
+        # build quilt using the default machine
+        # No Note/Warning should be emitted since sig is locked for another machine
+        # (quilt package is architecture dependant)
+        info_message = "NOTE: The following recipes have locked tasks: " + recipes[0]
+        warn_message = "The %s:%s sig is computed to be" % (recipes[0], tasks[0])
+        result = bitbake(recipes[0] + " -n")
+        self.assertNotIn(info_message, result.output)
+        self.assertNotIn(warn_message, result.output)
+
+        # unlock all recipes
+        self.unlock_recipes()
+
+    def _run_test(self, recipes, tasks=None):
+        # unlock all recipes and ensure no bblock.conf file exist
+        self.unlock_recipes()
+
+        self.write_config('BB_SIGNATURE_HANDLER = "OEBasicHash"')
+
+        # lock tasks for recipes
+        result = self.lock_recipes(recipes, tasks)
+
+        if not tasks:
+            tasks = []
+            result = bitbake("-c listtasks " + recipes[0])
+            with bb.tinfoil.Tinfoil() as tinfoil:
+                tinfoil.prepare(config_only=False, quiet=2)
+                d = tinfoil.parse_recipe(recipes[0])
+
+                for line in result.output.splitlines():
+                    if line.startswith("do_"):
+                        task = line.split()[0]
+                        if "setscene" in task:
+                            continue
+                        if d.getVarFlag(task, "nostamp"):
+                            continue
+                        tasks.append(task)
+
+        # build recipes. At this stage we should have a Note about recipes
+        # having locked task's sig, but no warning since sig still match
+        info_message = "NOTE: The following recipes have locked tasks: " + " ".join(
+            recipes
+        )
+        for recipe in recipes:
+            result = bitbake(recipe + " -n")
+            self.assertIn(info_message, result.output)
+            for task in tasks:
+                warn_message = "The %s:%s sig is computed to be" % (recipe, task)
+                self.assertNotIn(warn_message, result.output)
+
+        # modify all tasks that are locked to trigger a sig change then build the recipes
+        # at this stage we should have a Note as before, but also a Warning for all
+        # locked tasks indicating the sig mismatch
+        self.modify_tasks(recipes, tasks)
+        for recipe in recipes:
+            result = bitbake(recipe + " -n")
+            self.assertIn(info_message, result.output)
+            for task in tasks:
+                warn_message = "The %s:%s sig is computed to be" % (recipe, task)
+                self.assertIn(warn_message, result.output)
+
+        # unlock all tasks and rebuild, no more Note/Warning should remain
+        self.unlock_recipes(recipes, tasks)
+        for recipe in recipes:
+            result = bitbake(recipe + " -n")
+            self.assertNotIn(info_message, result.output)
+            for task in tasks:
+                warn_message = "The %s:%s sig is computed to be" % (recipe, task)
+                self.assertNotIn(warn_message, result.output)
+
+        # unlock all recipes
+        self.unlock_recipes()
diff --git a/poky/meta/lib/oeqa/selftest/cases/buildoptions.py b/poky/meta/lib/oeqa/selftest/cases/buildoptions.py
index 01ea4dc..1044484 100644
--- a/poky/meta/lib/oeqa/selftest/cases/buildoptions.py
+++ b/poky/meta/lib/oeqa/selftest/cases/buildoptions.py
@@ -50,8 +50,6 @@
             loglines = "".join(f.readlines())
         self.assertIn("ccache", loglines, msg="No match for ccache in %s log.do_compile. For further details: %s" % (recipe , log_compile))
 
-    # https://bugzilla.yoctoproject.org/show_bug.cgi?id=14962
-    @skipIfMachine("qemuarm64", "fails on qemuarm64 (uses SERIAL_CONSOLES_CHECK)")
     def test_read_only_image(self):
         distro_features = get_bb_var('DISTRO_FEATURES')
         if not ('x11' in distro_features and 'opengl' in distro_features):
diff --git a/poky/meta/lib/oeqa/selftest/cases/reproducible.py b/poky/meta/lib/oeqa/selftest/cases/reproducible.py
index 84c6c3a..9b4a088 100644
--- a/poky/meta/lib/oeqa/selftest/cases/reproducible.py
+++ b/poky/meta/lib/oeqa/selftest/cases/reproducible.py
@@ -16,8 +16,6 @@
 import datetime
 
 exclude_packages = [
-	'rust',
-	'rust-dbg'
 	]
 
 def is_excluded(package):
diff --git a/poky/meta/lib/oeqa/utils/gitarchive.py b/poky/meta/lib/oeqa/utils/gitarchive.py
index f9c1526..10cb267 100644
--- a/poky/meta/lib/oeqa/utils/gitarchive.py
+++ b/poky/meta/lib/oeqa/utils/gitarchive.py
@@ -113,7 +113,7 @@
     # First try to fetch tags from repository configured remote
     cmd.append('origin')
     if pattern:
-        cmd.append(pattern)
+        cmd.append("refs/tags/"+pattern)
     try:
         tags_refs = repo.run_cmd(cmd)
         tags = ["".join(d.split()[1].split('/', 2)[2:]) for d in tags_refs.splitlines()]
@@ -235,6 +235,8 @@
     revs = []
     for tag in tags:
         m = tag_re.match(tag)
+        if not m:
+            continue
         groups = m.groupdict()
         revs.append([groups[f] for f in undef_fields] + [tag])
 
diff --git a/poky/meta/lib/oeqa/utils/qemurunner.py b/poky/meta/lib/oeqa/utils/qemurunner.py
index 22cf258..a52fa41 100644
--- a/poky/meta/lib/oeqa/utils/qemurunner.py
+++ b/poky/meta/lib/oeqa/utils/qemurunner.py
@@ -97,6 +97,7 @@
         try:
             sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
             sock.setblocking(0)
+            sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
             sock.bind(("127.0.0.1",0))
             sock.listen(2)
             port = sock.getsockname()[1]
@@ -109,16 +110,15 @@
 
     def decode_qemulog(self, todecode):
         # Sanitize the data received from qemu as it may contain control characters
-        msg = todecode.decode("utf-8", errors='ignore')
+        msg = todecode.decode("utf-8", errors='backslashreplace')
         msg = re_control_char.sub('', msg)
         return msg
 
-    def log(self, msg):
+    def log(self, msg, extension=""):
         if self.logfile:
-            msg = self.decode_qemulog(msg)
-            self.msg += msg
-            with codecs.open(self.logfile, "a", encoding="utf-8") as f:
-                f.write("%s" % msg)
+            with codecs.open(self.logfile + extension, "ab") as f:
+                f.write(msg)
+        self.msg += self.decode_qemulog(msg)
 
     def getOutput(self, o):
         import fcntl
@@ -445,9 +445,11 @@
         self.logger.debug("Waiting at most %d seconds for login banner (%s)" %
                           (self.boottime, time.strftime("%D %H:%M:%S")))
         endtime = time.time() + self.boottime
+        newlinetime = time.time() + 120
         filelist = [self.server_socket, self.runqemu.stdout]
         reachedlogin = False
         stopread = False
+        sentnewlines = False
         qemusock = None
         bootlog = b''
         data = b''
@@ -456,6 +458,16 @@
                 sread, swrite, serror = select.select(filelist, [], [], 5)
             except InterruptedError:
                 continue
+            # With the 6.5 kernel, the serial port getty sometimes fails to appear, the data
+            # appears lost in some buffer somewhere. Wait two minutes, then if we've not had a login,
+            # try and provoke one. This is a workaround until we can work out the root cause.
+            if time.time() > newlinetime and not sentnewlines:
+                self.logger.warning('Probing the serial port to wake it up!')
+                try:
+                    self.server_socket.sendall(bytes("\n\n", "utf-8"))
+                    sentnewlines = True
+                except BrokenPipeError as e:
+                    self.logger.debug('Probe failed %s' % repr(e))
             for file in sread:
                 if file is self.server_socket:
                     qemusock, addr = self.server_socket.accept()
@@ -474,18 +486,14 @@
                         self.logger.error('Invalid file type: %s\n%s' % (file))
                         read = b''
 
-                    self.logger.debug2('Partial boot log:\n%s' % (read.decode('utf-8', errors='ignore')))
+                    self.logger.debug2('Partial boot log:\n%s' % (read.decode('utf-8', errors='backslashreplace')))
                     data = data + read
                     if data:
                         bootlog += data
-                        if self.serial_ports < 2:
-                            # this file has mixed console/kernel data, log it to logfile
-                            self.log(data)
-
+                        self.log(data, extension = ".2")
                         data = b''
 
-                        decodedlog = self.decode_qemulog(bootlog)
-                        if self.boot_patterns['search_reached_prompt'] in decodedlog:
+                        if bytes(self.boot_patterns['search_reached_prompt'], 'utf-8') in bootlog:
                             self.server_socket.close()
                             self.server_socket = qemusock
                             stopread = True
@@ -507,11 +515,20 @@
                                   (self.boottime, time.strftime("%D %H:%M:%S")))
             tail = lambda l: "\n".join(l.splitlines()[-25:])
             bootlog = self.decode_qemulog(bootlog)
-            # in case bootlog is empty, use tail qemu log store at self.msg
-            lines = tail(bootlog if bootlog else self.msg)
-            self.logger.warning("Last 25 lines of text (%d):\n%s" % (len(bootlog), lines))
+            self.logger.warning("Last 25 lines of login console (%d):\n%s" % (len(bootlog), tail(bootlog)))
+            self.logger.warning("Last 25 lines of all logging (%d):\n%s" % (len(self.msg), tail(self.msg)))
             self.logger.warning("Check full boot log: %s" % self.logfile)
             self.stop()
+            data = True
+            while data:
+                try:
+                    time.sleep(1)
+                    data = qemusock.recv(1024)
+                    self.log(data, extension = ".2")
+                    self.logger.warning('Extra log data read: %s\n' % (data.decode('utf-8', errors='backslashreplace')))
+                except Exception as e:
+                    self.logger.warning('Extra log data exception %s' % repr(e))
+                    data = None
             return False
 
         # If we are not able to login the tests can continue