TipsAndTricks/KernelDevelopmentWithEsdk: Difference between revisions

From Yocto Project
Jump to navigationJump to search
m (Bavery moved page TipsAndTricks/KernelDevelopment to TipsAndTricks/KernelDevelopmentWithEsdk: We want to emphasize the usage of the esdk in this workflow)
Line 3: Line 3:
This manual describes the Linux kernel development process with Yocto and devtool.
This manual describes the Linux kernel development process with Yocto and devtool.


== Setup your environment ==
== Setup your bitbake build environment ==
 
Open a new terminal window and navigat to your poky directory. We'll refer to this terminal as your 'bitbake terminal'.


The following command will configure the Yocto build environment
The following command will configure the Yocto build environment
Line 9: Line 11:
  source poky/oe-init-build-env kernel-dev
  source poky/oe-init-build-env kernel-dev


== Checkout the kernel source tree and construct .config ==
== Build Extensible SDK (bitbake terminal) ==
 
bitbake -c populate_sdk_ext core-image-minimal
 
== Install Extensible SDK (bitbake terminal) ==
 
The ESDK installer can be found in /path_to_build_directory/kernel-dev/tmp/deploy/sdk/
 
./tmp/deploy/sdk/poky-glibc-x86_64-core-image-minimal-corei7-64-toolchain-ext-2.3.sh
 
Follow the installer instructions and provide a target directory for your ESDK installation e.g /path_to_esdk/
 
== Checkout the kernel source tree and construct .config (bitbake terminal) ==


Check out the Linux kernel source and construct a .config from the Yocto kernel configuration segments. The sources can be found in /path_to_build_directory/kernel-dev/workspace/sources/linux-yocto.
Check out the Linux kernel source and construct a .config from the Yocto kernel configuration segments. The sources can be found in /path_to_build_directory/kernel-dev/workspace/sources/linux-yocto.
Line 15: Line 29:
  devtool modify linux-yocto  
  devtool modify linux-yocto  


== Modify your kernel and commit your changes ==
== Setup your ESDK build environment (ESDK terminal) ==
 
Open a new terminal and setup your build environment. Let's refer to this terminal as your 'ESDK terminal'
 
. /path_to_esdk/environment-setup-corei7-64-poky-linux
 
NOTE: If you see this message you will really need to open a new terminal :).
 
SDK environment now set up; additionally you may now run devtool to perform development tasks.
Run devtool --help for further details.
WARNING: attempting to use the extensible SDK in an environment set up to run bitbake - this may lead to unexpected results. Please source this script in a new shell session instead.
 


You can navigate to the Linux source directory (/path_to_build_directory/kernel-dev/workspace/sources/linux-yocto) and modify the kernel.
== Build your kernel (ESDK terminal) ==


== Build your kernel ==
Navigate to your workspace directory e.g /path_to_build_directory/kernel-dev/workspace/sources/linux-yocto
and build the kernel


Build the kernel in your workspace directory
make


devtool build linux-yocto
== Modify your kernel and commit your changes (ESDK terminal)==


== Build an image with your kernel changes ==
You can navigate to the Linux source directory (/path_to_build_directory/kernel-dev/workspace/sources/linux-yocto) and modify the kernel. Commit your kernel changes.
== Build an image with your kernel changes (optional) (bitbake terminal) ==


  devtool build-image core-image-minimal
  devtool build-image core-image-minimal


== Export patches and create a bbappend file ==
== Export patches and create a bbappend file (bitbake terminal) ==
To export your commits to patches and a bbappend file use the following command.  
To export your commits to patches and a bbappend file use the following command.  


Line 36: Line 64:
The patches and the bbappend can be found in /path_to_poky_directory/meta-yocto-bsp/recipes-kernel/linux.
The patches and the bbappend can be found in /path_to_poky_directory/meta-yocto-bsp/recipes-kernel/linux.


== Build image ==
== Build image with your modified kernel (bitbake terminal) ==


You can now build an image which will include your kernel patches.
You can now build an image which will include your kernel patches.

Revision as of 23:39, 22 June 2017

Overview

This manual describes the Linux kernel development process with Yocto and devtool.

Setup your bitbake build environment

Open a new terminal window and navigat to your poky directory. We'll refer to this terminal as your 'bitbake terminal'.

The following command will configure the Yocto build environment

source poky/oe-init-build-env kernel-dev

Build Extensible SDK (bitbake terminal)

bitbake -c populate_sdk_ext core-image-minimal

Install Extensible SDK (bitbake terminal)

The ESDK installer can be found in /path_to_build_directory/kernel-dev/tmp/deploy/sdk/

./tmp/deploy/sdk/poky-glibc-x86_64-core-image-minimal-corei7-64-toolchain-ext-2.3.sh

Follow the installer instructions and provide a target directory for your ESDK installation e.g /path_to_esdk/

Checkout the kernel source tree and construct .config (bitbake terminal)

Check out the Linux kernel source and construct a .config from the Yocto kernel configuration segments. The sources can be found in /path_to_build_directory/kernel-dev/workspace/sources/linux-yocto.

devtool modify linux-yocto 

Setup your ESDK build environment (ESDK terminal)

Open a new terminal and setup your build environment. Let's refer to this terminal as your 'ESDK terminal'

. /path_to_esdk/environment-setup-corei7-64-poky-linux

NOTE: If you see this message you will really need to open a new terminal :).

SDK environment now set up; additionally you may now run devtool to perform development tasks. Run devtool --help for further details. WARNING: attempting to use the extensible SDK in an environment set up to run bitbake - this may lead to unexpected results. Please source this script in a new shell session instead.


Build your kernel (ESDK terminal)

Navigate to your workspace directory e.g /path_to_build_directory/kernel-dev/workspace/sources/linux-yocto and build the kernel

make

Modify your kernel and commit your changes (ESDK terminal)

You can navigate to the Linux source directory (/path_to_build_directory/kernel-dev/workspace/sources/linux-yocto) and modify the kernel. Commit your kernel changes.

Build an image with your kernel changes (optional) (bitbake terminal)

devtool build-image core-image-minimal

Export patches and create a bbappend file (bitbake terminal)

To export your commits to patches and a bbappend file use the following command.

devtool finish linux-yocto /path_to_poky_directory/meta-yocto-bsp/

The patches and the bbappend can be found in /path_to_poky_directory/meta-yocto-bsp/recipes-kernel/linux.

Build image with your modified kernel (bitbake terminal)

You can now build an image which will include your kernel patches.

Execute the following command from your build directory ( e.g /path_to_build_directory/kernel-dev/)

bitbake core-image-minimal