[yocto] setting SRC_URI runtime - possible options

Belisko Marek marek.belisko at gmail.com
Mon May 20 23:09:40 PDT 2019


Hi,

I have special need to fetch repo which is defined in config file in form
(repo and branch):
git at testrepo.com/myrepo mysuperbranch

Config file is placed in recipe directory. I've tried to add some bits and
pieces but it seems it's not doing right. Snippet from recipe:

LICENSE = "CLOSED"

SRCREV = "${AUTOREV}"
PV = "${SRCPV}"

do_fetch_prepend () {

    src_uri = d.getVar('SRC_URI')

    p = d.getVar("FILE")
    idx = p.rfind("/")
    p = p[:idx]
    p += "/config.txt"

    with open(p) as f:
        read_data = f.readline().strip().split(" ")
        d.setVar('SRC_URI', read_data[0])
}

SRC_URI = ""

S = "${WORKDIR}/git"

It looks like that repo is fetched but unpack doesn't put git directory in
$WORKDIR and in build directory I get strange directories like:

!=
bitbake-cookerdaemon.log
cache
conf
${@d.getVar('S')
else
if
os.path.join('
os.path.normpath(d.getVar('S'))
os.path.normpath(d.getVar('WORKDIR'))
'patches')}
tmp

so there is obviously I'm doing something wrong :). My question is if this
is the way or should I stick to some variables set in local.conf and then
use it in recipe? Thanks a lot for any pointers.

BR,

marek
-- 
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20190521/2cb1d727/attachment.html>


More information about the yocto mailing list