Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
software:linux:yocto:getting_started_cpp [2022-10-04 08:50] – Urs Graf | software:linux:yocto:getting_started_cpp [2024-04-23 13:08] (aktuell) – Moritz Lammerich | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
======= Getting Started with Yocto and C/C++ ======= | ======= Getting Started with Yocto and C/C++ ======= | ||
- | This guide will go through setting up a build environment and building an x86_64 image, and adding a small "hello world" application to it. First the application will be compiled using the [[ .:sdk | SDK ]], then it will be added to the image directly by creating a [[ .:recipes | Recipe | + | This guide will go through setting up a build environment and building an x86_64 image, and adding a small "hello world" application to it. This page is a summary of the information from [[software:linux: |
===== Setting up the Build Environment ===== | ===== Setting up the Build Environment ===== | ||
Zeile 8: | Zeile 8: | ||
This guide will assume everything is in a directory called '' | This guide will assume everything is in a directory called '' | ||
- | Next, clone '' | + | Next, clone '' |
< | < | ||
- | git clone -b dunfell | + | git clone -b kirkstone |
</ | </ | ||
Zeile 18: | Zeile 18: | ||
</ | </ | ||
- | Now we can initialize | + | Now we can initialize yocto using: |
< | < | ||
. poky/ | . poky/ | ||
</ | </ | ||
- | This will populate the build directory with all necessary files and give you access to '' | + | This will populate the build directory with all necessary files and give you access to '' |
- | ==== Setting the machine | + | ==== Setting the Machine |
Setting the machine tells bitbake what hardware to build for. This build will be a 64bit qemu image, so we can set the machine to '' | Setting the machine tells bitbake what hardware to build for. This build will be a 64bit qemu image, so we can set the machine to '' | ||
Zeile 112: | Zeile 112: | ||
Create a '' | Create a '' | ||
Then execute '' | Then execute '' | ||
- | applucation | + | application |
Now there should be a '' | Now there should be a '' | ||
After confirming it works, change back to '' | After confirming it works, change back to '' | ||
Zeile 127: | Zeile 127: | ||
===== Creating a Recipe for the application ===== | ===== Creating a Recipe for the application ===== | ||
- | Bitbake povides a tool to create | + | We use [[software: |
- | To add a [[ .:recipes | recipe | + | |
< | < | ||
devtool add ../ | devtool add ../ | ||
Zeile 138: | Zeile 137: | ||
</ | </ | ||
- | This means devtool ran successfully and created a [[ .:recipes | recipe | + | This means devtool ran successfully and created a recipe at the specified |
- | To test whether this [[ .:recipes | recipe | + | To test whether this recipe works, build it by running bitbake: |
< | < | ||
Zeile 152: | Zeile 151: | ||
</ | </ | ||
- | This means the package provided by the [[ .:recipes | recipe | + | This means the package provided by the recipe was built successfully. |
===== Adding the Recipe to the Image ===== | ===== Adding the Recipe to the Image ===== |