'adding patch and another git source does not work in yocto

I have tried to add another git sources from another project and a patch like follwoing in bbappend file (fyi in the bb file I have the first git repo where I get my kernel source and it works) :

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRCREV_my_modules = "${AUTOREV}"
SRC_URI += "git://server/produc/kernel-modules;protocol=ssh;branch=master;name=my_modules;destsuffix=${S}/my_modules"
SRC_URI += "file://drivers_makefile.patch"

The problem is when I tried to build like following :

bitbake -c cleanall linux
bitbake linux

the changes does not take account, there are no sources getted from git and the patch is not applied

When I tried to make an error in git URI or in the name of patch bitbake detects the problem and shows an error even for git URI (

ssh: Could not resolve hostname server: Name or service not known
fatal: Could not read from remote repository.

) even in the patch file name.

fyi when I tried to add some symbolic link to the new source in do_compile_append() it works and the symbloic link is created but of course the link is done for inexistant source code.

I don't see what is the problem ? Can you help me to find the solution for that ?

NOTE: I have followed the same idea of meta/recipes-core/glibc/cross-localedef-native_2.22.bb



Solution 1:[1]

I read your post and also took a look at cross-localedef-native_%.bb. Your problem is right here:

SRC_URI += "git://server/produc/kernel-modules;protocol=ssh;branch=master;name=my_modules;destsuffix=${S}/my_modules"

If your git repo were indeed hosted at server and that name resolved via DNS, and presumably there was also a path like produc/kernel-modules/ in the repo, your fetch would work, and your build should continue, just fine. In the cross-localedef-native recipe there are repo URIs from github.com and sourceware.org, which do indeed resolve, so everything works well there.

Fill in your actual git repo server name (github.com, git.yoctoproject.org, whatever), make sure you really have ssh access since you're specifying that, and you'll be good.

Solution 2:[2]

You should remove ${S} from your destsuffix, i.e: destsuffix=my_modules.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Modus Tollens
Solution 2 Henry Ecker