diff options
author | Bruce Ashfield <bruce.ashfield@windriver.com> | 2015-02-18 16:15:35 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-21 22:05:33 +0000 |
commit | dfa83e662511e8d9f397d458b6eae1bf323cb271 (patch) | |
tree | 415a15721f9a999f88e9a82acc23fc1c8fcb97d2 | |
parent | 63dd5d0669192b0dbdb5b39282d22d8d5ceccbb1 (diff) | |
download | poky-dfa83e662511e8d9f397d458b6eae1bf323cb271.tar.gz |
linux-yocto: make kernel configuration audit user visible
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]
(From OE-Core rev: ad4d59495194b37bc510e9891bd14c0a2ac30dba)
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/kernel-yocto.bbclass | 24 | ||||
-rw-r--r-- | meta/recipes-kernel/kern-tools/kern-tools-native_git.bb | 2 | ||||
-rw-r--r-- | meta/recipes-kernel/linux/linux-yocto.inc | 6 |
3 files changed, 24 insertions, 8 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass index 223825e546..0cbbb5f2d2 100644 --- a/meta/classes/kernel-yocto.bbclass +++ b/meta/classes/kernel-yocto.bbclass | |||
@@ -253,8 +253,6 @@ addtask kernel_configme after do_patch | |||
253 | python do_kernel_configcheck() { | 253 | python do_kernel_configcheck() { |
254 | import re, string, sys | 254 | import re, string, sys |
255 | 255 | ||
256 | bb.plain("NOTE: validating kernel config, see log.do_kernel_configcheck for details") | ||
257 | |||
258 | # if KMETA isn't set globally by a recipe using this routine, we need to | 256 | # if KMETA isn't set globally by a recipe using this routine, we need to |
259 | # set the default to 'meta'. Otherwise, kconf_check is not passed a valid | 257 | # set the default to 'meta'. Otherwise, kconf_check is not passed a valid |
260 | # meta-series for processing | 258 | # meta-series for processing |
@@ -266,11 +264,23 @@ python do_kernel_configcheck() { | |||
266 | cmd = d.expand("cd ${S}; kconf_check -config- %s/meta-series ${S} ${B}" % kmeta) | 264 | cmd = d.expand("cd ${S}; kconf_check -config- %s/meta-series ${S} ${B}" % kmeta) |
267 | ret, result = oe.utils.getstatusoutput("%s%s" % (pathprefix, cmd)) | 265 | ret, result = oe.utils.getstatusoutput("%s%s" % (pathprefix, cmd)) |
268 | 266 | ||
269 | config_check_visibility = d.getVar( "KCONF_AUDIT_LEVEL", True ) or 1 | 267 | config_check_visibility = int(d.getVar( "KCONF_AUDIT_LEVEL", True ) or 0) |
270 | if config_check_visibility == 1: | 268 | |
271 | bb.debug( 1, "%s" % result ) | 269 | # if config check visibility is non-zero, report dropped configuration values |
272 | else: | 270 | mismatch_file = "${S}/" + kmeta + "/" + "mismatch.cfg" |
273 | bb.note( "%s" % result ) | 271 | if os.path.exists(mismatch_file): |
272 | if config_check_visibility: | ||
273 | with open (mismatch_file, "r") as myfile: | ||
274 | results = myfile.read() | ||
275 | bb.warn( "[kernel config]: specified values did not make it into the kernel's final configuration:\n\n%s" % results) | ||
276 | |||
277 | # if config check visibility is level 2 or higher, report non-hardware options | ||
278 | nonhw_file = "${S}/" + kmeta + "/" + "nonhw_report.cfg" | ||
279 | if os.path.exists(nonhw_file): | ||
280 | if config_check_visibility > 1: | ||
281 | with open (nonhw_file, "r") as myfile: | ||
282 | results = myfile.read() | ||
283 | bb.warn( "[kernel config]: BSP specified non-hw configuration:\n\n%s" % results) | ||
274 | } | 284 | } |
275 | 285 | ||
276 | # Ensure that the branches (BSP and meta) are on the locations specified by | 286 | # Ensure that the branches (BSP and meta) are on the locations specified by |
diff --git a/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb b/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb index 3278398648..80d26f9874 100644 --- a/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb +++ b/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb | |||
@@ -4,7 +4,7 @@ LIC_FILES_CHKSUM = "file://git/tools/kgit;beginline=5;endline=9;md5=d8d1d729a70c | |||
4 | 4 | ||
5 | DEPENDS = "git-native" | 5 | DEPENDS = "git-native" |
6 | 6 | ||
7 | SRCREV = "daab4442c22c09a98a823c32d7219316b6832182" | 7 | SRCREV = "cab17f884998b43692244a863dea6f505c7f67af" |
8 | PR = "r12" | 8 | PR = "r12" |
9 | PV = "0.2+git${SRCPV}" | 9 | PV = "0.2+git${SRCPV}" |
10 | 10 | ||
diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc index 7416af99f5..79b3f256f4 100644 --- a/meta/recipes-kernel/linux/linux-yocto.inc +++ b/meta/recipes-kernel/linux/linux-yocto.inc | |||
@@ -23,6 +23,12 @@ KBRANCH ?= "master" | |||
23 | KMACHINE ?= "${MACHINE}" | 23 | KMACHINE ?= "${MACHINE}" |
24 | SRCREV_FORMAT ?= "meta_machine" | 24 | SRCREV_FORMAT ?= "meta_machine" |
25 | 25 | ||
26 | # LEVELS: | ||
27 | # 0: no reporting | ||
28 | # 1: report options that are specified, but not in the final config | ||
29 | # 2: report options that are not hardware related, but set by a BSP | ||
30 | KCONF_AUDIT_LEVEL ?= "1" | ||
31 | |||
26 | LINUX_VERSION_EXTENSION ?= "-yocto-${LINUX_KERNEL_TYPE}" | 32 | LINUX_VERSION_EXTENSION ?= "-yocto-${LINUX_KERNEL_TYPE}" |
27 | 33 | ||
28 | do_patch[depends] = "kern-tools-native:do_populate_sysroot" | 34 | do_patch[depends] = "kern-tools-native:do_populate_sysroot" |