SDK 2.0 LS1043ARDB EXTERNALSRC fails for full build

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SDK 2.0 LS1043ARDB EXTERNALSRC fails for full build

4,702 Views
tracysmith
Contributor IV

When doing a fsl-image-full bitbake and after creating an external source, the bitbake still attempts to do a do_patch from the linux-qoriq_4.1.bb and fails.  Why does the do_patch fail when all source is external?  Recipes are all SDK 2.0 1609 defaults except for adding the external source: EXTERNALSRC = "/home/tlsmith/neo_mcu_eos-qoriq_v2_sources/src/ls1043ardb-fsl-linux/linux-qoriq/4.1-r0/git"

bitbake fsl-image-full

NOTE: Preparing RunQueue
ERROR: Task do_populate_lic in /home/tlsmith/neo_mcu_eos-qoriq_v2_sources/sources/poky/meta/recipes-kernel/perf/perf.bb depends upon non-existent task do_patch in /home/tlsmith/neo_mcu_eos-qoriq_v2_sources/sources/meta-freescale/recipes-kernel/linux/linux-qoriq_4.1.bb

Summary: There was 1 ERROR message shown, returning a non-zero exit code.

Using EXTERNALSRC was able to successfully build the kernel (bitbake virtual/kernel) from an external source with no issues and a message printed indicating the externalsrc was being used.  But there is a dependency issue when doing fsl-image-full where the perf.bb needs to include a patch but cannot find it.

The first issue is why patches cannot be found after moving the entire source to an external location?  Does the full build assume source to be in a specific location to do patches?  But when externalsrc is used and source is relocated, the  source needed for patching cannot be found.  If this is the case, how do we change the recipes for patches to look for the source using EXTERNALSRC for patches? 

Another issue is that the bitbake uses sources/poky/meta/recipes-kernel/perf/perf.bb instead of or in addition to sources/meta-freescale/recipes-kernel/perf-qoriq/perf-qoriq_....bb, and it is the poky perf.bb recipe that is breaking the full build.  When adding EXTERNALSRC to perf.bb or perf-qoriq_...bb it cannot find the source to patch and the bitbake fsl-image-full breaks.  Why is the poky perf.bb being used when there is a perf-qoriq recipe and how do we avoid breaking the build?

1)   sources/meta-freescale/recipes-kernel/linux/linux-qoriq_4.1.bb


inherit kernel kernel-arch qoriq_build_64bit_kernel siteinfo

inherit fsl-kernel-localversion
require recipes-kernel/linux/linux-dtb.inc

DESCRIPTION = "Linux kernel for Freescale platforms"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"

SRC_URI = "git://git.freescale.com/ppc/sdk/linux.git;branch=sdk-v2.0.x"
SRCREV = "bd51baffc04ecc73f933aee1c3a37c8b44b889a7"

EXTERNALSRC = "/home/tlsmith/neo_mcu_eos-qoriq_v2_sources/src/ls1043ardb-fsl-linux/linux-qoriq/4.1-r0/git"

S = "${WORKDIR}/git"

2)   sources/poky/meta/recipes-kernel/perf/perf.bb

SUMMARY = "Performance analysis tools for Linux"
DESCRIPTION = "Performance counters for Linux are a new kernel-based \
subsystem that provide a framework for all things \
performance analysis. It covers hardware level \
(CPU/PMU, Performance Monitoring Unit) features \
and software features (software counters, tracepoints) \
as well."

LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"

EXTERNALSRC = "/home/tlsmith/neo_mcu_eos-qoriq_v2_sources/src/ls1043ardb-fsl-linux/linux-qoriq/4.1-r0/git"

PR = "r9"

require perf-features.inc

BUILDPERF_libc-uclibc = "no"

# gui support was added with kernel 3.6.35
# since 3.10 libnewt was replaced by slang
# to cover a wide range of kernel we add both dependencies
TUI_DEPENDS = "${@perf_feature_enabled('perf-tui', 'libnewt slang', '',d)}"
SCRIPTING_DEPENDS = "${@perf_feature_enabled('perf-scripting', 'perl python', '',d)}"
LIBUNWIND_DEPENDS = "${@perf_feature_enabled('perf-libunwind', 'libunwind', '',d)}"

