[yocto] crops/poky workflow and git

Khem Raj raj.khem at gmail.com
Tue Feb 27 19:24:38 PST 2018



On 2/27/18 9:47 AM, Andrea Galbusera wrote:
> Hi!
> 
> Anyone here regularly doing yocto builds from crops/poky [1] containers?
> If I got it right, the idea behind using containers derived from
> crops/poky image for builds is to keep the entire development workflow
> outside the container and use the container for build related commands
> only (ideally setting up the env and running bitbake).
> 
> Then, a very annoying issue I face in trying to enforce this idea as
> my regular workflow is that interacting with git repositories created
> while the build runs is becoming almost impossible from outside the
> container, where regular git work is expected to be more conveniently
> done.
> 
> The point is that repos get created when bitbake fetches sources from
> within the container and git itself hardcodes absolute paths in some
> of its control files. What I see is while running git from within the
> repo but outside the contained scope, is git itself complaining with
> messages like this:
> 
> error: object directory /workdir/blah/blah/blah does not exist; check
> .git/objects/info/alternates. fatal: bad object HEAD docker
> 
> I'm using crops/poky as suggested in [1] hence bind mounting a volume
> with the entire project rootdir under /workdir within the container.
> 
> Any suggestion how to make this more friendly, other than moving the
> entire git workflow inside the same or another container that bind
> mounts the volume at the same location? I'm curious to know if/how
> people try to leverage the isolation of containers and how they do
> mitigate sharp edges I found in migrating builds to them.
> 
> [1] https://github.com/crops/poky-container
> 

Yes, I have been doing it for some time pretty regularly, the idea is to 
map the directories identically into container to avoid these kind of errors

you can look at this here

http://bec-systems.com/site/1281/using-docker-for-oeyocto-builds

The template we use is here

https://github.com/kraj/oe-build

look at https://github.com/kraj/oe-build/blob/master/envsetup.sh#L540
how docker is tamed :)



More information about the yocto mailing list