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

From KoanSoftware Wiki
Jump to: navigation, search
(Edit the configuration files)
(Edit the configuration files)
 
(18 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]
  
  
== The Packages ==
+
== 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, Fedora, and openSUSE.
+
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.
Ubuntu
 
  
If your distribution is Ubuntu, you need to be running the bash shell. You can be sure you are running this shell by entering the following command and selecting "No" at the prompt:
+
If you have different distributions, please refer to the [https://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html Yocto Project Quick Start]
 
 
    $ sudo dpkg-reconfigure dash               
 
  
 
The packages you need for a supported Ubuntu distribution are shown in the following command:
 
The packages you need for a supported Ubuntu distribution are shown in the following command:
  
     $ sudo apt-get install sed wget cvs subversion git-core coreutils \
+
     $ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
    unzip texi2html texinfo libsdl1.2-dev docbook-utils gawk \
+
     build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
     python-pysqlite2 diffstat help2man make gcc build-essential \
+
     xz-utils debianutils iputils-ping libsdl1.2-dev xterm
     g++ desktop-file-utils chrpath libgl1-mesa-dev libglu1-mesa-dev \
 
    mercurial autoconf automake groff libtool xterm
 
 
 
 
 
The following list shows the required packages by function given a supported Ubuntu Linux distribution:
 
 
 
* Essentials: Packages needed to build an image on a headless system:
 
 
 
  $ sudo apt-get install gawk wget git-core diffstat unzip texinfo \
 
    build-essential chrpath
 
                           
 
 
 
* Graphical Extras: Packages recommended if the host system has graphics support:
 
  
  $ sudo apt-get install libsdl1.2-dev xterm
+
== Development Code - branch 2.4 'rocko' ==
                           
 
 
 
* Documentation: Packages needed if you are going to build out the Yocto Project documentation manuals:
 
 
 
  $ sudo apt-get install make xsltproc docbook-utils fop
 
                           
 
 
 
* ADT Installer Extras: Packages needed if you are going to be using the Application Development Toolkit (ADT) Installer:
 
 
 
  $ sudo apt-get install autoconf automake libtool libglib2.0-dev
 
 
 
 
 
== BitBake requires Python 2.7.3 or later ==
 
 
 
BitBake requires Python 2.7.3 or later <BR>
 
If you have Ubuntu older that 12.04 LTS you have to install Python 2.7.5 manually
 
 
 
sudo apt-get install libreadline5-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
 
 
wget http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tar.bz2
 
tar xjvf Python-2.7.5.tar.bz2
 
cd Python-2.7.5
 
 
./configure
 
make
 
sudo make install
 
 
python -V
 
 
 
 
 
== Development Code (branch jethro 2.0) ==
 
  
 
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 67: Line 20:
  
 
  $ cd $HOME/yocto
 
  $ cd $HOME/yocto
  $ git clone git://git.yoctoproject.org/poky -b jethro
+
  $ git clone git://git.yoctoproject.org/poky -b rocko
  
  
 
  $ cd $HOME/yocto/poky
 
  $ cd $HOME/yocto/poky
  $ git clone git://git.openembedded.org/meta-openembedded -b jethro
+
  $ git clone git://git.openembedded.org/meta-openembedded -b rocko
  
  .
+
  poky/
  └── poky
+
  ├── bitbake
    ├── bitbake
+
├── documentation
    ├── documentation
+
├── LICENSE
    ├── LICENSE
+
├── meta
    ├── meta
+
├── meta-openembedded
    ├── meta-hob
+
├── meta-poky
    ├── meta-skeleton
+
├── meta-selftest
    ├── meta-yocto
+
├── meta-skeleton
    ├── meta-yocto-bsp
+
├── meta-yocto-bsp
    ├── oe-init-build-env
+
├── oe-init-build-env
    ├── README
+
├── README.hardware -> meta-yocto-bsp/README.hardware
    ├── README.hardware
+
  ├── README.LSB
    └── scripts
+
  ├── README.poky -> meta-poky/README.poky
 
+
  ├── README.qemu
 
+
  └── scripts
Download the Freescale layers:
 
 
 
$ cd $HOME/yocto/poky
 
  $ git clone git://git.yoctoproject.org/meta-fsl-arm -b jethro
 
  $ git clone https://github.com/Freescale/meta-fsl-arm-extra.git -b jethro
 
 
 
Download the Qt5 layer (if necessary):
 
 
 
  $ cd $HOME/yocto/poky
 
  $ git clone https://github.com/meta-qt5/meta-qt5.git -b jethro
 
  
 
== Initializing the Build Environment ==
 
== Initializing the Build Environment ==
Line 105: Line 48:
  
 
  $ cd $HOME/yocto/poky
 
  $ cd $HOME/yocto/poky
  $ source ./oe-init-build-env
+
  $ source oe-init-build-env
  
 
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
 
    ├── bitbake
 
    ├── build      <----- run bitbake inside here
 
    ├── documentation
 
    ├── LICENSE
 
    ├── meta
 
    ├── meta-fsl-arm
 
    ├── meta-fsl-arm-extra
 
    ├── meta-hob
 
    ├── meta-skeleton
 
    ├── meta-yocto
 
    ├── meta-yocto-bsp
 
    ├── oe-init-build-env
 
    ├── README
 
    ├── README.hardware
 
    └── scripts
 
  
  
 +
poky/
 +
├── bitbake
 +
├── build          <----- run bitbake inside here
 +
├── documentation
 +
├── LICENSE
 +
├── meta
 +
├── meta-openembedded
 +
├── meta-poky
 +
├── meta-selftest
 +
├── meta-skeleton
 +
├── meta-yocto-bsp
 +
├── oe-init-build-env
 +
├── README.hardware -> meta-yocto-bsp/README.hardware
 +
├── README.LSB
 +
├── README.poky -> meta-poky/README.poky
 +
├── README.qemu
 +
└── scripts
  
 
== Edit the configuration files ==
 
== Edit the configuration files ==
Line 134: Line 76:
 
Edit $HOME/yocto/poky/build/conf/bblayers.conf
 
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 ?= " \
 
  BBLAYERS ?= " \
/home/tux/yocto/poky/meta \
+
  /home/koan/yocto/poky/meta \
/home/tux/yocto/poky/meta-yocto \
+
  /home/koan/yocto/poky/meta-poky \
/home/tux/yocto/poky/meta-yocto-bsp \
+
  /home/koan/yocto/poky/meta-yocto-bsp \
/home/tux/yocto/poky/meta-openembedded/meta-oe \
+
  /home/koan/yocto/poky/meta-openembedded/meta-oe \
/home/tux/yocto/poky/meta-fsl-arm \
+
  "
/home/tux/yocto/poky/meta-fsl-arm-extra \
 
"
 
  
or if use Qt5
+
Remember also to edit the file $HOME/yocto/poky/build/conf/local.conf
 +
and check the following variables:
  
  BBLAYERS ?= " \
+
  MACHINE ?= "qemuarm"
  /home/tux/yocto/poky/meta \
+
  DISTRO ?= "poky"
  /home/tux/yocto/poky/meta-yocto \
+
  PACKAGE_CLASSES ?= "package_ipk"
/home/tux/yocto/poky/meta-yocto-bsp \
+
  INHERIT += "rm_work"
/home/tux/yocto/poky/meta-openembedded/meta-oe \
 
/home/tux/yocto/poky/meta-fsl-arm \
 
/home/tux/yocto/poky/meta-fsl-arm-extra \
 
/home/tux/yocto/poky/meta-qt5 \
 
/home/tux/yocto/poky/meta-openembedded/meta-ruby \
 
/home/tux/yocto/poky/meta-openembedded/meta-multimedia \
 
  "
 
 
 
Remembed to edit also $HOME/yocto/poky/build/conf/local.conf
 
  
 
== Building the Image ==
 
== Building the Image ==
  
At this point, you need to select an image to build for the BeagleBoard. If this is your first build using the Yocto Project, you should try the smallest and simplest 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   
+
$ bitbake core-image-minimal   
  
 
Now you just wait for the build to finish.
 
Now you just wait for the build to finish.
 
  
 
== Starting the QEMU Emulator ==
 
== Starting the QEMU Emulator ==
Line 172: Line 112:
 
Before you start the QEMU emulator, be sure you have already to set up the emulation environment.  
 
Before you start the QEMU emulator, be sure you have already to set up the emulation environment.  
  
The following commands setup the emulation environment and launch QEMU. This example assumes the root filesystem (.ext3 file) and the pre-built kernel image file both reside in your home directory. The kernel and filesystem are for a 32-bit target architecture.
+
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 ==
  
    $ runqemu qemux86 tmp/deploy/images/bzImage-qemux86.bin tmp/deploy/images/core-image-minimal-qemux86.ext3
+
If you want you can create a re-distribuible cross-compiler targeted at your MACHINE.
  
The environment in which QEMU launches varies depending on the filesystem image and on the target architecture. For example, if you source the environment for the ARM target architecture and then boot the minimal QEMU image, the emulator comes up in a new shell in command-line mode. However, if you boot the SDK image, QEMU comes up with a GUI.
+
$ bitbake meta-toolchain

Latest revision as of 09:29, 29 April 2018

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 libsdl1.2-dev xterm

Development Code - branch 2.4 'rocko'

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 rocko


$ cd $HOME/yocto/poky
$ git clone git://git.openembedded.org/meta-openembedded -b rocko
poky/
├── bitbake
├── documentation
├── LICENSE
├── meta
├── meta-openembedded
├── meta-poky
├── meta-selftest
├── meta-skeleton
├── meta-yocto-bsp
├── oe-init-build-env
├── README.hardware -> meta-yocto-bsp/README.hardware
├── README.LSB
├── 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
├── documentation
├── LICENSE
├── meta
├── meta-openembedded
├── meta-poky
├── meta-selftest
├── meta-skeleton
├── meta-yocto-bsp
├── oe-init-build-env
├── README.hardware -> meta-yocto-bsp/README.hardware
├── README.LSB
├── 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