Transcript: from git checkout to meta-intel BSP

From Yocto Project
Revision as of 14:56, 5 March 2012 by Tzanussi (talk | contribs)
Jump to navigationJump to search

To build and run a meta-intel BSP, you need to check out a local copy of the poky repo, along with a local copy of the meta-intel repo somewhere inside the poky checkout e.g. see below (the example below uses the 'fishriver' BSP as an example. For other meta-intel BSPs, you can use the instructions in the same way - just substitute the BSP name you actually want to build below e.g. for the jasperforest BSP, substitute 'jasperforest', 'meta-jasperforest', etc.

NOTE: this transcript was from a build done on a Ubuntu 10.04 system. Please see the 'Yocto Project Quickstart' for the packages required to be installed on the host system for building [1]

First do the basic checkout of the Yocto sources:

trz@elmorro:/usr/local/dev$ mkdir Yocto
trz@elmorro:/usr/local/dev$ cd Yocto/
trz@elmorro:/usr/local/dev/Yocto$ ls
trz@elmorro:/usr/local/dev/Yocto$ git init
Initialized empty Git repository in /usr/local/dev/Yocto/.git/
trz@elmorro:/usr/local/dev/Yocto$ git remote add yocto git://git.yoctoproject.org/poky.git
trz@elmorro:/usr/local/dev/Yocto$ git remote update
Fetching yocto
remote: Counting objects: 133191, done.
remote: Compressing objects: 100% (39275/39275), done.
remote: Total 133191 (delta 92863), reused 130090 (delta 90408)
Receiving objects: 100% (133191/133191), 75.25 MiB | 1004 KiB/s, done.
Resolving deltas: 100% (92863/92863), done.
From git://git.yoctoproject.org/poky
 * [new branch]      1.1_M1     -> yocto/1.1_M1
 * [new branch]      1.1_M2     -> yocto/1.1_M2
 * [new branch]      1.1_M3     -> yocto/1.1_M3
 * [new branch]      1.1_M4     -> yocto/1.1_M4
 * [new branch]      1.2_M1     -> yocto/1.2_M1
 * [new branch]      1.2_M2     -> yocto/1.2_M2
 * [new branch]      1.2_M3     -> yocto/1.2_M3
 * [new branch]      bernard    -> yocto/bernard
 * [new branch]      blinky     -> yocto/blinky
 * [new branch]      clyde      -> yocto/clyde
 * [new branch]      edison     -> yocto/edison
 * [new branch]      elroy      -> yocto/elroy
 * [new branch]      green      -> yocto/green
 * [new branch]      laverne    -> yocto/laverne
 * [new branch]      master     -> yocto/master
 * [new branch]      pinky      -> yocto/pinky
 * [new branch]      purple     -> yocto/purple
 * [new tag]         1.1_M1.final -> 1.1_M1.final
 * [new tag]         1.1_M2.final -> 1.1_M2.final
 * [new tag]         1.1_M2.rc3 -> 1.1_M2.rc3
 * [new tag]         1.1_M3.final -> 1.1_M3.final
 * [new tag]         1.1_M3.rc3 -> 1.1_M3.rc3
 * [new tag]         1.2_M1.final -> 1.2_M1.final
 * [new tag]         1.2_M1.rc2 -> 1.2_M1.rc2
 * [new tag]         1.2_M2.final -> 1.2_M2.final
 * [new tag]         1.2_M2.rc1 -> 1.2_M2.rc1
 * [new tag]         bernard-5.0.2+docs -> bernard-5.0.2+docs
 * [new tag]         pinky-3.1.2 -> pinky-3.1.2
From git://git.yoctoproject.org/poky
 * [new tag]         1.1_M1.rc1 -> 1.1_M1.rc1
 * [new tag]         1.1_M1.rc2 -> 1.1_M1.rc2
 * [new tag]         1.1_M2.rc1 -> 1.1_M2.rc1
 * [new tag]         1.1_M2.rc2 -> 1.1_M2.rc2
 * [new tag]         1.1_M3.rc2 -> 1.1_M3.rc2
 * [new tag]         1.1_M4.rc2+ -> 1.1_M4.rc2+
 * [new tag]         1.1_M4.rc3 -> 1.1_M4.rc3
 * [new tag]         1.1_M4.rc4 -> 1.1_M4.rc4
 * [new tag]         1.2_M1.rc1 -> 1.2_M1.rc1
 * [new tag]         bernard-1.0rc1 -> bernard-1.0rc1
 * [new tag]         bernard-5.0 -> bernard-5.0
 * [new tag]         bernard-5.0-alpha -> bernard-5.0-alpha
 * [new tag]         bernard-5.0.1 -> bernard-5.0.1
 * [new tag]         bernard-5.0.2 -> bernard-5.0.2
 * [new tag]         bernard-5.0rc1 -> bernard-5.0rc1
 * [new tag]         bernard-5.0rc2 -> bernard-5.0rc2
 * [new tag]         edison-6.0 -> edison-6.0
 * [new tag]         laverne-4.0 -> laverne-4.0
 * [new tag]         laverne-4.0.1 -> laverne-4.0.1
 * [new tag]         m4         -> m4
 * [new tag]         purple-3.2 -> purple-3.2
 * [new tag]         purple-3.2.1 -> purple-3.2.1
trz@elmorro:/usr/local/dev/Yocto$ git checkout -b edison-cur yocto/edison
Branch edison-cur set up to track remote branch edison from yocto.
Switched to a new branch 'edison-cur'

Now check out the meta-intel repo into the top-level Yocto repo dir:

trz@elmorro:/usr/local/dev/Yocto$ mkdir meta-intel
trz@elmorro:/usr/local/dev/Yocto$ cd meta-intel
trz@elmorro:/usr/local/dev/Yocto/meta-intel$ git init
Initialized empty Git repository in /usr/local/dev/Yocto/meta-intel/.git/
trz@elmorro:/usr/local/dev/Yocto/meta-intel$ git remote add meta-intel git://git.yoctoproject.org/meta-intel.git
trz@elmorro:/usr/local/dev/Yocto/meta-intel$ git remote update
Fetching meta-intel
remote: Counting objects: 3042, done.
remote: Compressing objects: 100% (2462/2462), done.
remote: Total 3042 (delta 1522), reused 194 (delta 105)
Receiving objects: 100% (3042/3042), 1.73 MiB | 531 KiB/s, done.
Resolving deltas: 100% (1522/1522), done.
From git://git.yoctoproject.org/meta-intel
 * [new branch]      1.1_M1     -> meta-intel/1.1_M1
 * [new branch]      1.1_M2     -> meta-intel/1.1_M2
 * [new branch]      1.1_M3     -> meta-intel/1.1_M3
 * [new branch]      1.1_M4     -> meta-intel/1.1_M4
 * [new branch]      1.2_M1     -> meta-intel/1.2_M1
 * [new branch]      1.2_M2     -> meta-intel/1.2_M2
 * [new branch]      1.2_M3     -> meta-intel/1.2_M3
 * [new branch]      bernard    -> meta-intel/bernard
 * [new branch]      edison     -> meta-intel/edison
 * [new branch]      laverne    -> meta-intel/laverne
 * [new branch]      master     -> meta-intel/master
 * [new tag]         1.1_M1.rc2 -> 1.1_M1.rc2
 * [new tag]         1.1_M2.final -> 1.1_M2.final
 * [new tag]         1.1_M2.rc3 -> 1.1_M2.rc3
 * [new tag]         1.1_M3.final -> 1.1_M3.final
 * [new tag]         1.1_M3.rc3 -> 1.1_M3.rc3
 * [new tag]         1.2_M1.final -> 1.2_M1.final
 * [new tag]         1.2_M1.rc2 -> 1.2_M1.rc2
From git://git.yoctoproject.org/meta-intel
 * [new tag]         1.1_M1.rc1 -> 1.1_M1.rc1
 * [new tag]         1.1_M2.rc1 -> 1.1_M2.rc1
 * [new tag]         1.1_M3.rc2 -> 1.1_M3.rc2
 * [new tag]         1.1_M4.rc2+ -> 1.1_M4.rc2+
 * [new tag]         1.1_M4.rc4 -> 1.1_M4.rc4
 * [new tag]         1.2_M2.final -> 1.2_M2.final
 * [new tag]         1.2_M2.rc1 -> 1.2_M2.rc1
 * [new tag]         bernard-1.0rc1 -> bernard-1.0rc1
 * [new tag]         bernard-5.0 -> bernard-5.0
 * [new tag]         bernard-5.0rc1 -> bernard-5.0rc1
 * [new tag]         bernard-5.0rc2 -> bernard-5.0rc2
 * [new tag]         edison-6.0 -> edison-6.0
trz@elmorro:/usr/local/dev/Yocto/meta-intel$ git checkout -b fishriver meta-intel/edison
Branch fishriver set up to track remote branch edison from meta-intel.
Switched to a new branch 'fishriver'
trz@elmorro:/usr/local/dev/Yocto/meta-intel$ cd ..
trz@elmorro:/usr/local/dev/Yocto$ source oe-init-build-env 
You had no conf/local.conf file. This configuration file has therefore been
created for you with some default values. You may wish to edit it to use a 
different MACHINE (target hardware) or enable parallel build options to take 
advantage of multiple cores for example. See the file for more information as 
common configuration options are commented.

The Yocto Project has extensive documentation about OE including a reference manual
which can be found at:
    http://yoctoproject.org/documentation

For more information about OpenEmbedded see their website:
    http://www.openembedded.org/

You had no conf/bblayers.conf file. The configuration file has been created for
you with some default values. To add additional metadata layers into your
configuration please add entries to this file.

The Yocto Project has extensive documentation about OE including a reference manual
which can be found at:
    http://yoctoproject.org/documentation

For more information about OpenEmbedded see their website:
    http://www.openembedded.org/



### Shell environment set up for builds. ###

You can now run 'bitbake <target>'

Common targets are:
    core-image-minimal
    core-image-sato
    meta-toolchain
    meta-toolchain-sdk
    adt-installer
    meta-ide-support

You can also run generated qemu images with a command like 'runqemu qemux86'


Before building, you need to add the meta-fishriver layer so the build recognizes it. So edit bblayers.conf:

trz@elmorro:/usr/local/dev/Yocto/build$ emacs -nw conf/bblayers.conf

And change:

BBLAYERS = " \                                                                                                       
  /usr/local/dev/Yocto/meta \                                                                                        
  /usr/local/dev/Yocto/meta-yocto \                                                                                  
  "

to:

BBLAYERS = " \                                                                                                       
  /usr/local/dev/Yocto/meta \                                                                                        
  /usr/local/dev/Yocto/meta-yocto \                                                                                  
  /usr/local/dev/Yocto/meta-intel/meta-fishriver \                                                                   
  "

You also need to make a few changes to your local.conf:

trz@elmorro:/usr/local/dev/Yocto/build$ emacs -nw conf/local.conf

Change:

MACHINE ??= "qemux86"

to

MACHINE ??= "fishriver"

To make the build go faster, depending on how many CPUs you have change the following variables. I have 4 cores, with HT, so I'm changing my values to 8:

trz@elmorro:/usr/local/dev/Yocto/build/conf$ emacs -nw local.conf
BB_NUMBER_THREADS = "8"
PARALLEL_MAKE = "-j 8"

Since this is your first build, it won't matter - it will take awhile regardless, but for later builds, to avoid re-downloading all the packages again, you can point the DL_DIR variable in local conf to the downloads dir of a previous build.

You're now ready to build your image, which make take several hours. Continuing the session...:

trz@elmorro:/usr/local/dev/Yocto/build$ cd /usr/local/dev/Yocto/
trz@elmorro:/usr/local/dev/Yocto$ source oe-init-build-env 
 
### Shell environment set up for builds. ###

You can now run 'bitbake <target>'

Common targets are:
    core-image-minimal
    core-image-sato
    meta-toolchain
    meta-toolchain-sdk
    adt-installer
    meta-ide-support

You can also run generated qemu images with a command like 'runqemu qemux86'

 
trz@elmorro:/usr/local/dev/Yocto/build$ bitbake core-image-sato
.
.
.
NOTE: Running noexec task 5894 of 5900 (ID: 1037, /usr/local/src/Yocto/meta/recipes-kernel/linux/linux-yocto_git.bb, do_package_write)
NOTE: package perl-5.12.2-r3: task do_package_write_ipk: Succeeded
NOTE: Running noexec task 5895 of 5900 (ID: 1104, /usr/local/src/Yocto/meta/recipes-devtools/perl/perl_5.12.2.bb, do_package_write)
NOTE: package eglibc-2.12-r13: task do_package_write_ipk: Succeeded
NOTE: Running noexec task 5896 of 5900 (ID: 233, /usr/local/src/Yocto/meta/recipes-core/eglibc/eglibc_2.12.bb, do_package_write)
NOTE: package poky-image-sato-1.0-r0: task do_rootfs: Succeeded
NOTE: package poky-image-sato-live-1.0-r0: task do_package_write_rpm: Succeeded
NOTE: Running noexec task 5897 of 5900 (ID: 10, /usr/local/src/Yocto/meta/recipes-sato/images/poky-image-sato-live.bb, do_package_write)
NOTE: package syslinux-4.03-r0: task do_package_write_rpm: Succeeded
NOTE: Running noexec task 5898 of 5900 (ID: 141, /usr/local/src/Yocto/meta/recipes-devtools/syslinux/syslinux_4.03.bb, do_package_write)
NOTE: package poky-image-minimal-initramfs-1.0-r0: task do_rootfs: Succeeded
NOTE: Running task 5899 of 5900 (ID: 9, /usr/local/src/Yocto/meta/recipes-sato/images/poky-image-sato-live.bb, do_bootimg)
NOTE: package poky-image-sato-live-1.0-r0: task do_bootimg: Started
NOTE: package poky-image-sato-live-1.0-r0: task do_bootimg: Succeeded
NOTE: Running noexec task 5900 of 5900 (ID: 4, /usr/local/src/Yocto/meta/recipes-sato/images/poky-image-sato-live.bb, do_build)
NOTE: Tasks Summary: Attempted 5900 tasks of which 544 didn't need to be rerun and 0 failed.

The build succeeded - look in build/tmp/deploy/images for the bootable image:

trz@elmorro:/usr/local/src/Yocto/build$ cd /usr/local/src/Yocto/build/tmp/deploy/images
trz@elmorro:/usr/local/src/Yocto/build/tmp/deploy/images$ ls -al
total 1960464
drwxr-xr-x   3 trz trz      4096 2011-04-05 00:03 .
drwxr-xr-x   5 trz trz      4096 2011-04-04 22:36 ..
-rw-r--r--   1 trz trz   3910368 2011-04-04 22:57 bzImage- 2.6.37+git1+51c761795b078bf3c80104ed6e73b3d995067384_1+86bd1278bbf11589d87639df17d2f5f42db97b60-r16-fishriver-20110405031037.bin
lrwxrwxrwx   1 trz trz       136 2011-04-04 22:57 bzImage-fishriver.bin -> bzImage-2.6.37+git1+51c761795b078bf3c80104ed6e73b3d995067384_1+86bd1278bbf11589d87639df17d2f5f42db97b60-r16-fishriver-20110405031037.bin
drwxr-xr-x 339 trz trz     12288 2011-04-04 22:36 licenses
-rw-r--r--   1 trz trz  33630384 2011-04-04 22:57 modules-2.6.37.6-yocto-standard+-r16-fishriver.tgz
-rwxr--r--   1 trz trz   4648687 2011-04-05 00:03 poky-image-minimal-initramfs-fishriver-20110405031037.rootfs.cpio.gz
-rw-r--r--   1 trz trz  67108864 2011-04-05 00:03 poky-image-minimal-initramfs-fishriver-20110405031037.rootfs.ext3
lrwxrwxrwx   1 trz trz        68 2011-04-05 00:03 poky-image-minimal-initramfs-fishriver.cpio.gz -> poky-image-minimal-initramfs-fishriver-20110405031037.rootfs.cpio.gz
lrwxrwxrwx   1 trz trz        65 2011-04-05 00:03 poky-image-minimal-initramfs-fishriver.ext3 -> poky-image-minimal-initramfs-fishriver-20110405031037.rootfs.ext3
-rwxr--r--   1 trz trz 161879951 2011-04-05 00:02 poky-image-sato-fishriver-20110405031037.rootfs.cpio.gz
-rw-r--r--   1 trz trz 572852224 2011-04-05 00:00 poky-image-sato-fishriver-20110405031037.rootfs.ext3
lrwxrwxrwx   1 trz trz        55 2011-04-05 00:02 poky-image-sato-fishriver.cpio.gz -> poky-image-sato-fishriver-20110405031037.rootfs.cpio.gz
lrwxrwxrwx   1 trz trz        52 2011-04-05 00:00 poky-image-sato-fishriver.ext3 -> poky-image-sato-fishriver-20110405031037.rootfs.ext3
-rw-r--r--   1 trz trz 581971968 2011-04-05 00:03 poky-image-sato-live-fishriver-20110405031037.hddimg
-rw-r--r--   1 trz trz 581804032 2011-04-05 00:03 poky-image-sato-live-fishriver-20110405031037.iso
lrwxrwxrwx   1 trz trz        52 2011-04-05 00:03 poky-image-sato-live-fishriver.hddimg -> poky-image-sato-live-fishriver-20110405031037.hddimg
lrwxrwxrwx   1 trz trz        49 2011-04-05 00:03 poky-image-sato-live-fishriver.iso -> poky-image-sato-live-fishriver-20110405031037.iso

Now dd the 'live' image to a USB drive (/dev/sdf for me, yours will be different):

trz@elmorro:/usr/local/src/Yocto/build/tmp/deploy/images$ sudo dd if=poky-image-sato-live-fishriver-20110405031037.hddimg of=/dev/sdf
[sudo] password for trz: 
1136664+0 records in
1136664+0 records out
581971968 bytes (582 MB) copied, 5.15645 s, 113 MB/s
trz@elmorro:/usr/local/src/Yocto/build/tmp/deploy/images$ sync
trz@elmorro:/usr/local/src/Yocto/build/tmp/deploy/images$ eject /dev/sdf

The image should now be on the USB drive and ready to boot, enjoy!

NOTE: if you have a problem with e.g. garbage characters, or other strange things, try doing this before you dd the image:

$ sudo dd if=/dev/zero of=/dev/sdf bs=1M count=1024