Skip to contentSkip to conversation

repo and bitbake

DISCUSSION Mike 2 participants 2 messages May 1, 2021

lore
Share & tools
lore

Mike

author
#0 lore raw

Hi!

I am a beginner to bitbake and openembedded, so please bear with me.

In short, I have a custom system where I want to fetch all source code from a Gerrit server using the (Google) repo tool.
So, after repo init and sync, all source code is populated in my workspace (thus, bitbake doesn't have to fetch or patch the sources). The SW modules themselves use regular CMake, make, or autotools for building.
The workspace looks like:
(workdir)/subsystem_A/SW_module_1
(workdir)/subsystem_A/SW_module_2
(workdir)/subsystem_B/...
(workdir)/product_X/meta-...     (this is were all bitbake files are stored in order to build product X)
(workdir)/product_Y/meta-...     (this is were all bitbake files are stored in order to build product Y; common configs/recipes will be a common product layer) In product_X folder, I also plan to have a script that sets up the build env (similar to oe-init-build-env), creating folder:
(workdir/build/
and populate it with bblayers.conf and local.conf. bblayers.conf will add the layers at (workdir)/product_X/meta-...
From here, the building of the SW modules as well as the final image takes place using bitbake.
The end result of the build is a ext4 file system image, which is flashed onto target device.

First basic question:
How do I properly set SRC_URI in the recipes to point to the SW_modules above, with no fetching/patching. Can I avoid that bitbake copy the source files to the build/tmp folder?
I don't want to list the source files in the recipe really, I just want to refer to folder (workdir)/subsystem_A/SW_module_1 as the CMakeLists.txt (for CMake) tells which files to build etc. Thus, "file:://" doesn't sound a good idea. I want to use inherit cmake and DEPENDS for managing deps.

Thanks!
Mike

#1 lore raw

Hi Mike,

I have started a project to use yocto in a repo environment. This is called openbar (https://github.com/openbar) but it is still a draft.

There is a wrapper makefile (the wizard) which starts bitbake in a docker environment and allows you to use .config files to specify a build with additional actions (use "make help" for the complete usage) .

It also exports the REPODIR variable (the root of the repo tree) to bitbake using the BB_ENV_EXTRAWHITE variable (
https://www.yoctoproject.org/docs/latest/bitbake-user-manual/bitbake-user-manual.html#var-bb-BB_ENV_EXTRAWHITE
).

Finally I wanted to have the same use case as you, I was thinking of using the externalsrc class (
http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/classes/externalsrc.bbclass)
the same way devtool do. I think mixing this class with something equivalent to the REPODIR variable should work.

Let me know if you have succeeded.

Best regards,
Jean-Marie

Quoted 46 lines · Mike

Hi!

I am a beginner to bitbake and openembedded, so please bear with me.

In short, I have a custom system where I want to fetch all source code from a Gerrit server using the (Google) repo tool.
So, after repo init and sync, all source code is populated in my workspace (thus, bitbake doesn't have to fetch or patch the sources).
The SW modules themselves use regular CMake, make, or autotools for building.
The workspace looks like:
(workdir)/subsystem_A/SW_module_1 (workdir)/subsystem_A/SW_module_2
(workdir)/subsystem_B/...
(workdir)/product_X/meta-... (this is were all bitbake files are
stored in order to build product X)
(workdir)/product_Y/meta-... (this is were all bitbake files are
stored in order to build product Y; common configs/recipes will be a common product layer)
In product_X folder, I also plan to have a script that sets up the build env (similar to oe-init-build-env), creating folder:
(workdir/build/
and populate it with bblayers.conf and local.conf. bblayers.conf will add the layers at (workdir)/product_X/meta-...
From here, the building of the SW modules as well as the final image takes place using bitbake.
The end result of the build is a ext4 file system image, which is flashed onto target device.

First basic question:
How do I properly set SRC_URI in the recipes to point to the SW_modules above, with no fetching/patching. Can I avoid that bitbake copy the source files to the build/tmp folder?
I don't want to list the source files in the recipe really, I just want to refer to folder (workdir)/subsystem_A/SW_module_1
as the CMakeLists.txt (for CMake) tells which files to build etc. Thus, "file:://" doesn't sound a good idea.
I want to use inherit cmake and DEPENDS for managing deps.

Thanks!
Mike