目次: Yocto
Yocto Scarthgap(5.0.1)のメモです。前回同様、コードを読んで依存関係を調べるのは大変時間が掛かるので、簡易的な調査手法として全ファイルを消してエラーを観察し、エラーの原因となるファイルを復活させて次ステップに進める手段を用います。
引き続きBitbakeを実行してエラーを見て、足りないファイルを元に戻していく方法で各パーツや設定の動作を見ます。
$ bitbake core-image-sato ERROR: Unable to parse /home/katsuhiro/share/projects/oss/poky/bitbake/lib/bb/parse/parse_py/BBHandler.py Traceback (most recent call last): File "/home/katsuhiro/share/projects/oss/poky/bitbake/lib/bb/parse/parse_py/BBHandler.py", line 71, in inherit(files=['base'], fn='configuration INHERITs', lineno=0, d=<bb.data_smart.DataSmart object at 0x7f7a85863c50>, deferred=False): if not os.path.exists(file): > raise ParseError("Could not inherit file %s" % (file), fn, lineno) bb.parse.ParseError: ParseError in configuration INHERITs: Could not inherit file classes/base.bbclass
なにやらclassesディレクトリと*.bbclassファイルが出てきました。これはクラス(Classes - The Yoct Project)といってレシピ間で処理を共有するための仕組みです。ドキュメントによると3種類あるそうです。
Yoctoのクラス(*.bbclassファイル)は全部meta/classes-globalかと思ったらそうでもなく、一部のクラスはmeta/classesディレクトリに配置されています。
エラーメッセージはmeta/classes/base.bbclassがないと言っていますが、ファイルの実際の在処はmeta/classes-global/base.bbclassです。どういうことでしょう?Bitbakeのソースコードを見ると、
# bitbake/lib/bb/parse/parse_py/BBHandler.py
def inherit(files, fn, lineno, d, deferred=False):
__inherit_cache = d.getVar('__inherit_cache', False) or []
#if "${" in files and not deferred:
# bb.warn("%s:%s has non deferred conditional inherit" % (fn, lineno))
files = d.expand(files).split()
#★★files配列には'base'だけが入っている★★
for file in files:
classtype = d.getVar("__bbclasstype", False) #★★classtype = global★★
origfile = file
#★★classes-global/base.bbclassがなければ、classes/base.bbclassを探す★★
for t in ["classes-" + classtype, "classes"]:
file = origfile
#★★パスと拡張子を連結★★
if not os.path.isabs(file) and not file.endswith(".bbclass"):
file = os.path.join(t, '%s.bbclass' % file)
if not os.path.isabs(file):
bbpath = d.getVar("BBPATH")
abs_fn, attempts = bb.utils.which(bbpath, file, history=True)
for af in attempts:
if af != abs_fn:
bb.parse.mark_dependency(d, af)
if abs_fn:
file = abs_fn
if os.path.exists(file):
break
#★★どちらもないと最後に探したパス名でエラーメッセージを出してくる★★
if not os.path.exists(file):
raise ParseError("Could not inherit file %s" % (file), fn, lineno) #★★エラーメッセージを発生させる行★★
Bitbakeはclasses-globalとclassesの両方を探し、どちらにも目当てのクラスがない場合は最後に探したパス名でエラーメッセージを出力します。従ってエラーメッセージのパスは必ずmeta/classesになります。
今回登場したファイル、ディレクトリは、
こんなとこ。次回はディストリビューションを見ます。
< | 2024 | > | ||||
<< | < | 05 | > | >> | ||
日 | 月 | 火 | 水 | 木 | 金 | 土 |
- | - | - | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 | - |
合計:
本日: