Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup an Yocto recipe to build from a local git source?

Hej

I am playing a bit around with Yocto, a Raspberry Pi and some code I wrote. Now I want that Yocto is building an image including the program I wrote. I like to know how to setup the fetcher to fetch from a local git repro.

My setup is simple. The code is in the directory:

/home/user/git/myTest

I linked the directory into my recipe directory of my Yocto meta-layer.

/home/user/poky/meta-test/myApp/myTest

Because it is a local git repro, there is the ".git" folder.

/home/user/git/myTest/.git

There are more files:

/home/user/git/myTest/CMakeLists.txt
/home/user/git/myTest/src/main.cpp
/home/user/git/myTest/src/...

I like to know how to setup my recipe to use the git fetcher:

SUMMARY = "test"
SECTION = "app"
LICENSE = "CLOSED"

inherit cmake

SRCREV = "${AUTOREV}"

SRC_URI = "git://.git"

S = "${WORKDIR}/git"

I did check the Yocto/Bitbake documentation. But I did not find an example how to do it. Any ideas?

like image 523
Stefan Jaritz Avatar asked Mar 28 '18 13:03

Stefan Jaritz


People also ask

What is Bitbake recipe?

BitBake recipes specify how a particular package is built. Recipes consist of the source URL (http, https, ftp, cvs, svn, git, local file system) of the package, dependencies and compile or install options. They also store the metadata for the package in standard variables.

What is recipe in Yocto Project?

Poky is an integration layer on top of OE-Core. Recipe: The most common form of metadata. A recipe contains a list of settings and tasks (i.e. instructions) for building packages that are then used to build the binary image. A recipe describes where you get source code and which patches to apply.

What is files _${ PN?

FILES_${PN} The base package, this includes everything needed to actually run the application on the target system.


1 Answers

GIT Fetcher in bitbake supports different protocols but with rather peculiar and non-standard syntax. In your case it should be something like

SRC_URI = "git:///home/user/git/myTest/;protocol=file"
like image 141
phd Avatar answered Sep 19 '22 12:09

phd