public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'Jan Kiszka' via isar-users" <isar-users@googlegroups.com>
To: Zhihang Wei <wzh@ilbers.de>, isar-users@googlegroups.com
Subject: Re: [PATCH v4] trixie: Workaround with missing drivers in initramfs
Date: Thu, 5 Mar 2026 15:14:37 +0100	[thread overview]
Message-ID: <499ca787-0971-455a-9fc6-ae9d91981678@siemens.com> (raw)
In-Reply-To: <20260305140933.1515497-1-wzh@ilbers.de>

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

-- 
Siemens AG, Foundational Technologies
Linux Expert Center

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/499ca787-0971-455a-9fc6-ae9d91981678%40siemens.com.

      reply	other threads:[~2026-03-05 14:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-05 14:09 Zhihang Wei
2026-03-05 14:14 ` 'Jan Kiszka' via isar-users [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=499ca787-0971-455a-9fc6-ae9d91981678@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    --cc=wzh@ilbers.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox