oeqa/selftest: add test that kernels build with defconfig

Message ID 20220111135540.2874535-1-ross.burton@arm.com
State New
Headers show
Series oeqa/selftest: add test that kernels build with defconfig | expand

Commit Message

Ross Burton Jan. 11, 2022, 1:55 p.m. UTC
The standard linux-yocto builds using config fragments, but it's a
supported option to use the standard defconfig.

However, our enhanced config checking means that defconfig will often
cause configure warnings.  Add a test suite that exercises a defconfig
build is successful without any warnings.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 .../oeqa/selftest/cases/kerneldevelopment.py  | 20 ++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

Comments

Ross Burton Jan. 11, 2022, 1:57 p.m. UTC | #1
On Tue, 11 Jan 2022 at 13:55, Ross Burton via lists.openembedded.org
<ross=burtonini.com@lists.openembedded.org> wrote:
> The standard linux-yocto builds using config fragments, but it's a
> supported option to use the standard defconfig.
>
> However, our enhanced config checking means that defconfig will often
> cause configure warnings.  Add a test suite that exercises a defconfig
> build is successful without any warnings.

Note that this breaks with current oe-core master:
https://www.irccloud.com/pastebin/nAapZUm6/

Anuj, would you be able to patch the x86_64_defconfig so that it
doesn't break with our tools?

Ross
Bruce Ashfield Jan. 11, 2022, 2 p.m. UTC | #2
On Tue, Jan 11, 2022 at 8:57 AM Ross Burton <ross@burtonini.com> wrote:
>
> On Tue, 11 Jan 2022 at 13:55, Ross Burton via lists.openembedded.org
> <ross=burtonini.com@lists.openembedded.org> wrote:
> > The standard linux-yocto builds using config fragments, but it's a
> > supported option to use the standard defconfig.
> >
> > However, our enhanced config checking means that defconfig will often
> > cause configure warnings.  Add a test suite that exercises a defconfig
> > build is successful without any warnings.
>
> Note that this breaks with current oe-core master:
> https://www.irccloud.com/pastebin/nAapZUm6/
>
> Anuj, would you be able to patch the x86_64_defconfig so that it
> doesn't break with our tools?

We also might be able to mask some of the warnings, if we decide that
they are optional / non-required.

Anuj: I'm finishing up some kernel updates, but if anyone starts
looking at this, feel free to ping me about options, etc.

Bruce

>
> Ross
Robert Berger Jan. 11, 2022, 5:48 p.m. UTC | #3
Hi,

On 11/01/2022 15:57, Ross Burton wrote:
> On Tue, 11 Jan 2022 at 13:55, Ross Burton via lists.openembedded.org
> <ross=burtonini.com@lists.openembedded.org> wrote:
>> The standard linux-yocto builds using config fragments, but it's a
>> supported option to use the standard defconfig.
>>
>> However, our enhanced config checking means that defconfig will often
>> cause configure warnings.  Add a test suite that exercises a defconfig
>> build is successful without any warnings.
> 
> Note that this breaks with current oe-core master:
> https://www.irccloud.com/pastebin/nAapZUm6/

I am a bit confused what exactly breaks.

Is this only one defconfig and nothing else or a defconfig plus fragments?

I build with an upstream 5.15.13 kernel with multi_v7_defconfig and it 
does not spit out any warnings. Not even after adding some of my own 
fragments.

I really like that Bruce finally outputs some warnings, since they 
typically indicate some configuration inconsistencies which would be 
otherwise hard to find.

Regards,

Robert
Ross Burton Jan. 11, 2022, 5:56 p.m. UTC | #4
On Tue, 11 Jan 2022 at 17:49, Robert Berger
<oecore.mailinglist@gmail.com> wrote:
> Is this only one defconfig and nothing else or a defconfig plus fragments?
>
> I build with an upstream 5.15.13 kernel with multi_v7_defconfig and it
> does not spit out any warnings. Not even after adding some of my own
> fragments.

I've been maintaining a patch in meta-arm to fix this issue and I
believe that v7 actually works out of the box in 5.15, finally.  It
definitely fails for arm64 out of the box.

Ross

Patch

diff --git a/meta/lib/oeqa/selftest/cases/kerneldevelopment.py b/meta/lib/oeqa/selftest/cases/kerneldevelopment.py
index b1623a1885..a0e770071c 100644
--- a/meta/lib/oeqa/selftest/cases/kerneldevelopment.py
+++ b/meta/lib/oeqa/selftest/cases/kerneldevelopment.py
@@ -1,6 +1,6 @@ 
 import os
 from oeqa.selftest.case import OESelftestTestCase
-from oeqa.utils.commands import runCmd, get_bb_var
+from oeqa.utils.commands import bitbake, runCmd, get_bb_var
 from oeqa.utils.git import GitRepo
 
 class KernelDev(OESelftestTestCase):
@@ -65,3 +65,21 @@  class KernelDev(OESelftestTestCase):
         self.assertTrue(os.path.exists(readme))
         result = runCmd('tail -n 1 %s' % readme)
         self.assertEqual(result.output, patch_content)
+
+
+class KernelConfigs(OESelftestTestCase):
+    def test_defconfig(self):
+        """
+        Test that a kernel build with the default defconfig doesn't produce any
+        build warnings from the config checker.
+        """
+        self.write_config('''
+KCONF_AUDIT_LEVEL = "1"
+KMETA_AUDIT_WERROR = "1"
+KBUILD_DEFCONFIG = "unset"
+KBUILD_DEFCONFIG:aarch64 = "defconfig"
+KBUILD_DEFCONFIG:x86-64 = "x86_64_defconfig"
+# BSPs can append KERNEL_FEATURES, so force it empty so we just use defconfig
+KERNEL_FEATURES:forcevariable = ""
+''')
+        bitbake('virtual/kernel -c kernel_configcheck -f')