Difference between revisions of "Yocto Project my own quick start"

From KoanSoftware Wiki
Jump to: navigation, search
(Initializing the Build Environment)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This page is an excerpt from [http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html Yocto Project Quick Start Copyright © 2010-2013 Linux Foundation]
+
This page is an excerpt from [http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html Yocto Project Quick Start Copyright © 2010-2018 Linux Foundation]
  
  
Line 12: Line 12:
 
     $ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
 
     $ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
 
     build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
 
     build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
     xz-utils debianutils iputils-ping libsdl1.2-dev xterm
+
     xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \
 +
    pylint3 xterm
  
== Development Code - branch 2.4 'rocko' ==
+
== Development Code - branch 3.0 'zeus' ==
  
 
Yocto Project code can be found in the Yocto Project Source Repositories.
 
Yocto Project code can be found in the Yocto Project Source Repositories.
Line 20: Line 21:
  
 
  $ cd $HOME/yocto
 
  $ cd $HOME/yocto
  $ git clone git://git.yoctoproject.org/poky -b rocko
+
  $ git clone git://git.yoctoproject.org/poky -b zeus
  
  
 
  $ cd $HOME/yocto/poky
 
  $ cd $HOME/yocto/poky
  $ git clone git://git.openembedded.org/meta-openembedded -b rocko
+
  $ git clone git://git.openembedded.org/meta-openembedded -b zeus
  
 
  poky/
 
  poky/
 
  ├── bitbake
 
  ├── bitbake
 +
├── contrib
 
  ├── documentation
 
  ├── documentation
 
  ├── LICENSE
 
  ├── LICENSE
 +
├── LICENSE.GPL-2.0-only
 +
├── LICENSE.MIT
 
  ├── meta
 
  ├── meta
├── meta-openembedded
 
 
  ├── meta-poky
 
  ├── meta-poky
 
  ├── meta-selftest
 
  ├── meta-selftest
Line 38: Line 41:
 
  ├── oe-init-build-env
 
  ├── oe-init-build-env
 
  ├── README.hardware -> meta-yocto-bsp/README.hardware
 
  ├── README.hardware -> meta-yocto-bsp/README.hardware
  ├── README.LSB
+
  ├── README.OE-Core
 
  ├── README.poky -> meta-poky/README.poky
 
  ├── README.poky -> meta-poky/README.poky
 
  ├── README.qemu
 
  ├── README.qemu
Line 52: Line 55:
 
At this point, the '''build''' directory has been created for you and it is now your current working directory.  
 
At this point, the '''build''' directory has been created for you and it is now your current working directory.  
 
This is the default tree you should have to build.
 
This is the default tree you should have to build.
 
  
 
  poky/
 
  poky/
 
  ├── bitbake
 
  ├── bitbake
 
  ├── build          <----- run bitbake inside here
 
  ├── build          <----- run bitbake inside here
 +
├── contrib
 
  ├── documentation
 
  ├── documentation
 
  ├── LICENSE
 
  ├── LICENSE
 +
├── LICENSE.GPL-2.0-only
 +
├── LICENSE.MIT
 
  ├── meta
 
  ├── meta
├── meta-openembedded
 
 
  ├── meta-poky
 
  ├── meta-poky
 
  ├── meta-selftest
 
  ├── meta-selftest
Line 67: Line 71:
 
  ├── oe-init-build-env
 
  ├── oe-init-build-env
 
  ├── README.hardware -> meta-yocto-bsp/README.hardware
 
  ├── README.hardware -> meta-yocto-bsp/README.hardware
  ├── README.LSB
+
  ├── README.OE-Core
 
  ├── README.poky -> meta-poky/README.poky
 
  ├── README.poky -> meta-poky/README.poky
 
  ├── README.qemu
 
  ├── README.qemu
Line 94: Line 98:
 
and check the following variables:
 
and check the following variables:
  
  MACHINE ?= "qemux86"
