最終更新:2012-05-19 (土) 09:40:49 (4587d)  

BitBake
Top / BitBake

http://bitbake.berlios.de/manual/

BitBake is the build tool used by OpenEmbedded and was originally used by the OpenHandhelds.org and OpenZaurus communities.

概要

BitBake is, at its simplest, a tool for executing tasks and managing metadata. As such, its similarities to GNU make and other build tools are readily apparent. It was inspired by Portage, the package management system used by the Gentoo Linux distribution.

BitBake is the basis of the OpenEmbedded project, which is being used to build and maintain a number of embedded Linux distributions, including OpenZaurus and Familiar.

OpenEmbedded

BitBakeレシピの集合として維持、開発されており、Gentooebuildシステムに似ている。 BitBakeは、パッケージのソースのURL、依存関係、コンパイルオプション、インストールオプションをまとめたものとなっている。 ビルドする場合にはこれらの情報を使って、依存関係を解決し、パッケージクロスコンパイルし、パックし、ターゲットの機器にインストールできるようにする。 ルートファイルシステムとカーネルを含んだ完全なイメージを作成することもできる。 最初の段階として、フレームワークはターゲットプラットフォーム用のクロスコンパイラツールチェーンをビルドする。

コマンド

$ bitbake omap3-console-image
$ bitbake u-boot-omap3
$ bitbake x-load
$ bitbake virtual/xserver
$ bitbake virtual/kernel #Builds the appropriate kernel for your device.
$ bitbake linux-omap3-2.6.32 #2.6.32がビルドされる

タスク

$ bitbake omap3-console-image -c listtasks
NOTE: Handling BitBake files: | (7291/7291) [100 %]
Parsing of 7291 .bb files complete (6862 cached, 429 parsed). 7685 targets, 312 skipped, 2 masked, 0 errors.

Build Configuration:
BB_VERSION        = "1.10.2"
METADATA_BRANCH   = "overo"
METADATA_REVISION = "b4574a2"
TARGET_ARCH       = "arm"
TARGET_OS         = "linux-gnueabi"
MACHINE           = "overo"
DISTRO            = "angstrom"
DISTRO_VERSION    = "2010.7-test-20110314"
TARGET_FPU        = "hard"

NOTE: Resolving any missing task queue dependencies
NOTE: Preparing runqueue
NOTE: Executing runqueue
do_devshell
do_listtasks
do_package_update_index_ipk
do_compile
do_deploy_to
do_package_stage_all
do_recipe_sanity_all
do_rootfs
do_checkuri
do_clean
do_configure
do_cleanall
do_fetch
do_distclean
do_populate_sysroot
do_setscene
do_package
do_qa_staging
do_distribute_sources
do_unpack
do_install
do_distribute_sources_all
do_checkuriall
do_buildall
do_package_write
do_package_stage
do_recipe_sanity
do_patch
do_fetchall
do_build
do_package_write_ipk
do_qa_configure
do_distsrcall
NOTE: Running task 1 of 1 (ID: 0, ~/overo-oe/org.openembedded.dev/recipes/images/omap3-console-image.bb, do_listtasks)
NOTE: package omap3-console-image-1.0-r0: task do_listtasks: Started
NOTE: package omap3-console-image-1.0-r0: task do_listtasks: Succeeded
NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and 0 failed.

タスク2

$ bitbake linux-omap3-2.6.32 -c listtasks
NOTE: Handling BitBake files: | (7291/7291) [100 %]
Parsing of 7291 .bb files complete (6862 cached, 429 parsed). 7685 targets, 312 skipped, 2 masked, 0 errors.

Build Configuration:
BB_VERSION        = "1.10.2"
METADATA_BRANCH   = "overo"
METADATA_REVISION = "b4574a2"
TARGET_ARCH       = "arm"
TARGET_OS         = "linux-gnueabi"
MACHINE           = "overo"
DISTRO            = "angstrom"
DISTRO_VERSION    = "2010.7-test-20110316"
TARGET_FPU        = "hard"

