public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v2] classes/initramfs: Print messages in case of a build error
@ 2023-05-12 14:46 Quirin Gylstorff
  2023-05-19  4:16 ` Uladzimir Bely
  0 siblings, 1 reply; 2+ messages in thread
From: Quirin Gylstorff @ 2023-05-12 14:46 UTC (permalink / raw)
  To: isar-users, jan.kiszka, felix.moessbauer

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


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

end of thread, other threads:[~2023-05-19  4:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-12 14:46 [PATCH v2] classes/initramfs: Print messages in case of a build error Quirin Gylstorff
2023-05-19  4:16 ` Uladzimir Bely

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