mirror of
https://git.yoctoproject.org/poky
synced 2026-04-29 09:32:11 +02:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
1f8c8aff09
commit
7ac426e9bd
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user