1.3. Extracting the Root Filesystem

After installing the toolchain, for some use cases you might need to separately extract a root filesystem:

Follow these steps to extract the root filesystem:

  1. 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 the Index of Releases in the "machines" directory.

    The "machines" directory contains tarballs (*.tar.bz2) for supported machines. The directory also contains 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, lsb-qt3, minimal, minimal-dev, sato,
                       sato-dev, sato-sdk, minimal-initramfs, or 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, edgerouter, genericx86, genericx86-64, mpc8315e-rdb,
                    qemuarm, qemuarm64, qemumips, qemumips64, qemuppc, qemux86, or
                    qemux86-64.
    
                    

    The root filesystems provided by the Yocto Project are based off of the core-image-sato and core-image-minimal images.

    For example, if your target hardware system is a BeagleBone board and your image is a core-image-minimal image, you need to download the following root filesystem image file:

         core-image-minimal-beaglebone.tar.bz2
                    

  2. 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 for the Core2 64-bit architecture:

         $ source ~/poky_sdk/environment-setup-core2-64-poky-linux
                    

  3. 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-core2-64.tar.bz2 ~/core2-64-sato
                    

    You could now point to the target sysroot at core2-64-sato.