NOTE: Resolving any missing task queue dependencies
NOTE: Preparing runqueue
NOTE: Executing runqueue
do_devshell
do_listtasks
do_package_update_index_ipk
do_compile
do_package_stage_all
do_deploy
do_recipe_sanity_all
do_checkuri
do_clean
do_configure
do_cleanall
do_fetch
do_distclean
do_populate_sysroot
do_devicetree_image
do_compile_kernelmodules
do_setscene
do_package
do_qa_staging
do_distribute_sources
do_unpack
do_install
do_distribute_sources_all
do_checkuriall
do_buildall
do_package_write
do_sizecheck
do_uboot_mkimage
do_package_stage
do_recipe_sanity
do_patch
do_fetchall
do_build
do_package_write_ipk
do_qa_configure
do_menuconfig
do_distsrcall
NOTE: Running task 1 of 1 (ID: 0, ~/overo-oe/org.openembedded.dev/recipes/linux/linux-omap3_2.6.32.bb, do_listtasks)
NOTE: package linux-omap3-2.6.32-r97: task do_listtasks: Started
NOTE: package linux-omap3-2.6.32-r97: task do_listtasks: Succeeded
NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and 0 failed.

ヘルプ

Usage: bitbake [options] [package ...]

Executes the specified task (default is 'build') for a given set of BitBake files.
It expects that BBFILES is defined, which is a space separated list of files to
be executed.  BBFILES does support wildcards.
Default BBFILES are the .bb files in the current directory.

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -b BUILDFILE, --buildfile=BUILDFILE
                        execute the task against this .bb file, rather than a
                        package from BBFILES.
  -k, --continue        continue as much as possible after an error. While the
                        target that failed, and those that depend on it,
                        cannot be remade, the other dependencies of these
                        targets can be processed all the same.
  -a, --tryaltconfigs   continue with builds by trying to use alternative
                        providers where possible.
  -f, --force           force run of specified cmd, regardless of stamp status
  -i, --interactive     drop into the interactive mode also called the BitBake
                        shell.
  -c CMD, --cmd=CMD     Specify task to execute. Note that this only executes
                        the specified task for the providee and the packages
                        it depends on, i.e. 'compile' does not implicitly call
                        stage for the dependencies (IOW: use only if you know
                        what you are doing). Depending on the base.bbclass a
                        listtasks tasks is defined and will show available
                        tasks
  -r FILE, --read=FILE  read the specified file before bitbake.conf
  -v, --verbose         output more chit-chat to the terminal
  -D, --debug           Increase the debug level. You can specify this more
                        than once.
  -n, --dry-run         don't execute, just go through the motions
  -p, --parse-only      quit after parsing the BB files (developers only)
  -d, --disable-psyco   disable using the psyco just-in-time compiler (not
                        recommended)
  -s, --show-versions   show current and preferred versions of all packages
  -e, --environment     show the global or per-package environment (this is
                        what used to be bbread)
  -g, --graphviz        emit the dependency trees of the specified packages in
                        the dot syntax
  -I EXTRA_ASSUME_PROVIDED, --ignore-deps=EXTRA_ASSUME_PROVIDED
                        Assume these dependencies don't exist and are already
                        provided (equivalent to ASSUME_PROVIDED). Useful to
                        make dependency graphs more appealing
  -l DEBUG_DOMAINS, --log-domains=DEBUG_DOMAINS
                        Show debug logging for the specified logging domains
  -P, --profile         profile the command and print a report
  -u UI, --ui=UI        userinterface to use
  --revisions-changed   Set the exit code depending on whether upstream
                        floating revisions have changed or not

クロスコンパイラ

$ bitbake meta-toolchain

http://www.openembedded.org/index.php/Cross_Compiler

パッチをあてる場合

$ bitbake -c clean omap3-console-image
$ bitbake -c compile omap3-console-image //ソースコードとかをフェッチしてくる
 -なんかパッチ当てる -  
$ bitbake -f -c complie omap3-console-image //-fをつけて強制再コンパイル
$ bitbake -f -c deploy omap3-console-image

高速化

  • Pythonを使ってるのでPsycoを入れると速くなる

レシピ

関連ハードウェア

関連

参考