3)   sources/meta-freescale/recipes-kernel/perf-qoriq/perf-qoriq_0.8.2.bb

DESCRIPTION = "QorIQ extension to Perf for supporting non core counters"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=e29234dd5d40dc352cc60cc0c93437ba"

SRC_URI = "git://git.freescale.com/ppc/sdk/qoriq-perf.git;branch=master"
SRCREV = "7beb3783edac66bab00c85d99a7b073f569af7fd"
EXTERNALSRC = "/home/tlsmith/neo_mcu_eos-qoriq_v2_sources/src/ls1043ardb-fsl-linux/linux-qoriq/4.1-r0/git"

S = "${WORKDIR}/git"

inherit module autotools-brokensep qoriq_build_64bit_kernel

PROCESSOR_REV ?= "B4860_R1"
EXTRA_OECONF += "--with-linux=${STAGING_KERNEL_DIR} \
    --with-processor=${PROCESSOR_REV}"

EXTRA_OEMAKE += 'SYSROOT="${D}"'

COMPATIBLE_MACHINE = "(b4860qds)"

Labels (1)
Tags (1)
11 Replies

3,681 Views
tracysmith
Contributor IV

FYI NXP will provide fixes for EXTERNALSRC for the kernel and uboot in SDK2.0-1703 release so both can successfully build using external source. 

Having said that, anything using EXTERNALSRC such as building rootfs or LTP for instance will likely be broken.  So, ultimately you will have to fix the yocto recipes yourselves to get external source functionality to work properly for your customized build.  Changes to the recipes required are a case by case basis.

With the changes NXP has applied in SDK2.0-1703, we can successfully do bitbake to both the kernel and U-Boot from EXTERNTALSRC. 

3,681 Views
tracysmith
Contributor IV

Hi Yiping, I don't think we consider this answered.  I think when you ran the bitbake, you  never compiled the kernel from the external source. You likely compiled the default source tree.

Please rerun after adding INHERIT += "externalsrc" to the build_ls1043ardb/conf/local.conf file.  When you see the message below after doing a bitbake virtual/kernel then you are accessing the external source.  After this then clean and then do your bitbake fsl-image-full.

meta-cloud-services
meta-security     
meta-linaro-toolchain
meta-nxp-npi-1609 = "master:7d3a65cb2c5c005acb3a8399b18c7ef9286a003f"

NOTE: Preparing RunQueue
NOTE: Checking sstate mirror object availability (for 72 objects)
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: linux-qoriq: compiling from external source tree /home/tlsmith/neo_mcu_eos-qoriq_v2_sources/src/ls1043ardb-fsl-linux/linux-qoriq/4.1-r0/git

0 Kudos
Reply

3,681 Views
shaungreene
Contributor II

I'm having the same issue with Yocto Krogoth 2.1.1 for the i.MX6 SoloX when using meta-fsl-arm linux-fslc-imx_4.1-1.0.  Building normally everything is fine, but after using "devtool modify linux-fslc-imx" to modify the kernel, perf throws this error.  One simple workaround I have found was to remove perf from the image while modifying the kernel, but that seems a bit extreme. 

ERROR: Task do_unpack in /home/<pathToProject>/sources/poky/meta/recipes-kernel/perf/perf.bb depends upon non-existent task do_patch in /home/<pathToProject>/sources/meta-fsl-arm/recipes-kernel/linux/linux-fslc-imx_4.1-1.0.x.bb
ERROR: Command execution failed: 1

0 Kudos
Reply

3,681 Views
jamesstenquist
Contributor II

Have your tried an older version of Linux?  Ubuntu14 has worked for me on a Yocto 2.0 build.

0 Kudos
Reply

3,681 Views
tracysmith
Contributor IV

I'm also using Ubuntu 14.04 to build and see the issue.  Where are you adding the yocto definitions for EXTERNALSRC and for your build from the source?  We may be missing something.  For example, do you add anything in your local.conf file for the externalsrc?

0 Kudos
Reply

3,681 Views
shaungreene
Contributor II

