[yocto] how to set up PREMIRRORS_prepend to avoid constant git clones?

Robert P. J. Day rpjday at crashcourse.ca
Sat Mar 10 03:17:52 PST 2012


On Sat, 10 Mar 2012, Gary Thomas wrote:

> All you really need are these lines:
>   SOURCE_MIRROR_URL ?= "file://${COREBASE}/sources/"

  ah ... and i see no mention of that in the variable glossary in the
reference manual. :-P  i'm assuming that that value is nothing more
than the name of my massive tarballs directory, right?

>   INHERIT += "own-mirrors"

> Adjust the SOURCE_MIRROR_URL to wherever you want the files.
>
> I also always add
>
>   BB_GENERATE_MIRROR_TARBALLS = "1"
> This will let the fetcher make a git2_XXX tarball, once the repo has been
> cloned.
>
> My understanding is that the git (and other SCM) fetcher works like this:
>   * If there is a git2_XXX tar file in the DL_DIR (or mirror), unpack it
>     into ${BUILD}/downloads/git2
>   * Check to see if the desired ${SRCREV} is present.  If not, do a 'git pull'
>     to update the local clone and then rebuild the git2_XXX tarball.
> This way, you only have to clone once - just copy any generated tarballs back
> to your source mirror.

  yup, that's what i was after -- the ability to avoid constant
cloning.  and i see i still have to manually copy the git-based
tarball back to my own mirror, that's fine, i would have expected
that.

> Finally, if you set
>   BB_NO_NETWORK = "1"
> the build will fail if bitbake *ever* has to go to the network, i.e. not find
> the desired files in the source mirror or DL_DIR.  This is a great way to
> insure
> that you've got what you need locally.  I use this all the time to make sure I
> have a fully populated local cache of sources.

  i knew about that setting, i can use that for, as you say,
verification that i have all local sources.

  ok, i'm off to try this, i'll let you know.  thanks.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================



More information about the yocto mailing list