Re: [yocto] How does bitbake work

2012-08-22 Thread Jeff Osier-Mixon
Hi Tim - this sounds quite correct to me, and a good way to represent
the process. Further, the elinux.org wiki page is coming along very
well, and I would encourage you to add this to the page. I'd be glad
to help with it if I can.


On Tue, Aug 21, 2012 at 11:23 AM, Tim Bird tim.b...@am.sony.com wrote:
 On 08/21/2012 01:11 AM, Liu wrote:
 Hi all,
  In order to learn to use poky,I am wondering how bitbake works with so 
 many
 recipes. When I bitbake target, I want to know how bitbake collect the
 providers of target . Then bitbake will prepare the runqueue tasks to build
 the target.So I need to know which tasks to assign to build the 
 target.And
 bitbake run these tasks in what order.In other words according to the
 characteristics of what to decided to implement which task first and then 
 next.
   I am very eager to know the answers.

 I'm not an expert, but here's some information that I believe is correct.
 (If someone else knows better, please correct this...)

 bitbake reads the entire set of recipe files that are specified by
 the local configuration, and parses them all into a global task namespace.
 This includes all the class files and include files as well.  These
 are specified by the BBFILES and BBLAYERS variables in the conf/bblayers.conf
 file.  Within the layers directories, the layer-dir/conf/layer.conf
 file is used to indicate the set of .bb files to parse for that layer.

 Note that this global parse of the entire set of recipe files is
 quite different from 'make', which usually operated on a single Makefile.
 (This is also why bitbake startup is a little slow).

 Information in the meta-data (the DEPENDS and PROVIDES lines) determine
 package ordering.  Where packages are independent of each other, the
 build order is dependent (I believe) on file parse order.  In this case,
 processing is not required to be in any particular order (and, in fact,
 can be parallelized). You can have bitbake produce the dependency graph
 of the packages for your build by using the -g option.  This produces output 
 in
 'dot' syntax (suitable for processing using some graphviz visualizer).

 The list of tasks to perform within a package appears to come
 from the common class meta-data
 (see meta/classes/utility-tasks.bbclass, for example) and the
 meta-data for the individual package  These are added by
 the 'addtask' keyword.  You can see a list of tasks for an
 individual package with: bitbake pkg -c listtasks

 I have started to put together an overview introduction of Yocto at:
 http://elinux.org/Yocto_Project_Introduction

 I haven't gotten much completed yet, but I do discuss bitbake there
 a bit.  Hopefully what I've got so far will be helpful.
  -- Tim

 P.S. someone correct me if I'm wrong.

   Thanks ,
 -- Yu Liu
   Following is the some output of bitbake busybox and in this example I 
 want
 to know why first do the task of (quilt-native_0.51.bb, do_fetch)  :
 Parsing recipes...done.
 Parsing of 830 .bb files complete (0 cached, 830 parsed). 1106 targets, 34
 skipped, 0 masked, 0 errors.
 OE Build Configuration:
 BB_VERSION= 1.15.2
 TARGET_ARCH   = arm
 TARGET_OS = linux-gnueabi
 MACHINE   = qemuarm
 DISTRO= poky
 DISTRO_VERSION= 1.2.1
 TUNE_FEATURES = armv5 dsp thumb arm926ejs
 TARGET_FPU= soft
 meta
 meta-yocto= unknown:unknown
 NOTE: Resolving any missing task queue dependencies
 NOTE: multiple providers are available for virtual/arm-none-linux-gnueabi-g++
 (external-csl-toolchain, gcc-cross)
 NOTE: consider defining a PREFERRED_PROVIDER entry to match
 virtual/arm-none-linux-gnueabi-g++
 NOTE: multiple providers are available for runtime linux-libc-headers-dev
 (linux-libc-headers, linux-libc-headers-yocto, 
 linux-libc-headers-yocto-nativesdk)
 NOTE: consider defining a PREFERRED_PROVIDER entry to match 
 linux-libc-headers-dev
 NOTE: Preparing runqueue
 NOTE: Executing SetScene Tasks
 NOTE: Executing RunQueue Tasks
 NOTE: Running task 1 of 706 (ID: 18,
 /home/ly/yocto/poky-denzil-7.0.1/meta/recipes-devtools/quilt/quilt-native_0.51.bb,
 do_fetch)
 NOTE: Running task 2 of 706 (ID: 228,
 virtual:native:/home/ly/yocto/poky-denzil-7.0.1/meta/recipes-devtools/gnu-config/gnu-config_2011.bb,
 do_fetch)
 NOTE: Running task 3 of 706 (ID: 189,
 virtual:native:/home/ly/yocto/poky-denzil-7.0.1/meta/recipes-devtools/autoconf/autoconf_2.68.bb,
 do_fetch)
 NOTE: Running task 4 of 706 (ID: 515,
 /home/ly/yocto/poky-denzil-7.0.1/meta/recipes-devtools/m4/m4-native_1.4.16.bb,
 do_fetch)
 NOTE: package gnu-config-native-2011-r1: task do_fetch: Started
 NOTE: package m4-native-1.4.16-r2: task do_fetch: Started
 NOTE: package quilt-native-0.51-r1: task do_fetch: Started
 NOTE: package autoconf-native-2.68-r7: task do_fetch: Started
 NOTE: package gnu-config-native-2011-r1: task do_fetch: Succeeded
 NOTE: Running task 5 of 706 (ID: 224,
 

Re: [yocto] How does bitbake work

2012-08-21 Thread Stewart, David C
I like the chapter Beth Flanagan wrote recently about the architecture of the 
Yocto Project. Check it out at the following link, and I think you might learn 
a lot.  I do suspect that what's happening for you is that certain native tools 
like quilt need to be built first so that other parts of the build will run. 
(Quilt is used to manage the patches that applied in the build process).

Dave

http://www.aosabook.org/en/yocto.html

From: yocto-boun...@yoctoproject.org [mailto:yocto-boun...@yoctoproject.org] On 
Behalf Of Liu
Sent: Tuesday, August 21, 2012 1:11 AM
To: yocto
Subject: [yocto] How does bitbake work

Hi all,
In order to learn to use poky,I am wondering how bitbake works with so many 
recipes. When I bitbake target, I want to know how bitbake collect the 
providers of target . Then bitbake will prepare the runqueue tasks to build 
the target.So I need to know which tasks to assign to build the target.And 
bitbake run these tasks in what order.In other words according to the 
characteristics of what to decided to implement which task first and then next.
 I am very eager to know the answers.
 Thanks ,
-- Yu Liu
 Following is the some output of bitbake busybox and in this example I want 
to know why first do the task of (quilt-native_0.51.bb, do_fetch)  :

Parsing recipes...done.
Parsing of 830 .bb files complete (0 cached, 830 parsed). 1106 targets, 34 
skipped, 0 masked, 0 errors.
OE Build Configuration:
BB_VERSION= 1.15.2
TARGET_ARCH   = arm
TARGET_OS = linux-gnueabi
MACHINE   = qemuarm
DISTRO= poky
DISTRO_VERSION= 1.2.1
TUNE_FEATURES = armv5 dsp thumb arm926ejs
TARGET_FPU= soft
meta
meta-yocto= unknown:unknown
NOTE: Resolving any missing task queue dependencies
NOTE: multiple providers are available for virtual/arm-none-linux-gnueabi-g++ 
(external-csl-toolchain, gcc-cross)
NOTE: consider defining a PREFERRED_PROVIDER entry to match 
virtual/arm-none-linux-gnueabi-g++
NOTE: multiple providers are available for runtime linux-libc-headers-dev 
(linux-libc-headers, linux-libc-headers-yocto, 
linux-libc-headers-yocto-nativesdk)
NOTE: consider defining a PREFERRED_PROVIDER entry to match 
linux-libc-headers-dev
NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Running task 1 of 706 (ID: 18, 
/home/ly/yocto/poky-denzil-7.0.1/meta/recipes-devtools/quilt/quilt-native_0.51.bb,
 do_fetch)
NOTE: Running task 2 of 706 (ID: 228, 
virtual:native:/home/ly/yocto/poky-denzil-7.0.1/meta/recipes-devtools/gnu-config/gnu-config_2011.bb,
 do_fetch)
NOTE: Running task 3 of 706 (ID: 189, 
virtual:native:/home/ly/yocto/poky-denzil-7.0.1/meta/recipes-devtools/autoconf/autoconf_2.68.bb,
 do_fetch)
NOTE: Running task 4 of 706 (ID: 515, 
/home/ly/yocto/poky-denzil-7.0.1/meta/recipes-devtools/m4/m4-native_1.4.16.bb, 
do_fetch)
NOTE: package gnu-config-native-2011-r1: task do_fetch: Started
NOTE: package m4-native-1.4.16-r2: task do_fetch: Started
NOTE: package quilt-native-0.51-r1: task do_fetch: Started
NOTE: package autoconf-native-2.68-r7: task do_fetch: Started
NOTE: package gnu-config-native-2011-r1: task do_fetch: Succeeded
NOTE: Running task 5 of 706 (ID: 224, 
virtual:native:/home/ly/yocto/poky-denzil-7.0.1/meta/recipes-devtools/gnu-config/gnu-config_2011.bb,
 do_unpack)
NOTE: package gnu-config-native-2011-r1: task do_unpack: Started
NOTE: package gnu-config-native-2011-r1: task do_unpack: Succeeded
NOTE: Running task 6 of 706 (ID: 202, 
virtual:native:/home/ly/yocto/poky-denzil-7.0.1/meta/recipes-devtools/automake/automake_1.11.2.bb,
 do_fetch)
NOTE: package automake-native-1.11.2-r3: task do_fetch: Started
NOTE: package m4-native-1.4.16-r2: task do_fetch: Succeeded
NOTE: Running task 7 of 706 (ID: 511, 
/home/ly/yocto/poky-denzil-7.0.1/meta/recipes-devtools/m4/m4-native_1.4.16.bb, 
do_unpack)
NOTE: package m4-native-1.4.16-r2: task do_unpack: Started
NOTE: package m4-native-1.4.16-r2: task do_unpack: Succeeded
NOTE: Running task 8 of 706 (ID: 215, 
/home/ly/yocto/poky-denzil-7.0.1/meta/recipes-devtools/libtool/libtool-native_2.4.2.bb,
 do_fetch)
NOTE: package autoconf-native-2.68-r7: task do_fetch: Succeeded
NOTE: Running task 9 of 706 (ID: 185, 
virtual:native:/home/ly/yocto/poky-denzil-7.0.1/meta/recipes-devtools/autoconf/autoconf_2.68.bb,
 do_unpack)
NOTE: package libtool-native-2.4.2-r2.0: task do_fetch: Started
NOTE: package autoconf-native-2.68-r7: task do_unpack: Started
NOTE: package autoconf-native-2.68-r7: task do_unpack: Succeeded
NOTE: Running task 10 of 706 (ID: 254, 
virtual:native:/home/ly/yocto/poky-denzil-7.0.1/meta/recipes-core/zlib/zlib_1.2.6.bb,
 do_fetch)
NOTE: package automake-native-1.11.2-r3: task do_fetch: Succeeded
NOTE: Running task 11 of 706 (ID: 198, 
virtual:native:/home/ly/yocto/poky-denzil-7.0.1/meta/recipes-devtools/automake/automake_1.11.2.bb,
 do_unpack)
NOTE: package zlib-native-1.2.6-r1: task do_fetch: Started
NOTE: package