[yocto] do_kernel_checkout() not using the correct directory

Bishop, Mark (STRT) MBishop at smithsinterconnectinc.com
Thu Nov 2 10:48:04 PDT 2017


I am trying to compile a kernel located in SVN.

I get this error message:
ERROR: linux-xlnx-4.9-xilinx-v2017.2+git20-r0 do_kernel_checkout: S /tmp/stride/work-shared/plnx_arm/kernel-source is not set to the linux source directory. Check
ERROR: linux-xlnx-4.9-xilinx-v2017.2+git20-r0 do_kernel_checkout: the recipe and set S to the proper extracted subdirectory
ERROR: linux-xlnx-4.9-xilinx-v2017.2+git20-r0 do_kernel_checkout: Function failed: do_kernel_checkout (log file is located at /tmp/stride/work/plnx_arm-xilinx-linux-gnueabi/linux-xlnx/4.9-xilinx-v2017.2+git20-r0/temp/log.do_kernel_checkout.34928)
ERROR: Logfile of failure stored in: /tmp/stride/work/plnx_arm-xilinx-linux-gnueabi/linux-xlnx/4.9-xilinx-v2017.2+git20-r0/temp/log.do_kernel_checkout.34928
ERROR: Task (/opt/pkg/petalinux/2017.2/components/yocto/source/arm/layers/meta-xilinx/recipes-kernel/linux/linux-xlnx_4.9.bb:do_kernel_checkout) failed with exit code '1'

And my kernel gets downloaded to:
/tmp/stride/work/plnx_arm-xilinx-linux-gnueabi/linux-xlnx/4.9-xilinx-v2017.2+git20-r0/trunk
But Yocto is looking for it in /tmp/stride/work-shared/plnx_arm/kernel-source
Which is why it is failing in kernel-yocto.bbclass when I try and compile a kernel located in SVN.

If it is a git repo it gets copied into /tmp/stride/work-shared/plnx_arm/kernel-source and things work nicely.


do_kernel_checkout() {
.......
if [ -d "${WORKDIR}/git/" ]; then
# case: git repository
                # if S is WORKDIR/git, then we shouldn't be moving or deleting the tree.
                if [ "${source_dir}" != "${source_workdir}" ]; then
                        if [ -d "${source_workdir}/.git" ]; then
                                # regular git repository with .git
                                rm -rf ${S}
                                mv ${WORKDIR}/git ${S}
                        else
                                # create source for bare cloned git repository
                                git clone ${WORKDIR}/git ${S}
                                rm -rf ${WORKDIR}/git
                        fi
                fi
                cd ${S}
else
                # case: we have no git repository at all.
                # To support low bandwidth options for building the kernel, we'll just
                # convert the tree to a git repo and let the rest of the process work unchanged

                # if ${S} hasn't been set to the proper subdirectory a default of "linux" is
                # used, but we can't initialize that empty directory. So check it and throw a
                # clear error

                cd ${S}
                if [ ! -f "Makefile" ]; then
                        bberror "S ${S} is not set to the linux source directory. Check "
                        bbfatal "the recipe and set S to the proper extracted subdirectory"
                fi
......

${S} is set to /tmp/stride/work-shared/plnx_arm/kernel-source when I need one of the two things to happen:

A)     ${S} set to  ${WORKDIR}/trunk             OR

B)      ${WORKDIR}/trunk copied to ${S}/

I could modify that file directly on my machine and move on, but is there a way I can create an .bbappend or something that will change ${S}

I'm pretty new to Yocto and I'd like to have a solution that resides in my project folder instead of having to modify Yocto files so that when I do tool installs on new development machines I can just checkout my project data and have it work.  I'm using Petalinux, so the process would be install that, then checkout the project and then build it, with the correct ${S} directory flowing into kernel-yocto.bbclass:do_kernel_checkout()

I'm new Yocto but I've been reading a ton and am looking for some advice.





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20171102/ab7c9513/attachment.html>


More information about the yocto mailing list