Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
Nächste ÜberarbeitungBeide Seiten der Revision
software:linux:yocto:sdk [2020-10-21 15:30] Urs Grafsoftware:linux:yocto:sdk [2022-09-29 11:37] Urs Graf
Zeile 1: Zeile 1:
-====== SDK'====== +====== SDK ======
- +
-===== Build Natively ===== +
- +
-This is the simplest but also least useful way to build packages for yocto. +
-By default, there is no toolchain installed in the image. +
- +
-To add the toolchain to an image, append ''tools-sdk'' to ''CORE_IMAGE_INSTALL''+
- +
-<code> +
-CORE_IMAGE_INSTALL_append  = " tools-sdk" +
-</code> +
- +
-Note that this will significantly increase image size and build time.+
  
 ===== Cross Development SDK ===== ===== Cross Development SDK =====
Zeile 23: Zeile 10:
  
 <code> <code>
-bitbake <image name> -c poulate_sdk+bitbake <image name> -c populate_sdk
 # for example: # for example:
-bitbake ntb-prod-image -c pouplate_sdk+bitbake ost-image -c populate_sdk
 </code> </code>
  
Zeile 32: Zeile 19:
  
 ==== Installing the SDK ==== ==== Installing the SDK ====
-The sdk can be built as described above or can be fetched from [[software:linux:images:start|Linux Images]]. Building the SDK will generate a few files. The most important one being a ''.sh'' script that is used to isntall the SDK.+The sdk can be built as described above or can be fetched from [[software:linux:images:start|Linux Images]]. Building the SDK will generate a few files. The most important one being a ''.sh'' script that is used to install the SDK.
 For example, building the SDK yields: For example, building the SDK yields:
  
 <code> <code>
-poky-glibc-x86_64-ntb-dev-image-armv7at2hf-neon-bblue-toolchain-3.0.2.host.manifest +poky-glibc-x86_64-ost-image-dev-armv7at2hf-neon-bblue-toolchain-3.0.2.host.manifest 
-poky-glibc-x86_64-ntb-dev-image-armv7at2hf-neon-bblue-toolchain-3.0.2.sh +poky-glibc-x86_64-ost-image-dev-armv7at2hf-neon-bblue-toolchain-3.0.2.sh 
-poky-glibc-x86_64-ntb-dev-image-armv7at2hf-neon-bblue-toolchain-3.0.2.target.manifest +poky-glibc-x86_64-ost-image-dev-armv7at2hf-neon-bblue-toolchain-3.0.2.target.manifest 
-poky-glibc-x86_64-ntb-dev-image-armv7at2hf-neon-bblue-toolchain-3.0.2.testdata.json+poky-glibc-x86_64-ost-image-dev-armv7at2hf-neon-bblue-toolchain-3.0.2.testdata.json
 </code> </code>
  
Zeile 48: Zeile 35:
  
 <code> <code>
-./tmp/deploy/sdk/poky-glibc-x86_64-ntb-dev-image-armv7at2hf-neon-bblue-toolchain-3.0.2.sh+./tmp/deploy/sdk/poky-glibc-x86_64-ost-image-dev-armv7at2hf-neon-bblue-toolchain-3.0.2.sh
 Poky (Yocto Project Reference Distro) SDK installer version 3.0.2 Poky (Yocto Project Reference Distro) SDK installer version 3.0.2
 ================================================================= =================================================================
Zeile 81: Zeile 68:
 The script needs to be sourced rather than executed. The script needs to be sourced rather than executed.
 Now running any standard build system (eg ''make'') should pick up the cross compile settings and automatically build for the target platform. Now running any standard build system (eg ''make'') should pick up the cross compile settings and automatically build for the target platform.
 +
 +
 +==== Developing Kernel Modules ====
 +
 +When using [[meta-ost]], the SDK contains the kernel dev sources by default.
 +However, properly compiling an out of tree module requires some additional steps:
 +
 +<code>
 +. path/to/sdk/environment-setup-aarch64-linux-<arch>
 +pushd path/to/sdk/sysroot/<arch>/usr/kernel
 +make scripts
 +make prepare
 +</code>
 +
 +Source: {{ https://stackoverflow.com/questions/60923890/how-to-build-linux-kernel-module-using-yocto-sdk}}
 +
 +Note that depending on the location of the installed SDK, ''make scripts'' may encounter permission errors.
 +This has been observed when installing the SDK in ''/opt''.
 +The easiest way to work around this is installing the SDK in a location under the current user's home directory.
  
 === Additional Information === === Additional Information ===
  
 [[ https://www.youtube.com/watch?v=u1rzYRz83kc&t=3119s | Live Coding with Yocto Project #4: SDKs ]] [[ https://www.youtube.com/watch?v=u1rzYRz83kc&t=3119s | Live Coding with Yocto Project #4: SDKs ]]