I used "devtool modify linux-fslc-imx" to generate my workspace. That generated a {BUILD_DIR}/workspace/appends/linux-fslc-imx_4.1-1.0.x.bbappend file and in that file is this snippet: 

inherit externalsrc
# NOTE: We use pn- overrides here to avoid affecting multiple variants in the case where the recipe uses BBCLASSEXTEND
EXTERNALSRC_pn-linux-fslc-imx = "{BUILD_DIR}/workspace/sources/linux-fslc-imx"

SRCTREECOVEREDTASKS = "do_validate_branches do_kernel_checkout do_fetch do_unpack do_patch do_kernel_configme do_kernel_configcheck"

There is nothing in my local.conf for the workspace.  After running the devtool command, my bblayers.conf gets the following line added: 

{BUILD_DIR}/workspace \

Also this post is about a very similar issue: [OE-core] [PATCH] kernel-yocto: remove do_shared_workdir from SRCTREECOVEREDTASKS .  I manually made the change from the patch, but it doesn't seem to fix anything for me. 

0 Kudos
Reply

3,681 Views
shaungreene
Contributor II

I'm building on Ubuntu 14.04.5 LTS (with recent security patches).  What version of Ubuntu14 are you using? 

0 Kudos
Reply

3,681 Views
tracysmith
Contributor IV

Workaround.  Is the perf.bb no longer needed, or is there an unnecessary dopatch for perf?

changing:

neo_mcu_eos-qoriq_v2_sources/sources/poky/meta/classes/kernelsrc.bbclass (commented out the do_unpack[depends] = “virtual/kernel:dopatch”)

neo_mcu_eos-qoriq_v2_sources/sources/poky/meta/recipes-kernel/perf/perf.bb (commented out the do_populate_lic[depends]=”virtual/kernel:dopatch”)

 

 

neo_mcu_eos-qoriq_v2_sources/sources/meta-freescale/ recipes-kernel/linux/linux-qoriq_4.1.bb (added EXTERNALSRC = “/myfilesystempath/git” and also added a line to skip patching do_patch[no_exec] = “1”

0 Kudos
Reply

3,681 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Tracy Smith,

I didn't reproduce this problem on my build server. Anyway, please try whether the following modification would be helpful in the file sources/poky/meta/recipes-kernel/perf/perf.bb.

- do_populate_lic[depends] += "virtual/kernel:do_patch"

+ do_populate_lic[depends] += "virtual/kernel:do_install"


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

3,681 Views
shaungreene
Contributor II

yipingwang‌ I tried changing the line in perf.bb

--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -49,7 +49,7 @@ export PYTHON_SITEPACKAGES_DIR
 #kernel 3.1+ supports WERROR to disable warnings as errors
 export WERROR = "0"

-do_populate_lic[depends] += "virtual/kernel:do_patch"
+do_populate_lic[depends] += "virtual/kernel:do_install"

 # needed for building the tools/perf Perl binding
 inherit perlnative cpan-base

But it did not fix the problem.  I expected the error to change, but got the same error as posted above.  Either the recipe is not getting reparsed properly, or that is not the line that is causing the error. 

0 Kudos
Reply

3,681 Views
tracysmith
Contributor IV

Hi Yiping,

was perf deprecated in the yocto bitbake by NXP?  Previously under build_ls1043ardb/conf/local.conf one could add "perf" as a EXTRA_IMAGE_FEATURES package, is this still possible and when this is used is the sources/poky/meta/recipes-kernel/perf/perf.bb used for bitbakes?  Just making sure "perf" is not deprecated for any reason?

I'll use do_populate_lic[depends] += "virtual/kernel:do_install" today and let you know. 

Since others are seeing a similar situation, how are you setting up building from your external source?  Your configuration appears to work and ours do not, so it may be in how you are setting up yocto definitions for EXTERNALSRC and for the bitbake for building from the external source?  Are you sure you are bitbaking from EXTERNALSRC? 

Do you make any changes to your build_ls1043ardb/conf/local.conf for INHERIT +=  "/external source location" or any other yocto definition changes related to where the external source is located and built from in the .bb file for the kernel or in local.conf?  Remove or change any other definitions SRC_URL or others?

0 Kudos
Reply