public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'MOESSBAUER, Felix' via isar-users" <isar-users@googlegroups.com>
To: "amikan@ilbers.de" <amikan@ilbers.de>,
	"isar-users@googlegroups.com" <isar-users@googlegroups.com>
Subject: Re: [PATCH] Generate initrd for all installed kernels
Date: Fri, 29 Aug 2025 07:29:56 +0000	[thread overview]
Message-ID: <a6dcdbbdbc10c28f4e5413d21aff7f1a756e3e2b.camel@siemens.com> (raw)
In-Reply-To: <20250828061733.3320270-1-amikan@ilbers.de>

On Thu, 2025-08-28 at 09:17 +0300, Anton Mikanovich wrote:
> Since commit 2f27a20f, we support multiple kernels on target.
> 
> Generate initrd for all of them instead of some random choice.

Reviewed-by: Felix Moessbauer <felix.moessbauer@siemens.com>

Felix

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

-- 
Siemens AG
Linux Expert Center
Friedrich-Ludwig-Bauer-Str. 3
85748 Garching, Germany

-- 
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/a6dcdbbdbc10c28f4e5413d21aff7f1a756e3e2b.camel%40siemens.com.

      reply	other threads:[~2025-08-29  7:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-28  6:17 Anton Mikanovich
2025-08-29  7:29 ` 'MOESSBAUER, Felix' 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=a6dcdbbdbc10c28f4e5413d21aff7f1a756e3e2b.camel@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=amikan@ilbers.de \
    --cc=felix.moessbauer@siemens.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