Transcript: from git checkout to qemu desktop

From Yocto Project
Revision as of 15:20, 2 April 2011 by Tzanussi (talk | contribs)
Jump to navigationJump to search

Here's a cut-and-paste shell session showing one way to do a start-from-scratch git checkout and build, the end result being a sato desktop in a qemu session (commands also shown for that).

One thing to not with this example, is that I'm checking out from poky/bernard, only because when I create this session, poky/master wasn't building for me. Normally, you'd want to use poky/master i.e. in the step below where it says 'git checkout -b bernard-cur poky/bernard' you'd want to do 'git checkout -b master-cur poky/master'. Sometimes it's easier to just use the last known stable version in cases where master is broken and you don't necessarily need master to get your work done.

trz@elmorro:/usr/local/src$ mkdir Yocto
trz@elmorro:/usr/local/src$ cd Yocto
trz@elmorro:/usr/local/src/Yocto$ git init
Initialized empty Git repository in /usr/local/src/Yocto/.git/
trz@elmorro:/usr/local/src/Yocto$ git remote add poky git://git.pokylinux.org/poky.git
trz@elmorro:/usr/local/src/Yocto$ git remote update
Fetching poky
remote: Counting objects: 93305, done.
remote: Compressing objects: 100% (28353/28353), done.
remote: Total 93305 (delta 63159), reused 91786 (delta 62057)
Receiving objects: 100% (93305/93305), 61.47 MiB | 506 KiB/s, done.
Resolving deltas: 100% (63159/63159), done.
From git://git.pokylinux.org/poky
 * [new branch]      bernard    -> poky/bernard
 * [new branch]      bernard-5.0.1 -> poky/bernard-5.0.1
 * [new branch]      blinky     -> poky/blinky
 * [new branch]      clyde      -> poky/clyde
 * [new branch]      elroy      -> poky/elroy
 * [new branch]      green      -> poky/green
 * [new branch]      laverne    -> poky/laverne
 * [new branch]      master     -> poky/master
 * [new branch]      pinky      -> poky/pinky
 * [new branch]      purple     -> poky/purple
 * [new tag]         bernard-5.0 -> bernard-5.0
 * [new tag]         pinky-3.1.2 -> pinky-3.1.2
