[yocto] setting SRC_URI runtime - possible options

Alexander Kanavin alex.kanavin at gmail.com
Tue May 21 03:14:07 PDT 2019


You can write a class which sets the template for SRC_URI and then a
series of recipes that inherit the class, and define the variable that
would turn the template into the actual URI.

Alex

On Tue, 21 May 2019 at 12:10, Belisko Marek <marek.belisko at gmail.com> wrote:
>
> Hi,
>
> On Tue, May 21, 2019 at 12:00 PM Alexander Kanavin <alex.kanavin at gmail.com> wrote:
>>
>> If you provide some context for why you want this, we might be able to
>> suggest a different way.
>
> Customer wants to have kind of base-os (build in yocto) and then on top of that different flavor python application which should be fetch and added during build based on configuration file. This is only need. Thanks.
>>
>>
>> Alex
>>
>> On Tue, 21 May 2019 at 08:11, Belisko Marek <marek.belisko at gmail.com> wrote:
>> >
>> > 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
>> > --
>> > _______________________________________________
>> > yocto mailing list
>> > yocto at yoctoproject.org
>> > https://lists.yoctoproject.org/listinfo/yocto
>
>
>
> marek


More information about the yocto mailing list