public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "florian.bezdeka@siemens.com" <florian.bezdeka@siemens.com>
To: "isar-users@googlegroups.com" <isar-users@googlegroups.com>
Cc: "henning.schild@siemens.com" <henning.schild@siemens.com>,
	"quirin.gylstorff@siemens.com" <quirin.gylstorff@siemens.com>,
	"jan.kiszka@siemens.com" <jan.kiszka@siemens.com>,
	"florian.bezdeka@siemens.com" <florian.bezdeka@siemens.com>
Subject: [RFC PATCH 1/2] wic-img: Forward warnings from wic to bitbake
Date: Mon, 1 Feb 2021 18:58:22 +0000	[thread overview]
Message-ID: <20210201185815.382326-2-florian.bezdeka@siemens.com> (raw)
In-Reply-To: <20210201185815.382326-1-florian.bezdeka@siemens.com>

From: Florian Bezdeka <florian.bezdeka@siemens.com>

By now warnings generated by wic are visible in the wic log file, but
they are note visible in the bitbake output (stdout) so they can easily
be overlooked.

To forward the warnings from the logfile to bitbake the logfile is
being parsed once the wic image generation has been done.

The bitbake task (do_wic_image) is now a python function which first
calls the previous (unchanged) shell function (now called
generate_wic_image) which does the image generation and checks for wic
warnings afterwards.

Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
---
 meta/classes/wic-img.bbclass | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass
index bbf5dd8..a11e493 100644
--- a/meta/classes/wic-img.bbclass
+++ b/meta/classes/wic-img.bbclass
@@ -129,7 +129,21 @@ do_rootfs_wicenv[prefuncs] = 'set_image_size'
 
 WIC_IMAGE_FILE ="${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.wic.img"
 
-do_wic_image() {
+python check_for_wic_warnings() {
+    with open("{}/log.do_wic_image".format(d.getVar("T"))) as f:
+        for line in f.readlines():
+            if line.startswith("WARNING"):
+                bb.warn(line.strip())
+}
+
+do_wic_image[file-checksums] += "${WKS_FILE_CHECKSUM}"
+python do_wic_image() {
+    bb.build.exec_func("generate_wic_image", d)
+    bb.build.exec_func("check_for_wic_warnings", d)
+}
+addtask wic_image before do_image after do_image_tools
+
+generate_wic_image() {
     buildchroot_do_mounts
     sudo -s <<'EOSUDO'
         ( flock 9
@@ -186,7 +200,3 @@ EOSUDO
     rm -rf ${BUILDCHROOT_DIR}/${WICTMP}
     rm -rf ${IMAGE_ROOTFS}/../pseudo
 }
-
-do_wic_image[file-checksums] += "${WKS_FILE_CHECKSUM}"
-
-addtask wic_image before do_image after do_image_tools
-- 
2.29.2

  reply	other threads:[~2021-02-01 18:58 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01 18:58 [RFC PATCH 0/2] wic: warn on usage of Y2038 affected file systems florian.bezdeka
2021-02-01 18:58 ` florian.bezdeka [this message]
2021-02-01 18:58 ` [RFC PATCH 2/2] wic: Warn if an ext filesystem affected by the Y2038 problem is used florian.bezdeka
2021-02-11  8:07 ` [RFC PATCH 0/2] wic: warn on usage of Y2038 affected file systems Anton Mikanovich
2021-02-11  8:23   ` Henning Schild
2021-02-11  9:09     ` Jan Kiszka
2021-02-11  9:57       ` florian.bezdeka
2021-02-11 10:21         ` Henning Schild
2021-02-11 12:47           ` florian.bezdeka
2021-02-11 13:31             ` florian.bezdeka
2021-02-11 14:13               ` Henning Schild
2021-02-11 17:57                 ` Jan Kiszka
2021-02-11 18:01                   ` Henning Schild
2021-02-17 11:56                     ` Baurzhan Ismagulov
2021-03-01 15:18                       ` [PATCH] wic: Warn if an ext filesystem affected by the Y2038 problem is used Florian Bezdeka
2021-03-01 15:23                         ` vijaikumar....@gmail.com
2021-03-01 15:38                           ` florian.bezdeka
2021-03-01 15:58                             ` vijaikumar....@gmail.com
2021-03-01 17:22                         ` Jan Kiszka
2021-03-01 17:45                           ` florian.bezdeka
2021-03-01 17:54                             ` vijaikumar....@gmail.com
2021-03-02  9:20                         ` Henning Schild
2021-03-02 10:12                           ` Jan Kiszka
2021-03-27  7:20 ` [RFC PATCH 0/2] wic: warn on usage of Y2038 affected file systems Jan Kiszka
2021-03-27  8:54   ` Florian Bezdeka

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=20210201185815.382326-2-florian.bezdeka@siemens.com \
    --to=florian.bezdeka@siemens.com \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    --cc=quirin.gylstorff@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