public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Anton Mikanovich <amikan@ilbers.de>
To: isar-users@googlegroups.com
Cc: Anton Mikanovich <amikan@ilbers.de>
Subject: [PATCH] Generate initrd for all installed kernels
Date: Thu, 28 Aug 2025 09:17:33 +0300	[thread overview]
Message-ID: <20250828061733.3320270-1-amikan@ilbers.de> (raw)

Since commit 2f27a20f, we support multiple kernels on target.

Generate initrd for all of them instead of some random choice.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 meta/classes/rootfs.bbclass | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
index 7b7859b9..ebe3bf4a 100644
--- a/meta/classes/rootfs.bbclass
+++ b/meta/classes/rootfs.bbclass
@@ -481,11 +481,13 @@ rootfs_generate_initramfs[progress] = "custom:rootfs_progress.InitrdProgressHand
 rootfs_generate_initramfs() {
     if [ -n "$(sudo find '${ROOTFSDIR}/boot' -type f -name 'vmlinu[xz]*')" ]; then
         sudo -E chroot "${ROOTFSDIR}" sh -c '\
-            mods_total="$(find /usr/lib/modules -type f -name '*.ko*' | wc -l)"; \
-            export kernel_version=$(basename /boot/vmlinu[xz]-* | cut -d'-' -f2-); \
-            echo "Total number of modules: $mods_total"; \
-            echo "Generating initrd for kernel version: $kernel_version"; \
-            update-initramfs -u -v -k "$kernel_version";'
+            for kernel in /boot/vmlinu[xz]-*; do \
+                export kernel_version=$(basename $kernel | cut -d'-' -f2-); \
+                mods_total="$(find /usr/lib/modules/$kernel_version -type f -name '*.ko*' | wc -l)"; \
+                echo "Total number of modules: $mods_total"; \
+                echo "Generating initrd for kernel version: $kernel_version"; \
+                update-initramfs -u -v -k "$kernel_version"; \
+            done;'
         if [ -n "${INITRD_DEPLOY_FILE}" ]; then
             if [ -f "${ROOTFSDIR}/initrd.img" ]; then
                 # debian (mkinitramfs)
-- 
2.34.1

-- 
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/20250828061733.3320270-1-amikan%40ilbers.de.

             reply	other threads:[~2025-08-28  6:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-28  6:17 Anton Mikanovich [this message]
2025-08-29  7:29 ` 'MOESSBAUER, Felix' via isar-users

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=20250828061733.3320270-1-amikan@ilbers.de \
    --to=amikan@ilbers.de \
    --cc=isar-users@googlegroups.com \
    /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