G'day All,

Just started migrating our layer to scarthgap and ran into an issue building 
the kernel.
We maintian a local git repo with a custom branch with all our patches and 
build from that.
So no KMETA layer. In addition we're building a couple of kernels and packaging 
them into the image.
We're using linux-dummy kernel for the image and then building the kernel using 
bitbake.
Possibly the problem is we're doing something the wrong(tm) way.
Anyway after migrating we get the following when building a kernel.

================================
NOTE: Executing Tasks
ERROR: linux-tst-6.6.52+git-r0 do_kernel_configme: A KBUILD_DEFCONFIG 
'socfpga_defconfig' was specified, but not present in the source tree 
(/home/preid/dev/v2024.09/tmp-glibc/work/cyclone5-emit-linux-gnueabi/linux-tst/6.6.52+git/kernel-source/arch/arm/configs/)
ERROR: linux-tst-6.6.52+git-r0 do_kernel_configme: 
ExecutionError('/home/preid/dev/v2024.09/tmp-glibc/work/cyclone5-emit-linux-gnueabi/linux-tst/6.6.52+git/temp/run.do_kernel_configme.8888',
 1, None, None)
ERROR: Logfile of failure stored in: 
/home/preid/dev/v2024.09/tmp-glibc/work/cyclone5-emit-linux-gnueabi/linux-tst/6.6.52+git/temp/log.do_kernel_configme.8888
ERROR: Task 
(/home/preid/dev/v2024.09/layers/meta-emit/recipes/emit-linux/linux-tst_6.6.bb:do_kernel_configme)
 failed with exit code '1'
NOTE: Tasks Summary: Attempted 989 tasks of which 973 didn't need to be rerun 
and 1 failed.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 1 seconds

Summary: 1 task failed:
  
/home/preid/dev/v2024.09/layers/meta-emit/recipes/emit-linux/linux-tst_6.6.bb:do_kernel_configme
================================


I've managed to trace the change in behaviour to a change in archiver.bbclass.
Reverting the change to is_work_shared and everything is happy.

================================
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index 9d286224d6..9bac870449 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -472,9 +472,10 @@ def create_diff_gz(d, src_orig, src, ar_outdir):
         os.chdir(cwd)
def is_work_shared(d):
-    sharedworkdir = os.path.join(d.getVar('TMPDIR'), 'work-shared')
-    sourcedir = os.path.realpath(d.getVar('S'))
-    return sourcedir.startswith(sharedworkdir)
+    pn = d.getVar('PN')
+    return pn.startswith('gcc-source') or \
+        bb.data.inherits_class('kernel', d) or \
+        (bb.data.inherits_class('kernelsrc', d) and 
d.expand("${TMPDIR}/work-shared") in d.getVar('S'))
# Run do_unpack and do_patch
 python do_unpack_and_patch() {
================================




And here's a small reproducer kernel bb.
I've tested this with cyclone5 machine.

================================
KBRANCH ?= "v6.6/standard/base"

require recipes-kernel/linux/linux-yocto.inc

# CVE exclusions
include recipes-kernel/linux/cve-exclusion.inc
include recipes-kernel/linux/cve-exclusion_6.6.inc

# board specific branches
SRCREV_machine ?= "561bbd55f91a8e94576ca3fbf35a0c99ff70d4b2"

SRC_URI = 
"git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRANCH};protocol=https"

LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
LINUX_VERSION ?= "6.6.52"

PV = "${LINUX_VERSION}+git"

KCONF_BSP_AUDIT_LEVEL = "1"

COMPATIBLE_MACHINE = "^(qemux86-64|cyclone5)$"

# Functionality flags
KERNEL_FEATURES:append = " ${KERNEL_EXTRA_FEATURES}"

KERNEL_PACKAGE_NAME          = "kernel-tst"

KBUILD_DEFCONFIG:qemux86-64  = "x86_64_defconfig"
KCONFIG_MODE:qemux86-64      = "--alldefconfig"

KBUILD_DEFCONFIG:cyclone5    = "socfpga_defconfig"
KCONFIG_MODE:cyclone5        = "--alldefconfig"

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


The key trigger here I think is:
- PREFERRED_PROVIDER_virtual/kernel is not equal to the kernel package.
- KERNEL_PACKAGE_NAME is not equal to kernel

And therefore the source doesn't end up in work-shared.
But something somewhere expects the kernel-source folder to be in work-shared
and ends up deleting the kernel-source folder

After do_patch the kernel-source still contains the source files.
The git checkout folder has gone by this step.

Then during do_unpack_and_patch the kernel-source folder is cleaned of all 
files.
They've been moved to archiver-work/git

And after that kernel-source is empty.


So is the method we're using to build the kernel still supported?
Or are we doing something wrong...



--
Regards
Phil Reid
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#205001): 
https://lists.openembedded.org/g/openembedded-core/message/205001
Mute This Topic: https://lists.openembedded.org/mt/108679274/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to