From 972dcfcdbfe75dcfeb777150c136576cf1a71e99 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Fri, 9 Oct 2015 22:59:03 +0200 Subject: initial commit for Enea Linux 5.0 arm Signed-off-by: Tudor Florea --- .../figures/kernel-architecture-overview.png | Bin 0 -> 40748 bytes .../kernel-dev/figures/kernel-dev-title.png | Bin 0 -> 13453 bytes documentation/kernel-dev/kernel-dev-advanced.xml | 1074 ++++++++++++++++++++ documentation/kernel-dev/kernel-dev-common.xml | 915 +++++++++++++++++ .../kernel-dev/kernel-dev-concepts-appx.xml | 253 +++++ .../kernel-dev/kernel-dev-customization.xsl | 18 + .../kernel-dev-eclipse-customization.xsl | 27 + documentation/kernel-dev/kernel-dev-examples.xml | 918 +++++++++++++++++ documentation/kernel-dev/kernel-dev-faq.xml | 140 +++ documentation/kernel-dev/kernel-dev-intro.xml | 147 +++ documentation/kernel-dev/kernel-dev-maint-appx.xml | 220 ++++ documentation/kernel-dev/kernel-dev-style.css | 984 ++++++++++++++++++ documentation/kernel-dev/kernel-dev.xml | 115 +++ 13 files changed, 4811 insertions(+) create mode 100755 documentation/kernel-dev/figures/kernel-architecture-overview.png create mode 100644 documentation/kernel-dev/figures/kernel-dev-title.png create mode 100644 documentation/kernel-dev/kernel-dev-advanced.xml create mode 100644 documentation/kernel-dev/kernel-dev-common.xml create mode 100644 documentation/kernel-dev/kernel-dev-concepts-appx.xml create mode 100644 documentation/kernel-dev/kernel-dev-customization.xsl create mode 100644 documentation/kernel-dev/kernel-dev-eclipse-customization.xsl create mode 100644 documentation/kernel-dev/kernel-dev-examples.xml create mode 100644 documentation/kernel-dev/kernel-dev-faq.xml create mode 100644 documentation/kernel-dev/kernel-dev-intro.xml create mode 100644 documentation/kernel-dev/kernel-dev-maint-appx.xml create mode 100644 documentation/kernel-dev/kernel-dev-style.css create mode 100644 documentation/kernel-dev/kernel-dev.xml (limited to 'documentation/kernel-dev') diff --git a/documentation/kernel-dev/figures/kernel-architecture-overview.png b/documentation/kernel-dev/figures/kernel-architecture-overview.png new file mode 100755 index 0000000000..2aad172db3 Binary files /dev/null and b/documentation/kernel-dev/figures/kernel-architecture-overview.png differ diff --git a/documentation/kernel-dev/figures/kernel-dev-title.png b/documentation/kernel-dev/figures/kernel-dev-title.png new file mode 100644 index 0000000000..7a8dd54372 Binary files /dev/null and b/documentation/kernel-dev/figures/kernel-dev-title.png differ diff --git a/documentation/kernel-dev/kernel-dev-advanced.xml b/documentation/kernel-dev/kernel-dev-advanced.xml new file mode 100644 index 0000000000..283f483112 --- /dev/null +++ b/documentation/kernel-dev/kernel-dev-advanced.xml @@ -0,0 +1,1074 @@ + %poky; ] > + + +Working with Advanced Metadata + +
+ Overview + + + In addition to supporting configuration fragments and patches, the + Yocto Project kernel tools also support rich + Metadata that you can + use to define complex policies and Board Support Package (BSP) support. + The purpose of the Metadata and the tools that manage it, known as + the kern-tools (kern-tools-native_git.bb), is + to help you manage the complexity of the configuration and sources + used to support multiple BSPs and Linux kernel types. + +
+ +
+ Using Kernel Metadata in a Recipe + + + The kernel sources in the Yocto Project contain kernel Metadata, which is + located in the meta branches of the kernel source + Git repositories. + This Metadata defines Board Support Packages (BSPs) that + correspond to definitions in linux-yocto recipes for the same BSPs. + A BSP consists of an aggregation of kernel policy and hardware-specific + feature enablements. + The BSP can be influenced from within the linux-yocto recipe. + + Linux kernel source that contains kernel Metadata is said to be + "linux-yocto style" kernel source. + A Linux kernel recipe that inherits from the + linux-yocto.inc include file is said to be a + "linux-yocto style" recipe. + + + + + Every linux-yocto style recipe must define the + KMACHINE + variable. + This variable is typically set to the same value as the + MACHINE + variable, which is used by + BitBake + (e.g. "edgerouter" or "fri2"). + Multiple BSPs can reuse the same KMACHINE + name if they are built using the same BSP description. + The "fri2" and "fri2-noemgd" BSP combination + in the meta-intel + layer is a good example of two BSPs using the same + KMACHINE value (i.e. "fri2"). + See the BSP Descriptions section + for more information. + + + + The linux-yocto style recipes can optionally define the following + variables: + + KBRANCH + KERNEL_FEATURES + KBRANCH_DEFAULT + LINUX_KERNEL_TYPE + + KBRANCH_DEFAULT defines the Linux kernel source + repository's default branch to use to build the Linux kernel. + The value is used as the default for KBRANCH, which + can define an alternate branch typically with a machine override as + follows: + + KBRANCH_fri2 = "standard/fri2" + + Unless you specify otherwise, KBRANCH_DEFAULT + initializes to "master". + + + + LINUX_KERNEL_TYPE defines the kernel type to be + used in assembling the configuration. + If you do not specify a LINUX_KERNEL_TYPE, + it defaults to "standard". + Together with + KMACHINE, + LINUX_KERNEL_TYPE defines the search + arguments used by the kernel tools to find the + appropriate description within the kernel Metadata with which to + build out the sources and configuration. + The linux-yocto recipes define "standard", "tiny", and "preempt-rt" + kernel types. + See the Kernel Types section + for more information on kernel types. + + + + During the build, the kern-tools search for the BSP description + file that most closely matches the KMACHINE + and LINUX_KERNEL_TYPE variables passed in from the + recipe. + The tools use the first BSP description it finds that match + both variables. + If the tools cannot find a match, they issue a warning such as + the following: + + WARNING: Can't find any BSP hardware or required configuration fragments. + WARNING: Looked at meta/cfg/broken/fri2-broken/hdw_frags.txt and + meta/cfg/broken/fri2-broken/required_frags.txt in directory: + meta/cfg/broken/fri2-broken + + In this example, KMACHINE was set to "fri2-broken" + and LINUX_KERNEL_TYPE was set to "broken". + + + + The tools first search for the KMACHINE and + then for the LINUX_KERNEL_TYPE. + If the tools cannot find a partial match, they will use the + sources from the KBRANCH and any configuration + specified in the + SRC_URI. + + + + You can use the KERNEL_FEATURES variable + to include features (configuration fragments, patches, or both) that + are not already included by the KMACHINE and + LINUX_KERNEL_TYPE variable combination. + For example, to include a feature specified as "features/netfilter.scc", + specify: + + KERNEL_FEATURES += "features/netfilter.scc" + + To include a feature called "cfg/sound.scc" just for the + qemux86 machine, specify: + + KERNEL_FEATURES_append_qemux86 = "cfg/sound.scc" + + The value of the entries in KERNEL_FEATURES + are dependent on their location within the kernel Metadata itself. + The examples here are taken from the + linux-yocto-3.4 repository where "features" + and "cfg" are subdirectories within the + meta/cfg/kernel-cache directory. + For more information, see the + "Kernel Metadata Syntax" section. + + The processing of the these variables has evolved some between the + 0.9 and 1.3 releases of the Yocto Project and associated + kern-tools sources. + The descriptions in this section are accurate for 1.3 and later + releases of the Yocto Project. + + +
+ +
+ Kernel Metadata Location + + + Kernel Metadata can be defined in either the kernel recipe + (recipe-space) or in the kernel tree (in-tree). + Where you choose to define the Metadata depends on what you want + to do and how you intend to work. + Regardless of where you define the kernel Metadata, the syntax used + applies equally. + + + + If you are unfamiliar with the Linux kernel and only wish + to apply a configuration and possibly a couple of patches provided to + you by others, the recipe-space method is recommended. + This method is also a good approach if you are working with Linux kernel + sources you do not control or if you just do not want to maintain a + Linux kernel Git repository on your own. + For partial information on how you can define kernel Metadata in + the recipe-space, see the + "Modifying an Existing Recipe" + section. + + + + Conversely, if you are actively developing a kernel and are already + maintaining a Linux kernel Git repository of your own, you might find + it more convenient to work with the kernel Metadata in the same + repository as the Linux kernel sources. + This method can make iterative development of the Linux kernel + more efficient outside of the BitBake environment. + + +
+ Recipe-Space Metadata + + + When stored in recipe-space, the kernel Metadata files reside in a + directory hierarchy below + FILESEXTRAPATHS. + For a linux-yocto recipe or for a Linux kernel recipe derived + by copying and modifying + oe-core/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb + to a recipe in your layer, FILESEXTRAPATHS + is typically set to + ${THISDIR}/${PN}. + See the "Modifying an Existing Recipe" + section for more information. + + + + Here is an example that shows a trivial tree of kernel Metadata + stored in recipe-space within a BSP layer: + + meta-my_bsp_layer/ + `-- recipes-kernel + `-- linux + `-- linux-yocto + |-- bsp-standard.scc + |-- bsp.cfg + `-- standard.cfg + + + + + When the Metadata is stored in recipe-space, you must take + steps to ensure BitBake has the necessary information to decide + what files to fetch and when they need to be fetched again. + It is only necessary to specify the .scc + files on the + SRC_URI. + BitBake parses them and fetches any files referenced in the + .scc files by the include, + patch, or kconf commands. + Because of this, it is necessary to bump the recipe + PR + value when changing the content of files not explicitly listed + in the SRC_URI. + +
+ +
+ In-Tree Metadata + + + When stored in-tree, the kernel Metadata files reside in the + meta directory of the Linux kernel sources. + The meta directory can be present in the + same repository branch as the sources, + such as "master", or meta can be its own + orphan branch. + + An orphan branch in Git is a branch with unique history and + content to the other branches in the repository. + Orphan branches are useful to track Metadata changes + independently from the sources of the Linux kernel, while + still keeping them together in the same repository. + + For the purposes of this document, we will discuss all + in-tree Metadata as residing below the + meta/cfg/kernel-cache directory. + + + + Following is an example that shows how a trivial tree of Metadata + is stored in a custom Linux kernel Git repository: + + meta/ + `-- cfg + `-- kernel-cache + |-- bsp-standard.scc + |-- bsp.cfg + `-- standard.cfg + + + + + To use a branch different from where the sources reside, + specify the branch in the KMETA variable + in your Linux kernel recipe. + Here is an example: + + KMETA = "meta" + + To use the same branch as the sources, set + KMETA to an empty string: + + KMETA = "" + + If you are working with your own sources and want to create an + orphan meta branch, use these commands + from within your Linux kernel Git repository: + + $ git checkout --orphan meta + $ git rm -rf . + $ git commit --allow-empty -m "Create orphan meta branch" + + + + + If you modify the Metadata in the linux-yocto + meta branch, you must not forget to update + the + SRCREV + statements in the kernel's recipe. + In particular, you need to update the + SRCREV_meta variable to match the commit in + the KMETA branch you wish to use. + Changing the data in these branches and not updating the + SRCREV statements to match will cause the + build to fetch an older commit. + +
+
+ +
+ Kernel Metadata Syntax + + + The kernel Metadata consists of three primary types of files: + scc + + + scc stands for Series Configuration + Control, but the naming has less significance in the + current implementation of the tooling than it had in the + past. + Consider scc files to be description files. + + + description files, configuration fragments, and patches. + The scc files define variables and include or + otherwise reference any of the three file types. + The description files are used to aggregate all types of kernel + Metadata into + what ultimately describes the sources and the configuration required + to build a Linux kernel tailored to a specific machine. + + + + The scc description files are used to define two + fundamental types of kernel Metadata: + + Features + Board Support Packages (BSPs) + + + + + Features aggregate sources in the form of patches and configuration + fragments into a modular reusable unit. + You can use features to implement conceptually separate kernel + Metadata descriptions such as pure configuration fragments, + simple patches, complex features, and kernel types. + Kernel types define general + kernel features and policy to be reused in the BSPs. + + + + BSPs define hardware-specific features and aggregate them with kernel + types to form the final description of what will be assembled and built. + + + + While the kernel Metadata syntax does not enforce any logical + separation of configuration fragments, patches, features or kernel + types, best practices dictate a logical separation of these types + of Metadata. + The following Metadata file hierarchy is recommended: + + base/ + bsp/ + cfg/ + features/ + ktypes/ + patches/ + + + + + The bsp directory contains the + BSP descriptions. + The remaining directories all contain "features". + Separating bsp from the rest of the structure + aids conceptualizing intended usage. + + + + Use these guidelines to help place your scc + description files within the structure: + + If your file contains + only configuration fragments, place the file in the + cfg directory. + If your file contains + only source-code fixes, place the file in the + patches directory. + If your file encapsulates + a major feature, often combining sources and configurations, + place the file in features directory. + + If your file aggregates + non-hardware configuration and patches in order to define a + base kernel policy or major kernel type to be reused across + multiple BSPs, place the file in ktypes + directory. + + + + + + These distinctions can easily become blurred - especially as + out-of-tree features slowly merge upstream over time. + Also, remember that how the description files are placed is + a purely logical organization and has no impact on the functionality + of the kernel Metadata. + There is no impact because all of cfg, + features, patches, and + ktypes, contain "features" as far as the kernel + tools are concerned. + + + + Paths used in kernel Metadata files are relative to + <base>, which is either + FILESEXTRAPATHS + if you are creating Metadata in + recipe-space, + or meta/cfg/kernel-cache/ if you are creating + Metadata in-tree. + + +
+ Configuration + + + The simplest unit of kernel Metadata is the configuration-only + feature. + This feature consists of one or more Linux kernel configuration + parameters in a configuration fragment file + (.cfg) and an .scc file + that describes the fragment. + + + + The Symmetric Multi-Processing (SMP) fragment included in the + linux-yocto-3.4 Git repository + consists of the following two files: + + cfg/smp.scc: + define KFEATURE_DESCRIPTION "Enable SMP" + kconf hardware smp.cfg + + cfg/smp.cfg: + CONFIG_SMP=y + CONFIG_SCHED_SMT=y + + You can find information on configuration fragment files in the + "Creating Configuration Fragments" + section of the Yocto Project Development Manual and in + the "Generating Configuration Files" + section earlier in this manual. + + + + KFEATURE_DESCRIPTION + provides a short description of the fragment. + Higher level kernel tools use this description. + + + + The kconf command is used to include the + actual configuration fragment in an .scc + file, and the "hardware" keyword identifies the fragment as + being hardware enabling, as opposed to general policy, + which would use the "non-hardware" keyword. + The distinction is made for the benefit of the configuration + validation tools, which warn you if a hardware fragment + overrides a policy set by a non-hardware fragment. + + The description file can include multiple + kconf statements, one per fragment. + + + + + As described in the + "Generating Configuration Files" + section, you can use the following BitBake command to audit your + configuration: + + $ bitbake linux-yocto -c kernel_configcheck -f + + +
+ +
+ Patches + + + Patch descriptions are very similar to configuration fragment + descriptions, which are described in the previous section. + However, instead of a .cfg file, these + descriptions work with source patches. + + + + A typical patch includes a description file and the patch itself: + + patches/mypatch.scc: + patch mypatch.patch + + patches/mypatch.patch: + typical-patch + + You can create the typical .patch + file using diff -Nurp or + git format-patch. + + + + The description file can include multiple patch statements, + one per patch. + +
+ +
+ Features + + + Features are complex kernel Metadata types that consist + of configuration fragments (kconf), patches + (patch), and possibly other feature + description files (include). + + + + Here is an example that shows a feature description file: + + features/myfeature.scc + define KFEATURE_DESCRIPTION "Enable myfeature" + + patch 0001-myfeature-core.patch + patch 0002-myfeature-interface.patch + + include cfg/myfeature_dependency.scc + kconf non-hardware myfeature.cfg + + This example shows how the patch and + kconf commands are used as well as + how an additional feature description file is included. + + + + Typically, features are less granular than configuration + fragments and are more likely than configuration fragments + and patches to be the types of things you want to specify + in the KERNEL_FEATURES variable of the + Linux kernel recipe. + See the "Using Kernel Metadata in a Recipe" + section earlier in the manual. + +
+ +
+ Kernel Types + + + A kernel type defines a high-level kernel policy by + aggregating non-hardware configuration fragments with + patches you want to use when building a Linux kernels of a + specific type. + Syntactically, kernel types are no different than features + as described in the "Features" + section. + The LINUX_KERNEL_TYPE variable in the kernel + recipe selects the kernel type. + See the "Using Kernel Metadata in a Recipe" + section for more information. + + + + As an example, the linux-yocto-3.4 + tree defines three kernel types: "standard", + "tiny", and "preempt-rt": + + "standard": + Includes the generic Linux kernel policy of the Yocto + Project linux-yocto kernel recipes. + This policy includes, among other things, which file + systems, networking options, core kernel features, and + debugging and tracing options are supported. + + "preempt-rt": + Applies the PREEMPT_RT + patches and the configuration options required to + build a real-time Linux kernel. + This kernel type inherits from the "standard" kernel type. + + "tiny": + Defines a bare minimum configuration meant to serve as a + base for very small Linux kernels. + The "tiny" kernel type is independent from the "standard" + configuration. + Although the "tiny" kernel type does not currently include + any source changes, it might in the future. + + + + + + The "standard" kernel type is defined by + standard.scc: + + # Include this kernel type fragment to get the standard features and + # configuration values. + + # Include all standard features + include standard-nocfg.scc + + kconf non-hardware standard.cfg + + # individual cfg block section + include cfg/fs/devtmpfs.scc + include cfg/fs/debugfs.scc + include cfg/fs/btrfs.scc + include cfg/fs/ext2.scc + include cfg/fs/ext3.scc + include cfg/fs/ext4.scc + + include cfg/net/ipv6.scc + include cfg/net/ip_nf.scc + include cfg/net/ip6_nf.scc + include cfg/net/bridge.scc + + + + + As with any .scc file, a + kernel type definition can aggregate other + .scc files with + include commands. + These definitions can also directly pull in + configuration fragments and patches with the + kconf and patch + commands, respectively. + + + + It is not strictly necessary to create a kernel type + .scc file. + The Board Support Package (BSP) file can implicitly define + the kernel type using a define + KTYPE myktype + line. + See the "BSP Descriptions" + section for more information. + +
+ +
+ BSP Descriptions + + + BSP descriptions combine kernel types with hardware-specific + features. + The hardware-specific portion is typically defined + independently, and then aggregated with each supported kernel + type. + Consider this simple BSP description that supports the "mybsp" + machine: + + mybsp.scc: + define KMACHINE mybsp + define KTYPE standard + define KARCH i386 + + kconf mybsp.cfg + + Every BSP description should define the + KMACHINE, + KTYPE, + and KARCH + variables. + These variables allow the OpenEmbedded build system to identify + the description as meeting the criteria set by the recipe being + built. + This simple example supports the "mybsp" machine for the "standard" + kernel and the "i386" architecture. + + + + Be aware that a hard link between the + KTYPE variable and a kernel type + description file does not exist. + Thus, if you do not have kernel types defined in your kernel + Metadata, you only need to ensure that the kernel recipe's + LINUX_KERNEL_TYPE + variable and the KTYPE variable in the + BSP description file match. + + Future versions of the tooling make the specification of + KTYPE in the BSP optional. + + + + + If you did want to separate your kernel policy from your + hardware configuration, you could do so by specifying a kernel + type, such as "standard" and including that description file + in the BSP description file. + See the "Kernel Types" section + for more information. + + + + You might also have multiple hardware configurations that you + aggregate into a single hardware description file that you + could include in the BSP description file, rather than referencing + a single .cfg file. + Consider the following: + + mybsp.scc: + define KMACHINE mybsp + define KTYPE standard + define KARCH i386 + + include standard.scc + include mybsp-hw.scc + + + + + In the above example, standard.scc + aggregates all the configuration fragments, patches, and + features that make up your standard kernel policy whereas + mybsp-hw.scc aggregates all those necessary + to support the hardware available on the "mybsp" machine. + For information on how to break a complete + .config file into the various + configuration fragments, see the + "Generating Configuration Files" + section. + + + + Many real-world examples are more complex. + Like any other .scc file, BSP + descriptions can aggregate features. + Consider the Fish River Island 2 (fri2) + BSP definition from the linux-yocto-3.4 + Git repository: + + fri2.scc: + kconf hardware fri2.cfg + + include cfg/x86.scc + include features/eg20t/eg20t.scc + include cfg/dmaengine.scc + include features/ericsson-3g/f5521gw.scc + include features/power/intel.scc + include cfg/efi.scc + include features/usb/ehci-hcd.scc + include features/usb/ohci-hcd.scc + include features/iwlwifi/iwlwifi.scc + + + + + The fri2.scc description file includes + a hardware configuration fragment + (fri2.cfg) specific to the Fish River + Island 2 BSP as well as several more general configuration + fragments and features enabling hardware found on the + machine. + This description file is then included in each of the three + "fri2" description files for the supported kernel types + (i.e. "standard", "preempt-rt", and "tiny"). + Consider the "fri2" description for the "standard" kernel + type: + + fri2-standard.scc: + define KMACHINE fri2 + define KTYPE standard + define KARCH i386 + + include ktypes/standard/standard.scc + branch fri2 + + git merge emgd-1.14 + + include fri2.scc + + # Extra fri2 configs above the minimal defined in fri2.scc + include cfg/efi-ext.scc + include features/drm-emgd/drm-emgd.scc + include cfg/vesafb.scc + + # default policy for standard kernels + include cfg/usb-mass-storage.scc + + The include command midway through the file + includes the fri2.scc description that + defines all hardware enablements for the BSP that is common to all + kernel types. + Using this command significantly reduces duplication. + + + + This "fri2" standard description introduces a few more variables + and commands that are worth further discussion. + Notice the branch fri2 command, which creates + a machine-specific branch into which source changes are applied. + With this branch set up, the git merge command + uses Git to merge in a feature branch named "emgd-1.14". + You could also handle this with the patch + command. + However, for commonly used features such as this, feature branches + are a convenient mechanism. + See the "Feature Branches" + section for more information. + + + + Now consider the "fri2" description for the "tiny" kernel type: + + fri2-tiny.scc: + define KMACHINE fri2 + define KTYPE tiny + define KARCH i386 + + include ktypes/tiny/tiny.scc + branch fri2 + + include fri2.scc + + As you might expect, the "tiny" description includes quite a + bit less. + In fact, it includes only the minimal policy defined by the + "tiny" kernel type and the hardware-specific configuration required + for booting the machine along with the most basic functionality of + the system as defined in the base "fri2" description file. + + + + Notice again the three critical variables: + KMACHINE, KTYPE, + and KARCH. + Of these variables, only the KTYPE has changed. + It is now set to "tiny". + +
+
+ +
+ Organizing Your Source + + + Many recipes based on the linux-yocto-custom.bb + recipe use Linux kernel sources that have only a single + branch - "master". + This type of repository structure is fine for linear development + supporting a single machine and architecture. + However, if you work with multiple boards and architectures, + a kernel source repository with multiple branches is more + efficient. + For example, suppose you need a series of patches for one board to boot. + Sometimes, these patches are works-in-progress or fundamentally wrong, + yet they are still necessary for specific boards. + In these situations, you most likely do not want to include these + patches in every kernel you build (i.e. have the patches as part of + the lone "master" branch). + It is situations like these that give rise to multiple branches used + within a Linux kernel sources Git repository. + + + + Repository organization strategies exist that maximize source reuse, + remove redundancy, and logically order your changes. + This section presents strategies for the following cases: + + Encapsulating patches in a feature description + and only including the patches in the BSP descriptions of + the applicable boards. + Creating a machine branch in your + kernel source repository and applying the patches on that + branch only. + Creating a feature branch in your + kernel source repository and merging that branch into your + BSP when needed. + + + + + The approach you take is entirely up to you + and depends on what works best for your development model. + + +
+ Encapsulating Patches + + + if you are reusing patches from an external tree and are not + working on the patches, you might find the encapsulated feature + to be appropriate. + Given this scenario, you do not need to create any branches in the + source repository. + Rather, you just take the static patches you need and encapsulate + them within a feature description. + Once you have the feature description, you simply include that into + the BSP description as described in the + "BSP Descriptions" + section. + + + + You can find information on how to create patches and BSP + descriptions in the "Patches" and + "BSP Descriptions" + sections. + +
+ +
+ Machine Branches + + + When you have multiple machines and architectures to support, + or you are actively working on board support, it is more + efficient to create branches in the repository based on + individual machines. + Having machine branches allows common source to remain in the + "master" branch with any features specific to a machine stored + in the appropriate machine branch. + This organization method frees you from continually reintegrating + your patches into a feature. + + + + Once you have a new branch, you can set up your kernel Metadata + to use the branch a couple different ways. + In the recipe, you can specify the new branch as the + KBRANCH to use for the board as + follows: + + KBRANCH = "mynewbranch" + + Another method is to use the branch command + in the BSP description: + + mybsp.scc: + define KMACHINE mybsp + define KTYPE standard + define KARCH i386 + include standard.scc + + branch mynewbranch + + include mybsp-hw.scc + + + + + If you find + yourself with numerous branches, you might consider using a + hierarchical branching system similar to what the linux-yocto Linux + kernel repositories use: + + common/kernel_type/machine + + + + + If you had two kernel types, "standard" and "small" for + instance, three machines, and common + as mydir, the branches in your + Git repository might look like this: + + mydir/base + mydir/standard/base + mydir/standard/machine_a + mydir/standard/machine_b + mydir/standard/machine_c + mydir/small/base + mydir/small/machine_a + + + + + This organization can help clarify the branch relationships. + In this case, mydir/standard/machine_a + includes everything in mydir/base and + mydir/standard/base. + The "standard" and "small" branches add sources specific to those + kernel types that for whatever reason are not appropriate for the + other branches. + The "base" branches are an artifact of the way Git manages + its data internally on the filesystem: Git will not allow you + to use mydir/standard and + mydir/standard/machine_a because it + would have to create a file and a directory named "standard". + + +
+ +
+ Feature Branches + + + When you are actively developing new features, it can be more + efficient to work with that feature as a branch, rather than + as a set of patches that have to be regularly updated. + The Yocto Project Linux kernel tools provide for this with + the git merge command. + + + + To merge a feature branch into a BSP, insert the + git merge command after any + branch commands: + + mybsp.scc: + define KMACHINE mybsp + define KTYPE standard + define KARCH i386 + include standard.scc + + branch mynewbranch + git merge myfeature + + include mybsp-hw.scc + + +
+
+ +
+ SCC Description File Reference + + + This section provides a brief reference for the commands you can use + within an SCC description file (.scc): + + branch [ref]: + Creates a new branch relative to the current branch + (typically ${KTYPE}) using + the currently checked-out branch, or "ref" if specified. + + define: + Defines variables, such as KMACHINE, + KTYPE, KARCH, + and KFEATURE_DESCRIPTION. + include SCC_FILE: + Includes an SCC file in the current file. + The file is parsed as if you had inserted it inline. + + kconf [hardware|non-hardware] CFG_FILE: + Queues a configuration fragment for merging into the final + Linux .config file. + git merge GIT_BRANCH: + Merges the feature branch into the current branch. + + patch PATCH_FILE: + Applies the patch to the current Git branch. + + +
+ +
+ diff --git a/documentation/kernel-dev/kernel-dev-common.xml b/documentation/kernel-dev/kernel-dev-common.xml new file mode 100644 index 0000000000..58cc98ddff --- /dev/null +++ b/documentation/kernel-dev/kernel-dev-common.xml @@ -0,0 +1,915 @@ + %poky; ] > + + + +Common Tasks + + + This chapter presents several common tasks you perform when you + work with the Yocto Project Linux kernel. + These tasks include preparing a layer, modifying an existing recipe, + iterative development, working with your own sources, and incorporating + out-of-tree modules. + + The examples presented in this chapter work with the Yocto Project + 1.2.2 Release and forward. + + + +
+ Creating and Preparing a Layer + + + If you are going to be modifying kernel recipes, it is recommended + that you create and prepare your own layer in which to do your + work. + Your layer contains its own + BitBake + append files + (.bbappend) and provides a convenient + mechanism to create your own recipe files + (.bb). + For details on how to create and work with layers, see the following + sections in the Yocto Project Development Manual: + + "Understanding and Creating Layers" for + general information on layers and how to create layers. + "Set Up Your Layer for the Build" for + specific instructions on setting up a layer for kernel + development. + + +
+ +
+ Modifying an Existing Recipe + + + In many cases, you can customize an existing linux-yocto recipe to + meet the needs of your project. + Each release of the Yocto Project provides a few Linux + kernel recipes from which you can choose. + These are located in the + Source Directory + in meta/recipes-kernel/linux. + + + + Modifying an existing recipe can consist of the following: + + Creating the append file + Applying patches + Changing the configuration + + + + + Before modifying an existing recipe, be sure that you have created + a minimal, custom layer from which you can work. + See the "Creating and Preparing a Layer" + section for some general resources. + You can also see the + "Set Up Your Layer for the Build" section + of the Yocto Project Development Manual for a detailed + example. + + +
+ Creating the Append File + + + You create this file in your custom layer. + You also name it accordingly based on the linux-yocto recipe + you are using. + For example, if you are modifying the + meta/recipes-kernel/linux/linux-yocto_3.4.bb + recipe, the append file will typically be located as follows + within your custom layer: + + your-layer/recipes-kernel/linux/linux-yocto_3.4.bbappend + + The append file should initially extend the + FILESPATH + search path by prepending the directory that contains your + files to the + FILESEXTRAPATHS + variable as follows: + + FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + + The path ${THISDIR}/${PN} + expands to "linux-yocto" in the current directory for this + example. + If you add any new files that modify the kernel recipe and you + have extended FILESPATH as + described above, you must place the files in your layer in the + following area: + + your-layer/recipes-kernel/linux/linux-yocto/ + + If you are working on a new machine Board Support Package + (BSP), be sure to refer to the + Yocto Project Board Support Package (BSP) Developer's Guide. + + +
+ +
+ Applying Patches + + + If you have a single patch or a small series of patches + that you want to apply to the Linux kernel source, you + can do so just as you would with any other recipe. + You first copy the patches to the path added to + FILESEXTRAPATHS + in your .bbappend file as described in + the previous section, and then reference them in + SRC_URI + statements. + + + + For example, you can apply a three-patch series by adding the + following lines to your linux-yocto .bbappend + file in your layer: + + SRC_URI += "file://0001-first-change.patch" + SRC_URI += "file://0002-first-change.patch" + SRC_URI += "file://0003-first-change.patch" + + The next time you run BitBake to build the Linux kernel, BitBake + detects the change in the recipe and fetches and applies the patches + before building the kernel. + + + + For a detailed example showing how to patch the kernel, see the + "Patching the Kernel" + section in the Yocto Project Development Manual. + +
+ +
+ Changing the Configuration + + + You can make wholesale or incremental changes to the Linux + kernel .config file by including a + defconfig and by specifying + configuration fragments in the + SRC_URI. + + + + If you have a final Linux kernel .config + file you want to use, copy it to a directory named + files, which must be in + your layer's recipes-kernel/linux + directory, and name the file "defconfig". + Then, add the following lines to your linux-yocto + .bbappend file in your layer: + + FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + SRC_URI += "file://defconfig" + + The SRC_URI tells the build system how to + search for the file, while the + FILESEXTRAPATHS + extends the + FILESPATH + variable (search directories) to include the + files directory you created for the + configuration changes. + + + + The build system applies the configurations from the + .config file before applying any + subsequent configuration fragments. + The final kernel configuration is a combination of the + configurations in the .config file and + any configuration fragments you provide. + You need to realize that if you have any configuration + fragments, the build system applies these on top of and + after applying the existing .config + file configurations. + + + + Generally speaking, the preferred approach is to determine the + incremental change you want to make and add that as a + configuration fragment. + For example, if you want to add support for a basic serial + console, create a file named 8250.cfg in + the files directory with the following + content (without indentation): + + CONFIG_SERIAL_8250=y + CONFIG_SERIAL_8250_CONSOLE=y + CONFIG_SERIAL_8250_PCI=y + CONFIG_SERIAL_8250_NR_UARTS=4 + CONFIG_SERIAL_8250_RUNTIME_UARTS=4 + CONFIG_SERIAL_CORE=y + CONFIG_SERIAL_CORE_CONSOLE=y + + Next, include this configuration fragment and extend the + FILESPATH variable in your + .bbappend file: + + FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + SRC_URI += "file://8250.cfg" + + The next time you run BitBake to build the Linux kernel, BitBake + detects the change in the recipe and fetches and applies the + new configuration before building the kernel. + + + + For a detailed example showing how to configure the kernel, + see the + "Configuring the Kernel" + section in the Yocto Project Development Manual. + +
+
+ +
+ Using an Iterative Development Process + + + If you do not have existing patches or configuration files, + you can iteratively generate them from within the BitBake build + environment as described within this section. + During an iterative workflow, running a previously completed BitBake + task causes BitBake to invalidate the tasks that follow the + completed task in the build sequence. + Invalidated tasks rebuild the next time you run the build using + BitBake. + + + + As you read this section, be sure to substitute the name + of your Linux kernel recipe for the term + "linux-yocto". + + +
+ "-dirty" String + + + + + If kernel images are being built with "-dirty" on the + end of the version string, this simply means that + modifications in the source directory have not been committed. + + $ git status + + + + + You can use the above Git command to report modified, + removed, or added files. + You should commit those changes to the tree regardless of + whether they will be saved, exported, or used. + Once you commit the changes, you need to rebuild the kernel. + + + + To force a pickup and commit of all such pending changes, + enter the following: + + $ git add . + $ git commit -s -a -m "getting rid of -dirty" + + + + + Next, rebuild the kernel. + +
+ +
+ Generating Configuration Files + + + You can manipulate the .config file + used to build a linux-yocto recipe with the + menuconfig command as follows: + + $ bitbake linux-yocto -c menuconfig + + This command starts the Linux kernel configuration tool, + which allows you to prepare a new + .config file for the build. + When you exit the tool, be sure to save your changes + at the prompt. + + + + The resulting .config file is + located in + ${WORKDIR} under the + linux-${MACHINE}-${KTYPE}-build directory. + You can use the entire .config file as the + defconfig file as described in the + "Changing the Configuration" section. + + + + A better method is to create a configuration fragment using the + differences between two configuration files: one previously + created and saved, and one freshly created using the + menuconfig tool. + + + + To create a configuration fragment using this method, follow + these steps: + + Complete a build at least through the kernel + configuration task as follows: + + $ bitbake linux-yocto -c kernel_configme -f + + Run the menuconfig + command: + + $ bitbake linux-yocto -c menuconfig + + Run the diffconfig + command to prepare a configuration fragment. + The resulting file fragment.cfg + will be placed in the + ${WORKDIR} directory: + + $ bitbake linux-yocto -c diffconfig + + + + + + The diffconfig command creates a file that is a + list of Linux kernel CONFIG_ assignments. + See the "Changing the Configuration" + section for information on how to use the output as a + configuration fragment. + + You can also use this method to create configuration + fragments for a BSP. + See the "BSP Descriptions" + section for more information. + + + + + The kernel tools also provide configuration validation. + You can use these tools to produce warnings for when a + requested configuration does not appear in the final + .config file or when you override a + policy configuration in a hardware configuration fragment. + Here is an example with some sample output of the command + that runs these tools: + + $ bitbake linux-yocto -c kernel_configcheck -f + + ... + + NOTE: validating kernel configuration + This BSP sets 3 invalid/obsolete kernel options. + These config options are not offered anywhere within this kernel. + The full list can be found in your kernel src dir at: + meta/cfg/standard/mybsp/invalid.cfg + + This BSP sets 21 kernel options that are possibly non-hardware related. + The full list can be found in your kernel src dir at: + meta/cfg/standard/mybsp/specified_non_hdw.cfg + + WARNING: There were 2 hardware options requested that do not + have a corresponding value present in the final ".config" file. + This probably means you are not't getting the config you wanted. + The full list can be found in your kernel src dir at: + meta/cfg/standard/mybsp/mismatch.cfg + + + + + The output describes the various problems that you can + encounter along with where to find the offending configuration + items. + You can use the information in the logs to adjust your + configuration files and then repeat the + kernel_configme and + kernel_configcheck commands until + they produce no warnings. + + + + For more information on how to use the + menuconfig tool, see the + "Using menuconfig" + section in the Yocto Project Development Manual. + +
+ +
+ Modifying Source Code + + + You can experiment with source code changes and create a + simple patch without leaving the BitBake environment. + To get started, be sure to complete a build at + least through the kernel configuration task: + + $ bitbake linux-yocto -c kernel_configme -f + + Taking this step ensures you have the sources prepared + and the configuration completed. + You can find the sources in the + ${WORKDIR}/linux directory. + + + + You can edit the sources as you would any other Linux source + tree. + However, keep in mind that you will lose changes if you + trigger the + do_fetch + task for the recipe. + You can avoid triggering this task by not using BitBake to + run the + cleanall, + cleansstate, + or forced + fetch + commands. + Also, do not modify the recipe itself while working + with temporary changes or BitBake might run the + fetch command depending on the + changes to the recipe. + + + + To test your temporary changes, instruct BitBake to run the + compile again. + The -f option forces the command to run + even though BitBake might think it has already done so: + + $ bitbake linux-yocto -c compile -f + + If the compile fails, you can update the sources and repeat + the compile. + Once compilation is successful, you can inspect and test + the resulting build (i.e. kernel, modules, and so forth) from + the Build Directory: + + ${WORKDIR}/linux-${MACHINE}-${KTYPE}-build + + Alternatively, you can run the deploy + command to place the kernel image in the + tmp/deploy/images directory: + + $ bitbake linux-yocto -c deploy + + And, of course, you can perform the remaining installation and + packaging steps by issuing: + + $ bitbake linux-yocto + + + + + For rapid iterative development, the edit-compile-repeat loop + described in this section is preferable to rebuilding the + entire recipe because the installation and packaging tasks + are very time consuming. + + + + Once you are satisfied with your source code modifications, + you can make them permanent by generating patches and + applying them to the + SRC_URI + statement as described in the + "Applying Patches" + section. + If you are not familiar with generating patches, refer to the + "Creating the Patch" + section in the Yocto Project Development Manual. + +
+
+ +
+ Working With Your Own Sources + + + If you cannot work with one of the Linux kernel + versions supported by existing linux-yocto recipes, you can + still make use of the Yocto Project Linux kernel tooling by + working with your own sources. + When you use your own sources, you will not be able to + leverage the existing kernel + Metadata and + stabilization work of the linux-yocto sources. + However, you will be able to manage your own Metadata in the same + format as the linux-yocto sources. + Maintaining format compatibility facilitates converging with + linux-yocto on a future, mutually-supported kernel version. + + + + To help you use your own sources, the Yocto Project provides a + linux-yocto custom recipe + (linux-yocto-custom.bb) that uses + kernel.org sources + and the Yocto Project Linux kernel tools for managing + kernel Metadata. + You can find this recipe in the + poky Git repository of the + Yocto Project Source Repository + at: + + poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb + + + + + Here are some basic steps you can use to work with your own sources: + + Copy the linux-yocto-custom.bb + recipe to your layer and give it a meaningful name. + The name should include the version of the Linux kernel you + are using (e.g. linux-yocto-myproject_3.5.bb, + where "3.5" is the base version of the Linux kernel + with which you would be working). + In the same directory inside your layer, + create a matching directory + to store your patches and configuration files (e.g. + linux-yocto-myproject). + + Edit the following variables in your recipe + as appropriate for your project: + + SRC_URI: + The SRC_URI should be a Git + repository that uses one of the supported Git fetcher + protocols (i.e. file, + git, http, + and so forth). + The skeleton recipe provides an example + SRC_URI as a syntax reference. + + LINUX_VERSION: + The Linux kernel version you are using (e.g. + "3.4"). + LINUX_VERSION_EXTENSION: + The Linux kernel CONFIG_LOCALVERSION + that is compiled into the resulting kernel and visible + through the uname command. + + SRCREV: + The commit ID from which you want to build. + + PR: + Treat this variable the same as you would in any other + recipe. + Increment the variable to indicate to the OpenEmbedded + build system that the recipe has changed. + + PV: + The default PV assignment is + typically adequate. + It combines the LINUX_VERSION + with the Source Control Manager (SCM) revision + as derived from the + SRCPV + variable. + The combined results are a string with + the following form: + + 3.4.11+git1+68a635bf8dfb64b02263c1ac80c948647cc76d5f_1+218bd8d2022b9852c60d32f0d770931e3cf343e2 + + While lengthy, the extra verbosity in PV + helps ensure you are using the exact + sources from which you intend to build. + + COMPATIBLE_MACHINE: + A list of the machines supported by your new recipe. + This variable in the example recipe is set + by default to a regular expression that matches + only the empty string, "(^$)". + This default setting triggers an explicit build + failure. + You must change it to match a list of the machines + that your new recipe supports. + For example, to support the qemux86 + and qemux86-64 machines, use + the following form: + + COMPATIBLE_MACHINE = "qemux86|qemux86-64" + + + Provide further customizations to your recipe + as needed just as you would customize an existing + linux-yocto recipe. + See the "Modifying + an Existing Recipe" section for information. + + + +
+ +
+ Working with Out-of-Tree Modules + + + This section describes steps to build out-of-tree modules on + your target and describes how to incorporate out-of-tree modules + in the build. + + +
+ Building Out-of-Tree Modules on the Target + + + If you want to be able to build out-of-tree modules on + the target, there are some steps you need to take + on the target that is running your SDK image. + Briefly, the kernel-dev package + is installed by default on all + *.sdk images. + However, you need to create some scripts prior to + attempting to build the out-of-tree modules on the target + that is running that image. + + + + Prior to attempting to build the out-of-tree modules, + you need to be on the target as root and you need to + change to the /usr/src/kernel directory. + Next, make the scripts: + + # cd /usr/src/kernel + # make scripts + + Because all SDK image recipes include + dev-pkgs, the + kernel-dev packages will be installed + as part of the SDK image. + The SDK uses the scripts when building out-of-tree + modules. + Once you have switched to that directory and created the + scripts, you should be able to build your out-of-tree modules + on the target. + +
+ +
+ Incorporating Out-of-Tree Modules + + + While it is always preferable to work with sources integrated + into the Linux kernel sources, if you need an external kernel + module, the hello-mod.bb recipe is + available as a template from which you can create your + own out-of-tree Linux kernel module recipe. + + + + This template recipe is located in the + poky Git repository of the + Yocto Project Source Repository + at: + + poky/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb + + + + + To get started, copy this recipe to your layer and give it a + meaningful name (e.g. mymodule_1.0.bb). + In the same directory, create a new directory named + files where you can store any source files, + patches, or other files necessary for building + the module that do not come with the sources. + Finally, update the recipe as needed for the module. + Typically, you will need to set the following variables: + + DESCRIPTION + + LICENSE* + + SRC_URI + + PV + + + + + + Depending on the build system used by the module sources, + you might need to make some adjustments. + For example, a typical module Makefile + looks much like the one provided with the + hello-mod template: + + obj-m := hello.o + + SRC := $(shell pwd) + + all: + $(MAKE) -C $(KERNEL_SRC) M=$(SRC) + + modules_install: + $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install + ... + + + + + The important point to note here is the + KERNEL_SRC + variable. + The + module + class sets this variable and the + KERNEL_PATH + variable to + ${STAGING_KERNEL_DIR} + with the necessary Linux kernel build information to build + modules. + If your module Makefile uses a different + variable, you might want to override the + do_compile() + step, or create a patch to + the Makefile to work with the more typical + KERNEL_SRC or + KERNEL_PATH variables. + + + + After you have prepared your recipe, you will likely want to + include the module in your images. + To do this, see the documentation for the following variables in + the Yocto Project Reference Manual and set one of them + appropriately for your machine configuration file: + + MACHINE_ESSENTIAL_EXTRA_RDEPENDS + + MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS + + MACHINE_EXTRA_RDEPENDS + + MACHINE_EXTRA_RRECOMMENDS + + + + + + Modules are often not required for boot and can be excluded from + certain build configurations. + The following allows for the most flexibility: + + MACHINE_EXTRA_RRECOMMENDS += "kernel-module-mymodule" + + The value is derived by appending the module filename without + the .ko extension to the string + "kernel-module-". + + + + Because the variable is + RRECOMMENDS + and not a + RDEPENDS + variable, the build will not fail if this module is not + available to include in the image. + +
+
+ + +
+ Inspecting Changes and Commits + + + A common question when working with a kernel is: + "What changes have been applied to this tree?" + Rather than using "grep" across directories to see what has + changed, you can use Git to inspect or search the kernel tree. + Using Git is an efficient way to see what has changed in the tree. + + +
+ What Changed in a Kernel? + + + Following are a few examples that show how to use Git + commands to examine changes. + These examples are by no means the only way to see changes. + + In the following examples, unless you provide a commit + range, kernel.org history is blended + with Yocto Project kernel changes. + You can form ranges by using branch names from the + kernel tree as the upper and lower commit markers with + the Git commands. + You can see the branch names through the web interface + to the Yocto Project source repositories at + . + + To see a full range of the changes, use the + git whatchanged command and specify a + commit range for the branch + (<commit>..<commit>). + + + + Here is an example that looks at what has changed in the + emenlow branch of the + linux-yocto-3.4 kernel. + The lower commit range is the commit associated with the + standard/base branch, while + the upper commit range is the commit associated with the + standard/emenlow branch. + + $ git whatchanged origin/standard/base..origin/standard/emenlow + + + + + To see short, one line summaries of changes use the + git log command: + + $ git log --oneline origin/standard/base..origin/standard/emenlow + + + + + Use this command to see code differences for the changes: + + $ git diff origin/standard/base..origin/standard/emenlow + + + + + Use this command to see the commit log messages and the + text differences: + + $ git show origin/standard/base..origin/standard/emenlow + + + + + Use this command to create individual patches for + each change. + Here is an example that that creates patch files for each + commit and places them in your Documents + directory: + + $ git format-patch -o $HOME/Documents origin/standard/base..origin/standard/emenlow + + +
+ +
+ Showing a Particular Feature or Branch Change + + + Tags in the Yocto Project kernel tree divide changes for + significant features or branches. + The git show <tag> command shows + changes based on a tag. + Here is an example that shows systemtap + changes: + + $ git show systemtap + + You can use the + git branch --contains <tag> command + to show the branches that contain a particular feature. + This command shows the branches that contain the + systemtap feature: + + $ git branch --contains systemtap + + +
+
+
+ diff --git a/documentation/kernel-dev/kernel-dev-concepts-appx.xml b/documentation/kernel-dev/kernel-dev-concepts-appx.xml new file mode 100644 index 0000000000..ac91749cd6 --- /dev/null +++ b/documentation/kernel-dev/kernel-dev-concepts-appx.xml @@ -0,0 +1,253 @@ + %poky; ] > + + +Advanced Kernel Concepts + +
+ Yocto Project Kernel Development and Maintenance + + Kernels available through the Yocto Project, like other kernels, are based off the Linux + kernel releases from . + At the beginning of a major development cycle, the Yocto Project team + chooses its kernel based on factors such as release timing, the anticipated release + timing of final upstream kernel.org versions, and Yocto Project + feature requirements. + Typically, the kernel chosen is in the + final stages of development by the community. + In other words, the kernel is in the release + candidate or "rc" phase and not yet a final release. + But, by being in the final stages of external development, the team knows that the + kernel.org final release will clearly be within the early stages of + the Yocto Project development window. + + + This balance allows the team to deliver the most up-to-date kernel + possible, while still ensuring that the team has a stable official release for + the baseline Linux kernel version. + + + The ultimate source for kernels available through the Yocto Project are released kernels + from kernel.org. + In addition to a foundational kernel from kernel.org, the + kernels available contain a mix of important new mainline + developments, non-mainline developments (when there is no alternative), + Board Support Package (BSP) developments, + and custom features. + These additions result in a commercially released Yocto Project Linux kernel that caters + to specific embedded designer needs for targeted hardware. + + + Once a kernel is officially released, the Yocto Project team goes into + their next development cycle, or upward revision (uprev) cycle, while still + continuing maintenance on the released kernel. + It is important to note that the most sustainable and stable way + to include feature development upstream is through a kernel uprev process. + Back-porting hundreds of individual fixes and minor features from various + kernel versions is not sustainable and can easily compromise quality. + + + During the uprev cycle, the Yocto Project team uses an ongoing analysis of + kernel development, BSP support, and release timing to select the best + possible kernel.org version. + The team continually monitors community kernel + development to look for significant features of interest. + The team does consider back-porting large features if they have a significant advantage. + User or community demand can also trigger a back-port or creation of new + functionality in the Yocto Project baseline kernel during the uprev cycle. + + + Generally speaking, every new kernel both adds features and introduces new bugs. + These consequences are the basic properties of upstream kernel development and are + managed by the Yocto Project team's kernel strategy. + It is the Yocto Project team's policy to not back-port minor features to the released kernel. + They only consider back-porting significant technological jumps - and, that is done + after a complete gap analysis. + The reason for this policy is that back-porting any small to medium sized change + from an evolving kernel can easily create mismatches, incompatibilities and very + subtle errors. + + + These policies result in both a stable and a cutting + edge kernel that mixes forward ports of existing features and significant and critical + new functionality. + Forward porting functionality in the kernels available through the Yocto Project kernel + can be thought of as a "micro uprev." + The many “micro uprevs” produce a kernel version with a mix of + important new mainline, non-mainline, BSP developments and feature integrations. + This kernel gives insight into new features and allows focused + amounts of testing to be done on the kernel, which prevents + surprises when selecting the next major uprev. + The quality of these cutting edge kernels is evolving and the kernels are used in leading edge + feature and BSP development. + +
+ +
+ Kernel Architecture + + This section describes the architecture of the kernels available through the + Yocto Project and provides information + on the mechanisms used to achieve that architecture. + + +
+ Overview + + As mentioned earlier, a key goal of the Yocto Project is to present the + developer with + a kernel that has a clear and continuous history that is visible to the user. + The architecture and mechanisms used achieve that goal in a manner similar to the + upstream kernel.org. + + + You can think of a Yocto Project kernel as consisting of a baseline Linux kernel with + added features logically structured on top of the baseline. + The features are tagged and organized by way of a branching strategy implemented by the + source code manager (SCM) Git. + For information on Git as applied to the Yocto Project, see the + "Git" section in the + Yocto Project Development Manual. + + + The result is that the user has the ability to see the added features and + the commits that make up those features. + In addition to being able to see added features, the user can also view the history of what + made up the baseline kernel. + + + The following illustration shows the conceptual Yocto Project kernel. + + + + + + In the illustration, the "Kernel.org Branch Point" + marks the specific spot (or release) from + which the Yocto Project kernel is created. + From this point "up" in the tree, features and differences are organized and tagged. + + + The "Yocto Project Baseline Kernel" contains functionality that is common to every kernel + type and BSP that is organized further up the tree. + Placing these common features in the + tree this way means features do not have to be duplicated along individual branches of the + structure. + + + From the Yocto Project Baseline Kernel, branch points represent specific functionality + for individual BSPs as well as real-time kernels. + The illustration represents this through three BSP-specific branches and a real-time + kernel branch. + Each branch represents some unique functionality for the BSP or a real-time kernel. + + + In this example structure, the real-time kernel branch has common features for all + real-time kernels and contains + more branches for individual BSP-specific real-time kernels. + The illustration shows three branches as an example. + Each branch points the way to specific, unique features for a respective real-time + kernel as they apply to a given BSP. + + + The resulting tree structure presents a clear path of markers (or branches) to the + developer that, for all practical purposes, is the kernel needed for any given set + of requirements. + +
+ +
+ Branching Strategy and Workflow + + The Yocto Project team creates kernel branches at points where functionality is + no longer shared and thus, needs to be isolated. + For example, board-specific incompatibilities would require different functionality + and would require a branch to separate the features. + Likewise, for specific kernel features, the same branching strategy is used. + + + This branching strategy results in a tree that has features organized to be specific + for particular functionality, single kernel types, or a subset of kernel types. + This strategy also results in not having to store the same feature twice + internally in the tree. + Rather, the kernel team stores the unique differences required to apply the + feature onto the kernel type in question. + + The Yocto Project team strives to place features in the tree such that they can be + shared by all boards and kernel types where possible. + However, during development cycles or when large features are merged, + the team cannot always follow this practice. + In those cases, the team uses isolated branches to merge features. + + + + BSP-specific code additions are handled in a similar manner to kernel-specific additions. + Some BSPs only make sense given certain kernel types. + So, for these types, the team creates branches off the end of that kernel type for all + of the BSPs that are supported on that kernel type. + From the perspective of the tools that create the BSP branch, the BSP is really no + different than a feature. + Consequently, the same branching strategy applies to BSPs as it does to features. + So again, rather than store the BSP twice, the team only stores the unique + differences for the BSP across the supported multiple kernels. + + + While this strategy can result in a tree with a significant number of branches, it is + important to realize that from the developer's point of view, there is a linear + path that travels from the baseline kernel.org, through a select + group of features and ends with their BSP-specific commits. + In other words, the divisions of the kernel are transparent and are not relevant + to the developer on a day-to-day basis. + From the developer's perspective, this path is the "master" branch. + The developer does not need to be aware of the existence of any other branches at all. + Of course, there is value in the existence of these branches + in the tree, should a person decide to explore them. + For example, a comparison between two BSPs at either the commit level or at the line-by-line + code diff level is now a trivial operation. + + + Working with the kernel as a structured tree follows recognized community best practices. + In particular, the kernel as shipped with the product, should be + considered an "upstream source" and viewed as a series of + historical and documented modifications (commits). + These modifications represent the development and stabilization done + by the Yocto Project kernel development team. + + + Because commits only change at significant release points in the product life cycle, + developers can work on a branch created + from the last relevant commit in the shipped Yocto Project kernel. + As mentioned previously, the structure is transparent to the developer + because the kernel tree is left in this state after cloning and building the kernel. + +
+ +
+ Source Code Manager - Git + + The Source Code Manager (SCM) is Git. + This SCM is the obvious mechanism for meeting the previously mentioned goals. + Not only is it the SCM for kernel.org but, + Git continues to grow in popularity and supports many different work flows, + front-ends and management techniques. + + + You can find documentation on Git at . + You can also get an introduction to Git as it applies to the Yocto Project in the + "Git" + section in the Yocto Project Development Manual. + These referenced sections overview Git and describe a minimal set of + commands that allows you to be functional using Git. + + You can use as much, or as little, of what Git has to offer to accomplish what + you need for your project. + You do not have to be a "Git Master" in order to use it with the Yocto Project. + + +
+
+
+ diff --git a/documentation/kernel-dev/kernel-dev-customization.xsl b/documentation/kernel-dev/kernel-dev-customization.xsl new file mode 100644 index 0000000000..8676d66c3a --- /dev/null +++ b/documentation/kernel-dev/kernel-dev-customization.xsl @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + A + + + + diff --git a/documentation/kernel-dev/kernel-dev-eclipse-customization.xsl b/documentation/kernel-dev/kernel-dev-eclipse-customization.xsl new file mode 100644 index 0000000000..7d1bb8dc08 --- /dev/null +++ b/documentation/kernel-dev/kernel-dev-eclipse-customization.xsl @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + A + + + diff --git a/documentation/kernel-dev/kernel-dev-examples.xml b/documentation/kernel-dev/kernel-dev-examples.xml new file mode 100644 index 0000000000..9d9aef6d06 --- /dev/null +++ b/documentation/kernel-dev/kernel-dev-examples.xml @@ -0,0 +1,918 @@ + %poky; ] > + + + +Working with the Yocto Project Kernel + + +
+ Introduction + + This chapter describes how to accomplish tasks involving a kernel's tree structure. + The information is designed to help the developer that wants to modify the Yocto + Project kernel and contribute changes upstream to the Yocto Project. + The information covers the following: + + Tree construction + Build strategies + Workflow examples + + +
+ +
+ Tree Construction + + This section describes construction of the Yocto Project kernel source repositories + as accomplished by the Yocto Project team to create kernel repositories. + These kernel repositories are found under the heading "Yocto Linux Kernel" at + &YOCTO_GIT_URL;/cgit.cgi + and can be shipped as part of a Yocto Project release. + The team creates these repositories by + compiling and executing the set of feature descriptions for every BSP/feature + in the product. + Those feature descriptions list all necessary patches, + configuration, branching, tagging and feature divisions found in a kernel. + Thus, the Yocto Project kernel repository (or tree) is built. + + + The existence of this tree allows you to access and clone a particular + Yocto Project kernel repository and use it to build images based on their configurations + and features. + + + You can find the files used to describe all the valid features and BSPs + in the Yocto Project kernel in any clone of the Yocto Project kernel source repository + Git tree. + For example, the following command clones the Yocto Project baseline kernel that + branched off of linux.org version 3.4: + + $ git clone git://git.yoctoproject.org/linux-yocto-3.4 + + For another example of how to set up a local Git repository of the Yocto Project + kernel files, see the + "Yocto Project Kernel" bulleted + item in the Yocto Project Development Manual. + + + Once you have cloned the kernel Git repository on your local machine, you can + switch to the meta branch within the repository. + Here is an example that assumes the local Git repository for the kernel is in + a top-level directory named linux-yocto-3.4: + + $ cd ~/linux-yocto-3.4 + $ git checkout -b meta origin/meta + + Once you have checked out and switched to the meta branch, + you can see a snapshot of all the kernel configuration and feature descriptions that are + used to build that particular kernel repository. + These descriptions are in the form of .scc files. + + + You should realize, however, that browsing your local kernel repository + for feature descriptions and patches is not an effective way to determine what is in a + particular kernel branch. + Instead, you should use Git directly to discover the changes in a branch. + Using Git is an efficient and flexible way to inspect changes to the kernel. + For examples showing how to use Git to inspect kernel commits, see the following sections + in this chapter. + + Ground up reconstruction of the complete kernel tree is an action only taken by the + Yocto Project team during an active development cycle. + When you create a clone of the kernel Git repository, you are simply making it + efficiently available for building and development. + + + + The following steps describe what happens when the Yocto Project Team constructs + the Yocto Project kernel source Git repository (or tree) found at + given the + introduction of a new top-level kernel feature or BSP. + These are the actions that effectively create the tree + that includes the new feature, patch or BSP: + + A top-level kernel feature is passed to the kernel build subsystem. + Normally, this feature is a BSP for a particular kernel type. + The file that describes the top-level feature is located by searching + these system directories: + + The in-tree kernel-cache directories, which are located + in meta/cfg/kernel-cache + Areas pointed to by SRC_URI statements + found in recipes + + For a typical build, the target of the search is a + feature description in an .scc file + whose name follows this format: + + <bsp_name>-<kernel_type>.scc + + + Once located, the feature description is either compiled into a simple script + of actions, or into an existing equivalent script that is already part of the + shipped kernel. + Extra features are appended to the top-level feature description. + These features can come from the + KERNEL_FEATURES + variable in recipes. + Each extra feature is located, compiled and appended to the script + as described in step three. + The script is executed to produce a series of meta-* + directories. + These directories are descriptions of all the branches, tags, patches and configurations that + need to be applied to the base Git repository to completely create the + source (build) branch for the new BSP or feature. + The base repository is cloned, and the actions + listed in the meta-* directories are applied to the + tree. + The Git repository is left with the desired branch checked out and any + required branching, patching and tagging has been performed. + + + + The kernel tree is now ready for developer consumption to be locally cloned, + configured, and built into a Yocto Project kernel specific to some target hardware. + The generated meta-* directories add to the kernel + as shipped with the Yocto Project release. + Any add-ons and configuration data are applied to the end of an existing branch. + The full repository generation that is found in the + official Yocto Project kernel repositories at + http://git.yoctoproject.org/cgit.cgi + is the combination of all supported boards and configurations. + The technique the Yocto Project team uses is flexible and allows for seamless + blending of an immutable history with additional patches specific to a + deployment. + Any additions to the kernel become an integrated part of the branches. + + +
+ +
+ Build Strategy + + Once a local Git repository of the Yocto Project kernel exists on a development system, + you can consider the compilation phase of kernel development - building a kernel image. + Some prerequisites exist that are validated by the build process before compilation + starts: + + + + The + SRC_URI points + to the kernel Git repository. + A BSP build branch exists. + This branch has the following form: + + <kernel_type>/<bsp_name> + + + + + The OpenEmbedded build system makes sure these conditions exist before attempting compilation. + Other means, however, do exist, such as as bootstrapping a BSP, see + the "Workflow Examples". + + + + Before building a kernel, the build process verifies the tree + and configures the kernel by processing all of the + configuration "fragments" specified by feature descriptions in the .scc + files. + As the features are compiled, associated kernel configuration fragments are noted + and recorded in the meta-* series of directories in their compilation order. + The fragments are migrated, pre-processed and passed to the Linux Kernel + Configuration subsystem (lkc) as raw input in the form + of a .config file. + The lkc uses its own internal dependency constraints to do the final + processing of that information and generates the final .config file + that is used during compilation. + + + + Using the board's architecture and other relevant values from the board's template, + kernel compilation is started and a kernel image is produced. + + + + The other thing that you notice once you configure a kernel is that + the build process generates a build tree that is separate from your kernel's local Git + source repository tree. + This build tree has a name that uses the following form, where + ${MACHINE} is the metadata name of the machine (BSP) and "kernel_type" is one + of the Yocto Project supported kernel types (e.g. "standard"): + + linux-${MACHINE}-<kernel_type>-build + + + + + The existing support in the kernel.org tree achieves this + default functionality. + + + + This behavior means that all the generated files for a particular machine or BSP are now in + the build tree directory. + The files include the final .config file, all the .o + files, the .a files, and so forth. + Since each machine or BSP has its own separate build directory in its own separate branch + of the Git repository, you can easily switch between different builds. + +
+ +
+ Workflow Examples + + + As previously noted, the Yocto Project kernel has built-in Git integration. + However, these utilities are not the only way to work with the kernel repository. + The Yocto Project has not made changes to Git or to other tools that + would invalidate alternate workflows. + Additionally, the way the kernel repository is constructed results in using + only core Git functionality, thus allowing any number of tools or front ends to use the + resulting tree. + + + + This section contains several workflow examples. + Many of the examples use Git commands. + You can find Git documentation at + . + You can find a simple overview of using Git with the Yocto Project in the + "Git" + section of the Yocto Project Development Manual. + + +
+ Change Inspection: Changes/Commits + + + A common question when working with a kernel is: + "What changes have been applied to this tree?" + + + + In projects that have a collection of directories that + contain patches to the kernel, it is possible to inspect or "grep" the contents + of the directories to get a general feel for the changes. + This sort of patch inspection is not an efficient way to determine what has been + done to the kernel. + The reason it is inefficient is because there are many optional patches that are + selected based on the kernel type and the feature description. + Additionally, patches could exist in directories that are not included in the search. + + + + A more efficient way to determine what has changed in the branch is to use + Git and inspect or search the kernel tree. + This method gives you a full view of not only the source code modifications, + but also provides the reasons for the changes. + + +
+ What Changed in a Kernel? + + + Following are a few examples that show how to use Git commands to examine changes. + Because Git repositories in the Yocto Project do not break existing Git + functionality, and because there exists many permutations of these types of + Git commands, many methods exist by which you can discover changes. + + In the following examples, unless you provide a commit range, + kernel.org history is blended with Yocto Project + kernel changes. + You can form ranges by using branch names from the kernel tree as the + upper and lower commit markers with the Git commands. + You can see the branch names through the web interface to the + Yocto Project source repositories at + . + For example, the branch names for the linux-yocto-3.4 + kernel repository can be seen at + . + + To see a full range of the changes, use the + git whatchanged command and specify a commit range + for the branch (<commit>..<commit>). + + + + Here is an example that looks at what has changed in the + emenlow branch of the + linux-yocto-3.4 kernel. + The lower commit range is the commit associated with the + standard/base branch, while + the upper commit range is the commit associated with the + standard/emenlow branch. + + $ git whatchanged origin/standard/base..origin/standard/emenlow + + + + + To see a summary of changes use the git log command. + Here is an example using the same branches: + + $ git log --oneline origin/standard/base..origin/standard/emenlow + + The git log output might be more useful than + the git whatchanged as you get + a short, one-line summary of each change and not the entire commit. + + + + If you want to see code differences associated with all the changes, use + the git diff command. + Here is an example: + + $ git diff origin/standard/base..origin/standard/emenlow + + + + + You can see the commit log messages and the text differences using the + git show command: + Here is an example: + + $ git show origin/standard/base..origin/standard/emenlow + + + + + You can create individual patches for each change by using the + git format-patch command. + Here is an example that that creates patch files for each commit and + places them in your Documents directory: + + $ git format-patch -o $HOME/Documents origin/standard/base..origin/standard/emenlow + + +
+ +
+ Show a Particular Feature or Branch Change + + + Developers use tags in the Yocto Project kernel tree to divide changes for significant + features or branches. + Once you know a particular tag, you can use Git commands + to show changes associated with the tag and find the branches that contain + the feature. + + Because BSP branch, kernel.org, and feature tags are all + present, there could be many tags. + + The git show <tag> command shows changes that are tagged by + a feature. + Here is an example that shows changes tagged by the systemtap + feature: + + $ git show systemtap + + You can use the git branch --contains <tag> command + to show the branches that contain a particular feature. + This command shows the branches that contain the systemtap + feature: + + $ git branch --contains systemtap + + + + + You can use many other comparisons to isolate BSP and kernel changes. + For example, you can compare against kernel.org tags + such as the v3.4 tag. + +
+
+ +
+ Development: Saving Kernel Modifications + + + Another common operation is to build a BSP supplied by the Yocto Project, make some + changes, rebuild, and then test. + Those local changes often need to be exported, shared or otherwise maintained. + + + + Since the Yocto Project kernel source tree is backed by Git, this activity is + much easier as compared to with previous releases. + Because Git tracks file modifications, additions and deletions, it is easy + to modify the code and later realize that you need to save the changes. + It is also easy to determine what has changed. + This method also provides many tools to commit, undo and export those modifications. + + + + This section and its sub-sections, describe general application of Git's + push and pull commands, which are used to + get your changes upstream or source your code from an upstream repository. + The Yocto Project provides scripts that help you work in a collaborative development + environment. + For information on these scripts, see the + "Using Scripts to Push a Change + Upstream and Request a Pull" and + "Using Email to Submit a Patch" + sections in the Yocto Project Development Manual. + + + + There are many ways to save kernel modifications. + The technique employed + depends on the destination for the patches: + + + Bulk storage + Internal sharing either through patches or by using Git + External submissions + Exporting for integration into another Source Code + Manager (SCM) + + + + + Because of the following list of issues, the destination of the patches also influences + the method for gathering them: + + + Bisectability + Commit headers + Division of subsystems for separate submission or review + + + +
+ Bulk Export + + + This section describes how you can "bulk" export changes that have not + been separated or divided. + This situation works well when you are simply storing patches outside of the kernel + source repository, either permanently or temporarily, and you are not committing + incremental changes during development. + + This technique is not appropriate for full integration of upstream submission + because changes are not properly divided and do not provide an avenue for per-change + commit messages. + Therefore, this example assumes that changes have not been committed incrementally + during development and that you simply must gather and export them. + + + # bulk export of ALL modifications without separation or division + # of the changes + + $ git add . + $ git commit -s -a -m <msg> + or + $ git commit -s -a # and interact with $EDITOR + + + + + The previous operations capture all the local changes in the project source + tree in a single Git commit. + And, that commit is also stored in the project's source tree. + + + + Once the changes are exported, you can restore them manually using a template + or through integration with the default_kernel. + + +
+ +
+ Incremental/Planned Sharing + + + This section describes how to save modifications when you are making incremental + commits or practicing planned sharing. + The examples in this section assume that you have incrementally committed + changes to the tree during development and now need to export them. + The sections that follow + describe how you can export your changes internally through either patches or by + using Git commands. + + + + During development, the following commands are of interest. + For full Git documentation, refer to the Git documentation at + . + + + # edit a file + $ vi <path>/file + # stage the change + $ git add <path>/file + # commit the change + $ git commit -s + # remove a file + $ git rm <path>/file + # commit the change + $ git commit -s + + ... etc. + + + + + Distributed development with Git is possible when you use a universally + agreed-upon unique commit identifier (set by the creator of the commit) that maps to a + specific change set with a specific parent. + This identifier is created for you when + you create a commit, and is re-created when you amend, alter or re-apply + a commit. + As an individual in isolation, this is of no interest. + However, if you + intend to share your tree with normal Git push and + pull operations for + distributed development, you should consider the ramifications of changing a + commit that you have already shared with others. + + + + Assuming that the changes have not been pushed upstream, or pulled into + another repository, you can update both the commit content and commit messages + associated with development by using the following commands: + + + $ Git add <path>/file + $ Git commit --amend + $ Git rebase or Git rebase -i + + + + + Again, assuming that the changes have not been pushed upstream, and that + no pending works-in-progress exist (use git status to check), then + you can revert (undo) commits by using the following commands: + + + # remove the commit, update working tree and remove all + # traces of the change + $ git reset --hard HEAD^ + # remove the commit, but leave the files changed and staged for re-commit + $ git reset --soft HEAD^ + # remove the commit, leave file change, but not staged for commit + $ git reset --mixed HEAD^ + + + + + You can create branches, "cherry-pick" changes, or perform any number of Git + operations until the commits are in good order for pushing upstream + or for pull requests. + After a push or pull command, + commits are normally considered + "permanent" and you should not modify them. + If the commits need to be changed, you can incrementally do so with new commits. + These practices follow standard Git workflow and the kernel.org best + practices, which is recommended. + + It is recommended to tag or branch before adding changes to a Yocto Project + BSP or before creating a new one. + The reason for this recommendation is because the branch or tag provides a + reference point to facilitate locating and exporting local changes. + + + +
+ Exporting Changes Internally by Using Patches + + + This section describes how you can extract committed changes from a working directory + by exporting them as patches. + Once the changes have been extracted, you can use the patches for upstream submission, + place them in a Yocto Project template for automatic kernel patching, + or apply them in many other common uses. + + + + This example shows how to create a directory with sequentially numbered patches. + Once the directory is created, you can apply it to a repository using the + git am command to reproduce the original commit and all + the related information such as author, date, commit log, and so forth. + + The new commit identifiers (ID) will be generated upon re-application. + This action reflects that the commit is now applied to an underlying commit + with a different ID. + + + # <first-commit> can be a tag if one was created before development + # began. It can also be the parent branch if a branch was created + # before development began. + + $ git format-patch -o <dir> <first commit>..<last commit> + + + + + In other words: + + # Identify commits of interest. + + # If the tree was tagged before development + $ git format-patch -o <save dir> <tag> + + # If no tags are available + $ git format-patch -o <save dir> HEAD^ # last commit + $ git format-patch -o <save dir> HEAD^^ # last 2 commits + $ git whatchanged # identify last commit + $ git format-patch -o <save dir> <commit id> + $ git format-patch -o <save dir> <rev-list> + + +
+ +
+ Exporting Changes Internally by Using Git + + + This section describes how you can export changes from a working directory + by pushing the changes into a master repository or by making a pull request. + Once you have pushed the changes to the master repository, you can then + pull those same changes into a new kernel build at a later time. + + + + Use this command form to push the changes: + + $ git push ssh://<master_server>/<path_to_repo> + <local_branch>:<remote_branch> + + + + + For example, the following command pushes the changes from your local branch + yocto/standard/common-pc/base to the remote branch with the same name + in the master repository //git.mycompany.com/pub/git/kernel-3.4. + + $ git push ssh://git.mycompany.com/pub/git/kernel-3.4 \ + yocto/standard/common-pc/base:yocto/standard/common-pc/base + + + + + A pull request entails using the git request-pull command to compose + an email to the + maintainer requesting that a branch be pulled into the master repository, see + for an example. + + Other commands such as git stash or branching can also be used to save + changes, but are not covered in this document. + + +
+
+ +
+ Exporting Changes for External (Upstream) Submission + + + This section describes how to export changes for external upstream submission. + If the patch series is large or the maintainer prefers to pull + changes, you can submit these changes by using a pull request. + However, it is common to send patches as an email series. + This method allows easy review and integration of the changes. + + Before sending patches for review be sure you understand the + community standards for submitting and documenting changes and follow their best practices. + For example, kernel patches should follow standards such as: + + + + Documentation/SubmittingPatches (in any linux + kernel source tree) + + + + + + The messages used to commit changes are a large part of these standards. + Consequently, be sure that the headers for each commit have the required information. + For information on how to follow the Yocto Project commit message standards, see the + "How to Submit a + Change" section in the Yocto Project Development Manual. + + + + If the initial commits were not properly documented or do not meet those standards, + you can re-base by using the git rebase -i command to + manipulate the commits and + get them into the required format. + Other techniques such as branching and cherry-picking commits are also viable options. + + + + Once you complete the commits, you can generate the email that sends the patches + to the maintainer(s) or lists that review and integrate changes. + The command git send-email is commonly used to ensure + that patches are properly + formatted for easy application and avoid mailer-induced patch damage. + + + + The following is an example of dumping patches for external submission: + + # dump the last 4 commits + $ git format-patch --thread -n -o ~/rr/ HEAD^^^^ + $ git send-email --compose --subject '[RFC 0/N] <patch series summary>' \ + --to foo@yoctoproject.org --to bar@yoctoproject.org \ + --cc list@yoctoproject.org ~/rr + # the editor is invoked for the 0/N patch, and when complete the entire + # series is sent via email for review + + +
+ +
+ Exporting Changes for Import into Another SCM + + + When you want to export changes for import into another + Source Code Manager (SCM), you can use any of the previously discussed + techniques. + However, if the patches are manually applied to a secondary tree and then + that tree is checked into the SCM, you can lose change information such as + commit logs. + This process is not recommended. + + + + Many SCMs can directly import Git commits, or can translate Git patches so that + information is not lost. + Those facilities are SCM-dependent and you should use them whenever possible. + +
+
+ +
+ Working with the Yocto Project Kernel in Another SCM + + + This section describes kernel development in an SCM other than Git, + which is not the same as exporting changes to another SCM described earlier. + For this scenario, you use the OpenEmbedded build system to + develop the kernel in a different SCM. + The following must be true for you to accomplish this: + + The delivered Yocto Project kernel must be exported into the second + SCM. + Development must be exported from that secondary SCM into a + format that can be used by the OpenEmbedded build system. + + + +
+ Exporting the Delivered Kernel to the SCM + + + Depending on the SCM, it might be possible to export the entire Yocto Project + kernel Git repository, branches and all, into a new environment. + This method is preferred because it has the most flexibility and potential to maintain + the meta data associated with each commit. + + + + When a direct import mechanism is not available, it is still possible to + export a branch (or series of branches) and check them into a new repository. + + + + The following commands illustrate some of the steps you could use to + import the yocto/standard/common-pc/base + kernel into a secondary SCM: + + $ git checkout yocto/standard/common-pc/base + $ cd .. ; echo linux/.git > .cvsignore + $ cvs import -m "initial import" linux MY_COMPANY start + + + + + You could now relocate the CVS repository and use it in a centralized manner. + + + + The following commands illustrate how you can condense and merge two BSPs into a + second SCM: + + $ git checkout yocto/standard/common-pc/base + $ git merge yocto/standard/common-pc-64/base + # resolve any conflicts and commit them + $ cd .. ; echo linux/.git > .cvsignore + $ cvs import -m "initial import" linux MY_COMPANY start + + +
+ +
+ Importing Changes for the Build + + + Once development has reached a suitable point in the second development + environment, you need to export the changes as patches. + To export them, place the changes in a recipe and + automatically apply them to the kernel during patching. + +
+
+ +
+ Creating a BSP Based on an Existing Similar BSP + + + This section overviews the process of creating a BSP based on an + existing similar BSP. + The information is introductory in nature and does not provide step-by-step examples. + For detailed information on how to create a new BSP, see + the "Creating a New BSP Layer Using the yocto-bsp Script" section in the + Yocto Project Board Support Package (BSP) Developer's Guide, or see the + Transcript:_creating_one_generic_Atom_BSP_from_another + wiki page. + + + + The basic steps you need to follow are: + + Make sure you have set up a local Source Directory: + You must create a local + Source Directory + by either creating a Git repository (recommended) or + extracting a Yocto Project release tarball. + Choose an existing BSP available with the Yocto Project: + Try to map your board features as closely to the features of a BSP that is + already supported and exists in the Yocto Project. + Starting with something as close as possible to your board makes developing + your BSP easier. + You can find all the BSPs that are supported and ship with the Yocto Project + on the Yocto Project's Download page at + . + Be sure you have the Base BSP: + You need to either have a local Git repository of the base BSP set up or + have downloaded and extracted the files from a release BSP tarball. + Either method gives you access to the BSP source files. + Make a copy of the existing BSP, thus isolating your new + BSP work: + Copying the existing BSP file structure gives you a new area in which to work. + Make configuration and recipe changes to your new BSP: + Configuration changes involve the files in the BSP's conf + directory. + Changes include creating a machine-specific configuration file and editing the + layer.conf file. + The configuration changes identify the kernel you will be using. + Recipe changes include removing, modifying, or adding new recipe files that + instruct the build process on what features to include in the image. + Prepare for the build: + Before you actually initiate the build, you need to set up the build environment + by sourcing the environment initialization script. + After setting up the environment, you need to make some build configuration + changes to the local.conf and bblayers.conf + files. + Build the image: + The OpenEmbedded build system uses BitBake to create the image. + You need to decide on the type of image you are going to build (e.g. minimal, base, + core, sato, and so forth) and then start the build using the bitbake + command. + + +
+ +
+ "-dirty" String + + + If kernel images are being built with "-dirty" on the end of the version + string, this simply means that modifications in the source + directory have not been committed. + + $ git status + + + + + You can use the above Git command to report modified, removed, or added files. + You should commit those changes to the tree regardless of whether they will be saved, + exported, or used. + Once you commit the changes you need to rebuild the kernel. + + + + To brute force pickup and commit all such pending changes, enter the following: + + $ git add . + $ git commit -s -a -m "getting rid of -dirty" + + + + + Next, rebuild the kernel. + +
+
+
+ diff --git a/documentation/kernel-dev/kernel-dev-faq.xml b/documentation/kernel-dev/kernel-dev-faq.xml new file mode 100644 index 0000000000..2b99ad2dde --- /dev/null +++ b/documentation/kernel-dev/kernel-dev-faq.xml @@ -0,0 +1,140 @@ + %poky; ] > + + +Kernel Development FAQ + +
+ Common Questions and Solutions + + + The following lists some solutions for common questions. + + + + + + + How do I use my own Linux kernel .config + file? + + + + + Refer to the "Changing the Configuration" + section for information. + + + + + + + + How do I create configuration fragments? + + + + + Refer to the "Generating Configuration Files" + section for information. + + + + + + + + How do I use my own Linux kernel sources? + + + + + Refer to the "Working With Your Own Sources" + section for information. + + + + + + + + How do I install/not-install the kernel image on the rootfs? + + + + + The kernel image (e.g. vmlinuz) is provided + by the kernel-image package. + Image recipes depend on kernel-base. + To specify whether or not the kernel + image is installed in the generated root filesystem, override + RDEPENDS_kernel-base to include or not + include "kernel-image". + See the + "Using .bbappend Files" + section in the Yocto Project Development Manual for information on + how to use an append file to override metadata. + + + + + + + + How do I install a specific kernel module? + + + + + Linux kernel modules are packaged individually. + To ensure a specific kernel module is included in an image, + include it in the appropriate machine + RRECOMMENDS + variable. + These other variables are useful for installing specific + modules: + + MACHINE_ESSENTIAL_EXTRA_RDEPENDS + MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS + MACHINE_EXTRA_RDEPENDS + MACHINE_EXTRA_RRECOMMENDS + + For example, set the following in the qemux86.conf + file to include the ab123 kernel modules + with images built for the qemux86 machine: + + MACHINE_EXTRA_RRECOMMENDS += "kernel-module-ab123" + + For more information, see the + "Incorporating Out-of-Tree Modules" + section. + + + + + + + + How do I change the Linux kernel command line? + + + + + The Linux kernel command line is typically specified in + the machine config using the APPEND variable. + For example, you can add some helpful debug information doing + the following: + + APPEND += "printk.time=y initcall_debug debug" + + + + + + +
+
+ diff --git a/documentation/kernel-dev/kernel-dev-intro.xml b/documentation/kernel-dev/kernel-dev-intro.xml new file mode 100644 index 0000000000..38ef36de5a --- /dev/null +++ b/documentation/kernel-dev/kernel-dev-intro.xml @@ -0,0 +1,147 @@ + %poky; ] > + + +Introduction + + + +
+ Overview + + + Regardless of how you intend to make use of the Yocto Project, + chances are you will work with the Linux kernel. + This manual provides background information on the Yocto Linux kernel + Metadata, + describes common tasks you can perform using the kernel tools, + and shows you how to use the kernel Metadata needed to work with + the kernel inside the Yocto Project. + + + + Each Yocto Project release has a set of linux-yocto recipes, whose + Git repositories you can view in the Yocto + Source Repositories under + the "Yocto Linux Kernel" heading. + New recipes for the release track the latest upstream developments + and introduce newly supported platforms. + Previous recipes in the release are refreshed and supported for at + least one additional release. + As they align, these previous releases are updated to include the + latest from the Long Term Support Initiative (LTSI) project. + Also included is a linux-yocto development recipe + (linux-yocto-dev.bb) should you want to work + with the very latest in upstream Linux kernel development and + kernel Metadata development. + + + + The Yocto Project also provides a powerful set of kernel + tools for managing Linux kernel sources and configuration data. + You can use these tools to make a single configuration change, + apply multiple patches, or work with your own kernel sources. + + + + In particular, the kernel tools allow you to generate configuration + fragments that specify only what you must, and nothing more. + Configuration fragments only need to contain the highest level + visible CONFIG options as presented by the Linux + kernel menuconfig system. + Contrast this against a complete Linux kernel + .config, which includes all the automatically + selected CONFIG options. + This efficiency reduces your maintenance effort and allows you + to further separate your configuration in ways that make sense for + your project. + A common split separates policy and hardware. + For example, all your kernels might support + the proc and sys filesystems, + but only specific boards require sound, USB, or specific drivers. + Specifying these configurations individually allows you to aggregate + them together as needed, but maintains them in only one place. + Similar logic applies to separating source changes. + + + + If you do not maintain your own kernel sources and need to make + only minimal changes to the sources, the released recipes provide a + vetted base upon which to layer your changes. + Doing so allows you to benefit from the continual kernel + integration and testing performed during development of the + Yocto Project. + + + + If, instead, you have a very specific Linux kernel source tree + and are unable to align with one of the official linux-yocto + recipes, an alternative exists by which you can use the Yocto + Project Linux kernel tools with your own kernel sources. + +
+ +
+ Other Resources + + + The sections that follow provide instructions for completing + specific Linux kernel development tasks. + These instructions assume you are comfortable working with + BitBake + recipes and basic open-source development tools. + Understanding these concepts will facilitate the process of working + with the kernel recipes. + If you find you need some additional background, please be sure to + review and understand the following documentation: + + Yocto Project Quick Start + + The "Modifying Temporary Source Code" + section in the Yocto Project Development Manual + + The "Understanding and Creating Layers" section + in the Yocto Project Development Manual + The "Modifying the Kernel" section + in the Yocto Project Development Manual. + + + + + Finally, while this document focuses on the manual creation of + recipes, patches, and configuration files, the Yocto Project + Board Support Package (BSP) tools are available to automate + this process with existing content and work well to create the + initial framework and boilerplate code. + For details on these tools, see the + "Using the Yocto Project's BSP Tools" + section in the Yocto Project Board Support Package (BSP) Developer's + Guide. + +
+
+ diff --git a/documentation/kernel-dev/kernel-dev-maint-appx.xml b/documentation/kernel-dev/kernel-dev-maint-appx.xml new file mode 100644 index 0000000000..a72dcff01b --- /dev/null +++ b/documentation/kernel-dev/kernel-dev-maint-appx.xml @@ -0,0 +1,220 @@ + %poky; ] > + + +Kernel Maintenance + +
+ Tree Construction + + This section describes construction of the Yocto Project kernel source repositories + as accomplished by the Yocto Project team to create kernel repositories. + These kernel repositories are found under the heading "Yocto Linux Kernel" at + &YOCTO_GIT_URL;/cgit.cgi + and can be shipped as part of a Yocto Project release. + The team creates these repositories by + compiling and executing the set of feature descriptions for every BSP + and feature in the product. + Those feature descriptions list all necessary patches, + configuration, branching, tagging and feature divisions found in a kernel. + Thus, the Yocto Project kernel repository (or tree) is built. + + + The existence of this tree allows you to access and clone a particular + Yocto Project kernel repository and use it to build images based on their configurations + and features. + + + You can find the files used to describe all the valid features and BSPs + in the Yocto Project kernel in any clone of the Yocto Project kernel source repository + Git tree. + For example, the following command clones the Yocto Project baseline kernel that + branched off of linux.org version 3.4: + + $ git clone git://git.yoctoproject.org/linux-yocto-3.4 + + For another example of how to set up a local Git repository of the Yocto Project + kernel files, see the + "Yocto Project Kernel" bulleted + item in the Yocto Project Development Manual. + + + Once you have cloned the kernel Git repository on your local machine, you can + switch to the meta branch within the repository. + Here is an example that assumes the local Git repository for the kernel is in + a top-level directory named linux-yocto-3.4: + + $ cd linux-yocto-3.4 + $ git checkout -b meta origin/meta + + Once you have checked out and switched to the meta branch, + you can see a snapshot of all the kernel configuration and feature descriptions that are + used to build that particular kernel repository. + These descriptions are in the form of .scc files. + + + You should realize, however, that browsing your local kernel repository + for feature descriptions and patches is not an effective way to determine what is in a + particular kernel branch. + Instead, you should use Git directly to discover the changes in a branch. + Using Git is an efficient and flexible way to inspect changes to the kernel. + + Ground up reconstruction of the complete kernel tree is an action only taken by the + Yocto Project team during an active development cycle. + When you create a clone of the kernel Git repository, you are simply making it + efficiently available for building and development. + + + + The following steps describe what happens when the Yocto Project Team constructs + the Yocto Project kernel source Git repository (or tree) found at + given the + introduction of a new top-level kernel feature or BSP. + These are the actions that effectively create the tree + that includes the new feature, patch or BSP: + + A top-level kernel feature is passed to the kernel build subsystem. + Normally, this feature is a BSP for a particular kernel type. + The file that describes the top-level feature is located by searching + these system directories: + + The in-tree kernel-cache directories, which are located + in meta/cfg/kernel-cache + Areas pointed to by SRC_URI statements + found in recipes + + For a typical build, the target of the search is a + feature description in an .scc file + whose name follows this format: + + bsp_name-kernel_type.scc + + + Once located, the feature description is either compiled into a simple script + of actions, or into an existing equivalent script that is already part of the + shipped kernel. + Extra features are appended to the top-level feature description. + These features can come from the + KERNEL_FEATURES + variable in recipes. + Each extra feature is located, compiled and appended to the script + as described in step three. + The script is executed to produce a series of meta-* + directories. + These directories are descriptions of all the branches, tags, patches and configurations that + need to be applied to the base Git repository to completely create the + source (build) branch for the new BSP or feature. + The base repository is cloned, and the actions + listed in the meta-* directories are applied to the + tree. + The Git repository is left with the desired branch checked out and any + required branching, patching and tagging has been performed. + + + + The kernel tree is now ready for developer consumption to be locally cloned, + configured, and built into a Yocto Project kernel specific to some target hardware. + The generated meta-* directories add to the kernel + as shipped with the Yocto Project release. + Any add-ons and configuration data are applied to the end of an existing branch. + The full repository generation that is found in the + official Yocto Project kernel repositories at + http://git.yoctoproject.org/cgit.cgi + is the combination of all supported boards and configurations. + The technique the Yocto Project team uses is flexible and allows for seamless + blending of an immutable history with additional patches specific to a + deployment. + Any additions to the kernel become an integrated part of the branches. + + +
+ +
+ Build Strategy + + + + + Once a local Git repository of the Yocto Project kernel exists on a development system, + you can consider the compilation phase of kernel development - building a kernel image. + Some prerequisites exist that are validated by the build process before compilation + starts: + + + + The + SRC_URI points + to the kernel Git repository. + A BSP build branch exists. + This branch has the following form: + + kernel_type/bsp_name + + + + + The OpenEmbedded build system makes sure these conditions exist before attempting compilation. + Other means, however, do exist, such as as bootstrapping a BSP. + + + + Before building a kernel, the build process verifies the tree + and configures the kernel by processing all of the + configuration "fragments" specified by feature descriptions in the .scc + files. + As the features are compiled, associated kernel configuration fragments are noted + and recorded in the meta-* series of directories in their compilation order. + The fragments are migrated, pre-processed and passed to the Linux Kernel + Configuration subsystem (lkc) as raw input in the form + of a .config file. + The lkc uses its own internal dependency constraints to do the final + processing of that information and generates the final .config file + that is used during compilation. + + + + Using the board's architecture and other relevant values from the board's template, + kernel compilation is started and a kernel image is produced. + + + + The other thing that you notice once you configure a kernel is that + the build process generates a build tree that is separate from your kernel's local Git + source repository tree. + This build tree has a name that uses the following form, where + ${MACHINE} is the metadata name of the machine (BSP) and "kernel_type" is one + of the Yocto Project supported kernel types (e.g. "standard"): + + linux-${MACHINE}-kernel_type-build + + + + + The existing support in the kernel.org tree achieves this + default functionality. + + + + This behavior means that all the generated files for a particular machine or BSP are now in + the build tree directory. + The files include the final .config file, all the .o + files, the .a files, and so forth. + Since each machine or BSP has its own separate + Build Directory + in its own separate branch + of the Git repository, you can easily switch between different builds. + +
+
+ diff --git a/documentation/kernel-dev/kernel-dev-style.css b/documentation/kernel-dev/kernel-dev-style.css new file mode 100644 index 0000000000..6e0c1c7fc9 --- /dev/null +++ b/documentation/kernel-dev/kernel-dev-style.css @@ -0,0 +1,984 @@ +/* + Generic XHTML / DocBook XHTML CSS Stylesheet. + + Browser wrangling and typographic design by + Oyvind Kolas / pippin@gimp.org + + Customised for Poky by + Matthew Allum / mallum@o-hand.com + + Thanks to: + Liam R. E. Quin + William Skaggs + Jakub Steiner + + Structure + --------- + + The stylesheet is divided into the following sections: + + Positioning + Margins, paddings, width, font-size, clearing. + Decorations + Borders, style + Colors + Colors + Graphics + Graphical backgrounds + Nasty IE tweaks + Workarounds needed to make it work in internet explorer, + currently makes the stylesheet non validating, but up until + this point it is validating. + Mozilla extensions + Transparency for footer + Rounded corners on boxes + +*/ + + + /*************** / + / Positioning / +/ ***************/ + +body { + font-family: Verdana, Sans, sans-serif; + + min-width: 640px; + width: 80%; + margin: 0em auto; + padding: 2em 5em 5em 5em; + color: #333; +} + +h1,h2,h3,h4,h5,h6,h7 { + font-family: Arial, Sans; + color: #00557D; + clear: both; +} + +h1 { + font-size: 2em; + text-align: left; + padding: 0em 0em 0em 0em; + margin: 2em 0em 0em 0em; +} + +h2.subtitle { + margin: 0.10em 0em 3.0em 0em; + padding: 0em 0em 0em 0em; + font-size: 1.8em; + padding-left: 20%; + font-weight: normal; + font-style: italic; +} + +h2 { + margin: 2em 0em 0.66em 0em; + padding: 0.5em 0em 0em 0em; + font-size: 1.5em; + font-weight: bold; +} + +h3.subtitle { + margin: 0em 0em 1em 0em; + padding: 0em 0em 0em 0em; + font-size: 142.14%; + text-align: right; +} + +h3 { + margin: 1em 0em 0.5em 0em; + padding: 1em 0em 0em 0em; + font-size: 140%; + font-weight: bold; +} + +h4 { + margin: 1em 0em 0.5em 0em; + padding: 1em 0em 0em 0em; + font-size: 120%; + font-weight: bold; +} + +h5 { + margin: 1em 0em 0.5em 0em; + padding: 1em 0em 0em 0em; + font-size: 110%; + font-weight: bold; +} + +h6 { + margin: 1em 0em 0em 0em; + padding: 1em 0em 0em 0em; + font-size: 110%; + font-weight: bold; +} + +.authorgroup { + background-color: transparent; + background-repeat: no-repeat; + padding-top: 256px; + background-image: url("figures/kernel-dev-title.png"); + background-position: left top; + margin-top: -256px; + padding-right: 50px; + margin-left: 0px; + text-align: right; + width: 740px; +} + +h3.author { + margin: 0em 0me 0em 0em; + padding: 0em 0em 0em 0em; + font-weight: normal; + font-size: 100%; + color: #333; + clear: both; +} + +.author tt.email { + font-size: 66%; +} + +.titlepage hr { + width: 0em; + clear: both; +} + +.revhistory { + padding-top: 2em; + clear: both; +} + +.toc, +.list-of-tables, +.list-of-examples, +.list-of-figures { + padding: 1.33em 0em 2.5em 0em; + color: #00557D; +} + +.toc p, +.list-of-tables p, +.list-of-figures p, +.list-of-examples p { + padding: 0em 0em 0em 0em; + padding: 0em 0em 0.3em; + margin: 1.5em 0em 0em 0em; +} + +.toc p b, +.list-of-tables p b, +.list-of-figures p b, +.list-of-examples p b{ + font-size: 100.0%; + font-weight: bold; +} + +.toc dl, +.list-of-tables dl, +.list-of-figures dl, +.list-of-examples dl { + margin: 0em 0em 0.5em 0em; + padding: 0em 0em 0em 0em; +} + +.toc dt { + margin: 0em 0em 0em 0em; + padding: 0em 0em 0em 0em; +} + +.toc dd { + margin: 0em 0em 0em 2.6em; + padding: 0em 0em 0em 0em; +} + +div.glossary dl, +div.variablelist dl { +} + +.glossary dl dt, +.variablelist dl dt, +.variablelist dl dt span.term { + font-weight: normal; + width: 20em; + text-align: right; +} + +.variablelist dl dt { + margin-top: 0.5em; +} + +.glossary dl dd, +.variablelist dl dd { + margin-top: -1em; + margin-left: 25.5em; +} + +.glossary dd p, +.variablelist dd p { + margin-top: 0em; + margin-bottom: 1em; +} + + +div.calloutlist table td { + padding: 0em 0em 0em 0em; + margin: 0em 0em 0em 0em; +} + +div.calloutlist table td p { + margin-top: 0em; + margin-bottom: 1em; +} + +div p.copyright { + text-align: left; +} + +div.legalnotice p.legalnotice-title { + margin-bottom: 0em; +} + +p { + line-height: 1.5em; + margin-top: 0em; + +} + +dl { + padding-top: 0em; +} + +hr { + border: solid 1px; +} + + +.mediaobject, +.mediaobjectco { + text-align: center; +} + +img { + border: none; +} + +ul { + padding: 0em 0em 0em 1.5em; +} + +ul li { + padding: 0em 0em 0em 0em; +} + +ul li p { + text-align: left; +} + +table { + width :100%; +} + +th { + padding: 0.25em; + text-align: left; + font-weight: normal; + vertical-align: top; +} + +td { + padding: 0.25em; + vertical-align: top; +} + +p a[id] { + margin: 0px; + padding: 0px; + display: inline; + background-image: none; +} + +a { + text-decoration: underline; + color: #444; +} + +pre { + overflow: auto; +} + +a:hover { + text-decoration: underline; + /*font-weight: bold;*/ +} + +/* This style defines how the permalink character + appears by itself and when hovered over with + the mouse. */ + +[alt='Permalink'] { color: #eee; } +[alt='Permalink']:hover { color: black; } + + +div.informalfigure, +div.informalexample, +div.informaltable, +div.figure, +div.table, +div.example { + margin: 1em 0em; + padding: 1em; + page-break-inside: avoid; +} + + +div.informalfigure p.title b, +div.informalexample p.title b, +div.informaltable p.title b, +div.figure p.title b, +div.example p.title b, +div.table p.title b{ + padding-top: 0em; + margin-top: 0em; + font-size: 100%; + font-weight: normal; +} + +.mediaobject .caption, +.mediaobject .caption p { + text-align: center; + font-size: 80%; + padding-top: 0.5em; + padding-bottom: 0.5em; +} + +.epigraph { + padding-left: 55%; + margin-bottom: 1em; +} + +.epigraph p { + text-align: left; +} + +.epigraph .quote { + font-style: italic; +} +.epigraph .attribution { + font-style: normal; + text-align: right; +} + +span.application { + font-style: italic; +} + +.programlisting { + font-family: monospace; + font-size: 80%; + white-space: pre; + margin: 1.33em 0em; + padding: 1.33em; +} + +.tip, +.warning, +.caution, +.note { + margin-top: 1em; + margin-bottom: 1em; + +} + +/* force full width of table within div */ +.tip table, +.warning table, +.caution table, +.note table { + border: none; + width: 100%; +} + + +.tip table th, +.warning table th, +.caution table th, +.note table th { + padding: 0.8em 0.0em 0.0em 0.0em; + margin : 0em 0em 0em 0em; +} + +.tip p, +.warning p, +.caution p, +.note p { + margin-top: 0.5em; + margin-bottom: 0.5em; + padding-right: 1em; + text-align: left; +} + +.acronym { + text-transform: uppercase; +} + +b.keycap, +.keycap { + padding: 0.09em 0.3em; + margin: 0em; +} + +.itemizedlist li { + clear: none; +} + +.filename { + font-size: medium; + font-family: Courier, monospace; +} + + +div.navheader, div.heading{ + position: absolute; + left: 0em; + top: 0em; + width: 100%; + background-color: #cdf; + width: 100%; +} + +div.navfooter, div.footing{ + position: fixed; + left: 0em; + bottom: 0em; + background-color: #eee; + width: 100%; +} + + +div.navheader td, +div.navfooter td { + font-size: 66%; +} + +div.navheader table th { + /*font-family: Georgia, Times, serif;*/ + /*font-size: x-large;*/ + font-size: 80%; +} + +div.navheader table { + border-left: 0em; + border-right: 0em; + border-top: 0em; + width: 100%; +} + +div.navfooter table { + border-left: 0em; + border-right: 0em; + border-bottom: 0em; + width: 100%; +} + +div.navheader table td a, +div.navfooter table td a { + color: #777; + text-decoration: none; +} + +/* normal text in the footer */ +div.navfooter table td { + color: black; +} + +div.navheader table td a:visited, +div.navfooter table td a:visited { + color: #444; +} + + +/* links in header and footer */ +div.navheader table td a:hover, +div.navfooter table td a:hover { + text-decoration: underline; + background-color: transparent; + color: #33a; +} + +div.navheader hr, +div.navfooter hr { + display: none; +} + + +.qandaset tr.question td p { + margin: 0em 0em 1em 0em; + padding: 0em 0em 0em 0em; +} + +.qandaset tr.answer td p { + margin: 0em 0em 1em 0em; + padding: 0em 0em 0em 0em; +} +.answer td { + padding-bottom: 1.5em; +} + +.emphasis { + font-weight: bold; +} + + + /************* / + / decorations / +/ *************/ + +.titlepage { +} + +.part .title { +} + +.subtitle { + border: none; +} + +/* +h1 { + border: none; +} + +h2 { + border-top: solid 0.2em; + border-bottom: solid 0.06em; +} + +h3 { + border-top: 0em; + border-bottom: solid 0.06em; +} + +h4 { + border: 0em; + border-bottom: solid 0.06em; +} + +h5 { + border: 0em; +} +*/ + +.programlisting { + border: solid 1px; +} + +div.figure, +div.table, +div.informalfigure, +div.informaltable, +div.informalexample, +div.example { + border: 1px solid; +} + + + +.tip, +.warning, +.caution, +.note { + border: 1px solid; +} + +.tip table th, +.warning table th, +.caution table th, +.note table th { + border-bottom: 1px solid; +} + +.question td { + border-top: 1px solid black; +} + +.answer { +} + + +b.keycap, +.keycap { + border: 1px solid; +} + + +div.navheader, div.heading{ + border-bottom: 1px solid; +} + + +div.navfooter, div.footing{ + border-top: 1px solid; +} + + /********* / + / colors / +/ *********/ + +body { + color: #333; + background: white; +} + +a { + background: transparent; +} + +a:hover { + background-color: #dedede; +} + + +h1, +h2, +h3, +h4, +h5, +h6, +h7, +h8 { + background-color: transparent; +} + +hr { + border-color: #aaa; +} + + +.tip, .warning, .caution, .note { + border-color: #fff; +} + + +.tip table th, +.warning table th, +.caution table th, +.note table th { + border-bottom-color: #fff; +} + + +.warning { + background-color: #f0f0f2; +} + +.caution { + background-color: #f0f0f2; +} + +.tip { + background-color: #f0f0f2; +} + +.note { + background-color: #f0f0f2; +} + +.glossary dl dt, +.variablelist dl dt, +.variablelist dl dt span.term { + color: #044; +} + +div.figure, +div.table, +div.example, +div.informalfigure, +div.informaltable, +div.informalexample { + border-color: #aaa; +} + +pre.programlisting { + color: black; + background-color: #fff; + border-color: #aaa; + border-width: 2px; +} + +.guimenu, +.guilabel, +.guimenuitem { + background-color: #eee; +} + + +b.keycap, +.keycap { + background-color: #eee; + border-color: #999; +} + + +div.navheader { + border-color: black; +} + + +div.navfooter { + border-color: black; +} + + + /*********** / + / graphics / +/ ***********/ + +/* +body { + background-image: url("images/body_bg.jpg"); + background-attachment: fixed; +} + +.navheader, +.note, +.tip { + background-image: url("images/note_bg.jpg"); + background-attachment: fixed; +} + +.warning, +.caution { + background-image: url("images/warning_bg.jpg"); + background-attachment: fixed; +} + +.figure, +.informalfigure, +.example, +.informalexample, +.table, +.informaltable { + background-image: url("images/figure_bg.jpg"); + background-attachment: fixed; +} + +*/ +h1, +h2, +h3, +h4, +h5, +h6, +h7{ +} + +/* +Example of how to stick an image as part of the title. + +div.article .titlepage .title +{ + background-image: url("figures/white-on-black.png"); + background-position: center; + background-repeat: repeat-x; +} +*/ + +div.preface .titlepage .title, +div.colophon .title, +div.chapter .titlepage .title, +div.article .titlepage .title +{ +} + +div.section div.section .titlepage .title, +div.sect2 .titlepage .title { + background: none; +} + + +h1.title { + background-color: transparent; + background-repeat: no-repeat; + height: 256px; + text-indent: -9000px; + overflow:hidden; +} + +h2.subtitle { + background-color: transparent; + text-indent: -9000px; + overflow:hidden; + width: 0px; + display: none; +} + + /*************************************** / + / pippin.gimp.org specific alterations / +/ ***************************************/ + +/* +div.heading, div.navheader { + color: #777; + font-size: 80%; + padding: 0; + margin: 0; + text-align: left; + position: absolute; + top: 0px; + left: 0px; + width: 100%; + height: 50px; + background: url('/gfx/heading_bg.png') transparent; + background-repeat: repeat-x; + background-attachment: fixed; + border: none; +} + +div.heading a { + color: #444; +} + +div.footing, div.navfooter { + border: none; + color: #ddd; + font-size: 80%; + text-align:right; + + width: 100%; + padding-top: 10px; + position: absolute; + bottom: 0px; + left: 0px; + + background: url('/gfx/footing_bg.png') transparent; +} +*/ + + + + /****************** / + / nasty ie tweaks / +/ ******************/ + +/* +div.heading, div.navheader { + width:expression(document.body.clientWidth + "px"); +} + +div.footing, div.navfooter { + width:expression(document.body.clientWidth + "px"); + margin-left:expression("-5em"); +} +body { + padding:expression("4em 5em 0em 5em"); +} +*/ + + /**************************************** / + / mozilla vendor specific css extensions / +/ ****************************************/ +/* +div.navfooter, div.footing{ + -moz-opacity: 0.8em; +} + +div.figure, +div.table, +div.informalfigure, +div.informaltable, +div.informalexample, +div.example, +.tip, +.warning, +.caution, +.note { + -moz-border-radius: 0.5em; +} + +b.keycap, +.keycap { + -moz-border-radius: 0.3em; +} +*/ + +table tr td table tr td { + display: none; +} + + +hr { + display: none; +} + +table { + border: 0em; +} + + .photo { + float: right; + margin-left: 1.5em; + margin-bottom: 1.5em; + margin-top: 0em; + max-width: 17em; + border: 1px solid gray; + padding: 3px; + background: white; +} + .seperator { + padding-top: 2em; + clear: both; + } + + #validators { + margin-top: 5em; + text-align: right; + color: #777; + } + @media print { + body { + font-size: 8pt; + } + .noprint { + display: none; + } + } + + +.tip, +.note { + background: #f0f0f2; + color: #333; + padding: 20px; + margin: 20px; +} + +.tip h3, +.note h3 { + padding: 0em; + margin: 0em; + font-size: 2em; + font-weight: bold; + color: #333; +} + +.tip a, +.note a { + color: #333; + text-decoration: underline; +} + +.footnote { + font-size: small; + color: #333; +} + +/* Changes the announcement text */ +.tip h3, +.warning h3, +.caution h3, +.note h3 { + font-size:large; + color: #00557D; +} diff --git a/documentation/kernel-dev/kernel-dev.xml b/documentation/kernel-dev/kernel-dev.xml new file mode 100644 index 0000000000..4ab95cbfce --- /dev/null +++ b/documentation/kernel-dev/kernel-dev.xml @@ -0,0 +1,115 @@ + %poky; ] > + + + + + + + + + + + + Yocto Project Linux Kernel Development Manual + + + + + Darren Hart + + Intel Corporation + + darren.hart@intel.com + + + + + + 1.4 + April 2013 + Released with the Yocto Project 1.4 Release. + + + 1.5 + October 2013 + Released with the Yocto Project 1.5 Release. + + + 1.5.1 + January 2014 + Released with the Yocto Project 1.5.1 Release. + + + 1.6 + April 2014 + Released with the Yocto Project 1.6 Release. + + + 1.7 + October 2014 + Released with the Yocto Project 1.7 Release. + + + 1.7.1 + January 2015 + Released with the Yocto Project 1.7.1 Release. + + + 1.7.2 + June 2015 + Released with the Yocto Project 1.7.2 Release. + + + + + ©RIGHT_YEAR; + Linux Foundation + + + + + Permission is granted to copy, distribute and/or modify this document under + the terms of the Creative Commons Attribution-Share Alike 2.0 UK: England & Wales as published by Creative Commons. + + + For the latest version of this manual associated with this + Yocto Project release, see the + Yocto Project Linux Kernel Development Manual + from the Yocto Project website. + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3-54-g00ecf