public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Quirin Gylstorff <Quirin.Gylstorff@siemens.com>
To: isar-users@googlegroups.com, jan.kiszka@siemens.com,
	felix.moessbauer@siemens.com
Subject: [PATCH v2] classes/initramfs: Print messages in case of a build error
Date: Fri, 12 May 2023 16:46:13 +0200	[thread overview]
Message-ID: <20230512144613.2448204-1-Quirin.Gylstorff@siemens.com> (raw)

From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

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>
---
Changes v2:
 - Fix author

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


             reply	other threads:[~2023-05-12 14:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-12 14:46 Quirin Gylstorff [this message]
2023-05-19  4:16 ` Uladzimir Bely

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=20230512144613.2448204-1-Quirin.Gylstorff@siemens.com \
    --to=quirin.gylstorff@siemens.com \
    --cc=felix.moessbauer@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@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