From patchwork Tue Dec 1 15:22:38 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 106817 Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.13170.1796138591040274327 for ; Tue, 01 Dec 2026 07:23:11 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=dG8Znwyw; spf=pass (domain: gmail.com, ip: 209.85.167.171, mailfrom: twoerner@gmail.com) Received: by mail-oi1-f171.google.com with SMTP id 5614622812f47-4e4a4d77e5bso8019221b6e.0 for ; Tue, 01 Dec 2026 07:23:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796138590; x=1796743390; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=PsixwUBsT6jfmbwxZbHoJlrdBeTTyO1oxI71PriCvCU=; b=dG8ZnwywLY8lrK+ppIdYpoPV1A+bWkxixFTu4yundwjFBrj8AvXBxq0WgyM5xvuFdu b+/0SW0Qg7LuSPK/ww4sr2TFy0bX68O8HzKEr7id06o3xL9r1y7qs/EOS+PqU3FqNxDM SJyWpe+Dn+YItwagJ/ohVL1xklLismgcNrqEa53pr3IF8+KbkqMvccj4Um6k0cvj1c3d Jmml+p7ZK5bO3NQG22yjOtDTeZRwFePP8Lsyduw85JiuSChIf5F28QvSZuVXqLKJXa6R LZDLJZ2n3ACDhVsRvTvOfOIPdX9DKFi8Ev8DR9Xz7rk+ICTJOAaaaEW92EQ/ewGwpABT SMZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796138590; x=1796743390; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=PsixwUBsT6jfmbwxZbHoJlrdBeTTyO1oxI71PriCvCU=; b=nWrgNGrIXuGRupGosoYbPSari54c/cmSt2HYPzYMaAhSARaHIOJxEXfzztbXiZ+qaV hALK+0UeaMyWkNQbguthGhY3w20DLKluc18YErELS4bTv0b3McSScT0nUjTRCAbvRTJt LH8jDmwMoLyCzJq2L7OmR+NSp0xMmHocvjMEGiyRWDJM+uNZIPp2qLkajuQKh+P4d6wU 6lDT0vpMxfeF7E7aBypXt+O7me0fuKwczDL592aSjtlOROnw/7+GUSuaM9JKEHOAo4D7 cbgbvrxuYXNoxZPCx9DX1gPSa5G7EwL7DuoxZ8NZPXOCNrLy8tpeVq4IPdeZ7QmfeS9O 3oLA== X-Gm-Message-State: APuU4Z/MHgGh2WX4/eTeQUh31L6lUdYr+ekfiAy4HpVgsSig/xyMv2Yn CfDRKHCr5gnC54AIAU/59pkOevRmdEXavk00I0fepg5PBJYD6roWKUy7AWmX4w== X-Gm-Gg: AZFdTZdw2iJWOuDMN20SaMqAjMhAtuHNh4j8jPq90LJiH6Vk1Hw1nGAaKjmoG+BiIFf /O5Gc4Y+0LRWQsWwSvYneOlFyQPSfyMWiiKIVNcnWpZbgjELR3XE5AdX2ei1o2xjg4kuNl6/hJ9 3B/Q15p7vRhj+FEXL3x9KGTdtP2Sm6W2E/53FNTtpaCBMv+a4sJJd88K4LfV1kc7Isrbs9FeJvS FrX72xF5qXypFiWHOu6o0rJPCUum0EkUcrBYpMOFN/aj76wMTy+Ye8I0byG4acaB9sUlU1SFD5J nkowMa7ked61s+lkEAwigbzxaQJBG9rw/Z7sxRsfAeo2bRmUeBcpABtShYMvK0fXNDkpHjfyj0+ S6LqmBZ2Em5FGROhdkmYVfRKxXhWmvLryW9lS5KTADwA9JKVR12wbeHoCHcYBp37lVNuEvBkaKn V9bbkVlX5bsePhO0AU0OtzrrhbBIjgxnKPyqHTvPYXi7whgO43JVv0QFliE+1NX/OGCHQNKOKvq nVX80Hfvl0uYAnJIZeSegEBkWNyNfjgDopEs4zC9zNNMkt+aDS7fgNT8S+QNKCOU0nvufvfL64q k0ZA9Vbjx2fA/UpdR3ztOp33pK2maEtwRiH+1+VgmLVZ6LH4EQk1T/pKlpSAVgBPNdVQBajJCqM zxewPxglBcRSGKkshDWpRHwh2n43k9fo= X-Received: by 2002:a05:6808:250f:b0:564:57c3:2b28 with SMTP id 5614622812f47-57a095fcf70mr28148112b6e.8.1796138589078; Tue, 01 Dec 2026 07:23:09 -0800 (PST) Return-Path: Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id 5614622812f47-57a31929223sm27818249b6e.1.2026.12.01.07.23.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 07:23:07 -0800 (PST) From: Trevor Woerner To: docs@lists.yoctoproject.org Subject: [PATCH 05/16] kernel-dev: state the language of the blocks that are not BitBake Date: Tue, 1 Dec 2026 10:22:38 -0500 Message-ID: <20261201152251.2742634-6-twoerner@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20261201152251.2742634-1-twoerner@gmail.com> References: <20261201152251.2742634-1-twoerner@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Tue, 01 Dec 2026 15:23:20 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/10863 The manuals are moving to a default of bitbake for code blocks, so a BitBake block needs no language and every other block needs one. This gives the blocks in this manual that are not BitBake their language. AI-Generated: codex/claude-opus 5.5 (xhigh) Signed-off-by: Trevor Woerner --- documentation/kernel-dev/advanced.rst | 74 +++++--- documentation/kernel-dev/common.rst | 208 +++++++++++++++------ documentation/kernel-dev/concepts-appx.rst | 8 +- documentation/kernel-dev/maint-appx.rst | 20 +- 4 files changed, 228 insertions(+), 82 deletions(-) diff --git a/documentation/kernel-dev/advanced.rst b/documentation/kernel-dev/advanced.rst index ecd0137fa5fd..7e89c1924441 100644 --- a/documentation/kernel-dev/advanced.rst +++ b/documentation/kernel-dev/advanced.rst @@ -152,7 +152,9 @@ 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:: +following Metadata file hierarchy is recommended: + +.. code-block:: text base/ bsp/ @@ -218,7 +220,7 @@ two files: ``smp.scc`` and ``smp.cfg``. You can find these files in the ``cfg`` directory of the ``yocto-4.12`` branch in the ``yocto-kernel-cache`` Git repository. -.. code-block:: +.. code-block:: shell :caption: cfg/smp.scc define KFEATURE_DESCRIPTION "Enable SMP for 32 bit builds" @@ -226,7 +228,7 @@ two files: ``smp.scc`` and ``smp.cfg``. You can find these files in the kconf hardware smp.cfg -.. code-block:: +.. code-block:: ini :caption: cfg/smp.cfg CONFIG_SMP=y @@ -262,7 +264,9 @@ non-hardware fragment. As described in the ":ref:`kernel-dev/common:validating configuration`" section, you can -use the following BitBake command to audit your configuration:: +use the following BitBake command to audit your configuration: + +.. code-block:: console $ bitbake linux-yocto -c kernel_configcheck -f @@ -282,7 +286,7 @@ kernel as defined outside of the recipe space (i.e. in the ``patches/build`` directory of the ``yocto-4.12`` branch in the ``yocto-kernel-cache`` Git repository. -.. code-block:: +.. code-block:: shell :caption: patches/build/build.scc patch arm-serialize-build-targets.patch @@ -297,7 +301,7 @@ in the ``patches/build`` directory of the ``yocto-4.12`` branch in the and part of the patch it names: -.. code-block:: +.. code-block:: text :caption: patches/build/modpost-mask-trivial-warnings.patch From bd48931bc142bdd104668f3a062a1f22600aae61 Mon Sep 17 00:00:00 2001 @@ -334,7 +338,7 @@ Features are complex kernel Metadata types that consist of configuration fragments, patches, and possibly other feature description files. As an example, consider the following generic listing: -.. code-block:: +.. code-block:: shell :caption: features/myfeature.scc define KFEATURE_DESCRIPTION "Enable myfeature" @@ -406,7 +410,9 @@ for Linux Yocto kernels: For any given kernel type, the Metadata is defined by the ``.scc`` (e.g. ``standard.scc``). Here is a partial listing for the ``standard.scc`` file, which is found in the ``ktypes/standard`` directory of the -``yocto-kernel-cache`` Git repository:: +``yocto-kernel-cache`` Git repository: + +.. code-block:: shell # Include this kernel type fragment to get the standard features and # configuration values. @@ -475,13 +481,17 @@ Description Overview For simplicity, consider the following root BSP layer description files for the BeagleBone board. These files employ both a structure and naming convention for consistency. The naming convention for the file is as -follows:: +follows: + +.. code-block:: text bsp_root_name-kernel_type.scc Here are some example root layer BSP filenames for the BeagleBone Board BSP, which is supported by the -Yocto Project:: +Yocto Project: + +.. code-block:: text beaglebone-standard.scc beaglebone-preempt-rt.scc @@ -489,7 +499,9 @@ Yocto Project:: Each file uses the root name (i.e "beaglebone") BSP name followed by the kernel type. -Examine the ``beaglebone-standard.scc`` file:: +Examine the ``beaglebone-standard.scc`` file: + +.. code-block:: shell define KMACHINE beaglebone define KTYPE standard @@ -545,13 +557,17 @@ For information on how to break a complete ``.config`` file into the various configuration fragments, see the ":ref:`kernel-dev/common:creating configuration fragments`" section. Finally, if you have any configurations specific to the hardware that -are not in a ``*.scc`` file, you can include them as follows:: +are not in a ``*.scc`` file, you can include them as follows: + +.. code-block:: shell kconf hardware mybsp-extra.cfg The BeagleBone example does not include these types of configurations. However, the Malta 32-bit board does -("mti-malta32"). Here is the ``mti-malta32-le-standard.scc`` file:: +("mti-malta32"). Here is the ``mti-malta32-le-standard.scc`` file: + +.. code-block:: shell define KMACHINE mti-malta32-le define KMACHINE qemumipsel @@ -570,7 +586,9 @@ Example Many real-world examples are more complex. Like any other ``.scc`` file, BSP descriptions can aggregate features. Consider the Minnow BSP definition given the ``linux-yocto-4.4`` branch of the -``yocto-kernel-cache`` (i.e. ``yocto-kernel-cache/bsp/minnow/minnow.scc``):: +``yocto-kernel-cache`` (i.e. ``yocto-kernel-cache/bsp/minnow/minnow.scc``): + +.. code-block:: shell include cfg/x86.scc include features/eg20t/eg20t.scc @@ -605,7 +623,9 @@ found on the machine. This ``minnow.scc`` description file is then included in each of the three "minnow" description files for the supported kernel types (i.e. "standard", "preempt-rt", and "tiny"). Consider the "minnow" description for the "standard" kernel type (i.e. -``minnow-standard.scc``):: +``minnow-standard.scc``): + +.. code-block:: shell define KMACHINE minnow define KTYPE standard @@ -637,7 +657,9 @@ that defines all enabled hardware for the BSP that is common to all kernel types. Using this command significantly reduces duplication. Now consider the "minnow" description for the "tiny" kernel type (i.e. -``minnow-tiny.scc``):: +``minnow-tiny.scc``): + +.. code-block:: shell define KMACHINE minnow define KTYPE tiny @@ -699,7 +721,9 @@ See the ":ref:`kernel-dev/common: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:: +in recipe-space within a BSP layer: + +.. code-block:: text meta-my_bsp_layer/ `-- recipes-kernel @@ -810,7 +834,9 @@ supplied as a fragment, its ``patch`` directives, and those of everything it If your BSP genuinely lives outside the kernel source history (the branch you build does **not** already contain the BSP commits, and the patches *must* be applied), the BSP description can opt back in to patch application by adding the -following directive to the description itself:: +following directive to the description itself: + +.. code-block:: shell define KMETA_EXTERNAL_BSP 1 @@ -884,7 +910,7 @@ new branch as the :term:`KBRANCH` to use for the board as follows:: Another method is to use the ``branch`` command in the BSP description: -.. code-block:: +.. code-block:: shell :caption: mybsp.scc define KMACHINE mybsp @@ -898,13 +924,17 @@ description: If you find yourself with numerous branches, you might consider using a hierarchical branching system similar to what the Yocto Linux Kernel Git -repositories use:: +repositories use: + +.. code-block:: text 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:: +might look like this: + +.. code-block:: text mydir/base mydir/standard/base @@ -938,7 +968,7 @@ 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: -.. code-block:: +.. code-block:: shell :caption: mybsp.scc define KMACHINE mybsp diff --git a/documentation/kernel-dev/common.rst b/documentation/kernel-dev/common.rst index c478e64d6577..dd8d3cb79386 100644 --- a/documentation/kernel-dev/common.rst +++ b/documentation/kernel-dev/common.rst @@ -69,7 +69,9 @@ section: #. *Create a Layer for Patches:* You need to create a layer to hold patches created for the kernel image. You can use the - ``bitbake-layers create-layer`` command as follows:: + ``bitbake-layers create-layer`` command as follows: + + .. code-block:: console $ cd bitbake-builds/build $ bitbake-layers create-layer ../layers/meta-mylayer @@ -92,14 +94,18 @@ section: #. *Inform the BitBake Build Environment About Your Layer:* As directed when you created your layer, you need to add the layer to the :term:`BBLAYERS` variable in the - :ref:`structure-build-conf-bblayers.conf` file as follows:: + :ref:`structure-build-conf-bblayers.conf` file as follows: + + .. code-block:: console $ cd bitbake-builds/build $ bitbake-layers add-layer ../../meta-mylayer NOTE: Starting bitbake server... #. *Build the Clean Image:* The final step in preparing to work on the - kernel is to build an initial image using ``bitbake``:: + kernel is to build an initial image using ``bitbake``: + + .. code-block:: console $ bitbake core-image-minimal Parsing recipes: 100% |##########################################| Time: 0:00:05 @@ -164,7 +170,9 @@ section: #. *Create a Layer for Patches:* You need to create a layer to hold patches created for the kernel image. You can use the - ``bitbake-layers create-layer`` command as follows:: + ``bitbake-layers create-layer`` command as follows: + + .. code-block:: console $ cd bitbake-builds/build $ bitbake-layers create-layer ../../meta-mylayer @@ -187,7 +195,9 @@ section: #. *Inform the BitBake Build Environment About Your Layer:* As directed when you created your layer, you need to add the layer to the :term:`BBLAYERS` variable in the - :ref:`structure-build-conf-bblayers.conf` file as follows:: + :ref:`structure-build-conf-bblayers.conf` file as follows: + + .. code-block:: console $ cd bitbake-builds/build $ bitbake-layers add-layer ../../meta-mylayer @@ -204,7 +214,9 @@ section: ``standard/base`` branch. The following commands show how to create a local copy of the - ``linux-yocto-4.12`` kernel and be in the ``standard/base`` branch:: + ``linux-yocto-4.12`` kernel and be in the ``standard/base`` branch: + + .. code-block:: console $ cd ~ $ git clone https://git.yoctoproject.org/linux-yocto-4.12 --branch standard/base @@ -230,7 +242,9 @@ section: the ``yocto-4.12`` branch. The following commands show how to create a local copy of the - ``yocto-kernel-cache`` and switch to the ``yocto-4.12`` branch:: + ``yocto-kernel-cache`` and switch to the ``yocto-4.12`` branch: + + .. code-block:: console $ cd ~ $ git clone https://git.yoctoproject.org/yocto-kernel-cache --branch yocto-4.12 @@ -273,7 +287,9 @@ following section describes how to create a layer without the aid of tools. These steps assume creation of a layer named ``mylayer`` in your home directory: -#. *Create Structure*: Create the layer's structure:: +#. *Create Structure*: Create the layer's structure: + + .. code-block:: console $ mkdir -p meta-mylayer/conf meta-mylayer/recipes-kernel/linux/linux-yocto @@ -362,7 +378,9 @@ The path ``${``\ :term:`THISDIR`\ ``}/${``\ :term:`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 :term:`FILESPATH` as described above, you must place the files in -your layer in the following area:: +your layer in the following area: + +.. code-block:: text your-layer/recipes-kernel/linux/linux-yocto/ @@ -553,7 +571,9 @@ 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 ``${PN}`` directory -with the following content (without indentation):: +with the following content (without indentation): + +.. code-block:: ini CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y @@ -650,7 +670,9 @@ the ":ref:`kernel-dev/common:getting ready to develop using ``devtool```" Sectio ":ref:`kernel-dev/common:getting ready to develop using ``devtool```" section for more information. - Use the following ``devtool`` command to check out the code:: + Use the following ``devtool`` command to check out the code: + + .. code-block:: console $ devtool modify linux-yocto @@ -661,12 +683,16 @@ the ":ref:`kernel-dev/common:getting ready to develop using ``devtool```" Sectio noted where you can find the source files (e.g. ``build/workspace/sources/linux-yocto``). Change to where the kernel source code is before making your edits to the - ``calibrate.c`` file:: + ``calibrate.c`` file: + + .. code-block:: console $ cd build/workspace/sources/linux-yocto #. *Edit the source file*: Edit the ``init/calibrate.c`` file to have - the following changes:: + the following changes: + + .. code-block:: c void calibrate_delay(void) { @@ -686,13 +712,17 @@ the ":ref:`kernel-dev/common:getting ready to develop using ``devtool```" Sectio */ #. *Build the Updated Kernel Source:* To build the updated kernel - source, use ``devtool``:: + source, use ``devtool``: + + .. code-block:: console $ devtool build linux-yocto #. *Create the Image With the New Kernel:* Use the ``devtool build-image`` command to create a new image that has the - new kernel:: + new kernel: + + .. code-block:: console $ cd ~ $ devtool build-image core-image-minimal @@ -709,7 +739,9 @@ the ":ref:`kernel-dev/common:getting ready to develop using ``devtool```" Sectio using QEMU to verify your changes: #. *Boot the image*: Boot the modified image in the QEMU emulator - using this command:: + using this command: + + .. code-block:: console $ runqemu qemux86 @@ -717,7 +749,7 @@ the ":ref:`kernel-dev/common:getting ready to develop using ``devtool```" Sectio password and then use the following shell command to scroll through the console's boot output. - .. code-block:: none + .. code-block:: console root@qemux86:~# dmesg | less @@ -727,7 +759,9 @@ the ":ref:`kernel-dev/common:getting ready to develop using ``devtool```" Sectio #. *Stage and commit your changes*: Change your working directory to where you modified the ``calibrate.c`` file - and use these Git commands to stage and commit your changes:: + and use these Git commands to stage and commit your changes: + + .. code-block:: console $ cd build/workspace/sources/linux-yocto $ git status @@ -736,7 +770,9 @@ the ":ref:`kernel-dev/common:getting ready to develop using ``devtool```" Sectio #. *Export the Patches and Create an Append File:* To export your commits as patches and create a ``.bbappend`` file, use the following - command. This example uses the previously established layer named ``meta-mylayer``:: + command. This example uses the previously established layer named ``meta-mylayer``: + + .. code-block:: console $ devtool finish linux-yocto ~/meta-mylayer @@ -753,7 +789,9 @@ the ":ref:`kernel-dev/common:getting ready to develop using ``devtool```" Sectio #. *Build the Image With Your Modified Kernel:* You can now build an image that includes your kernel patches. Execute the following command from your :term:`Build Directory` in the terminal - set up to run BitBake:: + set up to run BitBake: + + .. code-block:: console $ cd bitbake-builds/build $ bitbake core-image-minimal @@ -797,12 +835,16 @@ Section. #. *Change the working directory*: You need to locate the source files in the local copy of the kernel Git repository. Change to where the kernel source code is before making your edits to the - ``calibrate.c`` file:: + ``calibrate.c`` file: + + .. code-block:: console $ cd ~/linux-yocto-4.12/init #. *Edit the source file*: Edit the ``calibrate.c`` file to have the - following changes:: + following changes: + + .. code-block:: c void calibrate_delay(void) { @@ -822,7 +864,9 @@ Section. */ #. *Stage and Commit Your Changes:* Use standard Git commands to stage - and commit the changes you just made:: + and commit the changes you just made: + + .. code-block:: console $ git add calibrate.c $ git commit -m "calibrate.c - Added some printk statements" @@ -837,7 +881,9 @@ Section. updated kernel source files. Add :term:`SRC_URI` and :term:`SRCREV` statements similar - to the following to your :ref:`structure-build-conf-local.conf`:: + to the following to your :ref:`structure-build-conf-local.conf`: + + .. code-block:: console $ cd bitbake-builds/build/conf @@ -857,14 +903,18 @@ Section. #. *Build the Image:* With the source modified, your changes staged and committed, and the :ref:`structure-build-conf-local.conf` file pointing to the kernel files, - you can now use BitBake to build the image:: + you can now use BitBake to build the image: + + .. code-block:: console $ cd bitbake-builds/build $ bitbake core-image-minimal #. *Boot the image*: Boot the modified image in the QEMU emulator using this command. When prompted to login to the QEMU console, use "root" - with no password:: + with no password: + + .. code-block:: console $ cd bitbake-builds/build $ runqemu qemux86 @@ -873,7 +923,7 @@ Section. changes rapidly scroll by. If not, use these commands to see your changes: - .. code-block:: none + .. code-block:: console root@qemux86:~# dmesg | less @@ -883,7 +933,9 @@ Section. #. *Generate the Patch File:* Once you are sure that your patch works correctly, you can generate a ``*.patch`` file in the kernel source - repository:: + repository: + + .. code-block:: console $ cd ~/linux-yocto-4.12/init $ git format-patch -1 @@ -896,14 +948,18 @@ Section. ``meta-mylayer``. When the layer was created using the ``yocto-create`` script, no additional hierarchy was created to support patches. Before moving the patch file, you need to add - additional structure to your layer using the following commands:: + additional structure to your layer using the following commands: + + .. code-block:: console $ cd ~/meta-mylayer $ mkdir -p recipes-kernel recipes-kernel/linux/linux-yocto Once you have created this hierarchy in your layer, you can move the patch file using the - following command:: + following command: + + .. code-block:: console $ mv ~/linux-yocto-4.12/init/0001-calibrate.c-Added-some-printk-statements.patch ~/meta-mylayer/recipes-kernel/linux/linux-yocto @@ -931,7 +987,9 @@ Section. To build ``core-image-minimal`` again and see the effects of your patch, you can essentially eliminate the temporary source files saved in ``bitbake-builds/build/tmp/work/...`` and residual effects of the build by entering - the following sequence of commands:: + the following sequence of commands: + + .. code-block:: console $ cd bitbake-builds/build $ bitbake -c cleanall linux-yocto @@ -976,7 +1034,9 @@ environment, you must do the following: - You must be sure of the state of your build's configuration in the :term:`Source Directory`. -- Your build host must have the following two packages installed:: +- Your build host must have the following two packages installed: + + .. code-block:: text libncurses5-dev libtinfo-dev @@ -984,7 +1044,9 @@ environment, you must do the following: The following commands initialize the BitBake environment, run the :ref:`ref-tasks-kernel_configme` task, and launch ``menuconfig``. These commands assume the Source -Directory's top-level folder is ``work``:: +Directory's top-level folder is ``work``: + +.. code-block:: console $ cd work $ source layers/openembedded-core/oe-init-build-env @@ -1046,7 +1108,9 @@ the ``.config`` file would be: Within the ``.config`` file, you can see the kernel settings. For example, the following entry shows that symmetric multi-processor -support is not set:: +support is not set: + +.. code-block:: ini # CONFIG_SMP is not set @@ -1136,7 +1200,9 @@ It is simple to create a configuration fragment. One method is to use shell commands. For example, issuing the following from the shell creates a configuration fragment file named ``my_changes.cfg`` that enables multi-processor support within the kernel and disables the FPGA -Configuration Framework:: +Configuration Framework: + +.. code-block:: console $ echo "CONFIG_SMP=y" >> my_changes.cfg $ echo "# CONFIG_FPGA is not set" >> my_changes.cfg @@ -1155,7 +1221,9 @@ To create a configuration fragment using this method, follow these steps: #. *Complete a Build Through Kernel Configuration:* Complete a build at - least through the kernel configuration task as follows:: + least through the kernel configuration task as follows: + + .. code-block:: console $ bitbake linux-yocto -c kernel_configme -f @@ -1164,7 +1232,9 @@ steps: your build state might become unknown, it is best to run this task prior to starting ``menuconfig``. -#. *Launch menuconfig:* Run the ``menuconfig`` command:: +#. *Launch menuconfig:* Run the ``menuconfig`` command: + + .. code-block:: console $ bitbake linux-yocto -c menuconfig @@ -1172,7 +1242,9 @@ steps: to prepare a configuration fragment. The resulting file ``fragment.cfg`` is placed in the ``${``\ :term:`WORKDIR`\ ``}`` - directory:: + directory: + + .. code-block:: console $ bitbake linux-yocto -c diffconfig @@ -1217,7 +1289,9 @@ Validating Configuration You can use the :ref:`ref-tasks-kernel_configcheck` -task to provide configuration validation:: +task to provide configuration validation: + +.. code-block:: console $ bitbake linux-yocto -c kernel_configcheck -f @@ -1344,7 +1418,9 @@ To streamline the configuration, do the following: successfully. Use this configuration file as your baseline. #. *Run Configure and Check Tasks:* Separately run the - :ref:`ref-tasks-kernel_configme` and :ref:`ref-tasks-kernel_configcheck` tasks:: + :ref:`ref-tasks-kernel_configme` and :ref:`ref-tasks-kernel_configcheck` tasks: + + .. code-block:: console $ bitbake linux-yocto -c kernel_configme -f $ bitbake linux-yocto -c kernel_configcheck -f @@ -1377,7 +1453,9 @@ Expanding Variables Sometimes it is helpful to determine what a variable expands to during a build. You can examine the value of a variable by running the ``bitbake-getvar`` -command:: +command: + +.. code-block:: console $ bitbake-getvar -r virtual/kernel VARIABLE @@ -1393,13 +1471,17 @@ source directory. Follow these steps to clean up the version string: #. *Discover the Uncommitted Changes:* Go to the kernel's locally cloned Git repository (source directory) and use the following Git command - to list the files that have been changed, added, or removed:: + to list the files that have been changed, added, or removed: + + .. code-block:: console $ git status #. *Commit the Changes:* You should commit those changes to the kernel source tree regardless of whether or not you will save, export, or - use the changes:: + use the changes: + + .. code-block:: console $ git add $ git commit -s -a -m "getting rid of -dirty" @@ -1451,7 +1533,9 @@ Here are some basic steps you can use to work with your own sources: ``defconfig`` file or configuration fragment files in your layer. When you use the ``linux-yocto-custom.bb`` recipe, you must specify a configuration. If you do not have a ``defconfig`` file, you can run - the following:: + the following: + + .. code-block:: console $ make defconfig @@ -1587,7 +1671,9 @@ Typically, you will need to set the following variables: 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:: +looks much like the one provided with the ``hello-mod`` template: + +.. code-block:: make obj-m := hello.o @@ -1666,26 +1752,36 @@ Here is an example that looks at what has changed in the ``emenlow`` branch of the ``linux-yocto-3.19`` 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:: +branch: + +.. code-block:: console $ git whatchanged origin/standard/base..origin/standard/emenlow -To see short, one line summaries of changes use the ``git log`` command:: +To see short, one line summaries of changes use the ``git log`` command: + +.. code-block:: console $ git log --oneline origin/standard/base..origin/standard/emenlow -Use this command to see code differences for the changes:: +Use this command to see code differences for the changes: + +.. code-block:: console $ git diff origin/standard/base..origin/standard/emenlow Use this command to see the commit log messages and the text -differences:: +differences: + +.. code-block:: console $ git show origin/standard/base..origin/standard/emenlow Use this command to create individual patches for each change. Here is an example that creates patch files for each commit and places them -in your ``Documents`` directory:: +in your ``Documents`` directory: + +.. code-block:: console $ git format-patch -o $HOME/Documents origin/standard/base..origin/standard/emenlow @@ -1694,13 +1790,17 @@ 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:: +on a tag. Here is an example that shows ``systemtap`` changes: + +.. code-block:: console $ 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:: +the branches that contain the ``systemtap`` feature: + +.. code-block:: console $ git branch --contains systemtap @@ -1755,7 +1855,9 @@ build. searched during the build as potential feature directories. Continuing with the example, suppose the "test.scc" feature you are - adding has a ``test.scc`` file in the following directory:: + adding has a ``test.scc`` file in the following directory: + + .. code-block:: text my_recipe | diff --git a/documentation/kernel-dev/concepts-appx.rst b/documentation/kernel-dev/concepts-appx.rst index 34b5628b5b98..27cd2dbbd5ea 100644 --- a/documentation/kernel-dev/concepts-appx.rst +++ b/documentation/kernel-dev/concepts-appx.rst @@ -343,7 +343,9 @@ To determine whether or not a given option is "hardware" or "non-hardware", the kernel Metadata in ``yocto-kernel-cache`` contains files that classify individual or groups of options as either hardware or non-hardware. To better show this, consider a situation where the -``yocto-kernel-cache`` contains the following files:: +``yocto-kernel-cache`` contains the following files: + +.. code-block:: text yocto-kernel-cache/features/drm-psb/hardware.cfg yocto-kernel-cache/features/kgdb/hardware.cfg @@ -382,7 +384,9 @@ Here are explanations for the various files: (i.e. ``hardware.kcf`` or ``non-hardware.kcf``). Here is a specific example using the -``kernel-cache/bsp/mti-malta32/hardware.cfg``:: +``kernel-cache/bsp/mti-malta32/hardware.cfg``: + +.. code-block:: text CONFIG_SERIAL_8250 CONFIG_SERIAL_8250_CONSOLE diff --git a/documentation/kernel-dev/maint-appx.rst b/documentation/kernel-dev/maint-appx.rst index 36ce77e89074..f49e12b4ae08 100644 --- a/documentation/kernel-dev/maint-appx.rst +++ b/documentation/kernel-dev/maint-appx.rst @@ -28,7 +28,9 @@ in the Yocto Project Linux kernel in any clone of the Yocto Project Linux kernel source repository and ``yocto-kernel-cache`` Git trees. For example, the following commands clone the Yocto Project baseline Linux kernel that branches off ``linux.org`` version 4.12 and the -``yocto-kernel-cache``, which contains stores of kernel Metadata:: +``yocto-kernel-cache``, which contains stores of kernel Metadata: + +.. code-block:: console $ git clone https://git.yoctoproject.org/linux-yocto-4.12 $ git clone https://git.yoctoproject.org/yocto-kernel-cache @@ -41,14 +43,18 @@ section. Once you have cloned the kernel Git repository and the cache of Metadata on your local machine, you can discover the branches that are available -in the repository using the following Git command:: +in the repository using the following Git command: + +.. code-block:: console $ git branch -a Checking out a branch allows you to work with a particular Yocto Linux kernel. For example, the following commands check out the "standard/beagleboard" branch of the Yocto Linux kernel repository and -the "yocto-4.12" branch of the ``yocto-kernel-cache`` repository:: +the "yocto-4.12" branch of the ``yocto-kernel-cache`` repository: + +.. code-block:: console $ cd ~/linux-yocto-4.12 $ git checkout -b my-kernel-4.12 remotes/origin/standard/beagleboard @@ -108,7 +114,9 @@ patch, or BSP: For a typical build, the target of the search is a feature description in an ``.scc`` file whose name follows this format (e.g. - ``beaglebone-standard.scc`` and ``beaglebone-preempt-rt.scc``):: + ``beaglebone-standard.scc`` and ``beaglebone-preempt-rt.scc``): + + .. code-block:: text bsp_root_name-kernel_type.scc @@ -218,7 +226,9 @@ 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"):: +kernel types (e.g. "standard"): + +.. code-block:: text linux-${MACHINE}-kernel_type-build