diff options
| author | Trevor Woerner <twoerner@gmail.com> | 2025-09-18 17:27:26 -0400 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-09-22 22:09:48 +0100 |
| commit | ed8544941bf47307a2e3bca39e5fa3a6a35dd447 (patch) | |
| tree | 3ed82e5800852a0220b29778d865756df06b0a41 /scripts | |
| parent | cd493181d70e55a0c67535c5bd9661e224ef7237 (diff) | |
| download | poky-ed8544941bf47307a2e3bca39e5fa3a6a35dd447.tar.gz | |
patchtest.README: update installation instructions
Update the installation instructions to demonstrate using a Python
virtual environment to install the patchtest module dependencies. Also
provide example #exactsteps. Using a virtual environment is considered a
best practice for Python programs, but also makes the git-pw tool
available in the user's PATH automatically.
(From OE-Core rev: 82d5797c2bc40f0465e57dbc745f3ccccfed1067)
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/patchtest.README | 74 |
1 files changed, 59 insertions, 15 deletions
diff --git a/scripts/patchtest.README b/scripts/patchtest.README index 5a9dabc50b..bfbe29a379 100644 --- a/scripts/patchtest.README +++ b/scripts/patchtest.README | |||
| @@ -26,26 +26,70 @@ https://git.yoctoproject.org/meta-patchtest/ | |||
| 26 | 26 | ||
| 27 | ## Installation | 27 | ## Installation |
| 28 | 28 | ||
| 29 | As a tool for use with the Yocto Project, the [quick start | 29 | Patchtest checks patches which are expected to be applied to |
| 30 | guide](https://docs.yoctoproject.org/brief-yoctoprojectqs/index.html) | 30 | Yocto layers. Therefore, familiarity with the Yocto Project, its |
| 31 | contains the necessary prerequisites. In addition, patchtest relies on | 31 | functionality, and image-build processes is assumed. Otherwise the |
| 32 | several Python modules for parsing and analysis, which can be installed | 32 | [quick start guide](https://docs.yoctoproject.org/brief-yoctoprojectqs/index.html) |
| 33 | by running `pip install -r meta/lib/patchtest/requirements.txt`. Note | 33 | contains the necessary information. |
| 34 | that git-pw is not automatically added to the user's PATH; by default, | 34 | |
| 35 | it is installed at ~/.local/bin/git-pw. | 35 | As a Python application, the recommended way it should be installed |
| 36 | (following Python best practices) is to use a virtual environment. A | ||
| 37 | Python virtual environment provides a convenient sandbox into which its | ||
| 38 | requirements can also be installed with out affecting a user's entire | ||
| 39 | system at large. Patchtest makes use of a test suite found in oe-core, | ||
| 40 | so it needs to be available as well. | ||
| 41 | |||
| 42 | For example, to install patchtest into a Python virtual environment | ||
| 43 | called "patchtest.venv" located at some/where in your filesystem: | ||
| 44 | |||
| 45 | $ mkdir -p some/where | ||
| 46 | $ cd some/where | ||
| 47 | $ mkdir yocto | ||
| 48 | $ pushd yocto | ||
| 49 | $ git clone https://git.openembedded.org/openembedded-core | ||
| 50 | $ git clone https://git.openembedded.org/bitbake | ||
| 51 | $ git clone https://git.yoctoproject.org/meta-patchtest | ||
| 52 | $ popd | ||
| 53 | $ . yocto/openembedded-core/oe-init-build-env build yocto/bitbake | ||
| 54 | $ cd .. | ||
| 55 | $ python3 -m venv patchtest.venv | ||
| 56 | $ . patchtest.venv/bin/activate | ||
| 57 | (patchtest.venv) $ pip install -r yocto/openembedded-core/meta/lib/patchtest/requirements.txt | ||
| 58 | |||
| 59 | In the above list of cloned repositories, the meta-patchtest layer is | ||
| 60 | only needed if you intend to use patchtest in "guest" mode. Also the | ||
| 61 | oe-core + bitbake clones can be replaced with poky instead. | ||
| 62 | |||
| 63 | If "guest" mode will be used, the meta-patchtest layer needs to be added | ||
| 64 | to the conf/bblayers.conf file generated above. | ||
| 65 | |||
| 66 | If you would like to run the patchtest selftest found in oe-core, the | ||
| 67 | openembedded-core/meta-selftest (or poky/meta-selftest, if using poky) | ||
| 68 | layer also needs to be added to bblayers.conf. | ||
| 69 | |||
| 70 | Once the installation is done, your directory layout will look like: | ||
| 71 | . | ||
| 72 | ├── build | ||
| 73 | │ └── conf | ||
| 74 | ├── yocto | ||
| 75 | │ ├── bitbake | ||
| 76 | │ ├── meta-patchtest | ||
| 77 | │ └── openembedded-core | ||
| 78 | └── patchtest.venv | ||
| 79 | ├── bin | ||
| 80 | ├── include | ||
| 81 | ├── lib | ||
| 82 | ├── lib64 -> lib | ||
| 83 | ├── pyvenv.cfg | ||
| 84 | └── share | ||
| 36 | 85 | ||
| 37 | For git-pw (and therefore scripts such as patchtest-get-series) to work, you need | 86 | For git-pw (and therefore scripts such as patchtest-get-series) to work, you need |
| 38 | to provide a Patchwork instance in your user's .gitconfig, like so (the project | 87 | to provide a Patchwork instance in your user's .gitconfig, like so (alternatively |
| 39 | can be specified using the --project argument): | 88 | the project can be specified using the --project argument to git-pw on its |
| 89 | cmdline): | ||
| 40 | 90 | ||
| 41 | git config --global pw.server "https://patchwork.yoctoproject.org/api/1.2/" | 91 | git config --global pw.server "https://patchwork.yoctoproject.org/api/1.2/" |
| 42 | 92 | ||
| 43 | To work with patchtest, you should have the following repositories cloned: | ||
| 44 | |||
| 45 | 1. https://git.openembedded.org/openembedded-core/ (or https://git.yoctoproject.org/poky/) | ||
| 46 | 2. https://git.openembedded.org/bitbake/ (if not using poky) | ||
| 47 | 3. https://git.yoctoproject.org/meta-patchtest (if using guest mode) | ||
| 48 | |||
| 49 | ## Usage | 93 | ## Usage |
| 50 | 94 | ||
| 51 | ### Obtaining Patches | 95 | ### Obtaining Patches |
