Transcript: from git checkout to qemu desktop
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).
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]
One thing to note with this example is that I'm checking out from poky/edison.
trz@elmorro:/usr/local/dev$ mkdir Yocto trz@elmorro:/usr/local/dev$ cd Yocto/ 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: 134438, done. remote: Compressing objects: 100% (39702/39702), done. remote: Total 134438 (delta 93915), reused 131102 (delta 91225) Receiving objects: 100% (134438/134438), 75.48 MiB | 1.70 MiB/s, done. Resolving deltas: 100% (93915/93915), 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] 1.2_M3.rc1 -> 1.2_M3.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' trz@elmorro:/usr/local/dev/Yocto$ ls bitbake LICENSE meta-demoapps meta-yocto README scripts documentation meta meta-skeleton oe-init-build-env README.hardware 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' trz@elmorro:/usr/local/dev/Yocto/build$ cd conf trz@elmorro:/usr/local/dev/Yocto/build/conf$ ls bblayers.conf local.conf
Change only the following variables in local.conf, it makes 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/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. Continuing the session...
trz@elmorro:/usr/local/dev$ cd 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 = "qemux86" DISTRO = "poky" DISTRO_VERSION = "1.1.1" TUNE_FEATURES = "m32 i586" TARGET_FPU = "" meta meta-yocto = "edison-cur:939ec1ca1eb428f536e324cc61f1d8afe6e60775" NOTE: Resolving any missing task queue dependencies NOTE: Preparing runqueue NOTE: Executing SetScene Tasks NOTE: Executing RunQueue Tasks NOTE: Running task 4488 of 4490 (ID: 8, /usr/local/dev/Yocto/meta/recipes-sato/images/core-image-sato.bb, do_rootfs) NOTE: package core-image-sato-1.0-r0: task do_rootfs: Started NOTE: package core-image-sato-1.0-r0: task do_rootfs: Succeeded NOTE: Running noexec task 4490 of 4490 (ID: 5, /usr/local/dev/Yocto/meta/recipes-sato/images/core-image-sato.bb, do_build) NOTE: Tasks Summary: Attempted 4490 tasks of which 4488 didn't need to be rerun and 0 failed.
The build succeeded so you can now boot the kernel and rootfs into a graphical desktop:
trz@elmorro:/usr/local/dev/Yocto/build$ runqemu qemux86 Continuing with the following parameters: KERNEL: [/usr/local/dev/Yocto/build/tmp/deploy/images/bzImage-qemux86.bin] ROOTFS: [/usr/local/dev/Yocto/build/tmp/deploy/images/core-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/dev/Yocto/build/tmp/sysroots/x86_64-linux/usr/bin/qemu -kernel /usr/local/dev/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/dev/Yocto/build/tmp/deploy/images/core-image-sato-qemux86.ext3 -show-cursor -usb -usbdevice wacom-tablet -vga vmware -enable-gl -no-reboot -m 128 --append "vga=0 root=/dev/hda rw mem=128M ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1 " Enabling opengl vmsvga_value_write: guest runs Linux. Set 'tap0' nonpersistent Releasing lockfile of preconfigured tap device 'tap0'