Analysis of directory structure under yocto poky

Posted by chrisdarby on Thu, 30 Dec 2021 17:33:17 +0100


Yocto consists of many files, directories or subdirectories. Understanding the meaning and role of these files will help us quickly understand the yocto project

Core components in poky directory

Bitmake directory

byd@ubuntu:/media/C/Learn/poky/bitbake$  ls
AUTHORS    contrib  LICENSE               README
bin        doc      LICENSE.GPL-2.0-only  toaster-requirements.txt
ChangeLog  lib      LICENSE.MIT

Bitmake is an independent project. A copy of the bitmake project is placed in the poky / bitmake directory here. The bitmake command we are using is actually the bitmake here, not in your environment system.
Bitmake is used to read and parse the data in the meta directory and create corresponding tasks for processing. Other directories are basically used by bitmake to compile a project according to the corresponding rules.
When we use the source environment (source OE init build Env), the paths of the scripts and bitmake / bin directories will be added to the PATH environment variable:

build directory

At the beginning, the clean poky directory downloaded by git clone does not have this build directory. We started to create this directory in the process of source (refer to OE init build Env and poky / scripts / OE setup builddir)
The poky/build directory contains the user profile and the output generated by the OpenEmbedded build system in its standard configuration, in which the downloaded and decompressed source code and compiled output are in this directory.
The build directory may not be fixed in the poky directory, or the name may not be fixed, as long as the parameters are brought with the source:
. ./oe-init-build-env

meta directory

The meta directory contains the smallest and underlying OpenEmbedded core metadata, which stores the virtual targets that can be run, such as the recipes of qemux86 and qemaurm, the public class classes and the configuration of machine machines.

byd@ubuntu:/media/C/Learn/poky/meta$ ls
classes  files   recipes-connectivity  recipes-extended  recipes-kernel recipes-sato  site
conf  lib  recipes-core   recipes-gnome   recipes-multimedia  recipes-support
COPYING.MIT recipes-bsp recipes-devtools recipes-graphics recipes-rt          recipes.txt

Meta poky directory

This directory is used to add enough metadata to define poky reference distribution. It is an extension based on the meta directory. The conf directory in the build directory evolved from meta poky / conf, such as local The conf and bblayer templates are here

byd@ubuntu:/media/C/Learn/poky/meta-poky$ tree
.
├── classes
│   └── poky-sanity.bbclass
├── conf
│   ├── bblayers.conf.sample
│   ├── conf-notes.txt
│   ├── distro
│   │   ├── include
│   │   │   ├── poky-distro-alt-test-config.inc
│   │   │   ├── poky-floating-revisions.inc
│   │   │   └── poky-world-exclude.inc
│   │   ├── poky-altcfg.conf
│   │   ├── poky-bleeding.conf
│   │   ├── poky.conf
│   │   └── poky-tiny.conf
│   ├── layer.conf
│   ├── local.conf.sample
│   ├── local.conf.sample.extended
│   └── site.conf.sample
├── README.poky
└── recipes-core
    ├── busybox
    │   ├── busybox
    │   │   └── poky-tiny
    │   │       └── defconfig
    │   └── busybox_%.bbappend
    ├── psplash
    │   ├── files
    │   │   └── psplash-poky-img.h
    │   └── psplash_git.bbappend
    └── tiny-init
        ├── files
        │   ├── init
        │   └── rc.local.sample
        └── tiny-init.bb

12 directories, 22 files

Meta yocto BSP directory

In order to facilitate BSP developers to develop and add their own bsp layer, yocto official in this directory provides three current mainstream architecture hardware platform BSP templates for reference. For example, under this directory, there are beaglebone platform corresponding to arm architecture, edgerouter platform corresponding to mips, generic X86 platform corresponding to x86, and so on. Here you can see how to add corresponding kernel, bootLoader and other BSP configurations to these platforms.

