TipsAndTricks/LinuxKernelAndSDKs: Difference between revisions
From Yocto Project
Jump to navigationJump to search
(Created page with "<strong> This is the start of what I hope becomes a longer article. This early stage is to answer a particular question. </strong> == Kernel Building w/o Bitbake == Suppose y...") |
No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<strong> This is the start of what I hope becomes a longer article. This early stage is to answer a particular question. </strong> | <strong> This is the start of what I hope becomes a longer article. This early stage is to answer a particular question. </strong> <br> | ||
<span style="color:#FF0000"> Issue: Currently <code>make menuconfig</code> fails in the sdk. This is an active bug and can be tracked here: https://bugzilla.yoctoproject.org/show_bug.cgi?id=11155 </span> You can work around this currently by running make menuconfig in a different bash shell from the one you sourced the sdk environment into. | |||
== Kernel Building w/o Bitbake == | == Kernel Building w/o Bitbake == | ||
Line 9: | Line 10: | ||
** if you need to build it do | ** if you need to build it do | ||
*** <code>$ bitbake core-image-minimal && bitbake core-image-minimal -c populate_sdk </code> | *** <code>$ bitbake core-image-minimal && bitbake core-image-minimal -c populate_sdk </code> | ||
*** you would only need to do this <strong>ONCE</strong> | **** you would only need to do this <strong>ONCE</strong> | ||
**** the result will be in tmp/deploy/sdk/ and will be named something like poky-glibc-x86_64-core-image-minimal-core2-64-toolchain-2.2+snapshot.sh | **** the result will be in tmp/deploy/sdk/ and will be named something like poky-glibc-x86_64-core-image-minimal-core2-64-toolchain-2.2+snapshot.sh | ||
**** This assumes you have set your MACHINE to whatever your target is (for example MACHINE=qemux86-64, in your conf/local.conf) to get the correct cross toolchains. | |||
* install the sdk <code>$. poky-glibc-x86_64-core-image-sato-core2-64-toolchain-2.2.1.sh </code> for example. Or, you could use the one you built. | * install the sdk <code>$. poky-glibc-x86_64-core-image-sato-core2-64-toolchain-2.2.1.sh </code> for example. Or, you could use the one you built. | ||
** Since we are focused on the kernel, the image that the toolchain was built for isn't important, we want to use the cross toolchains. | ** Since we are focused on the kernel, the image that the toolchain was built for isn't important, we want to use the cross toolchains. | ||
Line 22: | Line 24: | ||
** honestly, it's easier to do <code>$ find . -name .config| grep linux-yocto</code> | ** honestly, it's easier to do <code>$ find . -name .config| grep linux-yocto</code> | ||
* then just cp that .config file to your kernel tree and make like above. You should probably to a <code>make oldconfig</code> if you aren't using the linux-yocto kernel source itself. | * then just cp that .config file to your kernel tree and make like above. You should probably to a <code>make oldconfig</code> if you aren't using the linux-yocto kernel source itself. | ||
== Kernel Modules == | |||
* Addressed Later |
Latest revision as of 21:39, 15 March 2017
This is the start of what I hope becomes a longer article. This early stage is to answer a particular question.
Issue: Currently make menuconfig
fails in the sdk. This is an active bug and can be tracked here: https://bugzilla.yoctoproject.org/show_bug.cgi?id=11155 You can work around this currently by running make menuconfig in a different bash shell from the one you sourced the sdk environment into.
Kernel Building w/o Bitbake
Suppose you'd like to build a kernel but you don't care about having it packed into a wic image. Maybe you are loading the kernel on the command line in qemu, or maybe you are netbooting it. But, you'd like to use the Yocto toolchains to insure that it will work with an eventual Yocto image... How do you do that?
- make the sdk or download it.
- if you are targeting a release, you can download the sdk from http://downloads.yoctoproject.org/
- For example for YP 2.2.1 you could use http://downloads.yoctoproject.org/releases/yocto/yocto-2.2.1/toolchain/x86_64/poky-glibc-x86_64-core-image-sato-core2-64-toolchain-2.2.1.sh
- if you need to build it do
$ bitbake core-image-minimal && bitbake core-image-minimal -c populate_sdk
- you would only need to do this ONCE
- the result will be in tmp/deploy/sdk/ and will be named something like poky-glibc-x86_64-core-image-minimal-core2-64-toolchain-2.2+snapshot.sh
- This assumes you have set your MACHINE to whatever your target is (for example MACHINE=qemux86-64, in your conf/local.conf) to get the correct cross toolchains.
- if you are targeting a release, you can download the sdk from http://downloads.yoctoproject.org/
- install the sdk
$. poky-glibc-x86_64-core-image-sato-core2-64-toolchain-2.2.1.sh
for example. Or, you could use the one you built.- Since we are focused on the kernel, the image that the toolchain was built for isn't important, we want to use the cross toolchains.
- from here on, we'll assume you installed it into /opt/poky/2.2
- source the environment for the sdk from a fresh shell (i.e. not from the shell that has all the bitbake variables set in it).
$. /opt/poky/2.2/environment-setup-x86_64-poky-linux
- then just do
$ make bzImage
in your kernel directory. The kernel Makefile respects the env variables that were set in the environment script your sourced.
But, I want the config that linux-yocto would use...
- If you want to start with the config that linux-yocto would use, do
$ bitbake -c kernel_configme linux-yocto
- The resulting .config file will be somewhere like tmp/work/qemux86_64-poky-linux/linux-yocto/...
- honestly, it's easier to do
$ find . -name .config| grep linux-yocto
- then just cp that .config file to your kernel tree and make like above. You should probably to a
make oldconfig
if you aren't using the linux-yocto kernel source itself.
Kernel Modules
- Addressed Later