Bug 8177

Summary: Do not enable CONFIG_DEBUG_KERNEL and related options by default
Product: [Build System, Metadata & Runtime] BSPs Reporter: Jussi Laako <jussi.laako>
Component: bsps-meta-intelAssignee: California Sullivan <california.l.sullivan>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: bruce.ashfield, dvhart
Version: unspecified   
Target Milestone: 2.1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Jussi Laako 2015-08-18 08:08:36 UTC
Debug features should only be enabled when needed by the developer by using config fragment instead of enabling debug features by default.
Comment 1 Saul Wold 2015-08-18 14:37:59 UTC
One of the concerns here is that in order to disable DEBUG_KERNEL you have to disable the additional config options that cause this to be selected. For example in this case DEBUG_KERNEL is selected by EXPERT which enables many options to be enabled and selectable and by de-selecting EXPERT would force those configurations to be completely disabled and not-selectable when for a given BSP they need to be enabled.

What is the reasoning behind wanting to disable DEBUG_KERNEL? Understanding the *why* would be most important for this.
Comment 2 Saul Wold 2015-08-18 14:38:29 UTC
Meant to put this into NEEDINFO
Comment 3 Saul Wold 2015-08-18 14:38:29 UTC
Meant to put this into NEEDINFO
Comment 4 Jussi Laako 2015-08-19 08:03:29 UTC
EMBEDDED is another option that depends on DEBUG_KERNEL. IIRC, also Atheros WiFi driver depends on it.
Comment 5 Jussi Laako 2015-08-19 12:02:08 UTC
This is part of requested security hardening on a project we are working on. I disabled the related items on my own Quark BSP and didn't see any major disadvantages on disabling the related options which can be easily enabled by a config fragment later when necessary.

Going vice versa and disabling options with complex dependency trees from config fragments in maintenance nightmare. Especially since the options can become silently re-enabled without a notice from build system.

So config fragments work more like a "wish list", not necessarily resulting in wanted output nor any notice from the build system when not ending up in final config.
Comment 6 Bruce Ashfield 2015-08-19 12:06:03 UTC
(In reply to comment #5)
> This is part of requested security hardening on a project we are working on.
> I disabled the related items on my own Quark BSP and didn't see any major
> disadvantages on disabling the related options which can be easily enabled
> by a config fragment later when necessary.
> 
> Going vice versa and disabling options with complex dependency trees from
> config fragments in maintenance nightmare. Especially since the options can
> become silently re-enabled without a notice from build system.
> 
> So config fragments work more like a "wish list", not necessarily resulting
> in wanted output nor any notice from the build system when not ending up in
> final config.

That isn't accurate. The build system always audits the final .config
and writes a report.

Due to user requests in the past, it no longer breaks the build when
options are not in the final .config.

We can augment it to optionally stop the build to meet this use case, 
and display as much as possible about the dependency and selects for
an option.

But most of what you describe is already in place, or an issue no matter
how you maintain configurations.

Also note: you can take the poky-tiny approach, and start with a allnoconfig
and only enable what you want.
Comment 7 Stephen K Jolley 2015-09-14 16:32:16 UTC
NEEDINFO answered.
Comment 8 Stephen K Jolley 2015-09-21 16:17:01 UTC
NEEDINFO answered.  Put it back into NEEDINFO it more information is needed.
Comment 9 Saul Wold 2015-12-15 20:20:29 UTC
This is related to the addition of a ktype
Comment 10 California Sullivan 2016-01-06 22:23:50 UTC
Working on this.
Comment 11 California Sullivan 2016-01-25 21:39:25 UTC
EMBEDDED, EXPERT, and DEBUG_KERNEL are to be removed from the base ktype. Instead, they will be enabled by an "extended" ktype which includes standard. As preempt-rt currently includes standard with a nocfg option, to maintain current functionality it will instead include the extended ktype with the nocfg option.

There are so intricacies to this since EXTENDED sets many defaults and triggers some selects, but this is is gist of what will be changed.
Comment 12 California Sullivan 2016-03-08 21:16:42 UTC
This has been integrated into the yocto-kernel-cache and SRCREVs are staged in -next.