dev-manual: simplify references within the same document
PATCH 1/1 dev-manual: simplify references within the same document
From: Michael Opdenacker <[email protected]>
Replace :ref:path/docname.rst:section title
by section title_, which is much more compact and doesn't need changing when you change the document file name.
There are drawbacks though:
- There are no warnings at compile time when the trailing _ character is omitted. You just get plain italic text without a link. However, you do get an error if _ is present and the text doesn't correspond to an existing target.
- The capitalization of the link text doesn't necessarily match the one in the target. You get the capitalization that you specify in the text between quotes (target matching is case insensitive).
For example, take this section name:
Description of the First Section
================================
- With :ref:path/docname:description of the First Section, you get this link text:
"Description of the First Section"
- With Description of the first section_, you get this link text:
"Description of the first section"
- There is no support for \\ in the target name. For example, take this section name:
``runqemu`` Command-Line Options
================================
A :ref: reference to it would be:
:ref:dev-manual/qemu:\\runqemu\\ command-line options
A simpler reference to it would have to be:
runqemu command-line options_
Here, we're losing the special ``run-qemu`` fixed font in the link text, but it's usual not to have different fonts in the text of a link.
--- documentation/dev-manual/build-quality.rst | 8 +- documentation/dev-manual/building.rst | 30 ++++---- documentation/dev-manual/changes.rst | 15 ++-- documentation/dev-manual/debugging.rst | 76 ++++++++----------- .../dev-manual/gobject-introspection.rst | 3 +- documentation/dev-manual/layers.rst | 12 ++- documentation/dev-manual/libraries.rst | 11 +-- documentation/dev-manual/licenses.rst | 21 +++-- documentation/dev-manual/new-recipe.rst | 29 +++---- documentation/dev-manual/packages.rst | 20 +++-- documentation/dev-manual/qemu.rst | 6 +- documentation/dev-manual/runtime-testing.rst | 5 +- documentation/dev-manual/securing-images.rst | 2 +- documentation/dev-manual/start.rst | 47 +++++------- 14 files changed, 121 insertions(+), 164 deletions(-)
documentation/dev-manual/build-quality.rst +4 -4
@@ -22,13 +22,13 @@ information to a local Git repository where you can examine the information. The remainder of this section describes the following: -- :ref:`How you can enable and disable build history <dev-manual/build-quality:enabling and disabling build history>` +- `Enabling and disabling build history`_ -- :ref:`How to understand what the build history contains <dev-manual/build-quality:understanding what the build history contains>` +- `Understanding what the build history contains`_ -- :ref:`How to limit the information used for build history <dev-manual/build-quality:using build history to gather image information only>` +- `Using build history to gather image information only`_ -- :ref:`How to examine the build history from both a command-line and web interface <dev-manual/build-quality:examining build history information>` +- `Examining build history information`_ Enabling and Disabling Build History ====================================
documentation/dev-manual/building.rst +14 -16
@@ -317,7 +317,7 @@ to override it. To achieve this, you need to perform some additional steps: #. *Create a multiconfig for your Initramfs image:* You can perform the steps - on ":ref:`dev-manual/building:building images for multiple targets using multiple configurations`" to create a separate multiconfig. + on "`Building Images for Multiple Targets Using Multiple Configurations`_" to create a separate multiconfig. For the sake of simplicity let's assume such multiconfig is called: ``initramfscfg.conf`` and contains the variables::
@@ -370,24 +370,22 @@ perform to create distributions with smaller root filesystems, achieve faster boot times, maintain your critical functionality, and avoid initial RAM disks: -- :ref:`Determine your goals and guiding principles - <dev-manual/building:goals and guiding principles>` +- `Determine your goals and guiding principles`_ -- :ref:`dev-manual/building:understand what contributes to your image size` +- `Understand what contributes to your image size`_ -- :ref:`Reduce the size of the root filesystem - <dev-manual/building:trim the root filesystem>` +- `Reduce the size of the root filesystem`_ -- :ref:`Reduce the size of the kernel <dev-manual/building:trim the kernel>` +- `Reduce the size of the kernel`_ -- :ref:`dev-manual/building:remove package management requirements` +- `Remove package management requirements`_ -- :ref:`dev-manual/building:look for other ways to minimize size` +- `Look for other ways to minimize size`_ -- :ref:`dev-manual/building:iterate on the process` +- `Iterate on the process`_ -Goals and Guiding Principles ----------------------------- +Determine your Goals and Guiding Principles +------------------------------------------- Before you can reach your destination, you need to know where you are going. Here is an example list that you can use as a guide when creating
@@ -466,8 +464,8 @@ view file dependencies in a human-readable form: to make informed decisions when cutting out various pieces of the kernel and root filesystem. -Trim the Root Filesystem ------------------------- +Reduce the Size of the Root Filesystem +-------------------------------------- The root filesystem is made up of packages for booting, libraries, and applications. To change things, you can configure how the packaging
@@ -522,8 +520,8 @@ this journal. After each round of elimination, you need to rebuild your system and then use the tools to see the effects of your reductions. -Trim the Kernel ---------------- +Reduce the Size of the Kernel +----------------------------- The kernel is built by including policies for hardware-independent aspects. What subsystems do you enable? For what architecture are you
documentation/dev-manual/changes.rst +7 -8
@@ -247,15 +247,14 @@ Using Email to Submit a Patch Depending on the components changed, you need to submit the email to a specific mailing list. For some guidance on which mailing list to use, -see the -:ref:`list <dev-manual/changes:submitting a change to the yocto project>` -at the beginning of this section. For a description of all the available -mailing lists, see the ":ref:`Mailing Lists <resources-mailinglist>`" section in the +see "`Submitting a Change to the Yocto Project`_" at the beginning of this +section. For a description of all the available mailing lists, see the +":ref:`Mailing Lists <resources-mailinglist>`" section in the Yocto Project Reference Manual. Here is the general procedure on how to submit a patch through email without using the scripts once the steps in -:ref:`dev-manual/changes:preparing changes for submission` have been followed: +"`Preparing Changes for Submission`_" have been followed: #. *Format the Commit:* Format the commit into an email message. To format commits, use the ``git format-patch`` command. When you
@@ -343,7 +342,7 @@ and ``send-pull-request`` scripts from openembedded-core to create and send a patch series with a link to the branch for review. Follow this procedure to push a change to an upstream "contrib" Git -repository once the steps in :ref:`dev-manual/changes:preparing changes for submission` have +repository once the steps in "`Preparing Changes for Submission`_" have been followed: .. note::
@@ -515,8 +514,8 @@ follows: a newer version of the software which includes an upstream fix for the issue or when the issue has been fixed on the master branch in a way that introduces backwards incompatible changes. In this case follow the - steps in :ref:`dev-manual/changes:preparing changes for submission` and - :ref:`dev-manual/changes:using email to submit a patch` but modify the subject header of your patch + steps in "`Preparing Changes for Submission`_" and + "`Using Email to Submit a Patch`_" but modify the subject header of your patch email to include the name of the stable branch which you are targetting. This can be done using the ``--subject-prefix`` argument to ``git format-patch``, for example to submit a patch to the dunfell
documentation/dev-manual/debugging.rst +33 -43
101 lines not on this page · raw message
documentation/dev-manual/gobject-introspection.rst +1 -2
@@ -30,8 +30,7 @@ because the library is produced for the target architecture, but its code needs to be executed on the build host. This problem is solved with the OpenEmbedded build system by running the code through QEMU, which allows precisely that. Unfortunately, QEMU does not always work -perfectly as mentioned in the ":ref:`dev-manual/gobject-introspection:known issues`" -section. +perfectly as mentioned in the "`Known Issues`_" section. Enabling the Generation of Introspection Data =============================================
documentation/dev-manual/layers.rst +5 -7
@@ -23,7 +23,7 @@ Creating Your Own Layer layer-creation tools, see the ":ref:`bsp-guide/bsp:creating a new bsp layer using the \`\`bitbake-layers\`\` script`" section in the Yocto Project Board Support Package (BSP) Developer's - Guide and the ":ref:`dev-manual/layers:creating a general layer using the \`\`bitbake-layers\`\` script`" + Guide and the "`Creating a General Layer Using the bitbake-layers Script`_" section further down in this manual. Follow these general steps to create your layer without using tools:
@@ -144,8 +144,7 @@ Follow these general steps to create your layer without using tools: #. *Optionally Test for Compatibility:* If you want permission to use the Yocto Project Compatibility logo with your layer or application that uses your layer, perform the steps to apply for compatibility. - See the - ":ref:`dev-manual/layers:making sure your layer is compatible with yocto project`" + See the "`Making Sure Your Layer is Compatible With Yocto Project`_" section for more information. Following Best Practices When Creating Layers
@@ -261,8 +260,7 @@ following list: - *Perform Steps to Apply for Yocto Project Compatibility:* If you want permission to use the Yocto Project Compatibility logo with your layer or application that uses your layer, perform the steps to apply - for compatibility. See the - ":ref:`dev-manual/layers:making sure your layer is compatible with yocto project`" + for compatibility. See the "`Making Sure Your Layer is Compatible with Yocto Project`_" section for more information. - *Follow the Layer Naming Convention:* Store custom layers in a Git
@@ -726,7 +724,7 @@ The following list describes the available commands: - ``create-layers-setup``: Writes out a configuration file and/or a script that can replicate the directory structure and revisions of the layers in a current build. - For more information, see ":ref:`dev-manual/layers:saving and restoring the layers setup`". + For more information, see "`Saving and Restoring the Layers Setup`_". Creating a General Layer Using the ``bitbake-layers`` Script ============================================================
@@ -742,7 +740,7 @@ simplifies creating a new general layer. - In order to use a layer with the OpenEmbedded build system, you need to add the layer to your ``bblayers.conf`` configuration - file. See the ":ref:`dev-manual/layers:adding a layer using the \`\`bitbake-layers\`\` script`" + file. See the "`Adding a Layer Using the bitbake-layers Script`_" section for more information. The default mode of the script's operation with this subcommand is to
documentation/dev-manual/libraries.rst +3 -8
@@ -7,16 +7,11 @@ Libraries are an integral part of your system. This section describes some common practices you might find helpful when working with libraries to build your system: -- :ref:`How to include static library files - <dev-manual/libraries:including static library files>` +- `Including static library files`_ -- :ref:`How to use the Multilib feature to combine multiple versions of - library files into a single image - <dev-manual/libraries:combining multiple versions of library files into one image>` +- `Combining multiple versions of library files into one image`_ -- :ref:`How to install multiple versions of the same library in parallel on - the same system - <dev-manual/libraries:installing multiple versions of the same library>` +- `Installing multiple versions of the same library`_ Including Static Library Files ==============================
documentation/dev-manual/licenses.rst +9 -12
@@ -123,18 +123,15 @@ name and version (after variable expansion):: LICENSE_FLAGS = "license_${PN}_${PV}" -In order for a component restricted by a -:term:`LICENSE_FLAGS` definition to be enabled and included in an image, it -needs to have a matching entry in the global -:term:`LICENSE_FLAGS_ACCEPTED` -variable, which is a variable typically defined in your ``local.conf`` -file. For example, to enable the -``poky/meta/recipes-multimedia/gstreamer/gst-plugins-ugly`` package, you -could add either the string "commercial_gst-plugins-ugly" or the more -general string "commercial" to :term:`LICENSE_FLAGS_ACCEPTED`. See the -":ref:`dev-manual/licenses:license flag matching`" section for a full -explanation of how :term:`LICENSE_FLAGS` matching works. Here is the -example:: +In order for a component restricted by a :term:`LICENSE_FLAGS` definition to be +enabled and included in an image, it needs to have a matching entry in the +global :term:`LICENSE_FLAGS_ACCEPTED` variable, which is a variable typically +defined in your ``local.conf`` file. For example, to enable the +``poky/meta/recipes-multimedia/gstreamer/gst-plugins-ugly`` package, you could +add either the string "commercial_gst-plugins-ugly" or the more general string +"commercial" to :term:`LICENSE_FLAGS_ACCEPTED`. See the +"`License Flag Matching`_" section for a full explanation of how +:term:`LICENSE_FLAGS` matching works. Here is the example:: LICENSE_FLAGS_ACCEPTED = "commercial_gst-plugins-ugly"
documentation/dev-manual/new-recipe.rst +12 -17
@@ -42,8 +42,7 @@ that can help you quickly get started with a new recipe: .. note:: - For information on recipe syntax, see the - ":ref:`dev-manual/new-recipe:recipe syntax`" section. + For information on recipe syntax, see the "`Recipe Syntax`_" section. Creating the Base Recipe Using ``devtool add`` ----------------------------------------------
@@ -284,11 +283,10 @@ comes from a single tarball. Notice the use of the SRC_URI = "https://strace.io/files/${PV}/strace-${PV}.tar.xz \ Files mentioned in :term:`SRC_URI` whose names end in a typical archive -extension (e.g. ``.tar``, ``.tar.gz``, ``.tar.bz2``, ``.zip``, and so -forth), are automatically extracted during the -:ref:`ref-tasks-unpack` task. For +extension (e.g. ``.tar``, ``.tar.gz``, ``.tar.bz2``, ``.zip``, and so forth), +are automatically extracted during the :ref:`ref-tasks-unpack` task. For another example that specifies these types of files, see the -":ref:`dev-manual/new-recipe:building an autotooled package`" section. +"`Building an Autotooled Package`_" section. Another way of specifying source is from an SCM. For Git repositories, you must specify :term:`SRCREV` and you should specify :term:`PV` to include
@@ -367,7 +365,7 @@ The previous example also specifies a patch file. Patch files are files whose names usually end in ``.patch`` or ``.diff`` but can end with compressed suffixes such as ``diff.gz`` and ``patch.bz2``, for example. The build system automatically applies patches as described in the -":ref:`dev-manual/new-recipe:patching code`" section. +"`Patching Code`_" section. Fetching Code Through Firewalls -------------------------------
@@ -472,8 +470,7 @@ variables: appropriate files in the :term:`LIC_FILES_CHKSUM` variable with incorrect md5 strings, attempt to build the software, and then note the resulting error messages that will report the correct md5 strings. - See the ":ref:`dev-manual/new-recipe:fetching code`" section for - additional information. + See the "`Fetching Code`_" section for additional information. Here is an example that assumes the software has a ``COPYING`` file::
@@ -692,7 +689,7 @@ Here are some common issues that cause failures. For cases where improper paths are detected for configuration files or for when libraries/headers cannot be found, be sure you are using the more robust ``pkg-config``. See the note in section - ":ref:`dev-manual/new-recipe:Configuring the Recipe`" for additional information. + "`Configuring the Recipe`_" for additional information. - *Parallel build failures:* These failures manifest themselves as intermittent errors, or errors reporting that a file or directory
@@ -776,7 +773,7 @@ the software being built: ``PREFIX=${D}``, ``INSTALLROOT=${D}``, and so forth). For an example recipe using ``make install``, see the - ":ref:`dev-manual/new-recipe:building a makefile-based package`" section. + "`Building a Makefile-based Package`_" section. - *Manual:* You need to define a :ref:`ref-tasks-install` function in your recipe. The function must first use ``install -d`` to create the
@@ -905,12 +902,11 @@ take. The following list describes the process: - *Splitting an Application into Multiple Packages*: If you need to split an application into several packages, see the - ":ref:`dev-manual/new-recipe:splitting an application into multiple packages`" - section for an example. + "`Splitting an Application Into Multiple Packages`_" section for an example. - *Installing a Post-Installation Script*: For an example showing how to install a post-installation script, see the - ":ref:`dev-manual/new-recipe:post-installation scripts`" section. + "`Post-Installation Scripts`_" section. - *Marking Package Architecture*: Depending on what your recipe is building and how it is configured, it might be important to mark the
@@ -1075,7 +1071,7 @@ Properly Versioning Pre-Release Recipes Sometimes the name of a recipe can lead to versioning problems when the recipe is upgraded to a final release. For example, consider the ``irssi_0.8.16-rc1.bb`` recipe file in the list of example recipes in -the ":ref:`dev-manual/new-recipe:storing and naming the recipe`" section. +the "`Storing and Naming the Recipe`_" section. This recipe is at a release candidate stage (i.e. "rc1"). When the recipe is released, the recipe filename becomes ``irssi_0.8.16.bb``. The version change from ``0.8.16-rc1`` to ``0.8.16`` is seen as a decrease by the
@@ -1209,8 +1205,7 @@ case --- the directory BitBake uses for the build:: By default, the ``helloworld``, ``helloworld-dbg``, and ``helloworld-dev`` packages are built. For information on how to customize the packaging process, see the -":ref:`dev-manual/new-recipe:splitting an application into multiple packages`" -section. +"`Splitting an Application Into Multiple Packages`_" section. Building a Makefile-Based Package ---------------------------------
documentation/dev-manual/packages.rst +9 -11
@@ -5,22 +5,21 @@ Working with Packages This section describes a few tasks that involve packages: -- :ref:`dev-manual/packages:excluding packages from an image` +- `Excluding packages from an image`_ -- :ref:`dev-manual/packages:incrementing a package version` +- `Incrementing a package version`_ -- :ref:`dev-manual/packages:handling optional module packaging` +- `Handling optional module packaging`_ -- :ref:`dev-manual/packages:using runtime package management` +- `Using runtime package management`_ -- :ref:`dev-manual/packages:generating and using signed packages` +- `Generating and using signed packages`_ -- :ref:`Setting up and running package test - (ptest) <dev-manual/packages:testing packages with ptest>` +- `Testing packages with ptest`_ -- :ref:`dev-manual/packages:creating node package manager (npm) packages` +- `Creating Node Package Manager (NPM) packages`_ -- :ref:`dev-manual/packages:adding custom metadata to packages` +- `Adding custom metadata to packages`_ Excluding Packages from an Image ================================
@@ -110,8 +109,7 @@ requirement is that binary package version numbering increases in a linear fashion and that there is a number of version components that support that linear progression. For information on how to ensure package revisioning remains linear, see the -":ref:`dev-manual/packages:automatically incrementing a package version number`" -section. +"`Automatically Incrementing a Package Version Number`_" section. The following three sections provide related information on the PR Service, the manual method for "bumping" :term:`PR` and/or :term:`PV`, and on
documentation/dev-manual/qemu.rst +2 -4
@@ -123,8 +123,7 @@ available. Follow these general steps to run QEMU: enable audio in QEMU. For this case, ``runqemu`` sets the internal variable ``FSTYPE`` to ``cpio.gz``. Also, for audio to be enabled, an appropriate driver must be installed (see the ``audio`` option - in :ref:`dev-manual/qemu:\`\`runqemu\`\` command-line options` - for more information):: + in "`runqemu Command-Line Options`_" for more information):: $ runqemu qemux86-64 ramfs audio
@@ -293,8 +292,7 @@ present, the toolchain is also automatically used. tarball by using the ``runqemu-extract-sdk`` command. After running the command, you must then point the ``runqemu`` script to the extracted directory instead of a root filesystem image file. - See the - ":ref:`dev-manual/qemu:running under a network file system (nfs) server`" + See the "`Running Under a Network File System (NFS) Server`_" section for more information. QEMU Command-Line Syntax
documentation/dev-manual/runtime-testing.rst +2 -3
@@ -150,8 +150,7 @@ options are available: it the same IP address for each reboot. If you choose "SystemdbootTarget", there are additional requirements - and considerations. See the - ":ref:`dev-manual/runtime-testing:selecting systemdboottarget`" section, which + and considerations. See the "`Selecting systemdboottarget`_" section, which follows, for more information. - *"BeagleBoneTarget":* Choose "BeagleBoneTarget" if you are deploying
@@ -183,7 +182,7 @@ Selecting SystemdbootTarget If you did not set :term:`TEST_TARGET` to "SystemdbootTarget", then you do not need any information in this section. You can skip down to the -":ref:`dev-manual/runtime-testing:running tests`" section. +"`Running Tests`_" section. If you did set :term:`TEST_TARGET` to "SystemdbootTarget", you also need to perform a one-time setup of your controller image by doing the following:
documentation/dev-manual/securing-images.rst +1 -1
@@ -72,7 +72,7 @@ more secure: - Ensure you remove or disable debugging functionality before producing the final image. For information on how to do this, see the - ":ref:`dev-manual/securing-images:considerations specific to the openembedded build system`" + "`Considerations Specific to the OpenEmbedded Build System`_" section. - Ensure you have no network services listening that are not needed.
documentation/dev-manual/start.rst +19 -28
107 lines not on this page · raw message
Signature · 1 line
2.37.2
Hi Michael,
Quoted 13 lines · Michael Opdenacker via lists.yoctoproject.org
From: Michael Opdenacker <[email protected]>
Replace :ref:
path/docname.rst:section title
bysection title_, which is much more compact and doesn't need changing when you change the document file name.There are drawbacks though:
- There are no warnings at compile time when the trailing
_character is omitted. You just get plain italic text without a link. However, you do get an error if_is present and the text doesn't correspond to an existing target.
Quoted 5 lines
- The capitalization of the link text doesn't necessarily match the one in the target. You get the capitalization that you specify in the text between quotes (target matching is case insensitive).
Does it also detect when a link is broken because the section got renamed or removed?
Cheers,
Quentin
Hi Quentin
Quoted 16 lines · Quentin Schulz via lists.yoctoproject.org
Hi Michael,
Quoted 13 lines · Michael Opdenacker via lists.yoctoproject.org
From: Michael Opdenacker <[email protected]>
Replace :ref:
path/docname.rst:section title
bysection title_, which is much more compact and doesn't need changing when you change the document file name.There are drawbacks though:
- There are no warnings at compile time when the trailing
_character is omitted. You just get plain italic text without a link. However, you do get an error if_is present and the text doesn't correspond to an existing target.
Quoted 7 lines
Quoted 5 lines
- The capitalization of the link text doesn't necessarily match the one in the target. You get the capitalization that you specify in the text between quotes (target matching is case insensitive).
Does it also detect when a link is broken because the section got renamed or removed?
Yes, the references to the section will be broken, causing an error when building the docs. Cheers
Michael.
Signature · 3 lines
Michael Opdenacker, Bootlin Embedded Linux and Kernel engineering https://bootlin.com