Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
software:linux:yocto:sdk [2020-05-19 12:13] – mlammerich | software:linux:yocto:sdk [2023-11-16 16:16] (aktuell) – Urs Graf | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | ====== SDK' | + | ====== SDK ====== |
- | ===== Build Natively | + | ===== Cross Development SDK ===== |
- | This is the simplest but also least useful | + | The most common |
- | By default, there is no toolchain installed | + | Yocto provides an SDK package that can be built for an image to match possible dependencies |
- | To add the toolchain | + | ==== Building |
+ | run this command | ||
< | < | ||
- | CORE_IMAGE_INSTALL_append | + | bitbake <image name> |
+ | # for example: | ||
+ | bitbake ost-image -c populate_sdk | ||
</ | </ | ||
- | Note that this will significantly increase | + | This will generate a toolchain with a sysroot containing all header/ |
+ | By default the SDK is in '' | ||
- | ===== Cross Development | + | === Changing the SDK HOST CPU Architecture |
- | run this command | + | By default, the SDK is built for '' |
+ | To build the SDK for a 64bit ARM host (e.g. ARM based Apple computers), add the following to '' | ||
+ | < | ||
+ | SDKMACHINE = " | ||
+ | </ | ||
+ | |||
+ | ==== Installing the SDK ==== | ||
+ | The sdk can be built as described above or can be fetched from [[software: | ||
+ | For example, building the SDK yields: | ||
< | < | ||
- | bitbake <image name> | + | poky-glibc-x86_64-ost-image-dev-armv7at2hf-neon-bblue-toolchain-3.0.2.host.manifest |
- | # for example: | + | poky-glibc-x86_64-ost-image-dev-armv7at2hf-neon-bblue-toolchain-3.0.2.sh |
- | bitbake ntb-prod-image -c pouplate_sdk | + | poky-glibc-x86_64-ost-image-dev-armv7at2hf-neon-bblue-toolchain-3.0.2.target.manifest |
+ | poky-glibc-x86_64-ost-image-dev-armv7at2hf-neon-bblue-toolchain-3.0.2.testdata.json | ||
</ | </ | ||
- | This will generate a toolchain | + | Note that the file names include information about the image and hardware it was built for. |
- | By default the SDK is in '' | + | |
+ | Installing the SDK is as simple as executing the shell script (e.g. '' | ||
+ | An example installation is shown below. | ||
+ | |||
+ | < | ||
+ | ./tmp/deploy/ | ||
+ | Poky (Yocto Project Reference Distro) SDK installer version 3.0.2 | ||
+ | ================================================================= | ||
+ | Enter target directory for SDK (default: / | ||
+ | You are about to install the SDK to "/ | ||
+ | Extracting SDK.......................................................................................done | ||
+ | Setting it up...done | ||
+ | SDK has been successfully set up and is ready to be used. | ||
+ | Each time you wish to use the SDK in a new shell session, you need to source | ||
+ | $ . / | ||
+ | |||
+ | </ | ||
+ | |||
+ | There are two things of note: | ||
+ | The script will ask for a location to install the SDK to in case you do not want to install it to its default | ||
+ | Also the last line of output will tell you what script needs to be sourced in order to use the SDK (see below). | ||
+ | |||
+ | ==== Using the SDK ==== | ||
+ | |||
+ | The SDK includes a script that needs to be sourced in order to use the SDK. | ||
+ | This, among other things, sets up the standard environment variables (such as '' | ||
+ | |||
+ | The script | ||
+ | |||
+ | For the example above, the command is: | ||
+ | |||
+ | < | ||
+ | . / | ||
+ | </ | ||
+ | |||
+ | Note the space between | ||
+ | The script needs to be sourced rather than executed. | ||
+ | Now running any standard | ||
+ | |||
+ | |||
+ | ==== Developing Kernel Modules ==== | ||
+ | |||
+ | When using [[meta-ost]], | ||
+ | However, properly compiling an out of tree module requires some additional steps: | ||
+ | |||
+ | < | ||
+ | . path/to/sdk/ | ||
+ | pushd path/to/sdk/sysroot/< | ||
+ | make scripts | ||
+ | make prepare | ||
+ | </ | ||
+ | |||
+ | Source: {{ https:// | ||
- | Buildig | + | Note that depending on the location of the installed |
+ | This has been observed when installing the SDK in '' | ||
+ | The easiest way to work around this is installing | ||
=== Additional Information === | === Additional Information === | ||
[[ https:// | [[ https:// |