byd@ubuntu:/media/C/Learn/poky/meta-yocto-bsp$ tree
.
├── conf
│   ├── layer.conf
│   └── machine
│       ├── beaglebone-yocto.conf
│       ├── edgerouter.conf
│       ├── genericx86-64.conf
│       ├── genericx86.conf
│       └── include
│           └── genericx86-common.inc
├── lib
│   └── oeqa
│       ├── controllers
│       │   ├── beaglebonetarget.py
│       │   ├── edgeroutertarget.py
│       │   ├── grubtarget.py
│       │   └── __init__.py
│       └── selftest
│           └── cases
│               └── systemd_boot.py
├── README.hardware
├── recipes-bsp
│   ├── formfactor
│   │   ├── formfactor
│   │   │   ├── beaglebone-yocto
│   │   │   │   └── machconfig
│   │   │   ├── genericx86
│   │   │   │   └── machconfig
│   │   │   └── genericx86-64
│   │   │       └── machconfig
│   │   └── formfactor_0.0.bbappend
│   └── gma500-gfx-check
│       ├── gma500-gfx-check
│       │   ├── gma500-gfx-check.conf
│       │   └── gma500-gfx-check.sh
│       └── gma500-gfx-check_1.0.bb
├── recipes-graphics
│   └── xorg-xserver
│       ├── xserver-xf86-config
│       │   ├── beaglebone-yocto
│       │   │   └── xorg.conf
│       │   ├── genericx86
│       │   │   └── xorg.conf
│       │   └── genericx86-64
│       │       └── xorg.conf
│       └── xserver-xf86-config_0.1.bbappend
├── recipes-kernel
│   └── linux
│       ├── linux-yocto_5.4.bbappend
│       ├── linux-yocto_5.8.bbappend
│       └── linux-yocto-dev.bbappend
└── wic
    ├── beaglebone-yocto.wks
    ├── edgerouter.wks
    └── genericx86.wks.in

25 directories, 29 files

Meta selftest directory

This directory stores the configuration of your own test code, which is basically not used

Meta skeleton directory

Skeleton means skeleton in English. This directory provides bsp and kernel related development templates. For example, there is an instance of Hello mod driver module, system layer service program and adding multiple user accounts.

byd@ubuntu:/media/C/Learn/poky$ tree meta-skeleton/
meta-skeleton/
├── conf
│   ├── layer.conf
│   ├── multilib-example2.conf
│   └── multilib-example.conf
├── recipes-baremetal
│   └── baremetal-examples
│       └── baremetal-helloworld_git.bb
├── recipes-core
│   └── busybox
│       ├── busybox
│       │   └── no_rfkill.cfg
│       └── busybox_%.bbappend
├── recipes-kernel
│   ├── hello-mod
│   │   ├── files
│   │   │   ├── COPYING
│   │   │   ├── hello.c
│   │   │   └── Makefile
│   │   └── hello-mod_0.1.bb
│   └── linux
│       ├── linux-yocto-custom
│       │   ├── 0001-linux-version-tweak.patch
│       │   ├── feature.scc
│       │   └── smp.cfg
│       └── linux-yocto-custom.bb
├── recipes-multilib
│   └── images
│       └── core-image-multilib-example.bb
└── recipes-skeleton
    ├── service
    │   ├── service
    │   │   ├── COPYRIGHT
    │   │   ├── skeleton
    │   │   └── skeleton_test.c
    │   └── service_0.1.bb
    └── useradd
        ├── useradd-example
        │   ├── file1
        │   ├── file2
        │   ├── file3
        │   └── file4
        └── useradd-example.bb

18 directories, 24 files

The following are some recipes in meta skeleton, which can be analyzed in detail according to the prompts

  • 1,recipes-baremetal
    This directory contains a demonstration of bare metal programs that do not run the system. If you are interested, you can see this:
    https://github.com/aehs29/baremetal-helloqemu/blob/master/hello_baremetal_arm.c
  • 2,recipes-kernel
    Teach us how to add patch and config configuration to the Linux kernel, and how to add driver module instances outside the source tree
  • 3,recipes-skeleton
    It teaches us how to add an application layer service, and also gives us a startup script
    It also demonstrates how to install the contents of the startup script in the bb file
  • 4,recipes-skeleton/useradd
    There is usually only one root user in the default / home directory. Here is where we can add users below

Topics: Linux yocto