+
  MACHINE ?= "qemuarm"
 
  DISTRO ?= "poky"
 
  DISTRO ?= "poky"
 
  PACKAGE_CLASSES ?= "package_ipk"
 
  PACKAGE_CLASSES ?= "package_ipk"
Line 114: Line 118:
 
The following command setup the emulation environment and launch QEMU.
 
The following command setup the emulation environment and launch QEMU.
  
  $ runqemu qemux86
+
  $ runqemu qemuarm
 +
 
 +
Or if you prefer, open a new shell terminal, setup the environment again and run
 +
 
 +
$ runqemu qemuarm nographic
  
 
== Building cross-compiler ==
 
== Building cross-compiler ==

Latest revision as of 16:18, 13 January 2020

This page is an excerpt from Yocto Project Quick Start Copyright © 2010-2018 Linux Foundation


The required packages

Packages and package installation vary depending on your development system. In general, you need to have root access and then install the required packages. The next few sections show you how to get set up with the right packages for Ubuntu.

If you have different distributions, please refer to the Yocto Project Quick Start

The packages you need for a supported Ubuntu distribution are shown in the following command:

    $ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
    build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
    xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \
    pylint3 xterm

Development Code - branch 3.0 'zeus'

Yocto Project code can be found in the Yocto Project Source Repositories. To check out current development code using git:

$ cd $HOME/yocto
$ git clone git://git.yoctoproject.org/poky -b zeus


$ cd $HOME/yocto/poky
$ git clone git://git.openembedded.org/meta-openembedded -b zeus
poky/
├── bitbake
├── contrib
├── documentation
├── LICENSE
├── LICENSE.GPL-2.0-only
├── LICENSE.MIT
├── meta
├── meta-poky
├── meta-selftest
├── meta-skeleton
├── meta-yocto-bsp
├── oe-init-build-env
├── README.hardware -> meta-yocto-bsp/README.hardware
├── README.OE-Core
├── README.poky -> meta-poky/README.poky
├── README.qemu
└── scripts

Initializing the Build Environment

From the parent directory your Source Directory, initialize your environment and provide a meaningful Build Directory name:

$ cd $HOME/yocto/poky
$ source oe-init-build-env

At this point, the build directory has been created for you and it is now your current working directory. This is the default tree you should have to build.

poky/
├── bitbake
├── build          <----- run bitbake inside here
├── contrib
├── documentation
├── LICENSE
├── LICENSE.GPL-2.0-only
├── LICENSE.MIT
├── meta
├── meta-poky
├── meta-selftest
├── meta-skeleton
├── meta-yocto-bsp
├── oe-init-build-env
├── README.hardware -> meta-yocto-bsp/README.hardware
├── README.OE-Core
├── README.poky -> meta-poky/README.poky
├── README.qemu
└── scripts

Edit the configuration files

Edit $HOME/yocto/poky/build/conf/bblayers.conf


# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
 /home/koan/yocto/poky/meta \
 /home/koan/yocto/poky/meta-poky \
 /home/koan/yocto/poky/meta-yocto-bsp \
 /home/koan/yocto/poky/meta-openembedded/meta-oe \
 "

Remember also to edit the file $HOME/yocto/poky/build/conf/local.conf and check the following variables:

MACHINE ?= "qemuarm"
DISTRO ?= "poky"
PACKAGE_CLASSES ?= "package_ipk"
INHERIT += "rm_work"

Building the Image

At this point, you need to select an image to build. If this is your first build using the Yocto Project, you should try the smallest and simplest image:

$ bitbake core-image-minimal  

Now you just wait for the build to finish.

Starting the QEMU Emulator

Before you start the QEMU emulator, be sure you have already to set up the emulation environment.

The following command setup the emulation environment and launch QEMU.

$ runqemu qemuarm

Or if you prefer, open a new shell terminal, setup the environment again and run

$ runqemu qemuarm nographic

Building cross-compiler

If you want you can create a re-distribuible cross-compiler targeted at your MACHINE.

$ bitbake meta-toolchain