All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gary Thomas <gary@mlbassoc.com>
To: "Robert P. J. Day" <rpjday@crashcourse.ca>
Cc: Yocto discussion list <yocto@yoctoproject.org>
Subject: Re: how to set up PREMIRRORS_prepend to avoid constant git clones?
Date: Sat, 10 Mar 2012 07:55:00 -0700	[thread overview]
Message-ID: <4F5B6B44.7020409@mlbassoc.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1203100654540.29307@oneiric>

On 2012-03-10 06:39, Robert P. J. Day wrote:
> On Sat, 10 Mar 2012, Gary Thomas wrote:
>
>> All you really need are these lines:
>>    SOURCE_MIRROR_URL ?= "file://${COREBASE}/sources/"
>>    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.
>>
>> Finally, if you set
>>    BB_NO_NETWORK = "1"
>> the build will fail if bitbake *ever* has to go to the network,
>
>    well, that (sort of) worked so let me summarize for the benefit of
> anyone else interested.
>
>    i configured for a new build (beagleboard), and added the following
> to the bottom of local.conf:
>
> SOURCE_MIRROR_URL ?= "file:///home/rpjday/dl/"
> INHERIT += "own-mirrors"
> BB_GENERATE_MIRROR_TARBALLS = "1"
> # BB_NO_NETWORK = "1"
>
>    (since i know i'll need to do some downloading, i won't ban network
> access, obviously, not for this first run.)
>
>    did a "bitbake -c fetchall core-image-minimal", then checked my
> downloads/ directory for any content that actually got downloaded and
> tarball-ed, and found one obvious and sizable download:
>
> ... 87770604 2012-03-10 06:45 gcc-4_6-branch_gcc.gnu.org_.svn.gcc.branches_184847_.tar.gz
>
>    i copied that over to my own mirror dl/ directory, then configured a
> whole new build (also beagleboard), added same mirror directives to
> local.conf except (of course) banning network access this time, and
> once again did
>
>    $ bitbake -c fetchall core-image-minimal
>
> and got something unexpected:
>
> NOTE: package bash-4.2-r1: task do_fetch: Started
> ERROR: Function failed: Network access disabled through BB_NO_NETWORK
> but access rquested with command /usr/bin/env wget -t 5 -nv
> --passive-ftp --no-check-certificate -P
> /home/rpjday/yocto/builds/beag2/downloads
> 'ftp://ftp.gnu.org/gnu/bash/bash-4.2-patches/bash42-001' (for url
> None)
> ERROR: Logfile of failure stored in:
> /home/rpjday/yocto/builds/beag2/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/bash-4.2-r1/temp/log.do_fetch.32479
> Log data follows:
> | DEBUG: Trying PREMIRRORS
> ... snip ...
>
>    i can clearly see the problem -- while i have the bash tarball
> itself in my own mirror, i don't have the patches to go with it, as
> defined in the recipes file:
>
> SRC_URI = "${GNU_MIRROR}/bash/${BPN}-${PV}.tar.gz;name=tarball \
>
> ${GNU_MIRROR}/bash/bash-4.2-patches/bash42-001;apply=yes;striplevel=0;name=patch001 \
> ${GNU_MIRROR}/bash/bash-4.2-patches/bash42-002;apply=yes;striplevel=0;name=patch002 \
> ${GNU_MIRROR}/bash/bash-4.2-patches/bash42-003;apply=yes;striplevel=0;name=patch003 \
> ... etc etc ...
>
>    when i went looking for actual downloads in step 1, i just searched
> for sizable tarballs or zip files, it never occurred to me to check
> for patch files.  so i guess i just have to be more observant and
> check for patch files as well (or anything else a recipe might want to
> download).
>
>    so far, so good?

I didn't check but this is often the recipe's fault.  It must specify
an exact git SRCREV, not a tag, for the NO_NETWORK to be successful.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


  reply	other threads:[~2012-03-10 14:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-10 10:35 how to set up PREMIRRORS_prepend to avoid constant git clones? Robert P. J. Day
2012-03-10 10:52 ` Gary Thomas
2012-03-10 10:58   ` Gary Thomas
2012-03-10 11:17   ` Robert P. J. Day
2012-03-10 11:23   ` Robert P. J. Day
2012-03-10 13:39   ` Robert P. J. Day
2012-03-10 14:55     ` Gary Thomas [this message]
2012-03-10 15:29       ` Robert P. J. Day
2012-03-10 15:34         ` Gary Thomas
2012-03-10 15:46           ` Robert P. J. Day
2012-03-10 15:51             ` Gary Thomas
2012-03-12  8:28               ` David Nyström

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F5B6B44.7020409@mlbassoc.com \
    --to=gary@mlbassoc.com \
    --cc=rpjday@crashcourse.ca \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.