summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel-yocto.bbclass
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2020-08-27 13:54:03 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-28 07:06:44 +0100
commitb26a6df7efdaf640c612f6d557a2e74b4dc58af3 (patch)
treec001e96896b76bd1a1633bbde3d984c5a672a27c /meta/classes/kernel-yocto.bbclass
parentec23ada44fbf5143dd2cc89f3dd882be355358d0 (diff)
downloadopenembedded-core-b26a6df7efdaf640c612f6d557a2e74b4dc58af3.tar.gz
kernel-yocto: allow promotion of configuration warnings to errors
It was requested to add the ability to upgrade configuration warnings to errors, so that they can't be missed in a build. Add a flag KMETA_AUDIT_WERROR, that when set, triggers a bb.fatal at the end of configuration checking if any warnings are found. This is off by default, but is available for those that want to enable it in their kernel recipe or bbappend. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel-yocto.bbclass')
-rw-r--r--meta/classes/kernel-yocto.bbclass13
1 files changed, 11 insertions, 2 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 96ea612258..cb7614d64a 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -18,6 +18,7 @@ SRCREV_FORMAT ?= "meta_machine"
KCONF_AUDIT_LEVEL ?= "1"
KCONF_BSP_AUDIT_LEVEL ?= "0"
KMETA_AUDIT ?= "yes"
+KMETA_AUDIT_WERROR ?= ""
# returns local (absolute) path names for all valid patches in the
# src_uri
@@ -507,6 +508,8 @@ python do_kernel_configcheck() {
config_check_visibility = int(d.getVar("KCONF_AUDIT_LEVEL") or 0)
bsp_check_visibility = int(d.getVar("KCONF_BSP_AUDIT_LEVEL") or 0)
+ kmeta_audit_werror = d.getVar("KMETA_AUDIT_WERROR") or ""
+ warnings_detected = False
# if config check visibility is "1", that's the lowest level of audit. So
# we add the --classify option to the run, since classification will
@@ -533,6 +536,7 @@ python do_kernel_configcheck() {
with open (outfile, "r") as myfile:
results = myfile.read()
bb.warn( "[kernel config]: specified values did not make it into the kernel's final configuration:\n\n%s" % results)
+ warnings_detected = True
# category #2: invalid fragment elements
extra_params = ""
@@ -552,8 +556,9 @@ python do_kernel_configcheck() {
if bsp_check_visibility and os.stat(outfile).st_size > 0:
with open (outfile, "r") as myfile:
- results = myfile.read()
- bb.warn( "[kernel config]: This BSP contains fragments with warnings:\n\n%s" % results)
+ results = myfile.read()
+ bb.warn( "[kernel config]: This BSP contains fragments with warnings:\n\n%s" % results)
+ warnings_detected = True
# category #3: redefined options (this is pretty verbose and is debug only)
try:
@@ -574,6 +579,10 @@ python do_kernel_configcheck() {
with open (outfile, "r") as myfile:
results = myfile.read()
bb.warn( "[kernel config]: This BSP has configuration options defined in more than one config, with differing values:\n\n%s" % results)
+ warnings_detected = True
+
+ if warnings_detected and kmeta_audit_werror:
+ bb.fatal( "configuration warnings detected, werror is set, promoting to fatal" )
}
# Ensure that the branches (BSP and meta) are on the locations specified by