From git://git.pokylinux.org/poky
 * [new tag]         bernard-1.0rc1 -> bernard-1.0rc1
 * [new tag]         bernard-5.0-alpha -> bernard-5.0-alpha
 * [new tag]         bernard-5.0rc1 -> bernard-5.0rc1
 * [new tag]         bernard-5.0rc2 -> bernard-5.0rc2
 * [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/src/Yocto$ git checkout -b bernard-cur poky/bernard
Branch bernard-cur set up to track remote branch bernard from poky.
Switched to a new branch 'bernard-cur'
trz@elmorro:/usr/local/src/Yocto$ ls
bitbake  documentation  LICENSE  meta  meta-demoapps  meta-rt  poky-init-build-env  README  README.hardware  scripts
trz@elmorro:/usr/local/src/Yocto$ source poky-init-build-env 
You had no conf/local.conf file. Poky has created this configuration file 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.

Also, for more information see the Poky Reference Manual:
    http://yoctoproject.org/community/documentation

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

For more information see the Poky Reference Manual:
    http://yoctoproject.org/community/documentation


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

You can now run 'bitbake <target>'

Common targets are:
    poky-image-minimal
    poky-image-sato
    meta-toolchain
    meta-toolchain-sdk

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

trz@elmorro:/usr/local/src/Yocto/build$ cd conf
trz@elmorro:/usr/local/src/Yocto/build/conf$ ls
bblayers.conf  local.conf

Rahul: For this build, just change only the following variables in local.conf, it make the build go faster depending on how many CPUs you have. I have 4, with HT, so I'm changing my values to 8:

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

Since this is your first build, the following doesn'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.

trz@elmorro:/usr/local/src/Yocto/build/conf$ cd /usr/local/src/Yocto
trz@elmorro:/usr/local/src/Yocto$ source poky-init-build-env 

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

You can now run 'bitbake <target>'

Common targets are:
    poky-image-minimal
    poky-image-sato
    meta-toolchain
    meta-toolchain-sdk

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

trz@elmorro:/usr/local/src/Yocto/build$ bitbake poky-image-sato
Pseudo is not present but is required, building this first before the main build
NOTE: Out of date cache found, rebuilding...
Parsing recipes: 100% |#################################################################################################| Time: 00:00:52
Parsing of 783 .bb files complete (0 cached, 783 parsed). 991 targets, 11 skipped, 0 masked, 0 errors.

OE Build Configuration:
BB_VERSION        = "1.11.0"
METADATA_BRANCH   = "bernard-cur"
METADATA_REVISION = "8b6416db1e04af83ecdf57522240ac859d5d8031"
TARGET_ARCH       = "i586"
TARGET_OS         = "linux"
MACHINE           = "qemux86"
DISTRO            = "poky"
DISTRO_VERSION    = "1.0"
TARGET_FPU        = ""

NOTE: Resolving any missing task queue dependencies
NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Running task 1 of 88 (ID: 21, /usr/local/src/Yocto/meta/recipes-devtools/quilt/quilt-native_0.48.bb, do_setscene)
NOTE: Running task 2 of 88 (ID: 61, virtual:native:/usr/local/src/Yocto/meta/recipes-devtools/gnu-config/gnu-config_20080123.bb, do_setscene)
NOTE: Running task 3 of 88 (ID: 77, /usr/local/src/Yocto/meta/recipes-devtools/m4/m4-native_1.4.15.bb, do_setscene)
NOTE: Running task 4 of 88 (ID: 37, virtual:native:/usr/local/src/Yocto/meta/recipes-devtools/autoconf/autoconf_2.65.bb, do_setscene)
NOTE: Running task 5 of 88 (ID: 45, virtual:native:/usr/local/src/Yocto/meta/recipes-devtools/automake/automake_1.11.1.bb, do_setscene)
NOTE: Running task 6 of 88 (ID: 53, /usr/local/src/Yocto/meta/recipes-devtools/libtool/libtool-native_2.4.bb, do_setscene)
NOTE: Running task 7 of 88 (ID: 85, virtual:native:/usr/local/src/Yocto/meta/recipes-devtools/tcltk/tcl_8.5.9.bb, do_setscene)
NOTE: Running task 8 of 88 (ID: 69, virtual:native:/usr/local/src/Yocto/meta/recipes-core/gettext/gettext_0.17.bb, do_setscene)
NOTE: package quilt-native-0.48-r0: task do_setscene: Started
NOTE: package quilt-native-0.48-r0: task do_setscene: Succeeded
NOTE: package m4-native-1.4.15-r0: task do_setscene: Started
NOTE: package m4-native-1.4.15-r0: task do_setscene: Succeeded
NOTE: Running task 9 of 88 (ID: 20, /usr/local/src/Yocto/meta/recipes-devtools/quilt/quilt-native_0.48.bb, do_fetch)
NOTE: Running task 10 of 88 (ID: 76, /usr/local/src/Yocto/meta/recipes-devtools/m4/m4-native_1.4.15.bb, do_fetch)
.
.
.
NOTE: Running task 4960 of 4961 (ID: 9, /usr/local/src/Yocto/meta/recipes-sato/images/poky-image-sato.bb, do_rootfs)
NOTE: package poky-image-sato-1.0-r0: task do_rootfs: Started
NOTE: package poky-image-sato-1.0-r0: task do_rootfs: Succeeded
NOTE: Running noexec task 4961 of 4961 (ID: 4, /usr/local/src/Yocto/meta/recipes-sato/images/poky-image-sato.bb, do_build)
NOTE: Tasks Summary: Attempted 4961 tasks of which 4959 didn't need to be rerun and 0 failed.
trz@elmorro:/usr/local/src/Yocto/build$ 

trz@elmorro:/usr/local/src/Yocto/build$ poky-qemu qemux86

Continuing with the following parameters:
KERNEL: [/usr/local/src/Yocto/build/tmp/deploy/images/bzImage-qemux86.bin]
ROOTFS: [/usr/local/src/Yocto/build/tmp/deploy/images/poky-image-sato-qemux86.ext3]
FSTYPE: [ext3]
Setting up tap interface under sudo
[sudo] password for trz: 
Acquiring lockfile for tap0...
Starting distccd...
Running qemu...
/usr/local/src/Yocto/build/tmp/sysroots/x86_64-linux/usr/bin/qemu -kernel /usr/local/src/Yocto/build/tmp/deploy/images/bzImage-qemux86.bin -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=no,downscript=no -hda /usr/local/src/Yocto/build/tmp/deploy/images/poky-image-sato-qemux86.ext3 -show-cursor -usb -usbdevice wacom-tablet -vga vmware -enable-gl -no-reboot --append "vga=0 root=/dev/hda mem=128M ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1 "
vmsvga_value_write: guest runs Linux.
Set 'tap0' nonpersistent
Releasing lockfile of preconfigured tap device 'tap0'
trz@elmorro:/usr/local/src/Yocto/build$