Skip to contentSkip to conversation

how can i tell which default kernel config OE started with?

DISCUSSION Robert P. J. Day 2 participants 7 messages May 3, 2016

lore
Share & tools
lore
#0 lore raw

(actually, working in wind river linux but i suspect the answer will
be the same.)

i've defined a target board and, rather than supplying a full
"defconfig" file as a starting point for kernel configuration, my BSP layer starts by applying a "kernel_baseline.cfg" file which contains only a couple hundred settings that i am particularly interested in.

so, given that, how can i tell what OE chose as a starting point for
a .config file before beginning to apply my kernel config fragments? i'm poking around in the log files of the build, but i can't seem to see where the "configme" process selects a starting point. am i just missing the obvious? i want to see the .config file *before* any of my fragments are applied.

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
#1 lore raw
Quoted 9 lines · Robert P. J. Day

(actually, working in wind river linux but i suspect the answer will
be the same.)

i've defined a target board and, rather than supplying a full
"defconfig" file as a starting point for kernel configuration, my BSP layer starts by applying a "kernel_baseline.cfg" file which contains only a couple hundred settings that i am particularly interested in.

Quoted 7 lines

so, given that, how can i tell what OE chose as a starting point for
a .config file before beginning to apply my kernel config fragments? i'm poking around in the log files of the build, but i can't seem to see where the "configme" process selects a starting point. am i just missing the obvious? i want to see the .config file *before* any of my fragments are applied.

If you haven't specified a defconfig (in-tree, or in your layer), and are only using fragments, then it will
be the first fragment. There's no logic to go out and find a baseline, since it would almost always not
be what someone wanted.

Cheers,

Bruce

Quoted 19 lines

rday

--

========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday

========================================================================

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"
#2 lore raw
Quoted 20 lines · Bruce Ashfield

On Tue, May 3, 2016 at 6:53 AM, Robert P. J. Day <[email protected]> wrote:

  (actually, working in wind river linux but i suspect the answer will be the same.)

  i've defined a target board and, rather than supplying a full "defconfig" file as a starting point for kernel configuration, my BSP layer starts by applying a "kernel_baseline.cfg" file which contains only a couple hundred settings that i am particularly interested in.

  so, given that, how can i tell what OE chose as a starting point for a .config file before beginning to apply my kernel config fragments? i'm poking around in the log files of the build, but i can't seem to see where the "configme" process selects a starting point. am i just missing the obvious? i want to see the .config file *before* any of my fragments are applied.

Quoted 4 lines

If you haven't specified a defconfig (in-tree, or in your layer), and are only using fragments, then it will be the first fragment. There's no logic to go out and find a baseline, since it would almost always not be what someone wanted.

ok, i'm going to ask a few follow-up questions since i clearly don't
totally understand the full kernel configuration process.

i have a BSP layer for a target board that first specifies a
"kernel_baseline.cfg" fragment file which contains just those kernel config settings i want to make sure are set, and that file is just over 200 lines long. i also drag in a few other *very* short .cfg files. but in the end, the .config file generated under .../linux-windriver/4.1-r0/linux-cxii-standard-build/ is almost 2,200 lines long. where did all that extra content come from?

i'm assuming (and i could be wrong here) that since i'm using the
line:

TARGET_SUPPORTED_KTYPES = "standard"

i'm automatically incorporating "standard"-related content under .../kernel-meta/ktypes/standard? as in, the files:

* standard.cfg
* standard.scc

or am i mistaken? from where comes all that additional content that ends up in the final .config? is there a record of it in a log file somewhere?

couple more kernel config-related questions coming shortly ...

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
#3 lore raw
Quoted 32 lines · Robert P. J. Day
Quoted 3 lines · Bruce Ashfield

On Tue, May 3, 2016 at 6:53 AM, Robert P. J. Day <[email protected]>

Quoted 2 lines · wrote:

(actually, working in wind river linux but i suspect the answer

will

Quoted 4 lines

be the same.)

i've defined a target board and, rather than supplying a full
"defconfig" file as a starting point for kernel configuration, my

BSP

Quoted 1 line

layer starts by applying a "kernel_baseline.cfg" file which

contains

Quoted 1 line

only a couple hundred settings that i am particularly interested

in.

Quoted 2 lines

so, given that, how can i tell what OE chose as a starting point

for

Quoted 1 line

a .config file before beginning to apply my kernel config

fragments?

Quoted 1 line

i'm poking around in the log files of the build, but i can't seem

to

Quoted 1 line

see where the "configme" process selects a starting point. am i

just

Quoted 1 line

missing the obvious? i want to see the .config file *before* any

of my

Quoted 3 lines

fragments are applied.

Quoted 9 lines
Quoted 4 lines

If you haven't specified a defconfig (in-tree, or in your layer), and are only using fragments, then it will be the first fragment. There's no logic to go out and find a baseline, since it would almost always not be what someone wanted.

ok, i'm going to ask a few follow-up questions since i clearly don't
totally understand the full kernel configuration process.

That's because it varies a bit, based on the kernel and options :)

Quoted 8 lines

i have a BSP layer for a target board that first specifies a
"kernel_baseline.cfg" fragment file which contains just those kernel config settings i want to make sure are set, and that file is just over 200 lines long. i also drag in a few other *very* short .cfg files. but in the end, the .config file generated under .../linux-windriver/4.1-r0/linux-cxii-standard-build/ is almost 2,200 lines long. where did all that extra content come from?

