public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Quirin Gylstorff <Quirin.Gylstorff@siemens.com>,
	isar-users@googlegroups.com, felix.moessbauer@siemens.com
Subject: Re: [PATCH] classes/initramfs: Print messages in case of a build error
Date: Fri, 12 May 2023 15:03:28 +0200	[thread overview]
Message-ID: <005b2b55-136e-9d31-a68f-e792699d046b@siemens.com> (raw)
In-Reply-To: <20230512123310.2200924-1-Quirin.Gylstorff@siemens.com>

On 12.05.23 14:33, 'Quirin Gylstorff' via isar-users wrote:
> From: kas <kas@example.com>
        ^^^^^^^^^^^^^^^^^^^^^

Jan

> 
> This patch eases the fault analysis in case of a broken
> initramfs generation.
> 
> This prints the messages from 'update-initramfs' instead of:
> 
> ```
> Available versions:
> Nothing to do, exiting.
> ERROR: No initramfs was found after generation!
> ```
> 
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
>  meta/classes/initramfs.bbclass | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/classes/initramfs.bbclass b/meta/classes/initramfs.bbclass
> index b4c7d15e..817e97a3 100644
> --- a/meta/classes/initramfs.bbclass
> +++ b/meta/classes/initramfs.bbclass
> @@ -43,11 +43,16 @@ do_generate_initramfs() {
>          export SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH}"
>      fi
>  
> -    sudo -E chroot "${INITRAMFS_ROOTFS}" \
> -        update-initramfs -u -v
> +    sudo -E chroot "${INITRAMFS_ROOTFS}" sh -c '\
> +        export kernel_version=$(basename /boot/vmlinux* | cut -d'-' -f2-); \
> +        if [ -n "$kernel_version" ]; then \
> +          update-initramfs -u -v -k "$kernel_version"; \
> +        else \
> +          update-initramfs -u -v ;  \
> +        fi'
>  
>      if [ ! -e "${INITRAMFS_ROOTFS}/initrd.img" ]; then
> -        die "No initramfs was found after generation!"
> +        bberror "No initramfs was found after generation!"
>      fi
>      cp ${INITRAMFS_ROOTFS}/initrd.img ${DEPLOYDIR}/${INITRAMFS_IMAGE_NAME}
>  }

-- 
Siemens AG, Technology
Competence Center Embedded Linux


      reply	other threads:[~2023-05-12 13:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-12 12:33 Quirin Gylstorff
2023-05-12 13:03 ` Jan Kiszka [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=005b2b55-136e-9d31-a68f-e792699d046b@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=Quirin.Gylstorff@siemens.com \
    --cc=felix.moessbauer@siemens.com \
    --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