Get a site

Adding mirrors into Yocto list if the default set fails

This came out of our Intel Edison community discussion when builds were failing with a bogus git error.

It turned out to be a Git repo problem coupled with the secondary, tarball-based, mirrors fail and it was fixed by Yocto team after I talked to them on the IRC even before I could post the workaround to the forum. But I want to use this as an example of the mirror/premirror mechanism you can use in your recipes in such cases or e.g. when you want to establish a mirror internally in your organization’s network.

When something like that happens, you can work that around by finding another source of this same file on the Internet (filename will be in the do_fetch log mentioned in the bitbake error message) and then adding a line similar to the below to the recipe that fails (in this specific case that was a kernel recipe):

MIRRORS += “git://git.yoctoproject.org/linux-yocto-3.10.git http://build.gnome.org/ostree/work/build-yocto/downloads/ \n”

Here I’ve found the same file on one of the Gnome servers by googling, and by means of that variable I’m just adding it as a mirror for the location with URL “git://git.yoctoproject.org/linux-yocto-3.10.git” (which is the main source mentioned in the kernel recipe in question). I could have added it into the PREMIRROR variable instead, then the mirror would’ve been tried even before the main repo.

You can read more about MIRROR/PREMIRROR variable functions in the Yocto manual here

2 Replies to “Adding mirrors into Yocto list if the default set fails”

  1. Hi
    how do i add prebuild binary package to the final image?
    ex: add clamav.rpm to the final image.
    could you please help me.
    thanks

Leave a Reply

Your email address will not be published.