The .config is always the setting for all reachable kernel options. Some are set in fragments, or defconfigs, others are the result of 'select' and defaults by the kernel itself, etc.

If you run savedefconfig, you can see the non default options that were set.

Quoted 9 lines

i'm assuming (and i could be wrong here) that since i'm using the
line:

TARGET_SUPPORTED_KTYPES = "standard"

i'm automatically incorporating "standard"-related content under .../kernel-meta/ktypes/standard? as in, the files:

Quoted 7 lines

* standard.cfg
* standard.scc

or am i mistaken? from where comes all that additional content that ends up in the final .config? is there a record of it in a log file somewhere?

If you are not supplying a defconfig, and are inheriting the standard kernel options, then yes, you'd be getting those fragments as well.

You can look in the work-shared/ .. kernel-source/.kernel-meta/ directory for the meta-series (if using linux-yocto derived kernels), and that will reference
everything that was used to configure and patch the kernel. If it isn't in there,
it was a default or select by the kernel itself.

Bruce

Quoted 16 lines

couple more kernel config-related questions coming shortly ...

rday

--

========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday

========================================================================

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"
#4 lore raw
Quoted 3 lines · Bruce Ashfield

If you are not supplying a defconfig, and are inheriting the standard kernel options, then yes, you'd be getting those fragments as well.

ah, this actually leads me into my next question -- what is magic
about a "defconfig" file that changes the normal processing?

in the YP kernel dev manual, section 2.2.3, one reads:

"If you have a complete, working Linux kernel .config file you want to use for the configuration, as before, copy that file to the appropriate ${PN} directory in your layer's recipes-kernel/linux directory, and rename the copied file to "defconfig". Then, add the following lines to the linux-yocto .bbappend file in your layer:

     FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
     SRC_URI += "file://defconfig"

so the idea here is that a "defconfig" file is, in some sense, a "complete, working" config file that requires no extra processing, is that correct? does that mean that if you explicitly use a SRC_URI "defconfig" reference, all that extra normal processing won't be done?

also, that same section in the YP manual is slightly confusing -- if
your SRC_URI refers to a defconfig file *and* some .cfg fragment files, is it necessarily true that the defconfig file is consulted first (no matter where it shows up in SRC_URI), after which all .cfg files are applied on top of that in order? it's not entirely clear from the manual if that's what happens.

predictably, a couple more kernel config questions coming ...

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
#5 lore raw
Quoted 9 lines · Robert P. J. Day
Quoted 3 lines · Bruce Ashfield

If you are not supplying a defconfig, and are inheriting the standard kernel options, then yes, you'd be getting those fragments as well.

ah, this actually leads me into my next question -- what is magic
about a "defconfig" file that changes the normal processing?\

It's the existing kernel.bbclass mechanism, and a well known convention used in the kernel. So it is used to trigger the core kernel configuration, and when I was extending things for kernel fragments it was similarly used as a sentinel value.

Quoted 9 lines

in the YP kernel dev manual, section 2.2.3, one reads:

"If you have a complete, working Linux kernel .config file you want to use for the configuration, as before, copy that file to the appropriate ${PN} directory in your layer's recipes-kernel/linux directory, and rename the copied file to "defconfig". Then, add the following lines to the linux-yocto .bbappend file in your layer:

Quoted 8 lines
     FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
     SRC_URI += "file://defconfig"

so the idea here is that a "defconfig" file is, in some sense, a "complete, working" config file that requires no extra processing, is that correct? does that mean that if you explicitly use a SRC_URI "defconfig" reference, all that extra normal processing won't be done?

Nope. Everything is still processed, the kernel version you are using, patches, etc, all make a difference to what ends up in the .config. The phrasing there is to point out that it is what the mainline kernel considers a defconfig, and it is typically a complete configuration of the kernel (that
is expected to boot your target).

Quoted 8 lines

also, that same section in the YP manual is slightly confusing -- if
your SRC_URI refers to a defconfig file *and* some .cfg fragment files, is it necessarily true that the defconfig file is consulted first (no matter where it shows up in SRC_URI), after which all .cfg files are applied on top of that in order? it's not entirely clear from the manual if that's what happens.

Yep. If you mix the two techniques, the defconfig is first (and taken as the settings), and then fragments are applied on top.

Note: There are some changes in defconfig that are related to features I'm doing for the fall 2.2 release, but nothing that changes the basic processing (so compatibility is maintained).

Bruce

Quoted 16 lines

predictably, a couple more kernel config questions coming ...

rday

--

========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday

========================================================================

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"
#6 lore raw
Quoted 11 lines · Bruce Ashfield

On Tue, May 3, 2016 at 11:13 AM, Robert P. J. Day <[email protected]> wrote:

  also, that same section in the YP manual is slightly confusing -- if your SRC_URI refers to a defconfig file *and* some .cfg fragment files, is it necessarily true that the defconfig file is consulted first (no matter where it shows up in SRC_URI), after which all .cfg files are applied on top of that in order? it's not entirely clear from the manual if that's what happens.

Quoted 2 lines

Yep. If you mix the two techniques, the defconfig is first (and taken as the settings), and then fragments are applied on top.

yeah, that's not terrifically clear from that section in the manual,
Section 2.2.3, in the Note therein:

"The build system applies the configurations from the defconfig file before applying any subsequent configuration fragments."

                    ^^^^^^^^^^

the use of the word "subsequent" suggests an ordering and is
potentially misleading.

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================