Andrew Geissler | f034379 | 2020-11-18 10:42:21 -0600 | [diff] [blame] | 1 | .. SPDX-License-Identifier: CC-BY-SA-2.0-UK |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2 | |
| 3 | ******************************************************* |
| 4 | Working with Advanced Metadata (``yocto-kernel-cache``) |
| 5 | ******************************************************* |
| 6 | |
| 7 | .. _kernel-dev-advanced-overview: |
| 8 | |
| 9 | Overview |
| 10 | ======== |
| 11 | |
| 12 | In addition to supporting configuration fragments and patches, the Yocto |
| 13 | Project kernel tools also support rich |
| 14 | :term:`Metadata` that you can use to define |
| 15 | complex policies and Board Support Package (BSP) support. The purpose of |
| 16 | the Metadata and the tools that manage it is to help you manage the |
| 17 | complexity of the configuration and sources used to support multiple |
| 18 | BSPs and Linux kernel types. |
| 19 | |
| 20 | Kernel Metadata exists in many places. One area in the |
| 21 | :ref:`overview-manual/overview-manual-development-environment:yocto project source repositories` |
| 22 | is the ``yocto-kernel-cache`` Git repository. You can find this repository |
| 23 | grouped under the "Yocto Linux Kernel" heading in the |
| 24 | :yocto_git:`Yocto Project Source Repositories <>`. |
| 25 | |
| 26 | Kernel development tools ("kern-tools") exist also in the Yocto Project |
| 27 | Source Repositories under the "Yocto Linux Kernel" heading in the |
| 28 | ``yocto-kernel-tools`` Git repository. The recipe that builds these |
| 29 | tools is ``meta/recipes-kernel/kern-tools/kern-tools-native_git.bb`` in |
| 30 | the :term:`Source Directory` (e.g. |
| 31 | ``poky``). |
| 32 | |
| 33 | Using Kernel Metadata in a Recipe |
| 34 | ================================= |
| 35 | |
| 36 | As mentioned in the introduction, the Yocto Project contains kernel |
| 37 | Metadata, which is located in the ``yocto-kernel-cache`` Git repository. |
| 38 | This Metadata defines Board Support Packages (BSPs) that correspond to |
| 39 | definitions in linux-yocto recipes for corresponding BSPs. A BSP |
| 40 | consists of an aggregation of kernel policy and enabled |
| 41 | hardware-specific features. The BSP can be influenced from within the |
| 42 | linux-yocto recipe. |
| 43 | |
| 44 | .. note:: |
| 45 | |
| 46 | A Linux kernel recipe that contains kernel Metadata (e.g. inherits |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 47 | from the ``linux-yocto.inc`` file) is said to be a "linux-yocto style" recipe. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 48 | |
| 49 | Every linux-yocto style recipe must define the |
| 50 | :term:`KMACHINE` variable. This |
| 51 | variable is typically set to the same value as the ``MACHINE`` variable, |
| 52 | which is used by :term:`BitBake`. |
| 53 | However, in some cases, the variable might instead refer to the |
| 54 | underlying platform of the ``MACHINE``. |
| 55 | |
| 56 | Multiple BSPs can reuse the same ``KMACHINE`` name if they are built |
| 57 | using the same BSP description. Multiple Corei7-based BSPs could share |
| 58 | the same "intel-corei7-64" value for ``KMACHINE``. It is important to |
| 59 | realize that ``KMACHINE`` is just for kernel mapping, while ``MACHINE`` |
| 60 | is the machine type within a BSP Layer. Even with this distinction, |
| 61 | however, these two variables can hold the same value. See the `BSP |
| 62 | Descriptions <#bsp-descriptions>`__ section for more information. |
| 63 | |
| 64 | Every linux-yocto style recipe must also indicate the Linux kernel |
| 65 | source repository branch used to build the Linux kernel. The |
| 66 | :term:`KBRANCH` variable must be set |
| 67 | to indicate the branch. |
| 68 | |
| 69 | .. note:: |
| 70 | |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 71 | You can use the ``KBRANCH`` value to define an alternate branch typically |
| 72 | with a machine override as shown here from the ``meta-yocto-bsp`` layer: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 73 | :: |
| 74 | |
| 75 | KBRANCH_edgerouter = "standard/edgerouter" |
| 76 | |
| 77 | |
| 78 | The linux-yocto style recipes can optionally define the following |
| 79 | variables: |
| 80 | |
| 81 | - :term:`KERNEL_FEATURES` |
| 82 | |
| 83 | - :term:`LINUX_KERNEL_TYPE` |
| 84 | |
| 85 | :term:`LINUX_KERNEL_TYPE` |
| 86 | defines the kernel type to be used in assembling the configuration. If |
| 87 | you do not specify a ``LINUX_KERNEL_TYPE``, it defaults to "standard". |
| 88 | Together with ``KMACHINE``, ``LINUX_KERNEL_TYPE`` defines the search |
| 89 | arguments used by the kernel tools to find the appropriate description |
| 90 | within the kernel Metadata with which to build out the sources and |
| 91 | configuration. The linux-yocto recipes define "standard", "tiny", and |
| 92 | "preempt-rt" kernel types. See the "`Kernel Types <#kernel-types>`__" |
| 93 | section for more information on kernel types. |
| 94 | |
| 95 | During the build, the kern-tools search for the BSP description file |
| 96 | that most closely matches the ``KMACHINE`` and ``LINUX_KERNEL_TYPE`` |
| 97 | variables passed in from the recipe. The tools use the first BSP |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 98 | description they find that matches both variables. If the tools cannot find |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 99 | a match, they issue a warning. |
| 100 | |
| 101 | The tools first search for the ``KMACHINE`` and then for the |
| 102 | ``LINUX_KERNEL_TYPE``. If the tools cannot find a partial match, they |
| 103 | will use the sources from the ``KBRANCH`` and any configuration |
| 104 | specified in the :term:`SRC_URI`. |
| 105 | |
| 106 | You can use the |
| 107 | :term:`KERNEL_FEATURES` |
| 108 | variable to include features (configuration fragments, patches, or both) |
| 109 | that are not already included by the ``KMACHINE`` and |
| 110 | ``LINUX_KERNEL_TYPE`` variable combination. For example, to include a |
| 111 | feature specified as "features/netfilter/netfilter.scc", specify: |
| 112 | :: |
| 113 | |
| 114 | KERNEL_FEATURES += "features/netfilter/netfilter.scc" |
| 115 | |
| 116 | To include a |
| 117 | feature called "cfg/sound.scc" just for the ``qemux86`` machine, |
| 118 | specify: |
| 119 | :: |
| 120 | |
| 121 | KERNEL_FEATURES_append_qemux86 = " cfg/sound.scc" |
| 122 | |
| 123 | The value of |
| 124 | the entries in ``KERNEL_FEATURES`` are dependent on their location |
| 125 | within the kernel Metadata itself. The examples here are taken from the |
| 126 | ``yocto-kernel-cache`` repository. Each branch of this repository |
| 127 | contains "features" and "cfg" subdirectories at the top-level. For more |
| 128 | information, see the "`Kernel Metadata |
| 129 | Syntax <#kernel-metadata-syntax>`__" section. |
| 130 | |
| 131 | Kernel Metadata Syntax |
| 132 | ====================== |
| 133 | |
| 134 | The kernel Metadata consists of three primary types of files: ``scc`` |
| 135 | [1]_ description files, configuration fragments, and patches. The |
| 136 | ``scc`` files define variables and include or otherwise reference any of |
| 137 | the three file types. The description files are used to aggregate all |
| 138 | types of kernel Metadata into what ultimately describes the sources and |
| 139 | the configuration required to build a Linux kernel tailored to a |
| 140 | specific machine. |
| 141 | |
| 142 | The ``scc`` description files are used to define two fundamental types |
| 143 | of kernel Metadata: |
| 144 | |
| 145 | - Features |
| 146 | |
| 147 | - Board Support Packages (BSPs) |
| 148 | |
| 149 | Features aggregate sources in the form of patches and configuration |
| 150 | fragments into a modular reusable unit. You can use features to |
| 151 | implement conceptually separate kernel Metadata descriptions such as |
| 152 | pure configuration fragments, simple patches, complex features, and |
| 153 | kernel types. `Kernel types <#kernel-types>`__ define general kernel |
| 154 | features and policy to be reused in the BSPs. |
| 155 | |
| 156 | BSPs define hardware-specific features and aggregate them with kernel |
| 157 | types to form the final description of what will be assembled and built. |
| 158 | |
| 159 | While the kernel Metadata syntax does not enforce any logical separation |
| 160 | of configuration fragments, patches, features or kernel types, best |
| 161 | practices dictate a logical separation of these types of Metadata. The |
| 162 | following Metadata file hierarchy is recommended: |
| 163 | :: |
| 164 | |
| 165 | base/ |
| 166 | bsp/ |
| 167 | cfg/ |
| 168 | features/ |
| 169 | ktypes/ |
| 170 | patches/ |
| 171 | |
| 172 | The ``bsp`` directory contains the `BSP |
| 173 | descriptions <#bsp-descriptions>`__. The remaining directories all |
| 174 | contain "features". Separating ``bsp`` from the rest of the structure |
| 175 | aids conceptualizing intended usage. |
| 176 | |
| 177 | Use these guidelines to help place your ``scc`` description files within |
| 178 | the structure: |
| 179 | |
| 180 | - If your file contains only configuration fragments, place the file in |
| 181 | the ``cfg`` directory. |
| 182 | |
| 183 | - If your file contains only source-code fixes, place the file in the |
| 184 | ``patches`` directory. |
| 185 | |
| 186 | - If your file encapsulates a major feature, often combining sources |
| 187 | and configurations, place the file in ``features`` directory. |
| 188 | |
| 189 | - If your file aggregates non-hardware configuration and patches in |
| 190 | order to define a base kernel policy or major kernel type to be |
| 191 | reused across multiple BSPs, place the file in ``ktypes`` directory. |
| 192 | |
| 193 | These distinctions can easily become blurred - especially as out-of-tree |
| 194 | features slowly merge upstream over time. Also, remember that how the |
| 195 | description files are placed is a purely logical organization and has no |
| 196 | impact on the functionality of the kernel Metadata. There is no impact |
| 197 | because all of ``cfg``, ``features``, ``patches``, and ``ktypes``, |
| 198 | contain "features" as far as the kernel tools are concerned. |
| 199 | |
| 200 | Paths used in kernel Metadata files are relative to base, which is |
| 201 | either |
| 202 | :term:`FILESEXTRAPATHS` if |
| 203 | you are creating Metadata in `recipe-space <#recipe-space-metadata>`__, |
| 204 | or the top level of |
| 205 | :yocto_git:`yocto-kernel-cache </cgit/cgit.cgi/yocto-kernel-cache/tree/>` |
| 206 | if you are creating `Metadata outside of the |
| 207 | recipe-space <#metadata-outside-the-recipe-space>`__. |
| 208 | |
| 209 | .. [1] |
| 210 | ``scc`` stands for Series Configuration Control, but the naming has |
| 211 | less significance in the current implementation of the tooling than |
| 212 | it had in the past. Consider ``scc`` files to be description files. |
| 213 | |
| 214 | Configuration |
| 215 | ------------- |
| 216 | |
| 217 | The simplest unit of kernel Metadata is the configuration-only feature. |
| 218 | This feature consists of one or more Linux kernel configuration |
| 219 | parameters in a configuration fragment file (``.cfg``) and a ``.scc`` |
| 220 | file that describes the fragment. |
| 221 | |
| 222 | As an example, consider the Symmetric Multi-Processing (SMP) fragment |
| 223 | used with the ``linux-yocto-4.12`` kernel as defined outside of the |
| 224 | recipe space (i.e. ``yocto-kernel-cache``). This Metadata consists of |
| 225 | two files: ``smp.scc`` and ``smp.cfg``. You can find these files in the |
| 226 | ``cfg`` directory of the ``yocto-4.12`` branch in the |
| 227 | ``yocto-kernel-cache`` Git repository: |
| 228 | :: |
| 229 | |
| 230 | cfg/smp.scc: |
| 231 | define KFEATURE_DESCRIPTION "Enable SMP for 32 bit builds" |
| 232 | define KFEATURE_COMPATIBILITY all |
| 233 | |
| 234 | kconf hardware smp.cfg |
| 235 | |
| 236 | cfg/smp.cfg: |
| 237 | CONFIG_SMP=y |
| 238 | CONFIG_SCHED_SMT=y |
| 239 | # Increase default NR_CPUS from 8 to 64 so that platform with |
| 240 | # more than 8 processors can be all activated at boot time |
| 241 | CONFIG_NR_CPUS=64 |
| 242 | # The following is needed when setting NR_CPUS to something |
| 243 | # greater than 8 on x86 architectures, it should be automatically |
| 244 | # disregarded by Kconfig when using a different arch |
| 245 | CONFIG_X86_BIGSMP=y |
| 246 | |
| 247 | You can find general information on configuration |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 248 | fragment files in the ":ref:`creating-config-fragments`" section. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 249 | |
| 250 | Within the ``smp.scc`` file, the |
| 251 | :term:`KFEATURE_DESCRIPTION` |
| 252 | statement provides a short description of the fragment. Higher level |
| 253 | kernel tools use this description. |
| 254 | |
| 255 | Also within the ``smp.scc`` file, the ``kconf`` command includes the |
| 256 | actual configuration fragment in an ``.scc`` file, and the "hardware" |
| 257 | keyword identifies the fragment as being hardware enabling, as opposed |
| 258 | to general policy, which would use the "non-hardware" keyword. The |
| 259 | distinction is made for the benefit of the configuration validation |
| 260 | tools, which warn you if a hardware fragment overrides a policy set by a |
| 261 | non-hardware fragment. |
| 262 | |
| 263 | .. note:: |
| 264 | |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 265 | The description file can include multiple ``kconf`` statements, one per |
| 266 | fragment. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 267 | |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 268 | As described in the |
| 269 | ":ref:`kernel-dev/kernel-dev-common:validating configuration`" section, you can |
| 270 | use the following BitBake command to audit your configuration: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 271 | :: |
| 272 | |
| 273 | $ bitbake linux-yocto -c kernel_configcheck -f |
| 274 | |
| 275 | Patches |
| 276 | ------- |
| 277 | |
| 278 | Patch descriptions are very similar to configuration fragment |
| 279 | descriptions, which are described in the previous section. However, |
| 280 | instead of a ``.cfg`` file, these descriptions work with source patches |
| 281 | (i.e. ``.patch`` files). |
| 282 | |
| 283 | A typical patch includes a description file and the patch itself. As an |
| 284 | example, consider the build patches used with the ``linux-yocto-4.12`` |
| 285 | kernel as defined outside of the recipe space (i.e. |
| 286 | ``yocto-kernel-cache``). This Metadata consists of several files: |
| 287 | ``build.scc`` and a set of ``*.patch`` files. You can find these files |
| 288 | in the ``patches/build`` directory of the ``yocto-4.12`` branch in the |
| 289 | ``yocto-kernel-cache`` Git repository. |
| 290 | |
| 291 | The following listings show the ``build.scc`` file and part of the |
| 292 | ``modpost-mask-trivial-warnings.patch`` file: |
| 293 | :: |
| 294 | |
| 295 | patches/build/build.scc: |
| 296 | patch arm-serialize-build-targets.patch |
| 297 | patch powerpc-serialize-image-targets.patch |
| 298 | patch kbuild-exclude-meta-directory-from-distclean-processi.patch |
| 299 | |
| 300 | # applied by kgit |
| 301 | # patch kbuild-add-meta-files-to-the-ignore-li.patch |
| 302 | |
| 303 | patch modpost-mask-trivial-warnings.patch |
| 304 | patch menuconfig-check-lxdiaglog.sh-Allow-specification-of.patch |
| 305 | |
| 306 | patches/build/modpost-mask-trivial-warnings.patch: |
| 307 | From bd48931bc142bdd104668f3a062a1f22600aae61 Mon Sep 17 00:00:00 2001 |
| 308 | From: Paul Gortmaker <paul.gortmaker@windriver.com> |
| 309 | Date: Sun, 25 Jan 2009 17:58:09 -0500 |
| 310 | Subject: [PATCH] modpost: mask trivial warnings |
| 311 | |
| 312 | Newer HOSTCC will complain about various stdio fcns because |
| 313 | . |
| 314 | . |
| 315 | . |
| 316 | char *dump_write = NULL, *files_source = NULL; |
| 317 | int opt; |
| 318 | -- |
| 319 | 2.10.1 |
| 320 | |
| 321 | generated by cgit v0.10.2 at 2017-09-28 15:23:23 (GMT) |
| 322 | |
| 323 | The description file can |
| 324 | include multiple patch statements where each statement handles a single |
| 325 | patch. In the example ``build.scc`` file, five patch statements exist |
| 326 | for the five patches in the directory. |
| 327 | |
| 328 | You can create a typical ``.patch`` file using ``diff -Nurp`` or |
| 329 | ``git format-patch`` commands. For information on how to create patches, |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 330 | see the ":ref:`kernel-dev/kernel-dev-common:using \`\`devtool\`\` to patch the kernel`" |
| 331 | and ":ref:`kernel-dev/kernel-dev-common:using traditional kernel development to patch the kernel`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 332 | sections. |
| 333 | |
| 334 | Features |
| 335 | -------- |
| 336 | |
| 337 | Features are complex kernel Metadata types that consist of configuration |
| 338 | fragments, patches, and possibly other feature description files. As an |
| 339 | example, consider the following generic listing: |
| 340 | :: |
| 341 | |
| 342 | features/myfeature.scc |
| 343 | define KFEATURE_DESCRIPTION "Enable myfeature" |
| 344 | |
| 345 | patch 0001-myfeature-core.patch |
| 346 | patch 0002-myfeature-interface.patch |
| 347 | |
| 348 | include cfg/myfeature_dependency.scc |
| 349 | kconf non-hardware myfeature.cfg |
| 350 | |
| 351 | This example shows how the ``patch`` and ``kconf`` commands are used as well |
| 352 | as how an additional feature description file is included with the |
| 353 | ``include`` command. |
| 354 | |
| 355 | Typically, features are less granular than configuration fragments and |
| 356 | are more likely than configuration fragments and patches to be the types |
| 357 | of things you want to specify in the ``KERNEL_FEATURES`` variable of the |
| 358 | Linux kernel recipe. See the "`Using Kernel Metadata in a |
| 359 | Recipe <#using-kernel-metadata-in-a-recipe>`__" section earlier in the |
| 360 | manual. |
| 361 | |
| 362 | Kernel Types |
| 363 | ------------ |
| 364 | |
| 365 | A kernel type defines a high-level kernel policy by aggregating |
| 366 | non-hardware configuration fragments with patches you want to use when |
| 367 | building a Linux kernel of a specific type (e.g. a real-time kernel). |
| 368 | Syntactically, kernel types are no different than features as described |
| 369 | in the "`Features <#features>`__" section. The |
| 370 | :term:`LINUX_KERNEL_TYPE` |
| 371 | variable in the kernel recipe selects the kernel type. For example, in |
| 372 | the ``linux-yocto_4.12.bb`` kernel recipe found in |
| 373 | ``poky/meta/recipes-kernel/linux``, a |
| 374 | :ref:`require <bitbake:require-inclusion>` directive |
| 375 | includes the ``poky/meta/recipes-kernel/linux/linux-yocto.inc`` file, |
| 376 | which has the following statement that defines the default kernel type: |
| 377 | :: |
| 378 | |
| 379 | LINUX_KERNEL_TYPE ??= "standard" |
| 380 | |
| 381 | Another example would be the real-time kernel (i.e. |
| 382 | ``linux-yocto-rt_4.12.bb``). This kernel recipe directly sets the kernel |
| 383 | type as follows: |
| 384 | :: |
| 385 | |
| 386 | LINUX_KERNEL_TYPE = "preempt-rt" |
| 387 | |
| 388 | .. note:: |
| 389 | |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 390 | You can find kernel recipes in the ``meta/recipes-kernel/linux`` directory |
| 391 | of the :ref:`overview-manual/overview-manual-development-environment:yocto project source repositories` |
| 392 | (e.g. ``poky/meta/recipes-kernel/linux/linux-yocto_4.12.bb``). See the |
| 393 | ":ref:`kernel-dev/kernel-dev-advanced:using kernel metadata in a recipe`" |
| 394 | section for more information. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 395 | |
| 396 | Three kernel types ("standard", "tiny", and "preempt-rt") are supported |
| 397 | for Linux Yocto kernels: |
| 398 | |
| 399 | - "standard": Includes the generic Linux kernel policy of the Yocto |
| 400 | Project linux-yocto kernel recipes. This policy includes, among other |
| 401 | things, which file systems, networking options, core kernel features, |
| 402 | and debugging and tracing options are supported. |
| 403 | |
| 404 | - "preempt-rt": Applies the ``PREEMPT_RT`` patches and the |
| 405 | configuration options required to build a real-time Linux kernel. |
| 406 | This kernel type inherits from the "standard" kernel type. |
| 407 | |
| 408 | - "tiny": Defines a bare minimum configuration meant to serve as a base |
| 409 | for very small Linux kernels. The "tiny" kernel type is independent |
| 410 | from the "standard" configuration. Although the "tiny" kernel type |
| 411 | does not currently include any source changes, it might in the |
| 412 | future. |
| 413 | |
| 414 | For any given kernel type, the Metadata is defined by the ``.scc`` (e.g. |
| 415 | ``standard.scc``). Here is a partial listing for the ``standard.scc`` |
| 416 | file, which is found in the ``ktypes/standard`` directory of the |
| 417 | ``yocto-kernel-cache`` Git repository: |
| 418 | :: |
| 419 | |
| 420 | # Include this kernel type fragment to get the standard features and |
| 421 | # configuration values. |
| 422 | |
| 423 | # Note: if only the features are desired, but not the configuration |
| 424 | # then this should be included as: |
| 425 | # include ktypes/standard/standard.scc nocfg |
| 426 | # if no chained configuration is desired, include it as: |
| 427 | # include ktypes/standard/standard.scc nocfg inherit |
| 428 | |
| 429 | |
| 430 | |
| 431 | include ktypes/base/base.scc |
| 432 | branch standard |
| 433 | |
| 434 | kconf non-hardware standard.cfg |
| 435 | |
| 436 | include features/kgdb/kgdb.scc |
| 437 | . |
| 438 | . |
| 439 | . |
| 440 | |
| 441 | include cfg/net/ip6_nf.scc |
| 442 | include cfg/net/bridge.scc |
| 443 | |
| 444 | include cfg/systemd.scc |
| 445 | |
| 446 | include features/rfkill/rfkill.scc |
| 447 | |
| 448 | As with any ``.scc`` file, a kernel type definition can aggregate other |
| 449 | ``.scc`` files with ``include`` commands. These definitions can also |
| 450 | directly pull in configuration fragments and patches with the ``kconf`` |
| 451 | and ``patch`` commands, respectively. |
| 452 | |
| 453 | .. note:: |
| 454 | |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 455 | It is not strictly necessary to create a kernel type ``.scc`` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 456 | file. The Board Support Package (BSP) file can implicitly define the |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 457 | kernel type using a ``define`` :term:`KTYPE` ``myktype`` line. See the |
| 458 | ":ref:`kernel-dev/kernel-dev-advanced:bsp descriptions`" section for more |
| 459 | information. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 460 | |
| 461 | BSP Descriptions |
| 462 | ---------------- |
| 463 | |
| 464 | BSP descriptions (i.e. ``*.scc`` files) combine kernel types with |
| 465 | hardware-specific features. The hardware-specific Metadata is typically |
| 466 | defined independently in the BSP layer, and then aggregated with each |
| 467 | supported kernel type. |
| 468 | |
| 469 | .. note:: |
| 470 | |
| 471 | For BSPs supported by the Yocto Project, the BSP description files |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 472 | are located in the ``bsp`` directory of the ``yocto-kernel-cache`` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 473 | repository organized under the "Yocto Linux Kernel" heading in the |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 474 | :yocto_git:`Yocto Project Source Repositories </>`. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 475 | |
| 476 | This section overviews the BSP description structure, the aggregation |
| 477 | concepts, and presents a detailed example using a BSP supported by the |
| 478 | Yocto Project (i.e. BeagleBone Board). For complete information on BSP |
| 479 | layer file hierarchy, see the :doc:`../bsp-guide/bsp-guide`. |
| 480 | |
| 481 | .. _bsp-description-file-overview: |
| 482 | |
| 483 | Description Overview |
| 484 | ~~~~~~~~~~~~~~~~~~~~ |
| 485 | |
| 486 | For simplicity, consider the following root BSP layer description files |
| 487 | for the BeagleBone board. These files employ both a structure and naming |
| 488 | convention for consistency. The naming convention for the file is as |
| 489 | follows: |
| 490 | :: |
| 491 | |
| 492 | bsp_root_name-kernel_type.scc |
| 493 | |
| 494 | Here are some example root layer |
| 495 | BSP filenames for the BeagleBone Board BSP, which is supported by the |
| 496 | Yocto Project: |
| 497 | :: |
| 498 | |
| 499 | beaglebone-standard.scc |
| 500 | beaglebone-preempt-rt.scc |
| 501 | |
| 502 | Each file uses the root name (i.e "beaglebone") BSP name followed by the |
| 503 | kernel type. |
| 504 | |
| 505 | Examine the ``beaglebone-standard.scc`` file: |
| 506 | :: |
| 507 | |
| 508 | define KMACHINE beaglebone |
| 509 | define KTYPE standard |
| 510 | define KARCH arm |
| 511 | |
| 512 | include ktypes/standard/standard.scc |
| 513 | branch beaglebone |
| 514 | |
| 515 | include beaglebone.scc |
| 516 | |
| 517 | # default policy for standard kernels |
| 518 | include features/latencytop/latencytop.scc |
| 519 | include features/profiling/profiling.scc |
| 520 | |
| 521 | Every top-level BSP description file |
| 522 | should define the :term:`KMACHINE`, |
| 523 | :term:`KTYPE`, and |
| 524 | :term:`KARCH` variables. These |
| 525 | variables allow the OpenEmbedded build system to identify the |
| 526 | description as meeting the criteria set by the recipe being built. This |
| 527 | example supports the "beaglebone" machine for the "standard" kernel and |
| 528 | the "arm" architecture. |
| 529 | |
| 530 | Be aware that a hard link between the ``KTYPE`` variable and a kernel |
| 531 | type description file does not exist. Thus, if you do not have the |
| 532 | kernel type defined in your kernel Metadata as it is here, you only need |
| 533 | to ensure that the |
| 534 | :term:`LINUX_KERNEL_TYPE` |
| 535 | variable in the kernel recipe and the ``KTYPE`` variable in the BSP |
| 536 | description file match. |
| 537 | |
| 538 | To separate your kernel policy from your hardware configuration, you |
| 539 | include a kernel type (``ktype``), such as "standard". In the previous |
| 540 | example, this is done using the following: |
| 541 | :: |
| 542 | |
| 543 | include ktypes/standard/standard.scc |
| 544 | |
| 545 | This file aggregates all the configuration |
| 546 | fragments, patches, and features that make up your standard kernel |
| 547 | policy. See the "`Kernel Types <#kernel-types>`__" section for more |
| 548 | information. |
| 549 | |
| 550 | To aggregate common configurations and features specific to the kernel |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 551 | for `mybsp`, use the following: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 552 | :: |
| 553 | |
| 554 | include mybsp.scc |
| 555 | |
| 556 | You can see that in the BeagleBone example with the following: |
| 557 | :: |
| 558 | |
| 559 | include beaglebone.scc |
| 560 | |
| 561 | For information on how to break a complete ``.config`` file into the various |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 562 | configuration fragments, see the ":ref:`creating-config-fragments`" section. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 563 | |
| 564 | Finally, if you have any configurations specific to the hardware that |
| 565 | are not in a ``*.scc`` file, you can include them as follows: |
| 566 | :: |
| 567 | |
| 568 | kconf hardware mybsp-extra.cfg |
| 569 | |
| 570 | The BeagleBone example does not include these |
| 571 | types of configurations. However, the Malta 32-bit board does |
| 572 | ("mti-malta32"). Here is the ``mti-malta32-le-standard.scc`` file: |
| 573 | :: |
| 574 | |
| 575 | define KMACHINE mti-malta32-le |
| 576 | define KMACHINE qemumipsel |
| 577 | define KTYPE standard |
| 578 | define KARCH mips |
| 579 | |
| 580 | include ktypes/standard/standard.scc |
| 581 | branch mti-malta32 |
| 582 | |
| 583 | include mti-malta32.scc |
| 584 | kconf hardware mti-malta32-le.cfg |
| 585 | |
| 586 | .. _bsp-description-file-example-minnow: |
| 587 | |
| 588 | Example |
| 589 | ~~~~~~~ |
| 590 | |
| 591 | Many real-world examples are more complex. Like any other ``.scc`` file, |
| 592 | BSP descriptions can aggregate features. Consider the Minnow BSP |
| 593 | definition given the ``linux-yocto-4.4`` branch of the |
| 594 | ``yocto-kernel-cache`` (i.e. |
| 595 | ``yocto-kernel-cache/bsp/minnow/minnow.scc``): |
| 596 | |
| 597 | .. note:: |
| 598 | |
| 599 | Although the Minnow Board BSP is unused, the Metadata remains and is |
| 600 | being used here just as an example. |
| 601 | |
| 602 | :: |
| 603 | |
| 604 | include cfg/x86.scc |
| 605 | include features/eg20t/eg20t.scc |
| 606 | include cfg/dmaengine.scc |
| 607 | include features/power/intel.scc |
| 608 | include cfg/efi.scc |
| 609 | include features/usb/ehci-hcd.scc |
| 610 | include features/usb/ohci-hcd.scc |
| 611 | include features/usb/usb-gadgets.scc |
| 612 | include features/usb/touchscreen-composite.scc |
| 613 | include cfg/timer/hpet.scc |
| 614 | include features/leds/leds.scc |
| 615 | include features/spi/spidev.scc |
| 616 | include features/i2c/i2cdev.scc |
| 617 | include features/mei/mei-txe.scc |
| 618 | |
| 619 | # Earlyprintk and port debug requires 8250 |
| 620 | kconf hardware cfg/8250.cfg |
| 621 | |
| 622 | kconf hardware minnow.cfg |
| 623 | kconf hardware minnow-dev.cfg |
| 624 | |
| 625 | The ``minnow.scc`` description file includes a hardware configuration |
| 626 | fragment (``minnow.cfg``) specific to the Minnow BSP as well as several |
| 627 | more general configuration fragments and features enabling hardware |
| 628 | found on the machine. This ``minnow.scc`` description file is then |
| 629 | included in each of the three "minnow" description files for the |
| 630 | supported kernel types (i.e. "standard", "preempt-rt", and "tiny"). |
| 631 | Consider the "minnow" description for the "standard" kernel type (i.e. |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 632 | ``minnow-standard.scc``): |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 633 | :: |
| 634 | |
| 635 | define KMACHINE minnow |
| 636 | define KTYPE standard |
| 637 | define KARCH i386 |
| 638 | |
| 639 | include ktypes/standard |
| 640 | |
| 641 | include minnow.scc |
| 642 | |
| 643 | # Extra minnow configs above the minimal defined in minnow.scc |
| 644 | include cfg/efi-ext.scc |
| 645 | include features/media/media-all.scc |
| 646 | include features/sound/snd_hda_intel.scc |
| 647 | |
| 648 | # The following should really be in standard.scc |
| 649 | # USB live-image support |
| 650 | include cfg/usb-mass-storage.scc |
| 651 | include cfg/boot-live.scc |
| 652 | |
| 653 | # Basic profiling |
| 654 | include features/latencytop/latencytop.scc |
| 655 | include features/profiling/profiling.scc |
| 656 | |
| 657 | # Requested drivers that don't have an existing scc |
| 658 | kconf hardware minnow-drivers-extra.cfg |
| 659 | |
| 660 | The ``include`` command midway through the file includes the ``minnow.scc`` description |
| 661 | that defines all enabled hardware for the BSP that is common to all |
| 662 | kernel types. Using this command significantly reduces duplication. |
| 663 | |
| 664 | Now consider the "minnow" description for the "tiny" kernel type (i.e. |
| 665 | ``minnow-tiny.scc``): |
| 666 | :: |
| 667 | |
| 668 | define KMACHINE minnow |
| 669 | define KTYPE tiny |
| 670 | define KARCH i386 |
| 671 | |
| 672 | include ktypes/tiny |
| 673 | |
| 674 | include minnow.scc |
| 675 | |
| 676 | As you might expect, |
| 677 | the "tiny" description includes quite a bit less. In fact, it includes |
| 678 | only the minimal policy defined by the "tiny" kernel type and the |
| 679 | hardware-specific configuration required for booting the machine along |
| 680 | with the most basic functionality of the system as defined in the base |
| 681 | "minnow" description file. |
| 682 | |
| 683 | Notice again the three critical variables: |
| 684 | :term:`KMACHINE`, |
| 685 | :term:`KTYPE`, and |
| 686 | :term:`KARCH`. Of these variables, only |
| 687 | ``KTYPE`` has changed to specify the "tiny" kernel type. |
| 688 | |
| 689 | Kernel Metadata Location |
| 690 | ======================== |
| 691 | |
| 692 | Kernel Metadata always exists outside of the kernel tree either defined |
| 693 | in a kernel recipe (recipe-space) or outside of the recipe. Where you |
| 694 | choose to define the Metadata depends on what you want to do and how you |
| 695 | intend to work. Regardless of where you define the kernel Metadata, the |
| 696 | syntax used applies equally. |
| 697 | |
| 698 | If you are unfamiliar with the Linux kernel and only wish to apply a |
| 699 | configuration and possibly a couple of patches provided to you by |
| 700 | others, the recipe-space method is recommended. This method is also a |
| 701 | good approach if you are working with Linux kernel sources you do not |
| 702 | control or if you just do not want to maintain a Linux kernel Git |
| 703 | repository on your own. For partial information on how you can define |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 704 | kernel Metadata in the recipe-space, see the |
| 705 | ":ref:`kernel-dev/kernel-dev-common:modifying an existing recipe`" section. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 706 | |
| 707 | Conversely, if you are actively developing a kernel and are already |
| 708 | maintaining a Linux kernel Git repository of your own, you might find it |
| 709 | more convenient to work with kernel Metadata kept outside the |
| 710 | recipe-space. Working with Metadata in this area can make iterative |
| 711 | development of the Linux kernel more efficient outside of the BitBake |
| 712 | environment. |
| 713 | |
| 714 | Recipe-Space Metadata |
| 715 | --------------------- |
| 716 | |
| 717 | When stored in recipe-space, the kernel Metadata files reside in a |
| 718 | directory hierarchy below |
| 719 | :term:`FILESEXTRAPATHS`. For |
| 720 | a linux-yocto recipe or for a Linux kernel recipe derived by copying and |
| 721 | modifying |
| 722 | ``oe-core/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb`` to |
| 723 | a recipe in your layer, ``FILESEXTRAPATHS`` is typically set to |
| 724 | ``${``\ :term:`THISDIR`\ ``}/${``\ :term:`PN`\ ``}``. |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 725 | See the ":ref:`kernel-dev/kernel-dev-common:modifying an existing recipe`" |
| 726 | section for more information. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 727 | |
| 728 | Here is an example that shows a trivial tree of kernel Metadata stored |
| 729 | in recipe-space within a BSP layer: |
| 730 | :: |
| 731 | |
| 732 | meta-my_bsp_layer/ |
| 733 | `-- recipes-kernel |
| 734 | `-- linux |
| 735 | `-- linux-yocto |
| 736 | |-- bsp-standard.scc |
| 737 | |-- bsp.cfg |
| 738 | `-- standard.cfg |
| 739 | |
| 740 | When the Metadata is stored in recipe-space, you must take steps to |
| 741 | ensure BitBake has the necessary information to decide what files to |
| 742 | fetch and when they need to be fetched again. It is only necessary to |
| 743 | specify the ``.scc`` files on the |
| 744 | :term:`SRC_URI`. BitBake parses them |
| 745 | and fetches any files referenced in the ``.scc`` files by the |
| 746 | ``include``, ``patch``, or ``kconf`` commands. Because of this, it is |
| 747 | necessary to bump the recipe :term:`PR` |
| 748 | value when changing the content of files not explicitly listed in the |
| 749 | ``SRC_URI``. |
| 750 | |
| 751 | If the BSP description is in recipe space, you cannot simply list the |
| 752 | ``*.scc`` in the ``SRC_URI`` statement. You need to use the following |
| 753 | form from your kernel append file: |
| 754 | :: |
| 755 | |
| 756 | SRC_URI_append_myplatform = " \ |
| 757 | file://myplatform;type=kmeta;destsuffix=myplatform \ |
| 758 | " |
| 759 | |
| 760 | Metadata Outside the Recipe-Space |
| 761 | --------------------------------- |
| 762 | |
| 763 | When stored outside of the recipe-space, the kernel Metadata files |
| 764 | reside in a separate repository. The OpenEmbedded build system adds the |
| 765 | Metadata to the build as a "type=kmeta" repository through the |
| 766 | :term:`SRC_URI` variable. As an |
| 767 | example, consider the following ``SRC_URI`` statement from the |
| 768 | ``linux-yocto_4.12.bb`` kernel recipe: |
| 769 | :: |
| 770 | |
| 771 | SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.12.git;name=machine;branch=${KBRANCH}; \ |
| 772 | git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.12;destsuffix=${KMETA}" |
| 773 | |
| 774 | |
| 775 | ``${KMETA}``, in this context, is simply used to name the directory into |
| 776 | which the Git fetcher places the Metadata. This behavior is no different |
| 777 | than any multi-repository ``SRC_URI`` statement used in a recipe (e.g. |
| 778 | see the previous section). |
| 779 | |
| 780 | You can keep kernel Metadata in a "kernel-cache", which is a directory |
| 781 | containing configuration fragments. As with any Metadata kept outside |
| 782 | the recipe-space, you simply need to use the ``SRC_URI`` statement with |
| 783 | the "type=kmeta" attribute. Doing so makes the kernel Metadata available |
| 784 | during the configuration phase. |
| 785 | |
| 786 | If you modify the Metadata, you must not forget to update the ``SRCREV`` |
| 787 | statements in the kernel's recipe. In particular, you need to update the |
| 788 | ``SRCREV_meta`` variable to match the commit in the ``KMETA`` branch you |
| 789 | wish to use. Changing the data in these branches and not updating the |
| 790 | ``SRCREV`` statements to match will cause the build to fetch an older |
| 791 | commit. |
| 792 | |
| 793 | Organizing Your Source |
| 794 | ====================== |
| 795 | |
| 796 | Many recipes based on the ``linux-yocto-custom.bb`` recipe use Linux |
| 797 | kernel sources that have only a single branch - "master". This type of |
| 798 | repository structure is fine for linear development supporting a single |
| 799 | machine and architecture. However, if you work with multiple boards and |
| 800 | architectures, a kernel source repository with multiple branches is more |
| 801 | efficient. For example, suppose you need a series of patches for one |
| 802 | board to boot. Sometimes, these patches are works-in-progress or |
| 803 | fundamentally wrong, yet they are still necessary for specific boards. |
| 804 | In these situations, you most likely do not want to include these |
| 805 | patches in every kernel you build (i.e. have the patches as part of the |
| 806 | lone "master" branch). It is situations like these that give rise to |
| 807 | multiple branches used within a Linux kernel sources Git repository. |
| 808 | |
| 809 | Repository organization strategies exist that maximize source reuse, |
| 810 | remove redundancy, and logically order your changes. This section |
| 811 | presents strategies for the following cases: |
| 812 | |
| 813 | - Encapsulating patches in a feature description and only including the |
| 814 | patches in the BSP descriptions of the applicable boards. |
| 815 | |
| 816 | - Creating a machine branch in your kernel source repository and |
| 817 | applying the patches on that branch only. |
| 818 | |
| 819 | - Creating a feature branch in your kernel source repository and |
| 820 | merging that branch into your BSP when needed. |
| 821 | |
| 822 | The approach you take is entirely up to you and depends on what works |
| 823 | best for your development model. |
| 824 | |
| 825 | Encapsulating Patches |
| 826 | --------------------- |
| 827 | |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 828 | If you are reusing patches from an external tree and are not working on |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 829 | the patches, you might find the encapsulated feature to be appropriate. |
| 830 | Given this scenario, you do not need to create any branches in the |
| 831 | source repository. Rather, you just take the static patches you need and |
| 832 | encapsulate them within a feature description. Once you have the feature |
| 833 | description, you simply include that into the BSP description as |
| 834 | described in the "`BSP Descriptions <#bsp-descriptions>`__" section. |
| 835 | |
| 836 | You can find information on how to create patches and BSP descriptions |
| 837 | in the "`Patches <#patches>`__" and "`BSP |
| 838 | Descriptions <#bsp-descriptions>`__" sections. |
| 839 | |
| 840 | Machine Branches |
| 841 | ---------------- |
| 842 | |
| 843 | When you have multiple machines and architectures to support, or you are |
| 844 | actively working on board support, it is more efficient to create |
| 845 | branches in the repository based on individual machines. Having machine |
| 846 | branches allows common source to remain in the "master" branch with any |
| 847 | features specific to a machine stored in the appropriate machine branch. |
| 848 | This organization method frees you from continually reintegrating your |
| 849 | patches into a feature. |
| 850 | |
| 851 | Once you have a new branch, you can set up your kernel Metadata to use |
| 852 | the branch a couple different ways. In the recipe, you can specify the |
| 853 | new branch as the ``KBRANCH`` to use for the board as follows: |
| 854 | :: |
| 855 | |
| 856 | KBRANCH = "mynewbranch" |
| 857 | |
| 858 | Another method is to use the ``branch`` command in the BSP |
| 859 | description: |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 860 | :: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 861 | |
| 862 | mybsp.scc: |
| 863 | define KMACHINE mybsp |
| 864 | define KTYPE standard |
| 865 | define KARCH i386 |
| 866 | include standard.scc |
| 867 | |
| 868 | branch mynewbranch |
| 869 | |
| 870 | include mybsp-hw.scc |
| 871 | |
| 872 | If you find yourself with numerous branches, you might consider using a |
| 873 | hierarchical branching system similar to what the Yocto Linux Kernel Git |
| 874 | repositories use: |
| 875 | :: |
| 876 | |
| 877 | common/kernel_type/machine |
| 878 | |
| 879 | If you had two kernel types, "standard" and "small" for instance, three |
| 880 | machines, and common as ``mydir``, the branches in your Git repository |
| 881 | might look like this: |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 882 | :: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 883 | |
| 884 | mydir/base |
| 885 | mydir/standard/base |
| 886 | mydir/standard/machine_a |
| 887 | mydir/standard/machine_b |
| 888 | mydir/standard/machine_c |
| 889 | mydir/small/base |
| 890 | mydir/small/machine_a |
| 891 | |
| 892 | This organization can help clarify the branch relationships. In this |
| 893 | case, ``mydir/standard/machine_a`` includes everything in ``mydir/base`` |
| 894 | and ``mydir/standard/base``. The "standard" and "small" branches add |
| 895 | sources specific to those kernel types that for whatever reason are not |
| 896 | appropriate for the other branches. |
| 897 | |
| 898 | .. note:: |
| 899 | |
| 900 | The "base" branches are an artifact of the way Git manages its data |
| 901 | internally on the filesystem: Git will not allow you to use |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 902 | ``mydir/standard`` and ``mydir/standard/machine_a`` because it would have to |
| 903 | create a file and a directory named "standard". |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 904 | |
| 905 | Feature Branches |
| 906 | ---------------- |
| 907 | |
| 908 | When you are actively developing new features, it can be more efficient |
| 909 | to work with that feature as a branch, rather than as a set of patches |
| 910 | that have to be regularly updated. The Yocto Project Linux kernel tools |
| 911 | provide for this with the ``git merge`` command. |
| 912 | |
| 913 | To merge a feature branch into a BSP, insert the ``git merge`` command |
| 914 | after any ``branch`` commands: |
| 915 | :: |
| 916 | |
| 917 | mybsp.scc: |
| 918 | define KMACHINE mybsp |
| 919 | define KTYPE standard |
| 920 | define KARCH i386 |
| 921 | include standard.scc |
| 922 | |
| 923 | branch mynewbranch |
| 924 | git merge myfeature |
| 925 | |
| 926 | include mybsp-hw.scc |
| 927 | |
| 928 | .. _scc-reference: |
| 929 | |
| 930 | SCC Description File Reference |
| 931 | ============================== |
| 932 | |
| 933 | This section provides a brief reference for the commands you can use |
| 934 | within an SCC description file (``.scc``): |
| 935 | |
| 936 | - ``branch [ref]``: Creates a new branch relative to the current branch |
| 937 | (typically ``${KTYPE}``) using the currently checked-out branch, or |
| 938 | "ref" if specified. |
| 939 | |
| 940 | - ``define``: Defines variables, such as |
| 941 | :term:`KMACHINE`, |
| 942 | :term:`KTYPE`, |
| 943 | :term:`KARCH`, and |
| 944 | :term:`KFEATURE_DESCRIPTION`. |
| 945 | |
| 946 | - ``include SCC_FILE``: Includes an SCC file in the current file. The |
| 947 | file is parsed as if you had inserted it inline. |
| 948 | |
| 949 | - ``kconf [hardware|non-hardware] CFG_FILE``: Queues a configuration |
| 950 | fragment for merging into the final Linux ``.config`` file. |
| 951 | |
| 952 | - ``git merge GIT_BRANCH``: Merges the feature branch into the current |
| 953 | branch. |
| 954 | |
| 955 | - ``patch PATCH_FILE``: Applies the patch to the current Git branch. |
| 956 | |
| 957 | |