Bug 14723 - patches not applied by devtool when using overrides in SRC_URI
Summary: patches not applied by devtool when using overrides in SRC_URI
Status: IN PROGRESS DESIGN
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 5.99
Assignee: Chris Laplante
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2022-02-17 01:02 UTC by Jonathan Richardson
Modified: 2025-05-18 12:53 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
test layer for linux-yocto (1.97 KB, application/gzip)
2022-04-27 23:05 UTC, Jonathan Richardson
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Richardson 2022-02-17 01:02:52 UTC
I have a recipe that specifies patches with SRC_URI overrides. Any override causes the patches to not be applied. Eg-

FILESEXTRAPATHS_prepend_${MACHINE_ARCH} := "${THISDIR}/${PN}:${THISDIR}/${PN}/${MACHINE_ARCH}:"
SRC_URI += " \
            file://base-ces.cfg \
           "
SRC_URI_append_penguin = " \
            file://0001-add-penguin-specific-dts.patch \
            file://0002-Add-M41T80-RTC.patch \
           "

Directory: linux-variscite/penguin/:
0001-add-penguin-specific-dts.patch
0002-Add-M41T80-RTC.patch

If I move the patches into SRC_URI it works. This is similar to #14060 but the fix didn't resolve the issue for me. I moved to master and still see the issue:

Build Configuration:
BB_VERSION           = "1.46.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "ubuntu-18.04"
TARGET_SYS           = "aarch64-poky-linux"
MACHINE              = "penguin"
DISTRO               = "ces-linux"
DISTRO_VERSION       = "CES-1.1.1.B59-20220217003750"
TUNE_FEATURES        = "aarch64 cortexa53 crc crypto"
TARGET_FPU           = ""
meta                 
meta-poky            = "master:fca7b22674a2e23fb1cfcc46550531154c90fee6"

Additionally, the SRC_URI has a second git repo and it doesn't get copied over to WORKDIR, even though it's in the temporary workdir if I use devtool modify linux-variscite --keep-temp. See cst-certs below.

jonr@jonr:~/work/yocto/latest2/build_penguin/tmp/work/penguin-poky-linux/linux-variscite/5.4.142+gitAUTOINC+meta_machine-r0/devtooltmp-61aflsh1$ ll
total 148
drwx------ 5 jonr jonr   4096 Feb 16 16:37 ./
drwxrwxr-x 7 jonr jonr   4096 Feb 16 16:25 ../
-rw-rw-r-- 1 jonr jonr 122545 Feb 16 16:37 .config
-rw-rw-r-- 1 jonr jonr     40 Feb 16 16:33 initial_rev
-rw-rw-r-- 1 jonr jonr    154 Feb 16 16:33 srcsubdir
drwxrwxr-x 3 jonr jonr   4096 Feb 16 16:25 stamps/
drwxrwxr-x 2 jonr jonr   4096 Feb 16 16:37 temp/
drwxrwxr-x 7 jonr jonr   4096 Feb 16 16:37 workdir/

jonr@jonr:~/work/yocto/latest2/build_penguin/tmp/work/penguin-poky-linux/linux-variscite/5.4.142+gitAUTOINC+meta_machine-r0/devtooltmp-61aflsh1$ ll workdir/
total 64
drwxrwxr-x 7 jonr jonr  4096 Feb 16 16:37 ./
drwx------ 5 jonr jonr  4096 Feb 16 16:37 ../
-rw-rw-r-- 1 jonr jonr  6242 Jan 31 17:25 0001-add-penguin-specific-dts.patch
-rw-rw-r-- 1 jonr jonr   795 Feb 14 14:51 0002-Add-M41T80-RTC.patch
drwxr-xr-x 4 jonr jonr  4096 Feb 16 16:37 build/
drwxr-xr-x 3 jonr jonr  4096 Feb 16 16:26 cst/
drwxr-xr-x 5 jonr jonr  4096 Feb 16 16:26 cst-certs/
-rw-r--r-- 1 jonr jonr 22917 Feb 16 16:33 defconfig
drwxrwxr-x 4 jonr jonr  4096 Feb 16 16:36 recipe-sysroot/
drwxrwxr-x 8 jonr jonr  4096 Feb 16 16:36 recipe-sysroot-native/
jonr@jonr:~/work/yocto/latest2/build_penguin/tmp/work/penguin-poky-linux/linux-variscite/5.4.142+gitAUTOINC+meta_machine-r0/devtooltmp-61aflsh1$
Comment 1 Randy MacLeod 2022-02-17 15:41:24 UTC
Did this work before the over-rides change?
Comment 2 Jonathan Richardson 2022-02-17 18:04:53 UTC
Yes, if I remove all overrides then it works fine. As soon as there is any override, even if it doesn't apply to the currently configured machine it fails.
Comment 3 Saul Wold 2022-02-17 18:18:33 UTC
If you change

