summaryrefslogtreecommitdiffstats
path: root/meta/classes
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:08:37 +0100
commit7ac426e9bdb0b9e4808e0e19067c96beb384f580 (patch)
tree9b0f8e511d13ff854b2a7c8796b56bcf709fe68c /meta/classes
parent1f8c8aff092641b6c6901f221f7383653fce3a2b (diff)
downloadpoky-7ac426e9bdb0b9e4808e0e19067c96beb384f580.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. (From OE-Core rev: b26a6df7efdaf640c612f6d557a2e74b4dc58af3) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-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"
18KCONF_AUDIT_LEVEL ?= "1" 18KCONF_AUDIT_LEVEL ?= "1"
19KCONF_BSP_AUDIT_LEVEL ?= "0" 19KCONF_BSP_AUDIT_LEVEL ?= "0"
20KMETA_AUDIT ?= "yes" 20KMETA_AUDIT ?= "yes"
21KMETA_AUDIT_WERROR ?= ""
21 22
22# returns local (absolute) path names for all valid patches in the 23# returns local (absolute) path names for all valid patches in the
23# src_uri 24# src_uri
@@ -507,6 +508,8 @@ python do_kernel_configcheck() {
507 508
508 config_check_visibility = int(d.getVar("KCONF_AUDIT_LEVEL") or 0) 509 config_check_visibility = int(d.getVar("KCONF_AUDIT_LEVEL") or 0)
509 bsp_check_visibility = int(d.getVar("KCONF_BSP_AUDIT_LEVEL") or 0) 510 bsp_check_visibility = int(d.getVar("KCONF_BSP_AUDIT_LEVEL") or 0)
511 kmeta_audit_werror = d.getVar("KMETA_AUDIT_WERROR") or ""
512 warnings_detected = False
510 513
511 # if config check visibility is "1", that's the lowest level of audit. So 514 # if config check visibility is "1", that's the lowest level of audit. So
512 # we add the --classify option to the run, since classification will 515 # we add the --classify option to the run, since classification will
@@ -533,6 +536,7 @@ python do_kernel_configcheck() {
533 with open (outfile, "r") as myfile: 536 with open (outfile, "r") as myfile:
534 results = myfile.read() 537 results = myfile.read()
535 bb.warn( "[kernel config]: specified values did not make it into the kernel's final configuration:\n\n%s" % results) 538 bb.warn( "[kernel config]: specified values did not make it into the kernel's final configuration:\n\n%s" % results)
539 warnings_detected = True
536 540
537 # category #2: invalid fragment elements 541 # category #2: invalid fragment elements
538 extra_params = "" 542 extra_params = ""
@@ -552,8 +556,9 @@ python do_kernel_configcheck() {
552 556
553 if bsp_check_visibility and os.stat(outfile).st_size > 0: 557 if bsp_check_visibility and os.stat(outfile).st_size > 0:
554 with open (outfile, "r") as myfile: 558 with open (outfile, "r") as myfile:
555 results = myfile.read() 559 results = myfile.read()
556 bb.warn( "[kernel config]: This BSP contains fragments with warnings:\n\n%s" % results) 560 bb.warn( "[kernel config]: This BSP contains fragments with warnings:\n\n%s" % results)
561 warnings_detected = True
557 562
558 # category #3: redefined options (this is pretty verbose and is debug only) 563 # category #3: redefined options (this is pretty verbose and is debug only)
559 try: 564 try:
@@ -574,6 +579,10 @@ python do_kernel_configcheck() {
574 with open (outfile, "r") as myfile: 579 with open (outfile, "r") as myfile:
575 results = myfile.read() 580 results = myfile.read()
576 bb.warn( "[kernel config]: This BSP has configuration options defined in more than one config, with differing values:\n\n%s" % results) 581 bb.warn( "[kernel config]: This BSP has configuration options defined in more than one config, with differing values:\n\n%s" % results)
582 warnings_detected = True
583
584 if warnings_detected and kmeta_audit_werror:
585 bb.fatal( "configuration warnings detected, werror is set, promoting to fatal" )
577} 586}
578 587
579# Ensure that the branches (BSP and meta) are on the locations specified by 588# Ensure that the branches (BSP and meta) are on the locations specified by