[PATCH v3] trixie: Workaround with missing drivers in initramfs

3 views
Skip to first unread message

Zhihang Wei

unread,
Mar 4, 2026, 11:47:33 AM (14 days ago) Mar 4
to isar-...@googlegroups.com
This is a workaround for the booting issue on several Trixie
targets, which is caused by missing drivers in their initramfs.

Starting with Debian Trixie, update-initramfs invokes "dracut-install"
to collect and install required drivers into the generated initramfs.
"dracut-install" relies on fts_open() / fts_read() from glibc to
traverse directories and locate drivers.

Due to a long-standing bug [1] between qemu and glibc, the fts_*
functions may fail to find files on certain 32-bit architectures. As a
result, some required modules are not detected and not added to the
initramfs. The produced image then fails to boot.
It's known that at least these targets under Trixie are affected:
- qemuarm (missing virtio_blk)
- bananapi (missing sunxi_mmc)
- nanopi-neo (missing sunxi_mmc)

A similiar dracut bug report was filed in 2024 [2], pointing to this
upstream glibc issue reported in 2018 [1]. No upstream fix has been
applied, and the issue appears to affect only qemu builds for specific
32-bit targets.

As a temporary workaround, use a customized initramfs-hook to append
the neccessary drivers that are currently missed from the initramfs.

For a complete fix, we either need to push for an upstream glibc/qemu
fix, or convince dracut to avoid using these non-POSIX fts_* functions
and use opendir() / readdir() instead.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=23960
[2] https://bugs-devel.debian.org/cgi-bin/bugreport.cgi?bug=1079443

Signed-off-by: Zhihang Wei <w...@ilbers.de>
---

To apply this patch, the DTB patch and the "Add Trixie support for
various machines" patch are needed.

.../conf/multiconfig/bananapi-trixie.conf | 2 +
.../conf/multiconfig/nanopi-neo-trixie.conf | 2 +
.../conf/multiconfig/qemuarm-trixie.conf | 4 +-
.../initramfs-trixie-armhf-hook_0.1.bb | 50 +++++++++++++++++++
4 files changed, 57 insertions(+), 1 deletion(-)
create mode 100644 meta/recipes-initramfs/initramfs-trixie-armhf-hook/initramfs-trixie-armhf-hook_0.1.bb

diff --git a/meta-isar/conf/multiconfig/bananapi-trixie.conf b/meta-isar/conf/multiconfig/bananapi-trixie.conf
index 66f9db89..c2a9c667 100644
--- a/meta-isar/conf/multiconfig/bananapi-trixie.conf
+++ b/meta-isar/conf/multiconfig/bananapi-trixie.conf
@@ -3,3 +3,5 @@

MACHINE ?= "bananapi"
DISTRO ?= "debian-trixie"
+
+IMAGE_INSTALL += "initramfs-trixie-armhf-hook"
diff --git a/meta-isar/conf/multiconfig/nanopi-neo-trixie.conf b/meta-isar/conf/multiconfig/nanopi-neo-trixie.conf
index 6e8f8a44..ee53e68d 100644
--- a/meta-isar/conf/multiconfig/nanopi-neo-trixie.conf
+++ b/meta-isar/conf/multiconfig/nanopi-neo-trixie.conf
@@ -3,3 +3,5 @@

MACHINE ?= "nanopi-neo"
DISTRO ?= "debian-trixie"
+
+IMAGE_INSTALL += "initramfs-trixie-armhf-hook"
diff --git a/meta-isar/conf/multiconfig/qemuarm-trixie.conf b/meta-isar/conf/multiconfig/qemuarm-trixie.conf
index 5600ab23..5ec903a5 100644
--- a/meta-isar/conf/multiconfig/qemuarm-trixie.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-trixie.conf
@@ -1,7 +1,9 @@
# This software is a part of Isar.
-# Copyright (C) 2024 ilbers GmbH
+# Copyright (C) 2024-2026 ilbers GmbH
#
# SPDX-License-Identifier: MIT

