Transcript: from git checkout to meta-intel BSP

From Yocto Project
Revision as of 18:42, 10 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/conf$ 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
Loading cache: 100% |######################################################################| ETA:  00:00:00
Loaded 1041 entries from dependency cache.

OE Build Configuration:
BB_VERSION        = "1.13.3"
TARGET_ARCH       = "i586"
TARGET_OS         = "linux"
MACHINE           = "fishriver"
DISTRO            = "poky"
DISTRO_VERSION    = "1.1"
TUNE_FEATURES     = "m32 core2"
TARGET_FPU        = ""
meta              
meta-yocto        = "edison-cur:69b307523c0ed69bb181f1d50dd959b68428e300"
meta-fishriver    = "fishriver:31eaee8e24d570207338ada64f2df36cdbd5353d"  

NOTE: Resolving any missing task queue dependencies
NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Running task 4048 of 4471 (ID: 8, /usr/local/dev/Yocto/meta/recipes-sato/images/core-image-sato.bb, do_rootfs)
NOTE: Running task 4461 of 4471 (ID: 86, /usr/local/dev/Yocto/meta/recipes-core/images/core-image-minimal-initramfs.bb,  do_rootfs)
NOTE: package core-image-sato-1.0-r0: task do_rootfs: Started
NOTE: package core-image-minimal-initramfs-1.0-r0: task do_rootfs: Started
NOTE: package core-image-sato-1.0-r0: task do_rootfs: Succeeded
NOTE: package core-image-minimal-initramfs-1.0-r0: task do_rootfs: Succeeded
NOTE: Running task 4470 of 4471 (ID: 9, /usr/local/dev/Yocto/meta/recipes-sato/images/core-image-sato.bb, do_bootimg)
NOTE: package core-image-sato-1.0-r0: task do_bootimg: Started
NOTE: package core-image-sato-1.0-r0: task do_bootimg: Succeeded
NOTE: Running noexec task 4471 of 4471 (ID: 5, /usr/local/dev/Yocto/meta/recipes-sato/images/core-image-sato.bb, do_build)
NOTE: Tasks Summary: Attempted 4471 tasks of which 4467 didn't need to be rerun and 0 failed. 

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

trz@elmorro:~$ cd /usr/local/dev/Yocto/build/tmp/deploy/images/
trz@elmorro:/usr/local/dev/Yocto/build/tmp/deploy/images$ ls -al
total 2409980
drwxr-xr-x 2 trz trz      4096 2012-03-09 22:51 .
drwxr-xr-x 5 trz trz      4096 2012-03-05 10:50 ..
-rw-r--r-- 1 trz trz   4070144 2012-03-05 10:50 bzImage- 3.0.18+git1+d386e09f316e03061c088d2b13a48605c20fb3a6_1+148c56415463fd34a3cc8c1953aa44a7eb935528-r3-fishriver-20120305152905.bin
lrwxrwxrwx 1 trz trz       135 2012-03-05 10:50 bzImage-fishriver.bin -> bzImage- 3.0.18+git1+d386e09f316e03061c088d2b13a48605c20fb3a6_1+148c56415463fd34a3cc8c1953aa44a7eb935528-r3-fishriver-20120305152905.bin
-rw-r--r-- 1 trz trz   6432703 2012-03-05 10:51 core-image-minimal-initramfs-fishriver-20120305152905.rootfs.cpio.gz
-rw-r--r-- 1 trz trz  21592064 2012-03-05 10:51 core-image-minimal-initramfs-fishriver-20120305152905.rootfs.ext3
-rw-r--r-- 1 trz trz   6432520 2012-03-09 22:50 core-image-minimal-initramfs-fishriver-20120310044535.rootfs.cpio.gz
-rw-r--r-- 1 trz trz  21592064 2012-03-09 22:50 core-image-minimal-initramfs-fishriver-20120310044535.rootfs.ext3
lrwxrwxrwx 1 trz trz        68 2012-03-09 22:50 core-image-minimal-initramfs-fishriver.cpio.gz -> core-image-minimal- initramfs-fishriver-20120310044535.rootfs.cpio.gz
lrwxrwxrwx 1 trz trz        65 2012-03-09 22:50 core-image-minimal-initramfs-fishriver.ext3 -> core-image-minimal-initramfs- fishriver-20120310044535.rootfs.ext3
-rw-r--r-- 1 trz trz 368368640 2012-03-05 11:01 core-image-sato-fishriver-20120305152905.hddimg
-rw-r--r-- 1 trz trz 368201728 2012-03-05 11:01 core-image-sato-fishriver-20120305152905.iso
-rw-r--r-- 1 trz trz  89748829 2012-03-05 11:01 core-image-sato-fishriver-20120305152905.rootfs.cpio.gz
-rw-r--r-- 1 trz trz 357305344 2012-03-05 11:00 core-image-sato-fishriver-20120305152905.rootfs.ext3
-rw-r--r-- 1 trz trz 368368640 2012-03-09 22:50 core-image-sato-fishriver-20120310044535.hddimg
-rw-r--r-- 1 trz trz 368201728 2012-03-09 22:51 core-image-sato-fishriver-20120310044535.iso
-rw-r--r-- 1 trz trz  89744277 2012-03-09 22:50 core-image-sato-fishriver-20120310044535.rootfs.cpio.gz
-rw-r--r-- 1 trz trz 357305344 2012-03-09 22:49 core-image-sato-fishriver-20120310044535.rootfs.ext3
lrwxrwxrwx 1 trz trz        55 2012-03-09 22:50 core-image-sato-fishriver.cpio.gz -> core-image-sato-fishriver-20120310044535.rootfs.cpio.gz
lrwxrwxrwx 1 trz trz        52 2012-03-09 22:49 core-image-sato-fishriver.ext3 -> core-image-sato-fishriver-20120310044535.rootfs.ext3
lrwxrwxrwx 1 trz trz        47 2012-03-09 22:51 core-image-sato-fishriver.hddimg -> core-image-sato-fishriver-20120310044535.hddimg
lrwxrwxrwx 1 trz trz        44 2012-03-09 22:51 core-image-sato-fishriver.iso -> core-image-sato-fishriver-20120310044535.iso
-rw-r--r-- 1 trz trz  41038587 2012-03-05 10:50 modules-3.0.10-yocto-standard+-r3-fishriver.tgz
-rw-r--r-- 1 trz trz       294 2012-03-09 22:50 README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt

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