1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-31 12:49:46 +00:00

bitbake: user-manual-fetching: Editing pass over the manual chapter

(Bitbake rev: b0fc79e6405b7070a42cfda035e87edc832f8334)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2014-01-18 15:24:18 +00:00
parent 123b978c82
commit 1669f39e47
@@ -4,25 +4,25 @@
<chapter> <chapter>
<title>File download support</title> <title>File download support</title>
<section> <section id='file-download-overview'>
<title>Overview</title> <title>Overview</title>
<para> <para>
BitBake provides support to download files BitBake provides support to download files.
this procedure is called fetching and it handled by the This procedure is called fetching and is handled by the
fetch and fetch2 modules. fetch and fetch2 modules.
At this point the original fetch code is considered to At this point, the original fetch code is considered to
be replaced by fetch2 and this manual only related be replaced by fetch2 and this manual is only related
to the fetch2 codebase. to the fetch2 codebase.
</para> </para>
<para> <para>
The <filename>SRC_URI</filename> is normally used to The <filename>SRC_URI</filename> is normally used to
tell BitBake which files to fetch. tell BitBake which files to fetch.
The next sections will describe the available fetchers and The next sections describe the available fetchers and
their options. their options.
Each fetcher honors a set of variables and per Each fetcher honors a set of variables and per
URI parameters separated by a <quote>;</quote> consisting of a key and URI parameters separated by a “;” consisting of a key and
a value. a value.
The semantics of the variables and parameters are The semantics of the variables and parameters are
defined by the fetcher. defined by the fetcher.
@@ -31,16 +31,16 @@
</para> </para>
<para> <para>
The overall fetch process is that first, fetches are attempted from The overall fetch process first attempts to fetch from
<filename>PREMIRRORS</filename>. <filename>PREMIRRORS</filename>.
If those don't work, the original <filename>SRC_URI</filename> If these fail, the original <filename>SRC_URI</filename>
is attempted is attempted.
and if that fails, BitBake will fall back to If that fails, BitBake falls back to
<filename>MIRRORS</filename>. <filename>MIRRORS</filename>.
Cross urls are supported, so its possible to mirror Because cross-URLs are supported, it is possible to mirror
a git repository on an http server as a tarball for example. a Git repository on an HTTP server as a tarball.
Some example commonly used mirror Here are some examples that show commonly used mirror
definitions are: definitions:
<literallayout class='monospaced'> <literallayout class='monospaced'>
PREMIRRORS ?= "\ PREMIRRORS ?= "\
bzr://.*/.* http://somemirror.org/sources/ \n \ bzr://.*/.* http://somemirror.org/sources/ \n \
@@ -63,26 +63,33 @@ MIRRORS =+ "\
Non-local downloaded output is placed Non-local downloaded output is placed
into the directory specified by the into the directory specified by the
<filename>DL_DIR</filename> variable. <filename>DL_DIR</filename> variable.
For non local archive downloads the code can verify For non local archive downloads, the code can verify
sha256 and md5 checksums for the download to ensure sha256 and md5 checksums for the download to ensure
the file has been downloaded correctly. the file has been downloaded correctly.
These may be specified either in the form These can be specified in the following forms
<filename>SRC_URI[md5sum]</filename> for md5 and sha256 checksums, respectively:
for the md5 checksum and <literallayout class='monospaced'>
<filename>SRC_URI[sha256sum]</filename> SRC_URI[md5sum]
for the sha256 checksum or as parameters on the SRC_URI such as SRC_URI[sha256sum]
SRC_URI="http://example.com/foobar.tar.bz2;md5sum=4a8e0f237e961fd7785d19d07fdb994d". </literallayout>
You can also specify them as parameters on the
<filename>SRC_URI</filename>:
<literallayout class='monospaced'>
SRC_URI="http://example.com/foobar.tar.bz2;md5sum=4a8e0f237e961fd7785d19d07fdb994d"
</literallayout>
If <filename>BB_STRICT_CHECKSUM</filename> is set, any download If <filename>BB_STRICT_CHECKSUM</filename> is set, any download
without a checksum will trigger an error message. without a checksum will trigger an error message.
In cases where multiple files are listed in In cases where multiple files are listed in
SRC_URI, the name parameter is used <filename>SRC_URI</filename>, the name parameter is used
assign names to the urls and these are then specified assign names to the URLs and these are then specified
in the checksums in the form in the checksums using the following form:
SRC_URI[name.sha256sum]. <literallayout class='monospaced'>
SRC_URI[name.sha256sum]
</literallayout>
</para> </para>
</section> </section>
<section> <section id='local-file-fetcher'>
<title>Local file fetcher</title> <title>Local file fetcher</title>
<para> <para>
@@ -103,7 +110,7 @@ MIRRORS =+ "\
</para> </para>
</section> </section>
<section> <section id='cvs-fetcher'>
<title>CVS fetcher</title> <title>CVS fetcher</title>
<para> <para>
@@ -145,16 +152,16 @@ MIRRORS =+ "\
</para> </para>
</section> </section>
<section> <section id='http-ftp-fetcher'>
<title>HTTP/FTP fetcher</title> <title>HTTP/FTP fetcher</title>
<para> <para>
The URNs for the HTTP/FTP fetcher are http, https and ftp. The URNs for the HTTP/FTP fetcher are http, https, and ftp.
This fetcher honors the variables This fetcher honors the variables
<filename>FETCHCOMMAND_wget</filename>. <filename>FETCHCOMMAND_wget</filename>.
<filename>FETCHCOMMAND</filename> contains the command used <filename>FETCHCOMMAND</filename> contains the command used
for fetching. for fetching.
<quote>${URI}</quote> and <quote>${FILES}</quote> will be replaced by the URI and “${URI}” and “${FILES}” will be replaced by the URI and
basename of the file to be fetched. basename of the file to be fetched.
<literallayout class='monospaced'> <literallayout class='monospaced'>
SRC_URI = "http://oe.handhelds.org/not_there.aac" SRC_URI = "http://oe.handhelds.org/not_there.aac"
@@ -164,8 +171,9 @@ MIRRORS =+ "\
</para> </para>
</section> </section>
<section> <section id='svn-fetcher'>
<title>SVN fetcher</title> <title>SVN Fetcher</title>
<para> <para>
The URN for the SVN fetcher is svn. The URN for the SVN fetcher is svn.
</para> </para>
@@ -174,7 +182,7 @@ MIRRORS =+ "\
This fetcher honors the variables This fetcher honors the variables
<filename>FETCHCOMMAND_svn</filename>, <filename>FETCHCOMMAND_svn</filename>,
<filename>SVNDIR</filename>, <filename>SVNDIR</filename>,
<filename>SRCREV</filename>. and <filename>SRCREV</filename>.
<filename>FETCHCOMMAND</filename> contains the <filename>FETCHCOMMAND</filename> contains the
subversion command. subversion command.
<filename>SRCREV</filename> specifies which revision <filename>SRCREV</filename> specifies which revision
@@ -185,8 +193,8 @@ MIRRORS =+ "\
The supported parameters are proto, rev and scmdata. The supported parameters are proto, rev and scmdata.
proto is the Subversion protocol, rev is the proto is the Subversion protocol, rev is the
Subversion revision. Subversion revision.
If scmdata is set to <quote>keep</quote>, the <quote>.svn</quote> directories will If scmdata is set to “keep”, the “.svn” directories will
be available during compile-time. be available during compile-time.
<literallayout class='monospaced'> <literallayout class='monospaced'>
SRC_URI = "svn://svn.oe.handhelds.org/svn;module=vip;proto=http;rev=667" SRC_URI = "svn://svn.oe.handhelds.org/svn;module=vip;proto=http;rev=667"
SRC_URI = "svn://svn.oe.handhelds.org/svn/;module=opie;proto=svn+ssh;date=20060126" SRC_URI = "svn://svn.oe.handhelds.org/svn/;module=opie;proto=svn+ssh;date=20060126"
@@ -194,23 +202,24 @@ MIRRORS =+ "\
</para> </para>
</section> </section>
<section> <section id='git-fetcher'>
<title>GIT fetcher</title> <title>GIT Fetcher</title>
<para> <para>
The URN for the GIT Fetcher is git. The URN for the GIT Fetcher is git.
</para> </para>
<para> <para>
The variable <filename>GITDIR</filename> will be used as the The variable <filename>GITDIR</filename> will be used as the
base directory where the git tree is cloned to. base directory where the Git tree is cloned to.
</para> </para>
<para> <para>
The parameters are tag, protocol and scmdata. The parameters are tag, protocol, and scmdata.
tag is a Git tag, the default is <quote>master</quote>. The tag parameter is a Git tag, the default is “master”.
protocol is the Git protocol to use and defaults to <quote>git</quote> The protocol tag is the Git protocol to use and defaults to “git”
if a hostname is set, otherwise its <quote>file</quote>. if a hostname is set, otherwise it is “file”.
If scmdata is set to <quote>keep</quote>, the <quote>.git</quote> directory will be available If scmdata is set to “keep”, the “.git” directory will be available
during compile-time. during compile-time.
<literallayout class='monospaced'> <literallayout class='monospaced'>
SRC_URI = "git://git.oe.handhelds.org/git/vip.git;tag=version-1" SRC_URI = "git://git.oe.handhelds.org/git/vip.git;tag=version-1"