After installing the toolchain, for some use cases you might need to separately extract a root filesystem:
You want to boot the image using NFS.
You want to use the root filesystem as the target sysroot. For example, the Eclipse IDE environment with the Eclipse Yocto Plug-in installed allows you to use QEMU to boot under NFS.
You want to develop your target application using the root filesystem as the target sysroot.
Follow these steps to extract the root filesystem:
Locate and Download the Tarball for the Pre-Built Root Filesystem Image File: You need to find and download the root filesystem image file that is appropriate for your target system. These files are kept in machine-specific folders in the Index of Releases in the "machines" directory.
The machine-specific folders of the "machines" directory
contain tarballs (*.tar.bz2
) for supported
machines.
These directories also contain flattened root filesystem
image files (*.ext4
), which you can use
with QEMU directly.
The pre-built root filesystem image files follow these naming conventions:
core-image-profile
-arch
.tar.bz2 Where:profile
is the filesystem image's profile: lsb, lsb-dev, lsb-sdk, minimal, minimal-dev, minimal-initramfs, sato, sato-dev, sato-sdk, sato-sdk-ptest. For information on these types of image profiles, see the "Images" chapter in the Yocto Project Reference Manual.arch
is a string representing the target architecture: beaglebone-yocto, beaglebone-yocto-lsb, edgerouter, edgerouter-lsb, genericx86, genericx86-64, genericx86-64-lsb, genericx86-lsb, mpc8315e-rdb, mpc8315e-rdb-lsb, and qemu*.
The root filesystems provided by the Yocto Project are based
off of the core-image-sato
and
core-image-minimal
images.
For example, if you plan on using a BeagleBone device
as your target hardware and your image is a
core-image-sato-sdk
image, you can download the following file:
core-image-sato-sdk-beaglebone-yocto.tar.bz2
Initialize the Cross-Development Environment:
You must source
the cross-development
environment setup script to establish necessary environment
variables.
This script is located in the top-level directory in
which you installed the toolchain (e.g.
poky_sdk
).
Following is an example based on the toolchain installed in the "Locating Pre-Built SDK Installers" section:
$ source ~/poky_sdk/environment-setup-core2-64-poky-linux
Extract the Root Filesystem:
Use the runqemu-extract-sdk
command
and provide the root filesystem image.
Following is an example command that extracts the root
filesystem from a previously built root filesystem image that
was downloaded from the
Index of Releases.
This command extracts the root filesystem into the
core2-64-sato
directory:
$ runqemu-extract-sdk ~/Downloads/core-image-sato-sdk-beaglebone-yocto.tar.bz2 ~/beaglebone-sato
You could now point to the target sysroot at
beablebone-sato
.