public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] qemuarm-trixie: Workaround with missing drivers in qemuarm-trixie initrd
@ 2026-02-20 11:53 Zhihang Wei
  2026-02-20 11:59 ` 'Jan Kiszka' via isar-users
  0 siblings, 1 reply; 2+ messages in thread
From: Zhihang Wei @ 2026-02-20 11:53 UTC (permalink / raw)
  To: isar-users

This is a workaround to fix the current qemuarm-trixie image unbootable
issue.

Starting with Debian Trixie, update-initramfs invokes "dracut-install"
to collect and install required drivers into the generated initrd.
"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, required modules such as virtio_blk are not detected and not
added to the initrd. The produced image then fails to boot under qemu
because the block device driver is missing.

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, introduce INITRAMFS_EXTRA_DRIVERS and use it
to append the neccessary drivers that are currently missed from the
initrd.

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 <wzh@ilbers.de>
---
 meta-isar/conf/multiconfig/qemuarm-trixie.conf | 2 ++
 meta/classes-recipe/rootfs.bbclass             | 9 ++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/meta-isar/conf/multiconfig/qemuarm-trixie.conf b/meta-isar/conf/multiconfig/qemuarm-trixie.conf
index 5600ab23..dcf0b839 100644
--- a/meta-isar/conf/multiconfig/qemuarm-trixie.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-trixie.conf
@@ -5,3 +5,5 @@
 
 MACHINE ?= "qemuarm"
 DISTRO ?= "debian-trixie"
+
+INITRAMFS_EXTRA_DRIVERS += "virtio_blk"
diff --git a/meta/classes-recipe/rootfs.bbclass b/meta/classes-recipe/rootfs.bbclass
index 8485b32f..65843f61 100644
--- a/meta/classes-recipe/rootfs.bbclass
+++ b/meta/classes-recipe/rootfs.bbclass
@@ -12,12 +12,19 @@ ROOTFS_DISTRO ?= "${DISTRO}"
 # the default initramfs generator and it is not
 # possible to derive the value in another way
 ROOTFS_USE_DRACUT ??= ""
+INITRAMFS_EXTRA_DRIVERS ?= ""
 
 def initramfs_generator_cmdline(d):
     rootfs_packages =  d.getVar('ROOTFS_PACKAGES') or ''
+    extra_drivers = d.getVar('INITRAMFS_EXTRA_DRIVERS') or ''
     if 'dracut' in rootfs_packages or bb.utils.to_boolean(d.getVar('ROOTFS_USE_DRACUT')):
         return "dracut --force --kver \"$kernel_version\""
-    return "update-initramfs -u -v -k \"$kernel_version\""
+    cmds = []
+    if extra_drivers:
+        for drv in extra_drivers.split():
+            cmds.append(f'echo {drv} | tee -a /etc/initramfs-tools/modules')
+    cmds.append('update-initramfs -u -v -k "$kernel_version"')
+    return " && ".join(cmds)
 
 ROOTFS_PACKAGES ?= ""
 ROOTFS_VARDEPS ?= ""
-- 
2.39.5

-- 
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/20260220115339.1188052-1-wzh%40ilbers.de.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] qemuarm-trixie: Workaround with missing drivers in qemuarm-trixie initrd
  2026-02-20 11:53 [PATCH] qemuarm-trixie: Workaround with missing drivers in qemuarm-trixie initrd Zhihang Wei
@ 2026-02-20 11:59 ` 'Jan Kiszka' via isar-users
  0 siblings, 0 replies; 2+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2026-02-20 11:59 UTC (permalink / raw)
  To: Zhihang Wei, isar-users

On 20.02.26 12:53, Zhihang Wei wrote:
> This is a workaround to fix the current qemuarm-trixie image unbootable
> issue.
> 
> Starting with Debian Trixie, update-initramfs invokes "dracut-install"
> to collect and install required drivers into the generated initrd.
> "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, required modules such as virtio_blk are not detected and not
> added to the initrd. The produced image then fails to boot under qemu
> because the block device driver is missing.
> 
> 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, introduce INITRAMFS_EXTRA_DRIVERS and use it
> to append the neccessary drivers that are currently missed from the
> initrd.
> 
> 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 <wzh@ilbers.de>
> ---
>  meta-isar/conf/multiconfig/qemuarm-trixie.conf | 2 ++
>  meta/classes-recipe/rootfs.bbclass             | 9 ++++++++-
>  2 files changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/meta-isar/conf/multiconfig/qemuarm-trixie.conf b/meta-isar/conf/multiconfig/qemuarm-trixie.conf
> index 5600ab23..dcf0b839 100644
> --- a/meta-isar/conf/multiconfig/qemuarm-trixie.conf
> +++ b/meta-isar/conf/multiconfig/qemuarm-trixie.conf
> @@ -5,3 +5,5 @@
>  
>  MACHINE ?= "qemuarm"
>  DISTRO ?= "debian-trixie"
> +
> +INITRAMFS_EXTRA_DRIVERS += "virtio_blk"
> diff --git a/meta/classes-recipe/rootfs.bbclass b/meta/classes-recipe/rootfs.bbclass
> index 8485b32f..65843f61 100644
> --- a/meta/classes-recipe/rootfs.bbclass
> +++ b/meta/classes-recipe/rootfs.bbclass
> @@ -12,12 +12,19 @@ ROOTFS_DISTRO ?= "${DISTRO}"
>  # the default initramfs generator and it is not
>  # possible to derive the value in another way
>  ROOTFS_USE_DRACUT ??= ""
> +INITRAMFS_EXTRA_DRIVERS ?= ""
>  
>  def initramfs_generator_cmdline(d):
>      rootfs_packages =  d.getVar('ROOTFS_PACKAGES') or ''
> +    extra_drivers = d.getVar('INITRAMFS_EXTRA_DRIVERS') or ''
>      if 'dracut' in rootfs_packages or bb.utils.to_boolean(d.getVar('ROOTFS_USE_DRACUT')):
>          return "dracut --force --kver \"$kernel_version\""
> -    return "update-initramfs -u -v -k \"$kernel_version\""
> +    cmds = []
> +    if extra_drivers:
> +        for drv in extra_drivers.split():
> +            cmds.append(f'echo {drv} | tee -a /etc/initramfs-tools/modules')
> +    cmds.append('update-initramfs -u -v -k "$kernel_version"')
> +    return " && ".join(cmds)
>  

This is not a nice way to work around the issue. The variable introduced
here is bypassing how initramfs are configured via their generators in
isar (recipes for hooks or modules). Use that, please.

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/d34a2c26-3abe-4f26-b29b-a01510d6c4a0%40siemens.com.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-02-20 11:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-20 11:53 [PATCH] qemuarm-trixie: Workaround with missing drivers in qemuarm-trixie initrd Zhihang Wei
2026-02-20 11:59 ` 'Jan Kiszka' via isar-users

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox