Show page source of GumstixBitbake #76351

= Bitbake
[[PageOutline(start=2, depth=2)]]

== BitBake User Manual
<http://bitbake.berlios.de/manual/>

== Bitbakeの動作
=== u-boot,x-load,linux kernelソースの取得について
{{{
http://www.angstrom-distribution.org/
}}}
からのファイル取得にトライする。

もしエラーが起これば、
{{{
git://www.sakoman.com/git
}}}
からのgit cloneをトライする。

== bitbakeが通らないとき
{{{
$ bitbake omap3-console-image
}}}
とか
{{{
$ bitbake virtual/kernel
}}}
がエラーになる時。

=== ファイルのダウンロードが出来ない
404 Not Found
接続タイムアウト
などでファイルのダウンロードが出来ない。

該当するファイルを検索して別の場所からダウンロードして sources ディレクトリに保存する。

=== コンパイルエラーが出る。
再度同じコマンドでbitbakeしてみると通ることが多い。

=== bitbake <package>しても最新のversionにならない
MLOやu-bootなどがbitbakeしても最新のversionにならない場合。cleanする。
{{{
$ bitbake -c clean <package>
}}}

=== 最新のリポジトリをpullしてみる
{{{
$ cd org.openembedded.dev
$ git pull
$ bitbake -c clean omap3-console-image; bitbake omap3-console-image
}}}

=== Connection timed outが出る
{{{
 www.sakoman.com[0: 216.18.22.128]: errno=Connection timed out
 fatal: unable to connect a socket (Connection timed out)
}}}
www.sakoman.comが落ちているかもしれないので、ブラウザで開いてみる。
落ちていたら時間を置いてアクセスする。

=== gitプロトコルが通るか確認する
ファイヤーウォールなどの関係でgitプロトコルが通らない場合がある。

例えば下記のようなエラーが生じた時。
{{{
 www.sakoman.com[0: 216.18.22.128]: errno=Connection timed out
 fatal: unable to connect a socket (Connection timed out)
 Cloning into /home/hoge/overo-oe/sources/git/www.sakoman.com.git.u-boot.git...
NOTE: package u-boot-2011.09+r76+gitr0f331e606c80166c1bfe5cac40dfc0616708f31b-r76: task Fetch failed: Unable to fetch URL git://www.sakoman.com/git/u-boot.git;branch=omap3-v2011.09;protocol=git from any source.: Failed
ERROR: Function 'Fetch failed: Unable to fetch URL git://www.sakoman.com/git/u-boot.git;branch=omap3-v2011.09;protocol=git from any source.' failed
}}}
直接git cloneしてみる。
{{{
$ git clone git://www.sakoman.com/git/u-boot.git;branch=omap3-v2011.09;protocol=git
}}}
git clone出来無い場合、自宅などネットワーク環境の違う場所で上記コマンドを実行してみる。
もしエラーがー起こらなければ、ネットワーク環境が原因の可能性が高い。
ネットワーク環境を改善するか、gitの通る環境でbitbakeする。

=== 他からソースファイルを持ってくる
例えばu-bootのソース取得でエラーが起こった場合。
{{{
 www.sakoman.com[0: 216.18.22.128]: errno=Connection timed out
 fatal: unable to connect a socket (Connection timed out)
 Cloning into /home/hoge/overo-oe/sources/git/www.sakoman.com.git.u-boot.git...
NOTE: package u-boot-2011.09+r76+gitr0f331e606c80166c1bfe5cac40dfc0616708f31b-r76: task Fetch failed: Unable to fetch URL git://www.sakoman.com/git/u-boot.git;branch=omap3-v2011.09;protocol=git from any source.: Failed
ERROR: Function 'Fetch failed: Unable to fetch URL git://www.sakoman.com/git/u-boot.git;branch=omap3-v2011.09;protocol=git from any source.' failed
}}}

状況としては、
{{{
package u-boot-2011.09+r76+gitr0f331e606c80166c1bfe5cac40dfc0616708f31b-r76
}}}
をgetしたいが、
{{{
git clone git://www.sakoman.com/git/u-boot.git;branch=omap3-v2011.09;protocol=git
}}}
がFetch failedになってしまうということです。

u-bootの場合は、overo-oe/sourcesディレクトリに下記3つのファイルが必要です。
{{{
git_www.sakoman.com.git.u-boot.git.tar.gz .gitディレクトリを固めたもの
git_www.sakoman.com.git.u-boot.git_0f331e606c80166c1bfe5cac40dfc0616708f31b.tar.gz
u-bootソース
git_www.sakoman.com.git.u-boot.git_0f331e606c80166c1bfe5cac40dfc0616708f31b.tar.gz.md5
MD5チェックサム
}}}
上記3つのファイルを他のマシンなどのビルドディレクトリから持ってきます。

commit id(0f331e6...)が同じならば多分使えます。

overo-oe/sourcesにcopyして再度bitbakeします。