MACHINE ?= "qemuarm"
DISTRO ?= "debian-trixie"
+
+IMAGE_INSTALL += "initramfs-trixie-armhf-hook"
diff --git a/meta/recipes-initramfs/initramfs-trixie-armhf-hook/initramfs-trixie-armhf-hook_0.1.bb b/meta/recipes-initramfs/initramfs-trixie-armhf-hook/initramfs-trixie-armhf-hook_0.1.bb
new file mode 100644
index 00000000..dc923e9f
--- /dev/null
+++ b/meta/recipes-initramfs/initramfs-trixie-armhf-hook/initramfs-trixie-armhf-hook_0.1.bb
@@ -0,0 +1,50 @@
+# This software is a part of Isar.
+# Copyright (C) 2026 ilbers GmbH
+#
+# SPDX-License-Identifier: MIT
+
+MAINTAINER = "isar-users <isar-...@googlegroups.com>"
+
+inherit initramfs-hook
+
+# -----------------------------------------------------------------------------
+# This recipe serves as an example workaround to add missing drivers to
+# the initramfs generated for Debian Trixie. The drivers are missing due
+# to an upstream bug in glibc/qemu. This issue caused booting issue on
+# several Trixie targets.
+#
+# Background:
+#
+# Starting with Debian Trixie, update-initramfs invokes "dracut-install"
+# to collect and install required drivers into the generated initramfs.
+# "dracut-install" relies on fts_open() / fts_read() from glibc to
+# traverse directories and locate drivers.
+#
+# Due to a long-standing bug [1] between qemu and glibc, the fts_*
+# functions may fail to find files on certain 32-bit architectures. As a
+# result, some required modules are not detected and not added to the
+# initramfs. The produced image then fails to boot.
+#
+# It's known that at least these targets under Trixie are affected:
+# - qemuarm (missing virtio_blk)
+# - bananapi (missing sunxi_mmc)
+# - nanopi-neo (missing sunxi_mmc)
+#
+# A similiar dracut bug report was filed in 2024 [2], pointing to this
+# upstream glibc issue reported in 2018 [1]. No upstream fix has been
+# applied, and the issue appears to affect only qemu builds for specific
+# 32-bit targets.
+#
+# [1] https://sourceware.org/bugzilla/show_bug.cgi?id=23960
+# [2] https://bugs-devel.debian.org/cgi-bin/bugreport.cgi?bug=1079443
+#
+# Purpose of this recipe:
+#
+# This recipe provides a temporary workaround by using a customized
+# initramfs hook to append drivers that are currently missing from
+# the initramfs, allowing the target to boot.
+# -----------------------------------------------------------------------------
+
+HOOK_ADD_MODULES:append:qemuarm:debian-trixie = "virtio-blk"
+HOOK_ADD_MODULES:append:bananapi:debian-trixie = "sunxi_mmc"
+HOOK_ADD_MODULES:append:nanopi-neo:debian-trixie = "sunxi_mmc"
--
2.39.5

Jan Kiszka

unread,
Mar 4, 2026, 1:00:08 PM (14 days ago) Mar 4
to Zhihang Wei, isar-...@googlegroups.com
meta-isar/, please - you are referring to machines here which are not
known to meta/.
So, we are ignoring the dracut-native initramfs case. Please document
that at least because users can still configure that.

Jan

--
Siemens AG, Foundational Technologies
Linux Expert Center

Zhihang Wei

unread,
Mar 5, 2026, 9:09:37 AM (13 days ago) Mar 5
to isar-...@googlegroups.com
This workaround applies only to initramfs images generated with
initramfs-tools. It does not apply to dracut-based initramfs
generation. When using dracut, drivers may also be missing due to the
same underlying issue, but the affected drivers may differ.

Signed-off-by: Zhihang Wei <w...@ilbers.de>
---
Changes in v4:
- Move the hook recipe to meta-isar.
- Add notes on dracut.

.../conf/multiconfig/bananapi-trixie.conf | 2 +
.../conf/multiconfig/nanopi-neo-trixie.conf | 2 +
.../conf/multiconfig/qemuarm-trixie.conf | 4 +-
.../initramfs-trixie-armhf-hook_0.1.bb | 63 +++++++++++++++++++
4 files changed, 70 insertions(+), 1 deletion(-)
create mode 100644 meta-isar/recipes-initramfs/initramfs-trixie-armhf-hook/initramfs-trixie-armhf-hook_0.1.bb
diff --git a/meta-isar/recipes-initramfs/initramfs-trixie-armhf-hook/initramfs-trixie-armhf-hook_0.1.bb b/meta-isar/recipes-initramfs/initramfs-trixie-armhf-hook/initramfs-trixie-armhf-hook_0.1.bb
new file mode 100644
index 00000000..1a8c85d9
--- /dev/null
+++ b/meta-isar/recipes-initramfs/initramfs-trixie-armhf-hook/initramfs-trixie-armhf-hook_0.1.bb
@@ -0,0 +1,63 @@
+# Notes for dracut users:
+#
+# This workaround applies only to initramfs images generated with
+# initramfs-tools. It does not apply to initramfs images generated
+# directly with dracut.
+#
+# When using dracut, drivers may also be missing due to the same
+# underlying glibc/qemu issue. However, the set of missing drivers
+# may differ from those observed with initramfs-tools.
+#
+# This hook recipe cannot be used together with dracut, as it requires
+# initramfs-tools to be installed, and dracut conflicts with
+# initramfs-tools.
+# -----------------------------------------------------------------------------
+
+HOOK_ADD_MODULES:append:qemuarm:debian-trixie = "virtio-blk"
+HOOK_ADD_MODULES:append:bananapi:debian-trixie = "sunxi_mmc"
+HOOK_ADD_MODULES:append:nanopi-neo:debian-trixie = "sunxi_mmc"
--
2.39.5

Jan Kiszka

unread,
Mar 5, 2026, 9:14:45 AM (13 days ago) Mar 5
to Zhihang Wei, isar-...@googlegroups.com
Reviewed-by: Jan Kiszka <jan.k...@siemens.com>

Thanks!
Reply all
Reply to author
Forward
0 new messages