Kernel Building: Difference between revisions
Michaelfung (talk | contribs) |
PaulEggleton (talk | contribs) No edit summary |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Outdated}} | |||
== Default Build == | == Default Build == | ||
Line 9: | Line 11: | ||
== Kernel image type == | == Kernel image type == | ||
What kind of kernel image to build is controlled by the variable <tt>KERNEL_IMAGETYPE</tt>. For example, build image for u-boot | What kind of kernel image to build is controlled by the variable <tt>KERNEL_IMAGETYPE</tt>, which is normally defined in the machine config file. For example, build image for u-boot | ||
KERNEL_IMAGETYPE = "uImage" | KERNEL_IMAGETYPE = "uImage" | ||
== Select kernel version == | == Select kernel version == | ||
FIXME. | |||
== Default configuration == | |||
The default .config file used is normally placed somewhere under recipes/linux named '''defconfig'''. | The default .config file used is normally placed somewhere under recipes/linux named '''defconfig'''. | ||
Line 33: | Line 29: | ||
== Apply custom patches == | |||
FIXME | FIXME | ||
== Customize configuration == | |||
If you need to customize the kernel configuration, you may run the menuconfig task by: | If you need to customize the kernel configuration, you may run the menuconfig task by: | ||
bitbake -c menuconfig virtual/kernel | bitbake -c menuconfig virtual/kernel | ||
Line 43: | Line 39: | ||
'''Note:''' by default these command requires you to run in X Windows. If you want to work in text terminal only, here's a [[How_to_use_bitbake_without_X_Windows|how to]]. | '''Note:''' by default these command requires you to run in X Windows. If you want to work in text terminal only, here's a [[How_to_use_bitbake_without_X_Windows|how to]]. | ||
== Compile == | |||
After that, you can compile the kernel by: | After that, you can compile the kernel by: | ||
bitbake -f -c compile virtual/kernel | bitbake -f -c compile virtual/kernel | ||
== Fine control == | |||
If you need more control over the configuration and compile process, you can go to the shell by: | If you need more control over the configuration and compile process, add this somewhere into your local.conf: | ||
INHERIT += "devshell" | |||
and then you can go to the shell by: | |||
bitbake -c devshell virtual/kernel | bitbake -c devshell virtual/kernel | ||
The build environment will be well setup for you; you can run regular make commands like <tt>make bzImage</tt> ...etc | The build environment will be well setup for you; you can run regular make commands like <tt>make bzImage</tt> ...etc | ||
''Please note, that the INHERIT step depends on the distribution you're using, some of the distributions already include the INHERIT in their configuration, so it might work already. You can check that easily using listtask task.'' | |||
== Preserving the custom configuration == | |||
Changes are lost if you remove the tmpdir or do a "<tt>bitbake -c clean virtual/kernel</tt>", so you | Changes are lost if you remove the tmpdir or do a "<tt>bitbake -c clean virtual/kernel</tt>", so you | ||
may consider replacing the defconfig with it. | may consider replacing the defconfig with it. |
Latest revision as of 16:42, 3 November 2012
NOTE: This page has been identified as having content that is significantly out-of-date, usually because it refers to OpenEmbedded-Classic - for new projects, you should use OpenEmbedded-Core.
See OpenEmbedded Wiki Update Project for more details. |
Default Build
For a default build, just run:
bitbake virtual/kernel
After done, you can collect the built image from under the deploy folder, for example: build/tmp/deploy/glibc/images/vmware/bzImage-vmware.bin.
Kernel image type
What kind of kernel image to build is controlled by the variable KERNEL_IMAGETYPE, which is normally defined in the machine config file. For example, build image for u-boot
KERNEL_IMAGETYPE = "uImage"
Select kernel version
FIXME.
Default configuration
The default .config file used is normally placed somewhere under recipes/linux named defconfig. You may want to search for it, say for vmware:
find recipes/linux -name "vmware*"
And you find it in:
recipes/linux/linux/vmware/defconfig
Apply custom patches
FIXME
Customize configuration
If you need to customize the kernel configuration, you may run the menuconfig task by:
bitbake -c menuconfig virtual/kernel
Note: by default these command requires you to run in X Windows. If you want to work in text terminal only, here's a how to.
Compile
After that, you can compile the kernel by:
bitbake -f -c compile virtual/kernel
Fine control
If you need more control over the configuration and compile process, add this somewhere into your local.conf:
INHERIT += "devshell"
and then you can go to the shell by:
bitbake -c devshell virtual/kernel
The build environment will be well setup for you; you can run regular make commands like make bzImage ...etc
Please note, that the INHERIT step depends on the distribution you're using, some of the distributions already include the INHERIT in their configuration, so it might work already. You can check that easily using listtask task.
Preserving the custom configuration
Changes are lost if you remove the tmpdir or do a "bitbake -c clean virtual/kernel", so you may consider replacing the defconfig with it.