]> code.ossystems Code Review - openembedded-core.git/commitdiff
linux-yocto: make kernel configuration audit user visible
authorBruce Ashfield <bruce.ashfield@windriver.com>
Wed, 18 Feb 2015 21:15:35 +0000 (16:15 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 20 Feb 2015 18:16:53 +0000 (18:16 +0000)
After a linux-yocto style kernel is configured, a kernel configuration
audit is executed to detect common errors or issues with the config.

This output used to be visible, but was made less obvious to not alarm
users unnecessarily (since some configuration issues are acceptable).

There are some classes of configuration issue that are worth being
visible, and that is specified configuration values that do not make the
final .config. These dropped options can result in any number of runtime
failures, so flagging them at build time makes sense.

The visibility of auditing is controlled by KCONF_AUDIT_LEVEL:

   0: no reporting
   1: report options that are specified, but not in the final config
   2: report options that are not hardware related, but set by a BSP

The default level is 1, with level 2 and above being for BSP development
only.

If these conditions are detected, warnings will be generated as follows:

  WARNING: [kernel config]: specified values did not make it into the
  kernel's final configuration:

  Value requested for CONFIG_SND_PCSP not in final ".config"
  Requested value: "CONFIG_SND_PCSP=y"
  Actual value set: ""

or

  WARNING: [kernel config]: BSP specified non-hw configuration:

  CONFIG_BLOCK
  CONFIG_CFG80211_WEXT
  CONFIG_CORDIC
  CONFIG_CRC8
  CONFIG_EFIVAR_FS
  CONFIG_EFI_PARTITION
  CONFIG_NET
  CONFIG_NETDEVICES
  CONFIG_PARTITION_ADVANCED
  CONFIG_WEXT_CORE
  CONFIG_WEXT_PROC
  CONFIG_WIRELESS

At this point thse are only a warnings, since there needs to be time for
layers and configuration fragments to be validated against this new
check.

[YOCTO: #6943]

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
meta/classes/kernel-yocto.bbclass
meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
meta/recipes-kernel/linux/linux-yocto.inc

index 223825e546a460135a2817afe67cad530561b48d..0cbbb5f2d22ff77789c3aa65aaf37b903cd9319e 100644 (file)
@@ -253,8 +253,6 @@ addtask kernel_configme after do_patch
 python do_kernel_configcheck() {
     import re, string, sys
 
-    bb.plain("NOTE: validating kernel config, see log.do_kernel_configcheck for details")
-
     # if KMETA isn't set globally by a recipe using this routine, we need to
     # set the default to 'meta'. Otherwise, kconf_check is not passed a valid
     # meta-series for processing
@@ -266,11 +264,23 @@ python do_kernel_configcheck() {
     cmd = d.expand("cd ${S}; kconf_check -config- %s/meta-series ${S} ${B}" % kmeta)
     ret, result = oe.utils.getstatusoutput("%s%s" % (pathprefix, cmd))
 
-    config_check_visibility = d.getVar( "KCONF_AUDIT_LEVEL", True ) or 1
-    if config_check_visibility == 1:
-        bb.debug( 1, "%s" % result )
-    else:
-        bb.note( "%s" % result )
+    config_check_visibility = int(d.getVar( "KCONF_AUDIT_LEVEL", True ) or 0)
+
+    # if config check visibility is non-zero, report dropped configuration values
+    mismatch_file = "${S}/" + kmeta + "/" + "mismatch.cfg"
+    if os.path.exists(mismatch_file):
+        if config_check_visibility:
+            with open (mismatch_file, "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)
+
+    # if config check visibility is level 2 or higher, report non-hardware options
+    nonhw_file = "${S}/" + kmeta + "/" + "nonhw_report.cfg"
+    if os.path.exists(nonhw_file):
+        if config_check_visibility > 1:
+            with open (nonhw_file, "r") as myfile:
+                results = myfile.read()
+                bb.warn( "[kernel config]: BSP specified non-hw configuration:\n\n%s" % results)
 }
 
 # Ensure that the branches (BSP and meta) are on the locations specified by
index 32783986487f64e5fe986afda3551ba436bfa9a0..80d26f98749d2d20a6e4479f3fd1b5db90215493 100644 (file)
@@ -4,7 +4,7 @@ LIC_FILES_CHKSUM = "file://git/tools/kgit;beginline=5;endline=9;md5=d8d1d729a70c
 
 DEPENDS = "git-native"
 
-SRCREV = "daab4442c22c09a98a823c32d7219316b6832182"
+SRCREV = "cab17f884998b43692244a863dea6f505c7f67af"
 PR = "r12"
 PV = "0.2+git${SRCPV}"
 
index 7416af99f57f12cda2364d3832d0bff4fa7b0788..79b3f256f4bcc33c7b63203109b9096b62dcf2f4 100644 (file)
@@ -23,6 +23,12 @@ KBRANCH ?= "master"
 KMACHINE ?= "${MACHINE}"
 SRCREV_FORMAT ?= "meta_machine" 
 
+# LEVELS:
+#   0: no reporting
+#   1: report options that are specified, but not in the final config
+#   2: report options that are not hardware related, but set by a BSP
+KCONF_AUDIT_LEVEL ?= "1"
+
 LINUX_VERSION_EXTENSION ?= "-yocto-${LINUX_KERNEL_TYPE}"
 
 do_patch[depends] = "kern-tools-native:do_populate_sysroot"