SRC_URI_append_penguin = " \

to 

SRC_URI:append:penguin = " \

does it work?  This is the new override mechanism, if this works then it means the devtool needs to be fixed (which is likely the case).
Comment 4 Jonathan Richardson 2022-02-17 18:51:28 UTC
I'm getting an error with that new syntax. Do you have a commit # that implemented it?

ERROR: ParseError at /home/jonr/work/yocto/latest2/sources/meta-ces-linux/dynamic-layers/variscite-fslc/recipes-kernel/linux/linux-variscite_%.bbappend:9: unparsed line: 'SRC_URI:append:penguin = "':01:05
Comment 5 Jonathan Richardson 2022-02-17 19:39:56 UTC
Please disregard my previous comment. I introduced the syntax error. Using the new override still doesn't make a difference to devtool though unfortunately.
Comment 6 Saul Wold 2022-04-16 23:41:05 UTC
Hi Jonathan, 

I want to double check your failure mode. Does devtool modify complete the extraction/patching correctly or does it fail to create the workspace/sources/linux-variscite?

If it completes correctly, when you look at the git repo that's created by devtool in workspace/sources/linux-variscite/ are there branches for the overrides?  Are you changes in the devtool-override-penguin?

Can you provide a sample layer that fails if the above information does not help.
Comment 7 Jonathan Richardson 2022-04-25 22:06:37 UTC
Hi Saul,

devtool modify does extract the source code, and it creates the override specific branches, but the patches aren't applied. The patches are in the .kernel-meta directory:

jon@jon:~/work/yocto/latest/build_penguin/linux-variscite/.kernel-meta$ tree
.
├── bsp_definition
├── cfg
│   ├── merge_config_build.log
│   └── scratch
├── config.queue
├── configs
│   ├── base-ces.cfg
│   └── defconfig
├── meta-series
├── non-hardware_frags.txt
├── patches
│   ├── 0001-add-penguin-specific-dts.patch
│   ├── 0001-kthread-Fix-PF_KTHREAD-vs-to_kthread-race.patch
│   ├── 0002-Add-M41T80-RTC.patch
│   └── 0003-change-usb1-to-otg.patch
├── patch.queue
└── series -> patch.queue

4 directories, 13 files


$ git branch
commit fe01a41af899ae24944993b5293223430f7a6bbe (HEAD -> devtool, tag: devtool-patched, tag: devtool-base, origin/5.4-2.1.x-imx_var01, devtool-override-penguin, devtool-no-overrides)
Author: Alexander Herfurtner <alexander.h@variscite.com>
Date:   Thu Apr 7 22:35:38 2022 +0200

    imx7d-var-som: Override FEC property phy-mode for ADIN PHY


I'll try to get you an example using the linux-yocto recipe soon so you can reproduce easily. I'm using a different kernel recipe (so you avoid having to pull in meta-variscite-fslc. Thanks.
Comment 8 Jonathan Richardson 2022-04-27 23:05:31 UTC
Created attachment 4864 [details]
test layer for linux-yocto
Comment 9 Jonathan Richardson 2022-04-27 23:07:41 UTC
I've attached a test layer. Just set MACHINE = penguin. It's a copy of a qemu machine conf. Then devtool modify linux-yocto
Comment 10 Randy MacLeod 2022-04-28 15:02:06 UTC
Leaving as M2. Jonathan, let us know if that's a problem for you.
Comment 11 Ernst Persson 2022-08-25 12:15:43 UTC
Ah this happens on Dunfell 3.1.19 also.
Comment 12 Chris Laplante 2023-10-13 14:47:29 UTC
I've submitted a patch series (with selftests) that fixes this issue here: https://lists.openembedded.org/g/openembedded-core/message/189023.