oe-core, bitbake 를 이용한 recipe 개발

8457 단어 YoctoYocto
  • openembedded-core/meta/lib 에 각종 openembedded-core util이 있다.
    • 레시피에서 from oe.utils import Class,Method... 등을 가져오면 된다.

oe.utils

method                                argument
read_filedef read_file(filename)
ifelsedef read_file(filename)
conditionaldef conditional(variable, checkvalue, truevalue, falsevalue, d)
vartruedef vartrue(var, iftrue, iffalse, d)
less_or_equaldef less_or_equal(variable, checkvalue, truevalue, falsevalue, d)
version_less_or_equaldef version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d)
both_containdef both_contain(variable1, variable2, checkvalue, d)
set_intersectdef set_intersect(variable1, variable2, d)
prune_suffixdef prune_suffix(var, suffixes, d)
str_filterdef str_filter(f, str, d)
str_filter_outdef str_filter_out(f, str, d)
build_depends_stringdef build_depends_string(depends, task)
inheritsdef inherits(d, *classes)
featrues_backfilldef features_backfill(var,d)
all_distro_featuresdef all_distro_features(d, features, truevalue="1", falsevalue="")
any_distro_featuresdef any_distro_features(d, features, truevalue="1", falsevalue="")
parallel_makedef parallel_make(d, makeinst=False)
parallel_make_argumentdef parallel_make_argument(d, fmt, limit=None, makeinst=False)
getstatusoutputdef getstatusoutput(cmd):
trim_versiondef trim_version(version, num_parts=2)
cpu_countdef cpu_count(at_least=1)
execute_pre_post_processdef execute_pre_post_process(d, cmds)
multiprocess_launch
squashspace
format_pkg_list
get_host_compiler_version
host_gcc_version
get_multilib_datastore
class ThreadWorker
class ThreadPool
write_ld_so_conf
class ImageQAFailed
sh_quote

oe.data

method           argument
typed_valuedef typed_value(key, d)
export2jsondef export2json(d, json_file, expand=True, searchString="",replaceString="")

bb.utils

  • bitbake/lib 에 각종 bb util이 있다.
    • 레시피에서 from bb.utils import Class,Method... 등을 가져오면 된다.

bb.utils.lockfile

file_name = 'FILENAME'
lock = bb.utils.lockfile(file_name + '.lock')
with open(file_name, mode) as f:
    f.write(...)
bb.utils.unlockfile(lock)

bb.utils.contains('DISTRO_FEATURES', 'x11', 'true', 'false', d)


bb.data

bb.data.inherits_class('image',d))

  • 해당 레시피가 이미지 레시피인지 여부 확인
import bb
print( bb.data.inherits_class('image', d) )
# === 출력 === #
True

bb.plain

bb.plain("string")
  • Recipe 개발 시 print에 유용함
  • python Task, def PythonFunction 에서 print( ) 안됨
    • bb.plain( ) 사용할 것!

d

__inherit_cache

cmddescription
d.getVar('__inherit_cache',True)이 레시피가 inherit하는 bbclass

좋은 웹페이지 즐겨찾기