<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>3222</bug_id>
          
          <creation_ts>2012-10-03 16:37:46 +0000</creation_ts>
          <short_desc>Add command to create a mirror without building anything</short_desc>
          <delta_ts>2013-10-04 16:10:21 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>1.3</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>1.5</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Evadeflow">evadeflow</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>corneliux.stoicescu</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>26165</commentid>
    <comment_count>0</comment_count>
    <who name="Evadeflow">evadeflow</who>
    <bug_when>2012-10-03 16:37:46 +0000</bug_when>
    <thetext>My 16-core build server is behind an HTTP-only firewall, and getting all
required packages to it is a real pain. Basically, I go offsite and attempt to
download everything to a folder on a USB hard drive with:

  bitbake -c fetchall universe
  bitbake -c fetchall &lt;image_name&gt;

Then I rsync that folder over to my build server.

I think the second command is supposed to be redundant, but in practice, it&apos;s
not, for whatever reason: &apos;fetchall universe&apos; definitely does not download
everything required to build any arbitrary image my source tree is capable of
building. And even the above commands aren&apos;t fool-proof. Inevitably, my first
attempt to build a new image aborts due to some missing resource.

Also, &apos;fetchall&apos; builds quite a lot of support code that isn&apos;t strictly needed
if all you&apos;re trying to do is pull down a bunch of tarballs and repositories.

I&apos;d love to see a new bitbake command that does what &apos;fetchall universe&apos; seems
like it should do, which is download every single SRC_URI called out in any
recipe in my build tree--without building anything.  I understand that there
are possible complications with BB_GENERATE_MIRROR_TARBALLS and the version of
tar on the host. I would recommend issuing a stern, ALL CAPS warning if the
host tar is too old, or perhaps just refusing to run the command.

The bottom line for me is: getting *all* the sources I need behind the
firewall is just way, way, way harder than it should be. Computers are great
at this kind of automated drudgery, so it should be a no-brainer. Why do I
keep having to drive to the local public library with my laptop and USB hard
drive to pull down &quot;just one more tarball&quot;?

In summary, something like this:

  bitbake -c create-mirror /media/acme/poky-mirror

that *just works* would be FANTASTIC.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26167</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2012-10-03 16:44:19 +0000</bug_when>
    <thetext>Which &quot;support code that isn&apos;t strictly needed&quot; is it building? Its likely your version of git is old/buggy and hence its building git-native which in itself pulls in a signifiant dependency list.

Update to a version of git and tar meet the minimum version requirements and it will work as you describe.

We&apos;re not going down the route of printing ALL CAPS WARNINGS about things we can actually deal non-fatally with ourselves.

So as far as that part of this bug report goes, the resolution is WONTFIX.

When you say unverse doesn&apos;t fetch something that is actually required, can you please give a specific example? This should work and I&apos;d like to understand where it didn&apos;t work.

Actually, if you&apos;re behind an http only firewall, I&apos;d extremely surprised it couldn&apos;t get what it needed from the http sources mirror.

So I&apos;d appreciate more info about how this second part isn&apos;t working.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26171</commentid>
    <comment_count>2</comment_count>
    <who name="Evadeflow">evadeflow</who>
    <bug_when>2012-10-03 17:29:03 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; Which &quot;support code that isn&apos;t strictly needed&quot; is it building? Its
&gt; likely your version of git is old/buggy and hence its building
&gt; git-native which in itself pulls in a signifiant dependency list.

It&apos;s pseudo that&apos;s the problem.  This has already been marked NOTABUG
(see bug #3062), but perhaps it&apos;s a valid enhancement request for 1.4.

Also, you mention:

&gt; Actually, if you&apos;re behind an http only firewall, I&apos;d extremely surprised it
&gt; couldn&apos;t get what it needed from the http sources mirror.

There&apos;s an http sources mirror?! :-% Where&apos;s that? This would be a *huge*
help. If you can tell me how to point bitbake at it, I&apos;ll attempt to build
core-image-sato behind the firewall and let you know the results.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26173</commentid>
    <comment_count>3</comment_count>
    <who name="Evadeflow">evadeflow</who>
    <bug_when>2012-10-03 18:25:27 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; There&apos;s an http sources mirror?! :-% Where&apos;s that?

Okay, I think I found it:

  - http://mirrors.kernel.org/yocto/yocto/yocto-1.2/sources/

I&apos;ll spin up a build using that soonest...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26174</commentid>
    <comment_count>4</comment_count>
    <who name="Evadeflow">evadeflow</who>
    <bug_when>2012-10-03 18:35:59 +0000</bug_when>
    <thetext>&gt; Okay, I think I found it:
&gt; 
&gt;   - http://mirrors.kernel.org/yocto/yocto/yocto-1.2/sources/

Or maybe this:

  - http://downloads.yoctoproject.org/mirror/sources/

(They look substantially the same, but I guess I&apos;ll go with the second one, and fall back to the first...)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26184</commentid>
    <comment_count>5</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2012-10-03 22:35:43 +0000</bug_when>
    <thetext>Are you using the poky distro since it should be using this http mirror by default, perhaps not for the initial fetch but certainly falling back to it if the upstreams don&apos;t work...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26185</commentid>
    <comment_count>6</comment_count>
    <who name="Evadeflow">evadeflow</who>
    <bug_when>2012-10-03 22:55:26 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; Are you using the poky distro since it should be using this http mirror by
&gt; default, perhaps not for the initial fetch but certainly falling back to it
&gt; if the upstreams don&apos;t work...

Confirmed. It *does* fall back to downloading from whatever the default
mirror(s) are configured to be, per the documentation. So it appears
that PREMIRRORS_prepend line can be omitted, provided http_proxy is set
suitably in the environment. I&apos;m in the process of determining if this
does, in fact, pull in everything needed to build core-image-sato...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26239</commentid>
    <comment_count>7</comment_count>
    <who name="Evadeflow">evadeflow</who>
    <bug_when>2012-10-04 15:02:50 +0000</bug_when>
    <thetext>Sorry for spamming the bug tracker a bit here, but I&apos;d like to report
some of the issues I&apos;ve been encountering while trying to download
sources from behind a firewall. This isn&apos;t working as smoothly as it
should on denzil. The problems I&apos;m having are the reason I suggested
adding a new &apos;create-mirror&apos; command, but maybe a better path is just to
fix the issues I&apos;m stubbing my toe on.

Issue #1
--------
If I put this in local.conf:

&gt; MACHINE = qemux86
&gt; CONNECTIVITY_CHECK_URIS=&quot;&quot;
&gt; BB_GENERATE_MIRROR_TARBALLS = &quot;1&quot; 
&gt; BB_FETCH_PREMIRRORONLY = &quot;1&quot;
&gt; SOURCE_MIRROR_URL ?= &quot;file:///home/evadeflow/projects/poky-mirror/&quot;
&gt; INHERIT += &quot;own-mirrors&quot;

and then run:

&gt; bitbake -DD -c fetchall universe

I get a whole slew of errors along the lines of:

&gt; ERROR: Function failed: Network access disabled through BB_NO_NETWORK
&gt; but access rquested with command /usr/bin/env wget  -t 2 -T 30 -nv
&gt; --passive-ftp --no-check-certificate -P &gt; /home/evadeflow/projects/poky-git/build/downloads
&gt; &apos;ftp://ftp.gnu.org/gnu/m4/m4-1.4.16.tar.gz&apos; (for url None)
&gt; ERROR: Logfile of failure stored in: /home/evadeflow/projects/poky-git/build/tmp/work/i686-linux/m4-native-1.4.16-r2/temp/log.do_fetch.30723

My expectation was that including the line that says:

&gt; BB_FETCH_PREMIRRORONLY = &quot;1&quot;

would tell bitbake to not even bother trying to download anything from
upstream sources, and just to use its hard-coded default mirrors.  This
does not work. I&apos;m guessing this is somehow expected behavior, but I
find it confusing. If I omit the BB_FETCH_PREMIRRORONLY line, it does
download a bunch of stuff, but fails differently (see Issue #2, which
I&apos;ll add in a bit).  It also wastes time trying to download from
locations I already know are going to fail:

&gt; WARNING: Failed to fetch URL ftp://ftp.gnu.org/gnu/m4/m4-1.4.16.tar.gz
&gt; WARNING: Failed to fetch URL ftp://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz
&gt; WARNING: Failed to fetch URL ftp://ftp.gnu.org/gnu/automake/automake-1.11.2.tar.bz2
&gt; WARNING: Failed to fetch URL ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.68.tar.bz2
&gt; WARNING: Failed to fetch URL ftp://ftp.gnu.org/gnu/tar/tar-1.26.tar.bz2
&gt; WARNING: Failed to fetch URL http://www.zlib.net/zlib-1.2.6.tar.bz2
&gt; WARNING: Failed to fetch URL http://zlib.net/pigz/pigz-2.2.4.tar.gz
&gt; WARNING: Failed to fetch URL https://fedorahosted.org/releases/e/l/elfutils/elfutils-0.148.tar.bz2
&gt; WARNING: Failed to fetch URL ftp://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz
&gt; WARNING: Failed to fetch URL ftp://ftp.gnu.org/gnu/readline/readline-6.2.tar.gz
&gt; WARNING: Failed to fetch URL ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
&gt; WARNING: Failed to fetch URL ftp://ftp.gnu.org/gnu/bison/bison-2.5.tar.gz
&gt; WARNING: Failed to fetch URL ftp://ftp.astron.com/pub/file/file-5.11.tar.gz
&gt; WARNING: Failed to fetch URL ftp://ftp.gnu.org/gnu/binutils/binutils-2.22.tar.bz2
&gt; WARNING: Failed to fetch URL ftp://ftp.gnu.org/gnu/gettext/gettext-0.18.1.1.tar.gz
&gt; WARNING: Failed to fetch URL ftp://ftp.gnu.org/gnu/gmp/gmp-5.0.4.tar.bz2
&gt; WARNING: Failed to fetch URL ftp://ftp.gnu.org/gnu/gperf/gperf-3.0.4.tar.gz
&gt; WARNING: Failed to fetch URL ftp://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz;name=tarball
&gt; (etc, etc.)

As a new user unfamiliar with bitbake, who just wants to ensure I&apos;ve
captured all the bits needed to build an image, all those warnings are
kind of unnerving. How am I supposed to know that I can ignore them?

I&apos;d really like some way of simply fetching all required sources, with
zero fanfare, that doesn&apos;t waste time trying to download from sources I
don&apos;t want it to, and doesn&apos;t output any confusing warnings. I think the
closest I can currently get is to put something like this in local.conf:

&gt; BB_FETCH_PREMIRRORONLY = &quot;1&quot;
&gt; PREMIRRORS_prepend = &quot;\
&gt;    git://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;    ftp://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;    http://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;    https://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;    svn://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n&quot;

(I haven&apos;t confirmed yet whether the above works, but I think it does.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26242</commentid>
    <comment_count>8</comment_count>
    <who name="Evadeflow">evadeflow</who>
    <bug_when>2012-10-04 15:15:46 +0000</bug_when>
    <thetext>Issue #2
--------
When I put this in my local.conf:

&gt; MACHINE = qemux86
&gt; CONNECTIVITY_CHECK_URIS=&quot;&quot;
&gt; BB_GENERATE_MIRROR_TARBALLS = &quot;1&quot; 
&gt; SOURCE_MIRROR_URL ?= &quot;file:///home/evadeflow/projects/poky-mirror/&quot;
&gt; INHERIT += &quot;own-mirrors&quot;

and tried to run:

&gt; bitbake -DD -c fetchall universe

everything looked to be progressing fine, but then I got into some kind
of infinite loop where the following error kept getting printed over and
over:

&gt; ERROR: Running idle function
&gt; Traceback (most recent call last):
&gt;   File &quot;/home/evadeflow/projects/poky-git/bitbake/lib/bb/cooker.py&quot;, line 1134, in buildTargetsIdle(server=&lt;ProcessServer(ProcessServer-1, started)&gt;, rq=&lt;bb.runqueue.RunQueue instance at 0xd66b06c&gt;, abort=False):
&gt;                  try:
&gt;     &gt;                retval = rq.execute_runqueue()
&gt;                  except runqueue.TaskFailure as exc:
&gt;   File &quot;/home/evadeflow/projects/poky-git/bitbake/lib/bb/runqueue.py&quot;, line 974, in RunQueue.execute_runqueue():
&gt;              if self.state is runQueueCleanUp:
&gt;     &gt;           self.rqexe.finish()
&gt; 
&gt;   File &quot;/home/evadeflow/projects/poky-git/bitbake/lib/bb/runqueue.py&quot;, line 1088, in RunQueueExecuteTasks.finish():
&gt;              for pipe in self.build_pipes:
&gt;     &gt;            self.build_pipes[pipe].read()
&gt; 
&gt;   File &quot;/home/evadeflow/projects/poky-git/bitbake/lib/bb/runqueue.py&quot;, line 1808, in runQueuePipe.read():
&gt;              while index != -1:
&gt;     &gt;            bb.event.fire_from_worker(self.queue[:index+8], self.d)
&gt;                  self.queue = self.queue[index+8:]
&gt;   File &quot;/home/evadeflow/projects/poky-git/bitbake/lib/bb/event.py&quot;, line 155, in fire_from_worker(event=&apos;&lt;event&gt;(ilogging\nLogRecord\np1\n(dp2\nS\&apos;taskpid\&apos;\np3\nI6425\nsS\&apos;threadName\&apos;\np4\nS\&apos;MainThread\&apos;\np5\nsS\&apos;name\&apos;\np6\nS\&apos;BitBake.Util\&apos;\np7\nsS\&apos;thread\&apos;\np8\nI-1215575264\nsS\&apos;created\&apos;\np9\nF1349360300.301301\nsS\&apos;process\&apos;\np10\nI6425\nsS\&apos;processName\&apos;\np11\nS\&apos;ProcessServer-1\&apos;\np12\nsS\&apos;args\&apos;\np13\n(tsS\&apos;module\&apos;\np14\nS\&apos;utils\&apos;\np15\nsS\&apos;filename\&apos;\np16\nS\&apos;utils.py\&apos;\np17\nsS\&apos;levelno\&apos;\np18\nI40\nsS\&apos;exc_text\&apos;\np19\nNsS\&apos;pathname\&apos;\np20\nS\&apos;/home/evadeflow/projects/poky-git/bitbake/lib/bb/utils.py\&apos;\np21\nsS\&apos;lineno\&apos;\np22\nI372\nsS\&apos;msg\&apos;\np23\nS\&apos;    data = &quot;&lt;event&gt;&quot; + pickle.dumps(event) + &quot;&lt;/event&gt;&apos;, d=&lt;bb.data_smart.DataSmart object at 0x8b5720c&gt;):
&gt;              return
&gt;     &gt;    event = pickle.loads(event[7:-8])
&gt;          fire_ui_handlers(event, d)
&gt; ValueError: insecure string pickle


I suspect this is a known bug in denzil (I vaguely remember seeing a
patch with the words &quot;infinite loop&quot; and &quot;premirrors&quot; in the subject)? I
mention it here because it is part of what&apos;s contributing to my current
&quot;Making a local pre-mirror and/or working behind a firewall is *really*
hard&quot; mindset.

For grins, I tried removing the &apos;-DD&apos; from the invocation and simply
running:

&gt; bitbake -c fetchall universe

This made no difference; I got the same infinite loop. Next I&apos;ll try
explicitly pre-pending the premirrors I want to use, since I think this
worked for me yesterday...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26247</commentid>
    <comment_count>9</comment_count>
    <who name="Evadeflow">evadeflow</who>
    <bug_when>2012-10-04 15:51:46 +0000</bug_when>
    <thetext>(In reply to comment #8)
&gt;                                                        Next I&apos;ll try
&gt; explicitly pre-pending the premirrors I want to use, since I think this
&gt; worked for me yesterday...

Confirmed. If my local.conf mods look like this:

&gt; MACHINE = qemux86
&gt; CONNECTIVITY_CHECK_URIS=&quot;&quot;
&gt; BB_GENERATE_MIRROR_TARBALLS = &quot;1&quot; 
&gt; BB_FETCH_PREMIRRORONLY = &quot;1&quot;
&gt; PREMIRRORS_prepend = &quot;\
&gt;    git://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;    ftp://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;    http://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;    https://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;    svn://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n&quot;
&gt; SOURCE_MIRROR_URL ?= &quot;file:///home/evadeflow/projects/poky-mirror/&quot;
&gt; INHERIT += &quot;own-mirrors&quot;

then I&apos;m able to successfully &apos;download the universe&apos; from behind my
firewall in about 25 minutes:

&gt; time bitbake -c fetchall universe
&gt; ...
&gt; NOTE: Tasks Summary: Attempted 2005 tasks of which 64 didn&apos;t need to be rerun and all succeeded.
&gt;
&gt; Summary: There were 12 WARNING messages shown.
&gt; bitbake -c fetchall universe 1537.14s user 337.40s system 124% cpu 25:00.71 total

This is great news, but I am (unfortunately) not done exploring the rough
edges of this process. More to come...

[Aside: Why am I fetching the universe? I originally didn&apos;t understand
that bitbake can and will fall back to http mirrors accessible from
behind my company&apos;s firewall---provided that http_proxy is set
appropriately in the environment. It seemed to happen to me several
times that running, e.g., &apos;bitbake -c fethcall core-image-sato&apos; while
offsite didn&apos;t pull in all required packages, so I got paranoid. But I&apos;m
starting to believe that might have been a red herring, or been due to
other causes.]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26250</commentid>
    <comment_count>10</comment_count>
    <who name="Evadeflow">evadeflow</who>
    <bug_when>2012-10-04 16:55:41 +0000</bug_when>
    <thetext>Issue #3
--------
This may be a known bug on denzil that has since been fixed, but when I set
MACHINE to qemuarm in local.conf like so:

&gt; MACHINE = &quot;qemuarm&quot;
&gt; CONNECTIVITY_CHECK_URIS=&quot;&quot;
&gt; BB_GENERATE_MIRROR_TARBALLS = &quot;1&quot; 
&gt; BB_FETCH_PREMIRRORONLY = &quot;1&quot;
&gt; PREMIRRORS_prepend = &quot;\
&gt;      git://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;      ftp://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;      http://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;      https://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;      svn://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n&quot;
&gt; SOURCE_MIRROR_URL ?= &quot;file:///home/evadeflow/projects/poky-mirror/&quot;
&gt; INHERIT += &quot;own-mirrors&quot;

and run:

&gt; bitbake -c fetchall universe

it chugs for awhile (building pseudo and its dependencies) and then I get the
following error:

&gt; OE Build Configuration:
&gt; BB_VERSION        = &quot;1.15.2&quot;
&gt; TARGET_ARCH       = &quot;arm&quot;
&gt; TARGET_OS         = &quot;linux-gnueabi&quot;
&gt; MACHINE           = &quot;qemuarm&quot;
&gt; DISTRO            = &quot;poky&quot;
&gt; DISTRO_VERSION    = &quot;1.2.1&quot;
&gt; TUNE_FEATURES     = &quot;armv5 dsp thumb arm926ejs&quot;
&gt; TARGET_FPU        = &quot;soft&quot;
&gt; meta              
&gt; meta-yocto        = &quot;denzil:f6b83ac65be48a31510cda0df423f53d0f477046&quot;
&gt; 
&gt; NOTE: Resolving any missing task queue dependencies
&gt; ERROR: Nothing PROVIDES &apos;syslinux&apos;
&gt; ERROR: syslinux was skipped: incompatible with host arm-poky-linux-gnueabi (not in COMPATIBLE_HOST)
&gt; ERROR: Required build target &apos;self-hosted-image&apos; has no buildable providers.
&gt; Missing or unbuildable dependency chain was: [&apos;self-hosted-image&apos;, &apos;syslinux&apos;]
&gt; 
&gt; Summary: There was 1 WARNING message shown.
&gt; Summary: There were 2 ERROR messages shown, returning a non-zero exit code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26257</commentid>
    <comment_count>11</comment_count>
    <who name="Evadeflow">evadeflow</who>
    <bug_when>2012-10-04 17:31:29 +0000</bug_when>
    <thetext>Issue #4
--------
With my local.conf mods set this way:

&gt; MACHINE = &quot;qemux86&quot;
&gt; CONNECTIVITY_CHECK_URIS=&quot;&quot;
&gt; BB_GENERATE_MIRROR_TARBALLS = &quot;1&quot; 
&gt; BB_FETCH_PREMIRRORONLY = &quot;1&quot;
&gt; PREMIRRORS_prepend = &quot;\
&gt;      git://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;      ftp://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;      http://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;      https://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;      svn://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n&quot;
&gt; SOURCE_MIRROR_URL ?= &quot;file:///home/evadeflow/projects/poky-mirror/&quot;
&gt; INHERIT += &quot;own-mirrors&quot;

I&apos;m able to successfully execute the command:

&gt; bitbake -c fetchall universe

However, it puts all the downloaded resources in build/downloads, when I
expected them to wind up in /home/evadeflow/project/poky-mirror.  This is
perhaps a bug in my expectations. I can certainly move or copy build/downloads
to wherever I want it and delete all the &quot;*.done&quot; files, but I can&apos;t imagine
I&apos;m the only bitbake user who has to do this. It would be nice if there were
some way to get the computer to do it for us.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26258</commentid>
    <comment_count>12</comment_count>
    <who name="Evadeflow">evadeflow</who>
    <bug_when>2012-10-04 17:32:02 +0000</bug_when>
    <thetext>Issue #5
--------
With my local.conf mods set this way:

&gt; MACHINE = &quot;qemux86&quot;
&gt; CONNECTIVITY_CHECK_URIS=&quot;&quot;
&gt; BB_GENERATE_MIRROR_TARBALLS = &quot;1&quot; 
&gt; BB_FETCH_PREMIRRORONLY = &quot;1&quot;
&gt; PREMIRRORS_prepend = &quot;\
&gt;      git://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;      ftp://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;      http://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;      https://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;      svn://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n&quot;
&gt; SOURCE_MIRROR_URL ?= &quot;file:///home/evadeflow/projects/poky-mirror/&quot;
&gt; INHERIT += &quot;own-mirrors&quot;

when I execute:

&gt; bitbake -c fetchall universe

the following packages are compiled:

&gt; NOTE: package quilt-native-0.51-r1: task do_compile: Started
&gt; NOTE: package gettext-minimal-native-0.18.1.1-r3: task do_compile: Started
&gt; NOTE: package gnu-config-native-20111111-r1: task do_compile: Started
&gt; NOTE: package m4-native-1.4.16-r2: task do_compile: Started
&gt; NOTE: package autoconf-native-2.68-r7: task do_compile: Started
&gt; NOTE: package automake-native-1.11.2-r3: task do_compile: Started
&gt; NOTE: package libtool-native-2.4.2-r3.0: task do_compile: Started
&gt; NOTE: package pkgconfig-native-0.25-r3: task do_compile: Started
&gt; NOTE: package sqlite3-native-3.7.10-r2: task do_compile: Started
&gt; NOTE: package tar-replacement-native-1.26-r1: task do_compile: Started
&gt; NOTE: package pseudo-native-1.3-r10: task do_compile: Started
&gt; NOTE: package ocf-linux-native-20100325-r3.0: task do_compile: Started
&gt; NOTE: package zlib-native-1.2.6-r1: task do_compile: Started
&gt; NOTE: package pigz-native-2.2.4-r2: task do_compile: Started
&gt; NOTE: package openssl-native-1.0.0i-r0.2: task do_compile: Started
&gt; NOTE: package expat-native-2.0.1-r1: task do_compile: Started
&gt; NOTE: package perl-native-5.14.2-r0: task do_compile: Started
&gt; NOTE: package curl-native-7.24.0-r2: task do_compile: Started
&gt; NOTE: package git-native-1.7.7-r2: task do_compile: Started

This is &apos;expected behavior&apos;, as far as I can tell, I&apos;m merely documenting
precisely what gets built on my machine to support the notion that it may be
worthwhile to pursue adding a &apos;create-mirror&apos; command that does not build
anything.

Honestly, this is less of a problem for me now that I understand that the
default HTTP premirror(s) can be used as a kind of &apos;back door&apos; to save my
builds from aborting when run from behind a firewall with missing
dependencies. The whole key for me has been realizing:

1. I need to export http_proxy=http://user:passwd@myproxy.com:8080

2. I have to add a PREMIRRORS_prepend line to explicitly steer bitbake
   to my desired fallback mirror(s)

(#2 may actually be required due to a bug that has been fixed on master[??])

The thing I&apos;m (still) worried about is what happens when I build using layers
that aren&apos;t part of Yocto proper, such as meta-ivi and meta-ti. I&apos;m assuming
these contain recipes pointing at sources that are not part of the Yocto HTTP
mirror.  If this is the case, I still find myself wishing for a way to quickly
download all the required dependencies. I suppose this could be sufficient:

&gt; bitbake -c fetchall some-image-name

I&apos;ll try to build core-image-sato for my Pandaboard ES this way, using
meta-ti, and see what happens...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26259</commentid>
    <comment_count>13</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2012-10-04 18:06:14 +0000</bug_when>
    <thetext>(In reply to comment #11)
&gt; Issue #4
&gt; --------
&gt; With my local.conf mods set this way:
&gt; 
&gt; &gt; MACHINE = &quot;qemux86&quot;
&gt; &gt; CONNECTIVITY_CHECK_URIS=&quot;&quot;
&gt; &gt; BB_GENERATE_MIRROR_TARBALLS = &quot;1&quot; 
&gt; &gt; BB_FETCH_PREMIRRORONLY = &quot;1&quot;
&gt; &gt; PREMIRRORS_prepend = &quot;\
&gt; &gt;      git://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt; &gt;      ftp://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt; &gt;      http://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt; &gt;      https://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt; &gt;      svn://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n&quot;
&gt; &gt; SOURCE_MIRROR_URL ?= &quot;file:///home/evadeflow/projects/poky-mirror/&quot;
&gt; &gt; INHERIT += &quot;own-mirrors&quot;
&gt; 
&gt; I&apos;m able to successfully execute the command:
&gt; 
&gt; &gt; bitbake -c fetchall universe
&gt; 
&gt; However, it puts all the downloaded resources in build/downloads, when I
&gt; expected them to wind up in /home/evadeflow/project/poky-mirror.  This is
&gt; perhaps a bug in my expectations. I can certainly move or copy
&gt; build/downloads
&gt; to wherever I want it and delete all the &quot;*.done&quot; files, but I can&apos;t imagine
&gt; I&apos;m the only bitbake user who has to do this. It would be nice if there were
&gt; some way to get the computer to do it for us.

Wow, you have a lot going on here.

I think there might be a miss-understanding of a couple of the above flags.

First the BB_GENERATE_MIRROR_TARBALLS is for git related fetchs only, since you are doing everything from the PREMIRROR and getting tarballs, this will not do much for you.  It will work when you are connected outside the fire wall and attempt to fetch directly from a git repo.

When you set SOURCE_MIRROR_URL and then inherit own-mirrors, you are essentially setting PREMIRRORS to be your file location, it might be better to set the DL_DIR = &quot;/home/evadeflow/project/poky-mirror&quot; and
SOURCE_MIRROR_URL = &quot;http://downloads.yoctoproject.org/mirror/sources/&quot;

That will cause all the tarballs to be loaded into poky-mirror directory, you can the re-use it via DL_DIR for multiple builds if you want.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26261</commentid>
    <comment_count>14</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2012-10-04 18:07:39 +0000</bug_when>
    <thetext>*** Bug 2287 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26263</commentid>
    <comment_count>15</comment_count>
    <who name="Evadeflow">evadeflow</who>
    <bug_when>2012-10-04 20:49:46 +0000</bug_when>
    <thetext>(In reply to comment #13)
&gt; ...
&gt; I think there might be a miss-understanding of a couple of the above flags.
&gt; 
&gt; First the BB_GENERATE_MIRROR_TARBALLS is for git related fetchs only...

Really? Wouldn&apos;t a better name be BB_GENERATE_GIT_TARBALLS (or
something), then? I&apos;m still very new to Yocto/bitbake, so I have no
expectations whatsoever about what it means to &quot;download from a mirror&quot;.
I assumed that the mirrors were simply clones of the required git repos
made available via http. Indeed, it appears that this is how it works
for svn repos. But now that I look carefully, I see that
http://downloads.yoctoproject.org/mirror/sources contains a bunch of
tarballs named:

&gt; git2_git.denx.de.u-boot.git.tar.gz.done
&gt; git2_git.eclipse.org.gitroot.tcf.org.eclipse.tcf.agent.git.tar.gz
&gt; git2_git.efficios.com.babeltrace.git.tar.gz.done
&gt; git2_git.fedorahosted.org.git.newt.tar.gz
&gt; git2_git.freescale.com.ppc.sdk.boot-format.git.tar.gz
&gt; git2_git.gnome.org.clutter-box2d.git.tar.gz
&gt; git2_git.gnome.org.clutter.tar.gz
&gt; git_gitorious.org.x-loader.x-loader.git_6f3a26101303051e0f91b6213735b68ce804e94e.tar.gz
&gt; git_moblin.org.repos.users.pippin.prototype.git._8f2cb524fe06555182c25b4ba3202d7b368ac0ce.tar.gz
&gt; git_people.freedesktop.org.~jimmac.Darkilouche.git_b4ce102a303d1176107a9d9d28c14f7da78feedd.tar.gz
&gt; git_sources.redhat.com.git.systemtap.git.tar.gz
&gt; (etc., etc)
[Idle curiosity: why do some mirror tarball names start with &apos;git2_&apos;,
and others start with &apos;git_&apos;? Maybe I&apos;m better off not knowing! `:-}]

It looks like the (git) content of these mirrors was generated using
BB_GENERATE_MIRROR_TARBALLS, so I think you&apos;re telling me that
BB_FETCH_PREMIRRORONLY and BB_GENERATE_MIRROR_TARBALLS are mutually
exclusive options? Thanks for pointing this out! Perhaps bitbake should
exit with an error if both of these options are enabled.

&gt; When you set SOURCE_MIRROR_URL and then inherit own-mirrors, you are
&gt; essentially setting PREMIRRORS to be your file location, it might be better
&gt; to set the DL_DIR = &quot;/home/evadeflow/project/poky-mirror&quot; and
&gt; SOURCE_MIRROR_URL = &quot;http://downloads.yoctoproject.org/mirror/sources/&quot;
&gt; 
&gt; That will cause all the tarballs to be loaded into poky-mirror directory,
&gt; you can the re-use it via DL_DIR for multiple builds if you want.

Okay, I totally misunderstood this, thanks for the heads-up. I was
thinking that I could get bitbake to both fetch from external premirrors
*and* create a local premirror for me in one go.  It seems this is not
possible---at least not the way I was trying to do it. I wish I could
find documentation somewhere that spelled this out in the simplest
possible terms. (Or, better yet, perhaps a &apos;create-mirror&apos; target that
would just do it for me, no config required. :-})

While I&apos;m thinking about it, what the heck *is* a &apos;premirror&apos;? Without
any context, it&apos;s kind of a meaningless term. Is it just &quot;a list of
mirrors checked prior to checking the &apos;real&apos; mirrors&quot;? This FAQ
question:

  - http://www.yoctoproject.org/docs/current/poky-ref-manual/poky-ref-manual.html#id1252014

would seem to indicate that (quite succinctly, I might add):

&gt; When the build system searches for source code, it first tries the
&gt; local download directory. If that location fails, Poky tries
&gt; PREMIRRORS, the upstream source, and then MIRRORS in that order. 

Okay, I&apos;m starting to get it. Thanks for your patience as I put it all
together. I hope that my out-loud fumbling here is helpful in figuring
out how to make bitbake more accessible to new users. If it&apos;s not,
please let me know and I&apos;ll move these musings to the mailing list.
(Or go back to mumbling quietly at my desk...)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26264</commentid>
    <comment_count>16</comment_count>
    <who name="Evadeflow">evadeflow</who>
    <bug_when>2012-10-04 21:08:40 +0000</bug_when>
    <thetext>(In reply to comment #12)
&gt; I&apos;ll try to build core-image-sato for my Pandaboard ES this way, using
&gt; meta-ti, and see what happens...

With local.conf set as follows:

&gt; MACHINE = &quot;pandaboard&quot;
&gt; BBMASK = &quot;meta-ti/recipes-misc&quot;
&gt; CONNECTIVITY_CHECK_URIS=&quot;&quot;
&gt; BB_FETCH_PREMIRRORONLY = &quot;1&quot;
&gt; PREMIRRORS_prepend = &quot;\
&gt;      git://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;      ftp://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;      http://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;      https://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
&gt;      svn://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n&quot;

When I run the cmd:

&gt; bitbake -c fetchall core-sato-image

I (not surprisingly) get a few errors:

&gt; ERROR: Function failed: Network access disabled through BB_NO_NETWORK but access rquested with command git clone --bare --mirror http://dev.omapzoom.org/pub/scm/integration/kernel-ubuntu.git /home/evadeflow/projects/poky-git/build/downloads/git2/dev.omapzoom.org.pub.scm.integration.kernel-ubuntu.git (for url None)
&gt; ERROR: Function failed: Network access disabled through BB_NO_NETWORK but access rquested with command git clone --bare --mirror git://www.denx.de/git/u-boot.git /home/evadeflow/projects/poky-git/build/downloads/git2/www.denx.de.git.u-boot.git (for url None)

I totally expected this, so this was a &apos;watch it fail&apos; kind of test.
One nit: with my new user&apos;s eyes, this error message is still a bit
confusing. BB_NO_NETWORK? *I* didn&apos;t set that variable. A more helpful
message would be:

&gt; ERROR: Function failed: BB_FETCH_PREMIRRORONLY set, but non-premirror access requested with command git clone --bare --mirror http://dev.omapzoom.org/pub/scm/integration/kernel-ubuntu.git /home/evadeflow/projects/poky-git/build/downloads/git2/dev.omapzoom.org.pub.scm.integration.kernel-ubuntu.git (for url None)

Anyway, if I comment out the line in local.conf that reads
BB_FETCH_PREMIRRORONLY=&quot;1&quot; and re-run the same command, everything
downloads fine, and it takes approximately 19 minutes. Then, when I go
to actually build the image with:

&gt; bitbake core-image-sato

it builds successfully in about two hours! This is awesome! If it does
turn out that Issue #2 is due to a bug that has been fixed in 1.3 (can
someone confirm this?), and it is therefore no longer necessary to
manually add the PREMIRRORS_prepend line, I think I&apos;m pretty happy with
the status quo. A &apos;create-mirror&apos; target/command might be a nice
addition, but it is by no means a necessity. It might be more effective
to just tighten up the error reporting and documentation.

It occurs to me that maybe the reason I was seeing that infinite loop in
Issue #2 is the &apos;weird&apos; combination of options I was using. I&apos;ll check
this and report back...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26268</commentid>
    <comment_count>17</comment_count>
    <who name="Evadeflow">evadeflow</who>
    <bug_when>2012-10-04 22:47:02 +0000</bug_when>
    <thetext>(In reply to comment #16)
&gt; It occurs to me that maybe the reason I was seeing that infinite loop in
&gt; Issue #2 is the &apos;weird&apos; combination of options I was using. I&apos;ll check
&gt; this and report back...

FWIW, my tests of this seem to indicate that the weird cocktail of
variables I was using are not the cause of the &apos;Issue #2&apos; behavior. I
stripped down my local.conf so that the only modification from the
default created by &apos;source oe-init-build-env&apos; was to add:

&gt; CONNECTIVITY_CHECK_URIS=&quot;&quot;

Then I ran:

&gt; bitbake -c fetchall universe

and it still repeatably exhibits the same infinite error loop
(&quot;ValueError: insecure string pickle&quot;). It seems the only way I can get
rid of this is to explicitly prepend to PREMIRRORS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26292</commentid>
    <comment_count>18</comment_count>
    <who name="Evadeflow">evadeflow</who>
    <bug_when>2012-10-05 15:08:54 +0000</bug_when>
    <thetext>(In reply to comment #8)
&gt; Issue #2
&gt; --------
&gt; ...
&gt; everything looked to be progressing fine, but then I got into some kind
&gt; of infinite loop...
&gt; ...
&gt; I suspect this is a known bug in denzil (I vaguely remember seeing a
&gt; patch with the words &quot;infinite loop&quot; and &quot;premirrors&quot; in the subject)?

CONFIRMED. This is due to bug #3073. If I manually apply this patch:

  - http://patchwork.openembedded.org/patch/36547/

in my sandbox, the problem goes away. I&apos;m able to execute:

&gt; bitbake -c fetchall universe

with no problems from behind my company&apos;s HTTP-only firewall, provided
my local.conf contains the line:

&gt; CONNECTIVITY_CHECK_URIS= &quot;&quot;

This fix has been back-ported to denzil on 9/28 (about a week ago), but
I didn&apos;t have it in my work tree because I haven&apos;t yet figured out a way
to work around our firewall&apos;s blocking of &apos;git://&apos; repo URIs...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26563</commentid>
    <comment_count>19</comment_count>
    <who name="Evadeflow">evadeflow</who>
    <bug_when>2012-10-12 21:52:19 +0000</bug_when>
    <thetext>(In reply to comment #16)
&gt; ERROR: Function failed: Network access disabled through BB_NO_NETWORK but access rquested with command git clone --bare --mirror http://dev.omapzoom.org/pub/scm/integration/kernel-ubuntu.git /home/evadeflow/projects/poky-git/build/downloads/git2/dev.omapzoom.org.pub.scm.integration.kernel-ubuntu.git (for url None)
&gt; ERROR: Function failed: Network access disabled through BB_NO_NETWORK but access rquested with command git clone --bare --mirror git://www.denx.de/git/u-boot.git /home/evadeflow/projects/poky-git/build/downloads/git2/www.denx.de.git.u-boot.git (for url None)
&gt; 
&gt; I totally expected this, so this was a &apos;watch it fail&apos; kind of test.
&gt; One nit: with my new user&apos;s eyes, this error message is still a bit
&gt; confusing. BB_NO_NETWORK? *I* didn&apos;t set that variable...

I tracked this down to the following code of the Fetch.download() method in bitbake/lib/bb/fetch2/__init.py__ (~line 1185):

&gt; if premirroronly:
&gt; 		self.d.setVar(&quot;BB_NO_NETWORK&quot;, &quot;1&quot;)

So: when BB_FETCH_PREMIRRORONLY is set, bitbake is setting BB_NO_NETWORK after it has failed to download from any premirror, solely for the side effect this has of causing m.download() to later raise a NetworkAccess exception. This seems slightly sneaky, but I don&apos;t yet know the code well enough to know whether this is a one-off hack for convenience, or an instance of a generally-accepted paradigm within the bitbake code base. (I hope it&apos;s the former.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34004</commentid>
    <comment_count>20</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2013-06-20 12:45:17 +0000</bug_when>
    <thetext>There were some problems with fetching everything which were fixed in master with 
http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=5af68d42ba62a2a18d1b0cdacad8e32c2b119255
and
http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=de1841d9c2a0ec1d7103335d450b5fbc2273804e

so the fetchall command now does really fetch everything a given build target needs.

I also improved the warning message mentioned in one of the comments with http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=801fbe5a0c1316ac54a3e8ea61c42a74e28bb0ed

I&apos;m therefore going to mark this bug as resolved. If there are remaining issues I think we need to split them out into specific bugs for specific issues.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37644</commentid>
    <comment_count>21</comment_count>
    <who name="Stoicescu Cornel">corneliux.stoicescu</who>
    <bug_when>2013-10-04 16:10:21 +0000</bug_when>
    <thetext>Tested like this:
1) bitbake -c fetchall core-image-sato
2) unplug ethernet cable
3) bitbake core-image-sato

The build finished successfully.

Marking as VERIFIED on:
poky master:a02280f99f05b1c21de2a78de9222a2f62a0dabc</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>