2012-11-11 04:14:53 +01:00
|
|
|
// -*- mode:doc; -*-
|
2013-02-13 13:59:02 +01:00
|
|
|
// vim: set syntax=asciidoc:
|
2012-11-11 04:14:53 +01:00
|
|
|
|
manual: high-level restructuring
The structure of the buildroot manual is not always clear. There is a large
number of chapters, and some chapters seem to overlap. The distinction
between general usage and developer information is not always clear.
This patch restructures the manual into four large parts:
- getting started
- user guide
- developer guide
- appendix
Except for the names of these parts, the section names are not yet changed.
Content-wise there are no changes yet either. This will be handled in
subsequent patches.
In order to achieve the introduction of a new level 'parts' above
'chapters', the section indicators (=, ==, ===, ...) of several sections
have to be moved one level down. Additionally, the leveloffset indication to
asciidoc has to be removed. Finally, to maintain more or less the same level
of detail in the table of contents, the toc.section.depth attribute is
reduced as well. Note that for some sections, less detail is visible now.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-08-12 22:20:06 +02:00
|
|
|
== Contributing to Buildroot
|
2014-03-05 17:24:27 +01:00
|
|
|
|
|
|
|
There are many ways in which you can contribute to Buildroot: analyzing
|
|
|
|
and fixing bugs, analyzing and fixing package build failures detected by
|
|
|
|
the autobuilders, testing and reviewing patches sent by other
|
|
|
|
developers, working on the items in our TODO list and sending your own
|
|
|
|
improvements to Buildroot or its manual. The following sections give a
|
|
|
|
little more detail on each of these items.
|
|
|
|
|
|
|
|
If you are interested in contributing to Buildroot, the first thing you
|
|
|
|
should do is to subscribe to the Buildroot mailing list. This list is
|
|
|
|
the main way of interacting with other Buildroot developers and to send
|
|
|
|
contributions to. If you aren't subscribed yet, then refer to
|
2014-08-12 22:20:09 +02:00
|
|
|
xref:community-resources[] for the subscription link.
|
2012-11-11 04:14:53 +01:00
|
|
|
|
2014-03-05 17:24:27 +01:00
|
|
|
If you are going to touch the code, it is highly recommended to use a
|
|
|
|
git repository of Buildroot, rather than starting from an extracted
|
|
|
|
source code tarball. Git is the easiest way to develop from and directly
|
|
|
|
send your patches to the mailing list. Refer to xref:getting-buildroot[]
|
|
|
|
for more information on obtaining a Buildroot git tree.
|
2012-11-11 04:14:53 +01:00
|
|
|
|
manual: high-level restructuring
The structure of the buildroot manual is not always clear. There is a large
number of chapters, and some chapters seem to overlap. The distinction
between general usage and developer information is not always clear.
This patch restructures the manual into four large parts:
- getting started
- user guide
- developer guide
- appendix
Except for the names of these parts, the section names are not yet changed.
Content-wise there are no changes yet either. This will be handled in
subsequent patches.
In order to achieve the introduction of a new level 'parts' above
'chapters', the section indicators (=, ==, ===, ...) of several sections
have to be moved one level down. Additionally, the leveloffset indication to
asciidoc has to be removed. Finally, to maintain more or less the same level
of detail in the table of contents, the toc.section.depth attribute is
reduced as well. Note that for some sections, less detail is visible now.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-08-12 22:20:06 +02:00
|
|
|
=== Reproducing, analyzing and fixing bugs
|
2014-03-05 17:24:28 +01:00
|
|
|
|
|
|
|
A first way of contributing is to have a look at the open bug reports in
|
2015-09-14 14:44:48 +02:00
|
|
|
the https://bugs.buildroot.org/buglist.cgi?product=buildroot[Buildroot bug
|
2014-03-05 17:24:28 +01:00
|
|
|
tracker]. As we strive to keep the bug count as small as possible, all
|
|
|
|
help in reproducing, analyzing and fixing reported bugs is more than
|
|
|
|
welcome. Don't hesitate to add a comment to bug reports reporting your
|
|
|
|
findings, even if you don't yet see the full picture.
|
|
|
|
|
manual: high-level restructuring
The structure of the buildroot manual is not always clear. There is a large
number of chapters, and some chapters seem to overlap. The distinction
between general usage and developer information is not always clear.
This patch restructures the manual into four large parts:
- getting started
- user guide
- developer guide
- appendix
Except for the names of these parts, the section names are not yet changed.
Content-wise there are no changes yet either. This will be handled in
subsequent patches.
In order to achieve the introduction of a new level 'parts' above
'chapters', the section indicators (=, ==, ===, ...) of several sections
have to be moved one level down. Additionally, the leveloffset indication to
asciidoc has to be removed. Finally, to maintain more or less the same level
of detail in the table of contents, the toc.section.depth attribute is
reduced as well. Note that for some sections, less detail is visible now.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-08-12 22:20:06 +02:00
|
|
|
=== Analyzing and fixing autobuild failures
|
2014-03-06 11:07:29 +01:00
|
|
|
|
|
|
|
The Buildroot autobuilders are a set of build machines that continuously
|
|
|
|
run Buildroot builds based on random configurations. This is done for
|
|
|
|
all architectures supported by Buildroot, with various toolchains, and
|
|
|
|
with a random selection of packages. With the large commit activity on
|
|
|
|
Buildroot, these autobuilders are a great help in detecting problems
|
|
|
|
very early after commit.
|
|
|
|
|
|
|
|
All build results are available at http://autobuild.buildroot.org[],
|
|
|
|
statistics are at http://autobuild.buildroot.org/stats.php[]. Every day,
|
|
|
|
an overview of all failed packages is sent to the mailing list.
|
|
|
|
|
|
|
|
Detecting problems is great, but obviously these problems have to be
|
|
|
|
fixed as well. Your contribution is very welcome here! There are
|
|
|
|
basically two things that can be done:
|
|
|
|
|
|
|
|
- Analyzing the problems. The daily summary mails do not contain details
|
|
|
|
about the actual failures: in order to see what's going on you have to
|
|
|
|
open the build log and check the last output. Having someone doing
|
|
|
|
this for all packages in the mail is very useful for other developers,
|
|
|
|
as they can make a quick initial analysis based on this output alone.
|
|
|
|
|
|
|
|
- Fixing a problem. When fixing autobuild failures, you should follow
|
|
|
|
these steps:
|
|
|
|
. Check if you can reproduce the problem by building with the same
|
|
|
|
configuration. You can do this manually, or use the
|
|
|
|
http://git.buildroot.org/buildroot-test/tree/utils/br-reproduce-build[br-reproduce-build]
|
|
|
|
script that will automatically clone a Buildroot git repository,
|
|
|
|
checkout the correct revision, download and set the right
|
|
|
|
configuration, and start the build.
|
|
|
|
. Analyze the problem and create a fix.
|
|
|
|
. Verify that the problem is really fixed by starting from a clean
|
|
|
|
Buildroot tree and only applying your fix.
|
|
|
|
. Send the fix to the Buildroot mailing list (see
|
|
|
|
xref:submitting-patches[]). In case you created a patch against the
|
|
|
|
package sources, you should also send the patch upstream so that the
|
|
|
|
problem will be fixed in a later release, and the patch in Buildroot
|
|
|
|
can be removed.
|
|
|
|
In the commit message of a patch fixing an autobuild failure, add a
|
|
|
|
reference to the build result directory, as follows:
|
|
|
|
---------------------
|
2019-07-12 11:06:41 +02:00
|
|
|
Fixes: http://autobuild.buildroot.org/results/51000a9d4656afe9e0ea6f07b9f8ed374c2e4069
|
2014-03-06 11:07:29 +01:00
|
|
|
---------------------
|
|
|
|
|
manual: high-level restructuring
The structure of the buildroot manual is not always clear. There is a large
number of chapters, and some chapters seem to overlap. The distinction
between general usage and developer information is not always clear.
This patch restructures the manual into four large parts:
- getting started
- user guide
- developer guide
- appendix
Except for the names of these parts, the section names are not yet changed.
Content-wise there are no changes yet either. This will be handled in
subsequent patches.
In order to achieve the introduction of a new level 'parts' above
'chapters', the section indicators (=, ==, ===, ...) of several sections
have to be moved one level down. Additionally, the leveloffset indication to
asciidoc has to be removed. Finally, to maintain more or less the same level
of detail in the table of contents, the toc.section.depth attribute is
reduced as well. Note that for some sections, less detail is visible now.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-08-12 22:20:06 +02:00
|
|
|
=== Reviewing and testing patches
|
2014-03-06 11:07:30 +01:00
|
|
|
|
|
|
|
With the amount of patches sent to the mailing list each day, the
|
|
|
|
maintainer has a very hard job to judge which patches are ready to apply
|
|
|
|
and which ones aren't. Contributors can greatly help here by reviewing
|
|
|
|
and testing these patches.
|
|
|
|
|
|
|
|
In the review process, do not hesitate to respond to patch submissions
|
|
|
|
for remarks, suggestions or anything that will help everyone to
|
|
|
|
understand the patches and make them better. Please use internet
|
|
|
|
style replies in plain text emails when responding to patch
|
|
|
|
submissions.
|
|
|
|
|
|
|
|
To indicate approval of a patch, there are three formal tags that keep
|
|
|
|
track of this approval. To add your tag to a patch, reply to it with the
|
|
|
|
approval tag below the original author's Signed-off-by line. These tags
|
|
|
|
will be picked up automatically by patchwork (see
|
2014-03-28 22:24:45 +01:00
|
|
|
xref:apply-patches-patchwork[]) and will be part of the commit log when
|
2014-03-06 11:07:30 +01:00
|
|
|
the patch is accepted.
|
|
|
|
|
|
|
|
Tested-by:: Indicates that the patch has been tested successfully.
|
|
|
|
You are encouraged to specify what kind of testing you performed
|
|
|
|
(compile-test on architecture X and Y, runtime test on target A,
|
|
|
|
...). This additional information helps other testers and the
|
|
|
|
maintainer.
|
|
|
|
|
|
|
|
Reviewed-by:: Indicates that you code-reviewed the patch and did your
|
|
|
|
best in spotting problems, but you are not sufficiently familiar with
|
|
|
|
the area touched to provide an Acked-by tag. This means that there
|
|
|
|
may be remaining problems in the patch that would be spotted by
|
|
|
|
someone with more experience in that area. Should such problems be
|
|
|
|
detected, your Reviewed-by tag remains appropriate and you cannot
|
|
|
|
be blamed.
|
|
|
|
|
|
|
|
Acked-by:: Indicates that you code-reviewed the patch and you are
|
|
|
|
familiar enough with the area touched to feel that the patch can be
|
|
|
|
committed as-is (no additional changes required). In case it later
|
|
|
|
turns out that something is wrong with the patch, your Acked-by could
|
|
|
|
be considered inappropriate. The difference between Acked-by and
|
|
|
|
Reviewed-by is thus mainly that you are prepared to take the blame on
|
|
|
|
Acked patches, but not on Reviewed ones.
|
|
|
|
|
|
|
|
If you reviewed a patch and have comments on it, you should simply reply
|
|
|
|
to the patch stating these comments, without providing a Reviewed-by or
|
|
|
|
Acked-by tag. These tags should only be provided if you judge the patch
|
|
|
|
to be good as it is.
|
|
|
|
|
|
|
|
It is important to note that neither Reviewed-by nor Acked-by imply
|
|
|
|
that testing has been performed. To indicate that you both reviewed and
|
|
|
|
tested the patch, provide two separate tags (Reviewed/Acked-by and
|
|
|
|
Tested-by).
|
|
|
|
|
|
|
|
Note also that _any developer_ can provide Tested/Reviewed/Acked-by
|
|
|
|
tags, without exception, and we encourage everyone to do this. Buildroot
|
|
|
|
does not have a defined group of _core_ developers, it just so happens
|
|
|
|
that some developers are more active than others. The maintainer will
|
|
|
|
value tags according to the track record of their submitter. Tags
|
|
|
|
provided by a regular contributor will naturally be trusted more than
|
|
|
|
tags provided by a newcomer. As you provide tags more regularly, your
|
|
|
|
'trustworthiness' (in the eyes of the maintainer) will go up, but _any_
|
|
|
|
tag provided is valuable.
|
|
|
|
|
|
|
|
Buildroot's Patchwork website can be used to pull in patches for testing
|
|
|
|
purposes. Please see xref:apply-patches-patchwork[] for more
|
|
|
|
information on using Buildroot's Patchwork website to apply patches.
|
|
|
|
|
2014-08-12 22:20:09 +02:00
|
|
|
[[apply-patches-patchwork]]
|
|
|
|
==== Applying Patches from Patchwork
|
|
|
|
|
|
|
|
The main use of Buildroot's Patchwork website for a developer is for
|
|
|
|
pulling in patches into their local git repository for testing
|
|
|
|
purposes.
|
|
|
|
|
|
|
|
When browsing patches in the patchwork management interface, an +mbox+
|
|
|
|
link is provided at the top of the page. Copy this link address and
|
|
|
|
run the following commands:
|
|
|
|
|
|
|
|
---------------------
|
|
|
|
$ git checkout -b <test-branch-name>
|
|
|
|
$ wget -O - <mbox-url> | git am
|
|
|
|
---------------------
|
|
|
|
|
|
|
|
Another option for applying patches is to create a bundle. A bundle is
|
|
|
|
a set of patches that you can group together using the patchwork
|
|
|
|
interface. Once the bundle is created and the bundle is made public,
|
|
|
|
you can copy the +mbox+ link for the bundle and apply the bundle
|
|
|
|
using the above commands.
|
|
|
|
|
|
|
|
|
manual: high-level restructuring
The structure of the buildroot manual is not always clear. There is a large
number of chapters, and some chapters seem to overlap. The distinction
between general usage and developer information is not always clear.
This patch restructures the manual into four large parts:
- getting started
- user guide
- developer guide
- appendix
Except for the names of these parts, the section names are not yet changed.
Content-wise there are no changes yet either. This will be handled in
subsequent patches.
In order to achieve the introduction of a new level 'parts' above
'chapters', the section indicators (=, ==, ===, ...) of several sections
have to be moved one level down. Additionally, the leveloffset indication to
asciidoc has to be removed. Finally, to maintain more or less the same level
of detail in the table of contents, the toc.section.depth attribute is
reduced as well. Note that for some sections, less detail is visible now.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-08-12 22:20:06 +02:00
|
|
|
=== Work on items from the TODO list
|
2014-03-06 11:07:31 +01:00
|
|
|
|
|
|
|
If you want to contribute to Buildroot but don't know where to start,
|
|
|
|
and you don't like any of the above topics, you can always work on items
|
|
|
|
from the http://elinux.org/Buildroot#Todo_list[Buildroot TODO list].
|
|
|
|
Don't hesitate to discuss an item first on the mailing list or on IRC.
|
|
|
|
Do edit the wiki to indicate when you start working on an item, so we
|
|
|
|
avoid duplicate efforts.
|
2014-03-06 11:07:30 +01:00
|
|
|
|
2012-11-11 04:14:53 +01:00
|
|
|
[[submitting-patches]]
|
manual: high-level restructuring
The structure of the buildroot manual is not always clear. There is a large
number of chapters, and some chapters seem to overlap. The distinction
between general usage and developer information is not always clear.
This patch restructures the manual into four large parts:
- getting started
- user guide
- developer guide
- appendix
Except for the names of these parts, the section names are not yet changed.
Content-wise there are no changes yet either. This will be handled in
subsequent patches.
In order to achieve the introduction of a new level 'parts' above
'chapters', the section indicators (=, ==, ===, ...) of several sections
have to be moved one level down. Additionally, the leveloffset indication to
asciidoc has to be removed. Finally, to maintain more or less the same level
of detail in the table of contents, the toc.section.depth attribute is
reduced as well. Note that for some sections, less detail is visible now.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-08-12 22:20:06 +02:00
|
|
|
=== Submitting patches
|
2012-11-11 04:14:53 +01:00
|
|
|
|
2014-03-05 17:24:27 +01:00
|
|
|
[NOTE]
|
|
|
|
_Please, do not attach patches to bugs, send them to the mailing list
|
|
|
|
instead_.
|
|
|
|
|
2014-03-06 11:07:32 +01:00
|
|
|
If you made some changes to Buildroot and you would like to contribute
|
2016-02-01 18:45:16 +01:00
|
|
|
them to the Buildroot project, proceed as follows.
|
|
|
|
|
2016-02-01 18:45:17 +01:00
|
|
|
==== The formatting of a patch
|
|
|
|
|
|
|
|
We expect patches to be formatted in a specific way. This is necessary
|
|
|
|
to make it easy to review patches, to be able to apply them easily to
|
|
|
|
the git repository, to make it easy to find back in the history how
|
|
|
|
and why things have changed, and to make it possible to use +git
|
|
|
|
bisect+ to locate the origin of a problem.
|
|
|
|
|
|
|
|
First of all, it is essential that the patch has a good commit
|
|
|
|
message. The commit message should start with a separate line with a
|
2018-11-24 11:19:03 +01:00
|
|
|
brief summary of the change, prefixed by the area touched by the
|
|
|
|
patch. A few examples of good commit titles:
|
|
|
|
|
|
|
|
* +package/linuxptp: bump version to 2.0+
|
|
|
|
|
|
|
|
* +configs/imx23evk: bump Linux version to 4.19+
|
|
|
|
|
|
|
|
* +package/pkg-generic: postpone evaluation of dependency conditions+
|
|
|
|
|
|
|
|
* +boot/uboot: needs host-{flex,bison}+
|
|
|
|
|
|
|
|
* +support/testing: add python-ubjson tests+
|
|
|
|
|
|
|
|
The description that follows the prefix should start with a lower case
|
|
|
|
letter (i.e "bump", "needs", "postpone", "add" in the above examples).
|
|
|
|
|
|
|
|
Second, the body of the commit message should describe _why_ this
|
2016-02-01 18:45:17 +01:00
|
|
|
change is needed, and if necessary also give details about _how_ it
|
|
|
|
was done. When writing the commit message, think of how the reviewers
|
|
|
|
will read it, but also think about how you will read it when you look
|
|
|
|
at this change again a few years down the line.
|
|
|
|
|
2018-11-24 11:19:03 +01:00
|
|
|
Third, the patch itself should do only one change, but do it
|
2016-02-01 18:45:17 +01:00
|
|
|
completely. Two unrelated or weakly related changes should usually be
|
|
|
|
done in two separate patches. This usually means that a patch affects
|
|
|
|
only a single package. If several changes are related, it is often
|
|
|
|
still possible to split them up in small patches and apply them in a
|
|
|
|
specific order. Small patches make it easier to review, and often
|
|
|
|
make it easier to understand afterwards why a change was done.
|
|
|
|
However, each patch must be complete. It is not allowed that the
|
|
|
|
build is broken when only the first but not the second patch is
|
|
|
|
applied. This is necessary to be able to use +git bisect+ afterwards.
|
|
|
|
|
|
|
|
Of course, while you're doing your development, you're probably going
|
|
|
|
back and forth between packages, and certainly not committing things
|
|
|
|
immediately in a way that is clean enough for submission. So most
|
|
|
|
developers rewrite the history of commits to produce a clean set of
|
|
|
|
commits that is appropriate for submission. To do this, you need to
|
|
|
|
use _interactive rebasing_. You can learn about it
|
|
|
|
https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History[in the Pro
|
|
|
|
Git book]. Sometimes, it is even easier to discard you history with
|
|
|
|
+git reset --soft origin/master+ and select individual changes with
|
|
|
|
+git add -i+ or +git add -p+.
|
|
|
|
|
|
|
|
Finally, the patch should be signed off. This is done by adding
|
|
|
|
+Signed-off-by: Your Real Name <your@email.address>+ at the end of the
|
|
|
|
commit message. +git commit -s+ does that for you, if configured
|
|
|
|
properly. The +Signed-off-by+ tag means that you publish the patch
|
2017-04-15 07:14:40 +02:00
|
|
|
under the Buildroot license (i.e. GPL-2.0+, except for package patches,
|
2016-02-01 18:45:17 +01:00
|
|
|
which have the upstream license), and that you are allowed to do so.
|
|
|
|
See http://developercertificate.org/[the Developer Certificate of
|
|
|
|
Origin] for details.
|
|
|
|
|
2023-09-17 22:51:07 +02:00
|
|
|
To give credits to who sponsored the creation of a patch or the process of
|
|
|
|
upstreaming it, you may use
|
|
|
|
https://datatracker.ietf.org/doc/html/rfc5233[email subaddressing] for
|
|
|
|
your git identity (i.e. what is used as commit author and email +From:+
|
|
|
|
field, as well as your Signed-off-by tag); add suffix to the local part,
|
|
|
|
separated from it by a plus `+` sign. E.g.:
|
|
|
|
|
|
|
|
* for a company which sponsored the submitted work, use the company name
|
|
|
|
as the detail (suffix) part:
|
|
|
|
+
|
|
|
|
`Your-Name Your-Surname <your-name.your-surname+companyname@mail.com>`
|
|
|
|
|
|
|
|
* for an individual who sponsored who sponsored the submitted work, use
|
|
|
|
their name and surname:
|
|
|
|
+
|
|
|
|
`Your-Name Your-Surname <your-name.your-surname+their-name.their-surname@mail.com>`
|
|
|
|
|
2016-02-01 18:45:17 +01:00
|
|
|
When adding new packages, you should submit every package in a
|
|
|
|
separate patch. This patch should have the update to
|
|
|
|
+package/Config.in+, the package +Config.in+ file, the +.mk+ file, the
|
|
|
|
+.hash+ file, any init script, and all package patches. If the package
|
|
|
|
has many sub-options, these are sometimes better added as separate
|
|
|
|
follow-up patches. The summary line should be something like
|
|
|
|
+<packagename>: new package+. The body of the commit message can be
|
|
|
|
empty for simple packages, or it can contain the description of the
|
|
|
|
package (like the Config.in help text). If anything special has to be
|
|
|
|
done to build the package, this should also be explained explicitly in
|
|
|
|
the commit message body.
|
|
|
|
|
|
|
|
When you bump a package to a new version, you should also submit a
|
|
|
|
separate patch for each package. Don't forget to update the +.hash+
|
|
|
|
file, or add it if it doesn't exist yet. Also don't forget to check if
|
|
|
|
the +_LICENSE+ and +_LICENSE_FILES+ are still valid. The summary line
|
|
|
|
should be something like +<packagename>: bump to version <new
|
|
|
|
version>+. If the new version only contains security updates compared
|
|
|
|
to the existing one, the summary should be +<packagename>: security
|
|
|
|
bump to version <new version>+ and the commit message body should show
|
|
|
|
the CVE numbers that are fixed. If some package patches can be removed
|
|
|
|
in the new version, it should be explained explicitly why they can be
|
|
|
|
removed, preferably with the upstream commit ID. Also any other
|
|
|
|
required changes should be explained explicitly, like configure
|
|
|
|
options that no longer exist or are no longer needed.
|
|
|
|
|
2016-09-12 22:54:55 +02:00
|
|
|
If you are interested in getting notified of build failures and of
|
|
|
|
further changes in the packages you added or modified, please add
|
2017-11-03 22:10:53 +01:00
|
|
|
yourself to the DEVELOPERS file. This should be done in the same patch
|
|
|
|
creating or modifying the package. See xref:DEVELOPERS[the DEVELOPERS file]
|
|
|
|
for more information.
|
2016-09-12 22:54:55 +02:00
|
|
|
|
2018-04-02 00:31:56 +02:00
|
|
|
Buildroot provides a handy tool to check for common coding style
|
|
|
|
mistakes on files you created or modified, called +check-package+ (see
|
|
|
|
xref:check-package[] for more information).
|
|
|
|
|
2016-02-01 18:45:16 +01:00
|
|
|
==== Preparing a patch series
|
|
|
|
|
|
|
|
Starting from the changes committed in your local git view, _rebase_
|
|
|
|
your development branch on top of the upstream tree before generating
|
|
|
|
a patch set. To do so, run:
|
2012-11-11 04:14:53 +01:00
|
|
|
|
|
|
|
---------------------
|
2013-08-09 12:16:48 +02:00
|
|
|
$ git fetch --all --tags
|
|
|
|
$ git rebase origin/master
|
2012-11-11 04:14:53 +01:00
|
|
|
---------------------
|
|
|
|
|
2022-07-31 21:35:12 +02:00
|
|
|
Now check the coding style for the changes you committed:
|
|
|
|
|
|
|
|
---------------------
|
|
|
|
$ utils/docker-run make check-package
|
|
|
|
---------------------
|
|
|
|
|
2014-03-06 11:07:32 +01:00
|
|
|
Now, you are ready to generate then submit your patch set.
|
2012-11-11 04:14:53 +01:00
|
|
|
|
|
|
|
To generate it, run:
|
|
|
|
|
|
|
|
---------------------
|
2013-08-09 12:16:48 +02:00
|
|
|
$ git format-patch -M -n -s -o outgoing origin/master
|
2012-11-11 04:14:53 +01:00
|
|
|
---------------------
|
|
|
|
|
|
|
|
This will generate patch files in the +outgoing+ subdirectory,
|
2013-09-16 15:07:28 +02:00
|
|
|
automatically adding the +Signed-off-by+ line.
|
2012-11-11 04:14:53 +01:00
|
|
|
|
|
|
|
Once patch files are generated, you can review/edit the commit message
|
2014-03-06 11:07:32 +01:00
|
|
|
before submitting them, using your favorite text editor.
|
2012-11-11 04:14:53 +01:00
|
|
|
|
2016-09-12 22:54:54 +02:00
|
|
|
Buildroot provides a handy tool to know to whom your patches should be
|
2016-09-12 22:54:55 +02:00
|
|
|
sent, called +get-developers+ (see xref:DEVELOPERS[] for more
|
|
|
|
information). This tool reads your patches and outputs the appropriate
|
|
|
|
+git send-email+ command to use:
|
2012-11-11 04:14:53 +01:00
|
|
|
|
|
|
|
---------------------
|
2017-07-01 18:07:00 +02:00
|
|
|
$ ./utils/get-developers outgoing/*
|
2016-09-12 22:54:54 +02:00
|
|
|
---------------------
|
|
|
|
|
|
|
|
Use the output of +get-developers+ to send your patches:
|
|
|
|
|
|
|
|
---------------------
|
|
|
|
$ git send-email --to buildroot@buildroot.org --cc bob --cc alice outgoing/*
|
2012-11-11 04:14:53 +01:00
|
|
|
---------------------
|
|
|
|
|
2018-10-09 10:28:31 +02:00
|
|
|
Alternatively, +get-developers -e+ can be used directly with the
|
|
|
|
+--cc-cmd+ argument to +git send-email+ to automatically CC the
|
|
|
|
affected developers:
|
|
|
|
|
|
|
|
---------------------
|
|
|
|
$ git send-email --to buildroot@buildroot.org \
|
|
|
|
--cc-cmd './utils/get-developers -e' origin/master
|
|
|
|
---------------------
|
|
|
|
|
|
|
|
+git+ can be configured to automatically do this out of the box with:
|
|
|
|
|
|
|
|
---------------------
|
|
|
|
$ git config sendemail.to buildroot@buildroot.org
|
|
|
|
$ git config sendemail.ccCmd "$(pwd)/utils/get-developers -e"
|
|
|
|
---------------------
|
|
|
|
|
|
|
|
And then just do:
|
|
|
|
|
|
|
|
---------------------
|
|
|
|
$ git send-email origin/master
|
|
|
|
---------------------
|
|
|
|
|
2012-11-11 04:14:53 +01:00
|
|
|
Note that +git+ should be configured to use your mail account.
|
|
|
|
To configure +git+, see +man git-send-email+ or google it.
|
|
|
|
|
2014-03-06 11:07:32 +01:00
|
|
|
If you do not use +git send-email+, make sure posted *patches are not
|
|
|
|
line-wrapped*, otherwise they cannot easily be applied. In such a case,
|
|
|
|
fix your e-mail client, or better yet, learn to use +git send-email+.
|
2012-11-11 04:14:53 +01:00
|
|
|
|
manual: high-level restructuring
The structure of the buildroot manual is not always clear. There is a large
number of chapters, and some chapters seem to overlap. The distinction
between general usage and developer information is not always clear.
This patch restructures the manual into four large parts:
- getting started
- user guide
- developer guide
- appendix
Except for the names of these parts, the section names are not yet changed.
Content-wise there are no changes yet either. This will be handled in
subsequent patches.
In order to achieve the introduction of a new level 'parts' above
'chapters', the section indicators (=, ==, ===, ...) of several sections
have to be moved one level down. Additionally, the leveloffset indication to
asciidoc has to be removed. Finally, to maintain more or less the same level
of detail in the table of contents, the toc.section.depth attribute is
reduced as well. Note that for some sections, less detail is visible now.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-08-12 22:20:06 +02:00
|
|
|
==== Cover letter
|
2013-08-09 12:16:46 +02:00
|
|
|
|
|
|
|
If you want to present the whole patch set in a separate mail, add
|
|
|
|
+--cover-letter+ to the +git format-patch+ command (see +man
|
|
|
|
git-format-patch+ for further information). This will generate a
|
|
|
|
template for an introduction e-mail to your patch series.
|
|
|
|
|
|
|
|
A 'cover letter' may be useful to introduce the changes you propose
|
|
|
|
in the following cases:
|
|
|
|
|
|
|
|
* large number of commits in the series;
|
|
|
|
|
|
|
|
* deep impact of the changes in the rest of the project;
|
|
|
|
|
|
|
|
* RFC footnote:[RFC: (Request for comments) change proposal];
|
|
|
|
|
|
|
|
* whenever you feel it will help presenting your work, your choices,
|
|
|
|
the review process, etc.
|
|
|
|
|
2020-09-09 00:05:25 +02:00
|
|
|
==== Patches for maintenance branches
|
|
|
|
|
|
|
|
When fixing bugs on a maintenance branch, bugs should be fixed on the
|
|
|
|
master branch first. The commit log for such a patch may then contain a
|
|
|
|
post-commit note specifying what branches are affected:
|
|
|
|
|
|
|
|
----
|
|
|
|
package/foo: fix stuff
|
|
|
|
|
|
|
|
Signed-off-by: Your Real Name <your@email.address>
|
|
|
|
---
|
|
|
|
Backport to: 2020.02.x, 2020.05.x
|
|
|
|
(2020.08.x not affected as the version was bumped)
|
|
|
|
----
|
|
|
|
|
|
|
|
Those changes will then be backported by a maintainer to the affected
|
|
|
|
branches.
|
|
|
|
|
|
|
|
However, some bugs may apply only to a specific release, for example
|
|
|
|
because it is using an older version of a package. In that case, patches
|
|
|
|
should be based off the maintenance branch, and the patch subject prefix
|
|
|
|
must include the maintenance branch name (for example "[PATCH 2020.02.x]").
|
|
|
|
This can be done with the +git format-patch+ flag +--subject-prefix+:
|
|
|
|
|
|
|
|
---------------------
|
|
|
|
$ git format-patch --subject-prefix "PATCH 2020.02.x" \
|
|
|
|
-M -s -o outgoing origin/2020.02.x
|
|
|
|
---------------------
|
|
|
|
|
|
|
|
Then send the patches with +git send-email+, as described above.
|
|
|
|
|
manual: high-level restructuring
The structure of the buildroot manual is not always clear. There is a large
number of chapters, and some chapters seem to overlap. The distinction
between general usage and developer information is not always clear.
This patch restructures the manual into four large parts:
- getting started
- user guide
- developer guide
- appendix
Except for the names of these parts, the section names are not yet changed.
Content-wise there are no changes yet either. This will be handled in
subsequent patches.
In order to achieve the introduction of a new level 'parts' above
'chapters', the section indicators (=, ==, ===, ...) of several sections
have to be moved one level down. Additionally, the leveloffset indication to
asciidoc has to be removed. Finally, to maintain more or less the same level
of detail in the table of contents, the toc.section.depth attribute is
reduced as well. Note that for some sections, less detail is visible now.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-08-12 22:20:06 +02:00
|
|
|
==== Patch revision changelog
|
2013-08-09 12:16:46 +02:00
|
|
|
|
|
|
|
When improvements are requested, the new revision of each commit
|
|
|
|
should include a changelog of the modifications between each
|
|
|
|
submission. Note that when your patch series is introduced by a cover
|
2014-03-06 11:07:33 +01:00
|
|
|
letter, an overall changelog may be added to the cover letter in
|
|
|
|
addition to the changelog in the individual commits.
|
2014-04-29 21:30:27 +02:00
|
|
|
The best thing to rework a patch series is by interactive rebasing:
|
|
|
|
+git rebase -i origin/master+. Consult the git manual for more
|
|
|
|
information.
|
2013-08-09 12:16:46 +02:00
|
|
|
|
|
|
|
When added to the individual commits, this changelog is added when
|
2014-12-19 08:12:33 +01:00
|
|
|
editing the commit message. Below the +Signed-off-by+ section, add
|
2013-08-09 12:16:46 +02:00
|
|
|
+---+ and your changelog.
|
|
|
|
|
|
|
|
Although the changelog will be visible for the reviewers in the mail
|
2022-06-15 19:08:54 +02:00
|
|
|
thread, as well as in
|
|
|
|
https://patchwork.ozlabs.org/project/buildroot/list/[patchwork], +git+
|
2013-08-09 12:16:46 +02:00
|
|
|
will automatically ignores lines below +---+ when the patch will be
|
|
|
|
merged. This is the intended behavior: the changelog is not meant to
|
|
|
|
be preserved forever in the +git+ history of the project.
|
|
|
|
|
|
|
|
Hereafter the recommended layout:
|
|
|
|
|
|
|
|
---------------
|
2014-03-06 11:07:35 +01:00
|
|
|
Patch title: short explanation, max 72 chars
|
2013-08-09 12:16:46 +02:00
|
|
|
|
2014-03-06 11:07:35 +01:00
|
|
|
A paragraph that explains the problem, and how it manifests itself. If
|
|
|
|
the problem is complex, it is OK to add more paragraphs. All paragraphs
|
|
|
|
should be wrapped at 72 characters.
|
2013-08-09 12:16:46 +02:00
|
|
|
|
2014-03-06 11:07:35 +01:00
|
|
|
A paragraph that explains the root cause of the problem. Again, more
|
2019-06-10 12:31:18 +02:00
|
|
|
than one paragraph is OK.
|
2014-03-06 11:07:35 +01:00
|
|
|
|
|
|
|
Finally, one or more paragraphs that explain how the problem is solved.
|
|
|
|
Don't hesitate to explain complex solutions in detail.
|
|
|
|
|
|
|
|
Signed-off-by: John DOE <john.doe@example.net>
|
2013-08-09 12:16:46 +02:00
|
|
|
|
|
|
|
---
|
|
|
|
Changes v2 -> v3:
|
|
|
|
- foo bar (suggested by Jane)
|
|
|
|
- bar buz
|
|
|
|
|
|
|
|
Changes v1 -> v2:
|
|
|
|
- alpha bravo (suggested by John)
|
|
|
|
- charly delta
|
|
|
|
---------------
|
|
|
|
|
|
|
|
Any patch revision should include the version number. The version number
|
|
|
|
is simply composed of the letter +v+ followed by an +integer+ greater or
|
|
|
|
equal to two (i.e. "PATCH v2", "PATCH v3" ...).
|
|
|
|
|
|
|
|
This can be easily handled with +git format-patch+ by using the option
|
|
|
|
+--subject-prefix+:
|
|
|
|
|
|
|
|
---------------------
|
|
|
|
$ git format-patch --subject-prefix "PATCH v4" \
|
2014-07-29 17:01:30 +02:00
|
|
|
-M -s -o outgoing origin/master
|
2013-08-09 12:16:46 +02:00
|
|
|
---------------------
|
|
|
|
|
2015-09-08 17:28:04 +02:00
|
|
|
Since git version 1.8.1, you can also use +-v <n>+ (where <n> is the
|
|
|
|
version number):
|
|
|
|
|
|
|
|
---------------------
|
|
|
|
$ git format-patch -v4 -M -s -o outgoing origin/master
|
|
|
|
---------------------
|
|
|
|
|
2015-09-07 14:27:30 +02:00
|
|
|
When you provide a new version of a patch, please mark the old one as
|
2022-06-15 19:08:54 +02:00
|
|
|
superseded in
|
|
|
|
https://patchwork.ozlabs.org/project/buildroot/list/[patchwork]. You
|
|
|
|
need to create an account on
|
|
|
|
https://patchwork.ozlabs.org/project/buildroot/list/[patchwork] to be
|
2015-09-07 14:27:30 +02:00
|
|
|
able to modify the status of your patches. Note that you can only change
|
|
|
|
the status of patches you submitted yourself, which means the email
|
2022-06-15 19:08:54 +02:00
|
|
|
address you register in
|
|
|
|
https://patchwork.ozlabs.org/project/buildroot/list/[patchwork] should
|
2015-09-07 14:27:30 +02:00
|
|
|
match the one you use for sending patches to the mailing list.
|
|
|
|
|
2015-09-08 17:28:04 +02:00
|
|
|
You can also add the +--in-reply-to <message-id>+ option when
|
|
|
|
submitting a patch to the mailing list. The id of the mail to reply to
|
|
|
|
can be found under the "Message Id" tag on
|
2022-06-15 19:08:54 +02:00
|
|
|
https://patchwork.ozlabs.org/project/buildroot/list/[patchwork]. The
|
|
|
|
advantage of *in-reply-to* is that patchwork will automatically mark
|
|
|
|
the previous version of the patch as superseded.
|
2015-09-08 17:28:04 +02:00
|
|
|
|
2012-11-11 04:14:53 +01:00
|
|
|
[[reporting-bugs]]
|
manual: high-level restructuring
The structure of the buildroot manual is not always clear. There is a large
number of chapters, and some chapters seem to overlap. The distinction
between general usage and developer information is not always clear.
This patch restructures the manual into four large parts:
- getting started
- user guide
- developer guide
- appendix
Except for the names of these parts, the section names are not yet changed.
Content-wise there are no changes yet either. This will be handled in
subsequent patches.
In order to achieve the introduction of a new level 'parts' above
'chapters', the section indicators (=, ==, ===, ...) of several sections
have to be moved one level down. Additionally, the leveloffset indication to
asciidoc has to be removed. Finally, to maintain more or less the same level
of detail in the table of contents, the toc.section.depth attribute is
reduced as well. Note that for some sections, less detail is visible now.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-08-12 22:20:06 +02:00
|
|
|
=== Reporting issues/bugs or getting help
|
2012-11-11 04:14:53 +01:00
|
|
|
|
2014-08-12 22:20:09 +02:00
|
|
|
Before reporting any issue, please check in
|
|
|
|
xref:community-resources[the mailing list archive] whether someone has
|
|
|
|
already reported and/or fixed a similar problem.
|
2012-11-11 04:14:53 +01:00
|
|
|
|
2014-03-06 11:07:34 +01:00
|
|
|
However you choose to report bugs or get help, either by
|
2014-08-12 22:20:09 +02:00
|
|
|
opening a bug in the xref:community-resources[bug tracker] or by
|
|
|
|
xref:community-resources[sending a mail to the mailing list], there are
|
2012-11-16 05:54:19 +01:00
|
|
|
a number of details to provide in order to help people reproduce and
|
2012-11-11 04:14:53 +01:00
|
|
|
find a solution to the issue.
|
|
|
|
|
2012-11-16 05:54:19 +01:00
|
|
|
Try to think as if you were trying to help someone else; in
|
2012-11-11 04:14:53 +01:00
|
|
|
that case, what would you need?
|
|
|
|
|
|
|
|
Here is a short list of details to provide in such case:
|
|
|
|
|
|
|
|
* host machine (OS/release)
|
|
|
|
* version of Buildroot
|
|
|
|
* target for which the build fails
|
2014-03-06 11:07:34 +01:00
|
|
|
* package(s) for which the build fails
|
2012-11-11 04:14:53 +01:00
|
|
|
* the command that fails and its output
|
|
|
|
* any information you think that may be relevant
|
|
|
|
|
2014-03-06 11:07:34 +01:00
|
|
|
Additionally, you should add the +.config+ file (or if you know how, a
|
2014-03-28 22:24:46 +01:00
|
|
|
+defconfig+; see xref:customize-store-buildroot-config[]).
|
2012-11-11 04:14:53 +01:00
|
|
|
|
2012-11-16 05:54:19 +01:00
|
|
|
If some of these details are too large, do not hesitate to use a
|
2014-03-06 11:07:34 +01:00
|
|
|
pastebin service. Note that not all available pastebin services will
|
|
|
|
preserve Unix-style line terminators when downloading raw pastes.
|
|
|
|
Following pastebin services are known to work correctly:
|
|
|
|
- https://gist.github.com/
|
|
|
|
- http://code.bulix.org/
|
2020-01-14 16:04:24 +01:00
|
|
|
|
2021-10-09 21:10:42 +02:00
|
|
|
=== Using the runtime tests framework
|
2020-01-14 16:04:24 +01:00
|
|
|
|
2021-10-09 21:10:42 +02:00
|
|
|
Buildroot includes a run-time testing framework built upon Python
|
|
|
|
scripting and QEMU runtime execution. The goals of the framework are
|
2020-01-14 16:04:24 +01:00
|
|
|
the following:
|
|
|
|
|
2021-10-09 21:10:42 +02:00
|
|
|
* build a well defined Buildroot configuration
|
2020-01-14 16:04:24 +01:00
|
|
|
* optionally, verify some properties of the build output
|
2021-10-09 21:10:42 +02:00
|
|
|
* optionally, boot the build results under Qemu, and verify that a
|
|
|
|
given feature is working as expected
|
2020-01-14 16:04:24 +01:00
|
|
|
|
2021-10-09 21:10:42 +02:00
|
|
|
The entry point to use the runtime tests framework is the
|
|
|
|
+support/testing/run-tests+ tool, which has a series of options
|
|
|
|
documented in the tool's help '-h' description. Some common options
|
|
|
|
include setting the download folder, the output folder, keeping build
|
|
|
|
output, and for multiple test cases, you can set the JLEVEL for each.
|
2020-01-14 16:04:24 +01:00
|
|
|
|
|
|
|
Here is an example walk through of running a test case.
|
|
|
|
|
|
|
|
* For a first step, let us see what all the test case options are. The test
|
|
|
|
cases can be listed by executing +support/testing/run-tests -l+. These tests
|
|
|
|
can all be run individually during test development from the console. Both
|
|
|
|
one at a time and selectively as a group of a subset of tests.
|
|
|
|
|
|
|
|
---------------------
|
|
|
|
$ support/testing/run-tests -l
|
|
|
|
List of tests
|
|
|
|
test_run (tests.utils.test_check_package.TestCheckPackage)
|
|
|
|
test_run (tests.toolchain.test_external.TestExternalToolchainBuildrootMusl) ... ok
|
|
|
|
test_run (tests.toolchain.test_external.TestExternalToolchainBuildrootuClibc) ... ok
|
|
|
|
test_run (tests.toolchain.test_external.TestExternalToolchainCCache) ... ok
|
|
|
|
test_run (tests.toolchain.test_external.TestExternalToolchainCtngMusl) ... ok
|
|
|
|
test_run (tests.toolchain.test_external.TestExternalToolchainLinaroArm) ... ok
|
|
|
|
test_run (tests.toolchain.test_external.TestExternalToolchainSourceryArmv4) ... ok
|
|
|
|
test_run (tests.toolchain.test_external.TestExternalToolchainSourceryArmv5) ... ok
|
|
|
|
test_run (tests.toolchain.test_external.TestExternalToolchainSourceryArmv7) ... ok
|
|
|
|
[snip]
|
|
|
|
test_run (tests.init.test_systemd.TestInitSystemSystemdRoFull) ... ok
|
|
|
|
test_run (tests.init.test_systemd.TestInitSystemSystemdRoIfupdown) ... ok
|
|
|
|
test_run (tests.init.test_systemd.TestInitSystemSystemdRoNetworkd) ... ok
|
|
|
|
test_run (tests.init.test_systemd.TestInitSystemSystemdRwFull) ... ok
|
|
|
|
test_run (tests.init.test_systemd.TestInitSystemSystemdRwIfupdown) ... ok
|
|
|
|
test_run (tests.init.test_systemd.TestInitSystemSystemdRwNetworkd) ... ok
|
|
|
|
test_run (tests.init.test_busybox.TestInitSystemBusyboxRo) ... ok
|
|
|
|
test_run (tests.init.test_busybox.TestInitSystemBusyboxRoNet) ... ok
|
|
|
|
test_run (tests.init.test_busybox.TestInitSystemBusyboxRw) ... ok
|
|
|
|
test_run (tests.init.test_busybox.TestInitSystemBusyboxRwNet) ... ok
|
|
|
|
|
|
|
|
Ran 157 tests in 0.021s
|
|
|
|
|
|
|
|
OK
|
|
|
|
---------------------
|
|
|
|
|
2021-10-09 21:10:42 +02:00
|
|
|
* Then, to run one test case:
|
2020-01-14 16:04:24 +01:00
|
|
|
|
|
|
|
---------------------
|
|
|
|
$ support/testing/run-tests -d dl -o output_folder -k tests.init.test_busybox.TestInitSystemBusyboxRw
|
|
|
|
15:03:26 TestInitSystemBusyboxRw Starting
|
|
|
|
15:03:28 TestInitSystemBusyboxRw Building
|
|
|
|
15:08:18 TestInitSystemBusyboxRw Building done
|
|
|
|
15:08:27 TestInitSystemBusyboxRw Cleaning up
|
|
|
|
.
|
|
|
|
Ran 1 test in 301.140s
|
|
|
|
|
|
|
|
OK
|
|
|
|
---------------------
|
|
|
|
|
2021-10-09 21:10:42 +02:00
|
|
|
The standard output indicates if the test is successful or not. By
|
|
|
|
default, the output folder for the test is deleted automatically
|
|
|
|
unless the option +-k+ is passed to *keep* the output directory.
|
2020-01-14 16:04:24 +01:00
|
|
|
|
2021-10-09 21:10:42 +02:00
|
|
|
==== Creating a test case
|
|
|
|
|
|
|
|
Within the Buildroot repository, the testing framework is organized at the
|
|
|
|
top level in +support/testing/+ by folders of +conf+, +infra+ and +tests+.
|
|
|
|
All the test cases live under the +tests+ folder and are organized in various
|
|
|
|
folders representing the category of test.
|
|
|
|
|
|
|
|
The best way to get familiar with how to create a test case is to look
|
|
|
|
at a few of the basic file system +support/testing/tests/fs/+ and init
|
|
|
|
+support/testing/tests/init/+ test scripts. Those tests give good
|
|
|
|
examples of a basic tests that include both checking the build
|
|
|
|
results, and doing runtime tests. There are other more advanced cases
|
|
|
|
that use things like nested +br2-external+ folders to provide
|
|
|
|
skeletons and additional packages.
|
|
|
|
|
|
|
|
Creating a basic test case involves:
|
|
|
|
|
|
|
|
* Defining a test class that inherits from +infra.basetest.BRTest+
|
|
|
|
|
|
|
|
* Defining the +config+ member of the test class, to the Buildroot
|
|
|
|
configuration to build for this test case. It can optionally rely on
|
|
|
|
configuration snippets provided by the runtime test infrastructure:
|
|
|
|
+infra.basetest.BASIC_TOOLCHAIN_CONFIG+ to get a basic
|
|
|
|
architecture/toolchain configuration, and
|
|
|
|
+infra.basetest.MINIMAL_CONFIG+ to not build any filesystem. The
|
|
|
|
advantage of using +infra.basetest.BASIC_TOOLCHAIN_CONFIG+ is that a
|
|
|
|
matching Linux kernel image is provided, which allows to boot the
|
|
|
|
resulting image in Qemu without having to build a Linux kernel image
|
|
|
|
as part of the test case, therefore significant decreasing the build
|
|
|
|
time required for the test case.
|
|
|
|
|
|
|
|
* Implementing a +def test_run(self):+ function to implement the
|
|
|
|
actual tests to run after the build has completed. They may be tests
|
|
|
|
that verify the build output, by running command on the host using
|
|
|
|
the +run_cmd_on_host()+ helper function. Or they may boot the
|
|
|
|
generated system in Qemu using the +Emulator+ object available as
|
|
|
|
+self.emulator+ in the test case. For example +self.emulator.boot()+
|
|
|
|
allows to boot the system in Qemu, +self.emulator.login()+ allows to
|
|
|
|
login, +self.emulator.run()+ allows to run shell commands inside
|
|
|
|
Qemu.
|
|
|
|
|
|
|
|
After creating the test script, add yourself to the +DEVELOPERS+ file to
|
|
|
|
be the maintainer of that test case.
|
|
|
|
|
|
|
|
==== Debugging a test case
|
|
|
|
|
|
|
|
When a test case runs, the +output_folder+ will contain the following:
|
2020-01-14 16:04:24 +01:00
|
|
|
|
|
|
|
---------------------
|
|
|
|
$ ls output_folder/
|
|
|
|
TestInitSystemBusyboxRw/
|
|
|
|
TestInitSystemBusyboxRw-build.log
|
|
|
|
TestInitSystemBusyboxRw-run.log
|
|
|
|
---------------------
|
|
|
|
|
2021-10-09 21:10:42 +02:00
|
|
|
+TestInitSystemBusyboxRw/+ is the Buildroot output directory, and it
|
|
|
|
is preserved only if the +-k+ option is passed.
|
|
|
|
|
|
|
|
+TestInitSystemBusyboxRw-build.log+ is the log of the Buildroot build.
|
|
|
|
|
|
|
|
+TestInitSystemBusyboxRw-run.log+ is the log of the Qemu boot and
|
|
|
|
test. This file will only exist if the build was successful and the
|
|
|
|
test case involves booting under Qemu.
|
|
|
|
|
|
|
|
If you want to manually run Qemu to do manual tests of the build
|
|
|
|
result, the first few lines of +TestInitSystemBusyboxRw-run.log+
|
|
|
|
contain the Qemu command line to use.
|
|
|
|
|
|
|
|
You can also make modifications to the current sources inside the
|
|
|
|
+output_folder+ (e.g. for debug purposes) and rerun the standard
|
|
|
|
Buildroot make targets (in order to regenerate the complete image with
|
|
|
|
the new modifications) and then rerun the test.
|
|
|
|
|
|
|
|
==== Runtime tests and Gitlab CI
|
|
|
|
|
|
|
|
All runtime tests are regularly executed by Buildroot Gitlab CI
|
|
|
|
infrastructure, see .gitlab.yml and
|
|
|
|
https://gitlab.com/buildroot.org/buildroot/-/jobs.
|
|
|
|
|
|
|
|
You can also use Gitlab CI to test your new test cases, or verify that
|
|
|
|
existing tests continue to work after making changes in Buildroot.
|
2020-01-14 16:04:24 +01:00
|
|
|
|
2021-10-09 21:10:42 +02:00
|
|
|
In order to achieve this, you need to create a fork of the Buildroot
|
|
|
|
project on Gitlab, and be able to push branches to your Buildroot fork
|
|
|
|
on Gitlab.
|
2020-01-14 16:04:24 +01:00
|
|
|
|
2021-10-09 21:10:42 +02:00
|
|
|
The name of the branch that you push will determine if a Gitlab CI
|
|
|
|
pipeline will be triggered or not, and for which test cases.
|
2020-01-14 16:04:24 +01:00
|
|
|
|
2021-10-09 21:10:42 +02:00
|
|
|
In the examples below, the <name> component of the branch name is an
|
|
|
|
arbitrary string you choose.
|
2020-01-14 16:04:24 +01:00
|
|
|
|
2021-10-09 21:10:42 +02:00
|
|
|
* To trigger all run-test test case jobs, push a branch that ends with
|
|
|
|
+-runtime-tests+:
|
2020-01-14 16:04:24 +01:00
|
|
|
|
|
|
|
---------------------
|
|
|
|
$ git push gitlab HEAD:<name>-runtime-tests
|
|
|
|
---------------------
|
|
|
|
|
2021-10-09 21:10:42 +02:00
|
|
|
* To trigger one or several test case jobs, push a branch that ends
|
|
|
|
with the complete test case name
|
|
|
|
(+tests.init.test_busybox.TestInitSystemBusyboxRo+) or with the name
|
|
|
|
of a category of tests (+tests.init.test_busybox+):
|
2020-01-14 16:04:24 +01:00
|
|
|
|
|
|
|
---------------------
|
|
|
|
$ git push gitlab HEAD:<name>-<test case name>
|
|
|
|
---------------------
|
2021-10-09 21:10:40 +02:00
|
|
|
|
|
|
|
Example to run one test:
|
|
|
|
|
|
|
|
---------------------
|
|
|
|
$ git push gitlab HEAD:foo-tests.init.test_busybox.TestInitSystemBusyboxRo
|
|
|
|
---------------------
|
|
|
|
|
|
|
|
Examples to run several tests part of the same group:
|
|
|
|
|
|
|
|
---------------------
|
|
|
|
$ git push gitlab HEAD:foo-tests.init.test_busybox
|
|
|
|
$ git push gitlab HEAD:foo-tests.init
|
|
|
|
---------------------
|