[v4] trixie: Workaround with missing drivers in initramfs

Message ID 20260305140933.1515497-1-wzh@ilbers.de
State Under Review
Headers show
Series [v4] trixie: Workaround with missing drivers in initramfs | expand

Commit Message

Zhihang Wei March 5, 2026, 2:09 p.m. UTC
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

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 <wzh@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

Comments

Jan Kiszka March 5, 2026, 2:14 p.m. UTC | #1
On 05.03.26 15:09, Zhihang Wei wrote:
> 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
> 
> 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 <wzh@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/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-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 @@
> +# This software is a part of Isar.
> +# Copyright (C) 2026 ilbers GmbH
> +#
> +# SPDX-License-Identifier: MIT
> +
> +MAINTAINER = "isar-users <isar-users@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.
> +# 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"

Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>

Thanks!

Jan

Patch

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-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 @@ 
+# This software is a part of Isar.
+# Copyright (C) 2026 ilbers GmbH
+#
+# SPDX-License-Identifier: MIT
+
+MAINTAINER = "isar-users <isar-users@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.
+# 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"