summaryrefslogtreecommitdiffstats
path: root/scripts/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* devtool: use straight print in check-upgrade-status outputChen Qi2024-01-021-1/+1
| | | | | | | | | | | | 'devtool check-upgrade-status' is for reporting upgradable status for recipes. The output should always be printed out. So we should just use 'print' instead of 'logger.info' as the latter will be suppressed if '-q' parameter is supplied to devtool. (From OE-Core rev: 2c7bf9c8a833bec13a1ebabdce30933cbe691108) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: deploy: provide max_process to strip_execsClay Chang2023-12-231-1/+2
| | | | | | | | | | Use oe.utils.get_bb_number_threads to get max_process (From OE-Core rev: f0056dca0a44c374f1f0c5fccbf66ae88e0b1850) Signed-off-by: Clay Chang <clayc@hpe.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: use E2FSPROGS_FAKE_TIME and hash_seed to generate reproducible ext4 imagesvenkata pyla2023-12-211-0/+14
| | | | | | | | | | | | | E2FSPROGS_FAKE_TIME: sets fixed times for the inodes in the file system. hash_seed: creates reproducible directory indexes in the file system. Reference commit in e2fsprogs: e1f7100643a46456be107b33098f6034b0835e6d (From OE-Core rev: bb822ab75de0020572058090439b93cc56bbf7e0) Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: add python_maturin supportTim Orling2023-12-171-0/+1
| | | | | | | | | | | Add the new python_maturin PEP-517 backend Add selftest for 'pydantic-core' pypi package. (From OE-Core rev: 69b679380616a94a631681caa05d9bf7610f9372) Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: modify: Handle recipes with a menuconfig task correctlyPeter Kjellerstedt2023-12-161-1/+1
| | | | | | | | | | | | | | | | This avoids the following error when running `devtool modify` on a recipe that has a menuconfig task, but does not have KCONFIG_CONFIG_ENABLE_MENUCONFIG set. .../temp/run.do_configure.4163366: line 152: ${@ oe.types.boolean('${KCONFIG_CONFIG_ENABLE_MENUCONFIG}') }: bad substitution WARNING: .../temp/run.do_configure.4163366:152 exit 1 from '[ ${@ oe.types.boolean('${KCONFIG_CONFIG_ENABLE_MENUCONFIG}') } = True ]' (From OE-Core rev: e87e6fa84a0c4b5ac8e736dc62f6e08390ba2436) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: pypi: do not clobber SRC_URI checksumsTim Orling2023-12-091-6/+1
| | | | | | | | | | | | | | | | | The pypi change: "85a2a6f68af recipetool: create_buildsys_python: add pypi support" deleted all the SRC_URI variables, including the SRC_URI checksums. These are not generated by the pypi.bbclass (how could they be trusted?) Without the checksum(s), we are vulnerable to a man-in-the-middle attack and zero checks on the validity of the downloaded tarball from pypi.org. Fix by only setting S and SRC_URI to None. (From OE-Core rev: 560181a52111569f7bc57b09139b42510e0d0325) Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: modify: Make --no-extract work againPeter Kjellerstedt2023-12-081-1/+2
| | | | | | | | | | | | | | | | | | | | This avoids the following error when using --no-extract, introduced in commit 900129cbdf (devtool: add support for git submodules): Traceback (most recent call last): File ".../scripts/devtool", line 349, in <module> ret = main() File ".../scripts/devtool", line 336, in main ret = args.func(args, config, basepath, workspace) File ".../scripts/lib/devtool/standard.py", line 995, in modify for commit in commits[name]: KeyError: '.' (From OE-Core rev: 6a44fb10ef4b90ee24f470362007d56183abc593) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: upgrade: Update all existing checksums for the SRC_URIPeter Kjellerstedt2023-12-081-23/+28
| | | | | | | | | | | | | In addition to updating the sha256sum and removing the md5sum, update all other existing checksums. If the only existing checksum is md5sum, then replace it with the default expected checksums (currently only sha256sum). (From OE-Core rev: 8ea8827ee49b7f0443b1c4bd47d1344a689d73a3) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create: Only include the expected SRC_URI checksumsPeter Kjellerstedt2023-12-081-1/+3
| | | | | | | | | | | | Rather than including all SRC_URI checksums, include the ones that are expected. These are the same as are output if no checksums are included when building the recipe. (From OE-Core rev: c2af83eb5e8573480179b6c0bcce50606b547099) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create: Improve identification of licensesPeter Kjellerstedt2023-12-081-46/+45
| | | | | | | | | | | | Rather than having a static list of crunched MD5 checksums for some of the most common licenses, calculate it for all common licenses. This should improve the identification of license text variantions. (From OE-Core rev: 377f9513dc56e9b8e5f5813c1535be0206756949) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: appendsrcfile(s): add a mode to update the recipe itselfJulien Stephan2023-12-061-1/+5
| | | | | | | | | | | Add a new option -u/--update-recipe to update the recipe itself instead of creating/updating a bbappend file (From OE-Core rev: c9a80f55ed0bf9ce249205d6a9ba670fbb7f59ba) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: appendsrcfile(s): use params instead of extralineJulien Stephan2023-12-061-16/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | appendsrc function relies on oe.recipeutils.bbappend_recipe to copy files and add the corresponding entries in SRC_URI. Currently, appendsrc function build itself the new SRC_URI entry to add the correct subdir param, and gives it using the extralines parameter. This has 2 drawbacks: - oe.recipeutils.bbappend_recipe can already do this if we specify the correct params, so we have duplicate code - the duplicated code is not fully functional: for example, it doesn't take into account the -m/--machine parameter So fix this by not using extralines but give correctly formatted params. Also remove the check for already existing entries as oe.recipeutils.bbappend_recipe already implement it The new bbappend file now have the SRC_URI entry after the FILESEXTRAPATHS so fix the selftest. Update test_recipetool_appendsrcfile_existing_in_src_uri_diff_params test because recipetool appendsrcfiles used to not add new src_uri entry if the entry already exist even with different parameters while oe.recipeutils.bbappend_recipe adds it if parameters are different (and remove the old entry) (From OE-Core rev: cd5de8d53849a6f3bb6f82e45fb301e39892c789) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: appendsrcfile(s): add dry-run modeJulien Stephan2023-12-061-1/+32
| | | | | | | | | | | Add dry-run mode for recipetool appendsrcfile and appendsrcfiles, with if necessary, a diff of changes (From OE-Core rev: 456c726e6b52f4dc57ff605e1cf1687097537002) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: extend empty plugin with options to write zeros to partitonMalte Schmidt2023-12-061-1/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | Adds features to explicitly write zeros to the start of the partition. This is useful to overwrite old content like filesystem signatures which may be re-recognized otherwise. The new features can be enabled with '--soucreparams="[fill|size=<N>[S|s|K|k|M|G]][,][bs=<N>[S|s|K|k|M|G]]"' Conflicting or missing options throw errors. The features are: - fill Fill the entire partition with zeros. Requires '--fixed-size' option to be set. - size=<N>[S|s|K|k|M|G] Set the first N bytes of the partition to zero. Default unit is 'K'. - bs=<N>[S|s|K|k|M|G] Write at most N bytes at a time during source file creation. Defaults to '1M'. Default unit is 'K'. (From OE-Core rev: d19d4529e7a2056caeb526fed980cc1df19a5f6e) Signed-off-by: Malte Schmidt <malte.schmidt@weidmueller.com> Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create_buildsys_python: add pypi supportJulien Stephan2023-12-063-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Today, we can use devtool/recipetool to create recipes for python projects using the github url or the direct release tarball of the project, but the create_buildsys_python plugin doesn't support the pypi class, since we cannot know from the extracted source if the package is available on pypi or not. By implementing the new optional process_url callback, we can detect that the url is a pypi one (i.e 'https://pypi.org/project/<package>') and retrieve the release tarball location. Also detect if the url points to a release tarball hosted on "files.pythonhosted.iorg" (i.e https://files.pythonhosted.org/packages/...) In both cases, adds the pypi class, remove 'S' and 'SRC_URIxxx' variables from the created recipe as they will be handled by the pypi class and add the PYPI_PACKAGE variable This helps to produce cleaner recipes when package is hosted on pypi. If the url points to a github url or a release tarball not coming from "files.pythonhosted.org", the created recipe is the same as before. One can also use the newly added "--no-pypi" switch to NOT inherit from pypi class on matching url, to keep legacy behaviour. To create a recipe for a pypi package, one can now use one of the new following syntax (using recipetool create / devtool add): * recipetool create https://pypi.org/project/<package> * recipetool create https://pypi.org/project/<package>/<version> * recipetool create https://pypi.org/project/<package> --version <version> or the old syntax: * recipetool create https://files.pythonhosted.org/packages/<...> (From OE-Core rev: 097a43846cd99a7d74d004efc57f583ce78970a4) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create: add new optional process_url callback for pluginsJulien Stephan2023-12-061-22/+32
| | | | | | | | | | | | | | | | | | | | | | | Add a new process_url callback that plugins can optionally implement if they which to handle url. Plugins can implement this callback for example, to: * transform the url * add special variables using extravalues * add extra classes * ... If a plugin handles the url, it must append 'url' to the handled list and must return the fetchuri No functional changes expected for plugins non implementing this optional callback (From OE-Core rev: 3e5ce351e7dbe283562bf1db1f2ce3b121c49b53) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create: add trailing newlinesJulien Stephan2023-12-061-3/+5
| | | | | | | | | | | | | | create_recipe() function relies on oe.recipeutils.patch_recipe_lines() which relies on bb.utils.edit_metadata(). edit_metada expect lines to have trailing newlines, so add it to each lines before calling patch_recipe_lines, otherwise edit_metadata will not be able to squash blank line if there are two consecutive blanks after a removal (From OE-Core rev: 31b27cc76a1b669e2b126c332608fd772c124d69) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create_buildsys_python.py: initialize metadataJulien Stephan2023-12-061-0/+1
| | | | | | | | | | | | | In the case pyproject.toml doesn't contains metadatas, the metadata variable is not initialized and the plugin throws an error and falls back to another plugin, which is not the desired behaviour. So just ignore metadata if we don't have them (From OE-Core rev: 88d15877ba18309c521740d7a9649e14d77189bc) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: bootimg-efi: Make kernel image installation configurableKareem Zarka2023-12-041-3/+4
| | | | | | | | | | | | | | | | | | | | | The issue with installing the kernel image to both rootfs and boot partition is that some systems rely on the kernel image in rootfs and not in the boot partition. This leads to duplication of the kernel image, which can cause unnecessary storage usage. This patch provides a solution to the problem by adding a new parameter "install-kernel-into-boot-dir" to the wic kickstart file. If this parameter is set to 'true', the plugin will install the kernel image to the boot partition. If the parameter is set to 'false', the plugin will skip installing the kernel image, avoiding duplication. (From OE-Core rev: d3599afe5f604ea5afd9411e114934dcb52b2d48) Signed-off-by: Kareem Zarka <kareem.zarka@huawei.com> Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: add support for git submodulesJulien Stephan2023-12-014-125/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding the support of submodules required a lot of changes on the internal data structures: * initial_rev/startcommit used as a starting point for looking at new / updated commits was replaced by a dictionary where the keys are the submodule name ("." for main repo) and the values are the initial_rev/startcommit * the extractPatches function now extracts patch for the main repo and for all submodules and stores them in a hierarchical way describing the submodule path * store initial_rev/commit also for all submodules inside the recipe bbappend file * _export_patches now returns dictionaries that contains the 'patchdir' parameter (if any). This parameter is used to add the correct 'patchdir=' parameter on the recipe Also, recipe can extract a secondary git tree inside the workdir. By default, at the end of the do_patch function, there is a hook in devtool that commits everything that was modified to have a clean repository. It uses the command: "git add .; git commit ..." The issue here is that, it adds the secondary git tree as a submodule but in a wrong way. Doing "git add <git dir>" declares a submodule but do not adds a url associated to it, and all following "git submodule foreach" commands will fail. So detect that a git tree was extracted inside S and correctly add it using "git submodule add <url> <path>", so that it will be considered as a regular git submodule (From OE-Core rev: 900129cbdf25297a42ab5dbd02d1adbea405c935) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: tag all submodulesJulien Stephan2023-12-011-0/+3
| | | | | | | | | | | | In the case of a repository with submodules, we need to add the "devtool-base" and "devtool-patched" tag on all submodules in order to properly detect the added/removed/modified patches (From OE-Core rev: 241da68805d177d4ec4b302c8a997645cc645286) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: finish/update-recipe: restrict mode srcrev to recipes fetched from SCMJulien Stephan2023-12-011-1/+5
| | | | | | | | | | | | | | | | | | | | | | When specifying --mode / -m srcrev with devtool finish/update-recipe on recipes that are not fetched from a SCM repository we get the following error: Traceback (most recent call last): [..] File "<...>/poky/meta/lib/oe/patch.py", line 49, in runcmd raise CmdError(cmd, exitstatus >> 8, "stdout: %s\nstderr: %s" % (stdout, stderr)) oe.patch.CmdError: Command Error: 'sh -c 'git format-patch --no-signature --no-numbered INVALID -o /tmp/oepatchbj7pfmzj -- .'' exited with 0 Output: stdout: stderr: fatal: bad revision 'INVALID' Fix this by adding a check and abort with a proper error message. (From OE-Core rev: 5b77f60e85d07921ae5e808daa1fd7d8c3dc40ea) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: fix update-recipe dry-run modeJulien Stephan2023-11-301-5/+4
| | | | | | | | | | | | | | | | | When running devtool update-recipe with --mode=srcrev AND --append switch in dry-run, we get the following error: Traceback (most recent call last): [...] Exception: destpath should be set here Fix this by removing a misplaced else statement in _update_recipe_srcrev (From OE-Core rev: 85ba125703d5b442133fd7c470b915460ee68ac9) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: rawcopy: add support for zstd decompressionMalte Schmidt2023-11-271-1/+2
| | | | | | | | | | | Add support for zstd decompression in rawcopy plugin. zstd claims to reach higher, uniform decompression rates. (From OE-Core rev: 707471b71a417187f1e581d0c540e058825f7242) Signed-off-by: Malte Schmidt <malte.schmidt@weidmueller.com> Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Add handler to create go recipesLukas Funke2023-11-061-0/+751
| | | | | | | | [RP: Replace python 3.9 use of removeprefix()] (From OE-Core rev: 049afb933f42851d56d2e6522150a32bcccf2a6f) Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Ignore *.go files while scanning for licensesLukas Funke2023-11-061-1/+1
| | | | | | | (From OE-Core rev: 1765acc8bdc08e392daa8b77add8b4ce1a9e70b6) Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/resulttool: group all regressions in regression reportAlexis Lothoré2023-11-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit c304fcbe0588b1078373558c2ddf36064bcdf214 introduced a grouping when listing regressions. This grouping has been added only for ptests. It has been observed that any other kind of tests could benefit from it. For example, current regression reports can show the following: 1 regression(s) for oescripts.OEGitproxyTests.test_oegitproxy_proxy_dash oescripts.OEGitproxyTests.test_oegitproxy_proxy_dash: PASSED -> SKIPPED 1 regression(s) for oescripts.OEPybootchartguyTests.test_pybootchartguy_help oescripts.OEPybootchartguyTests.test_pybootchartguy_help: PASSED -> SKIPPED 1 regression(s) for oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_pdf_output oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_pdf_output: PASSED -> SKIPPED 1 regression(s) for oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_png_output oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_png_output: PASSED -> SKIPPED 1 regression(s) for oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_svg_output oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_svg_output: PASSED -> SKIPPED [...] This output is not so useful in its current state and should be grouped per test type too. Enable grouping for all kind of tests, to make it llok like the following in reports: 5 regression(s) for oescripts oescripts.OEGitproxyTests.test_oegitproxy_proxy_dash: PASSED -> SKIPPED oescripts.OEPybootchartguyTests.test_pybootchartguy_help: PASSED -> SKIPPED oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_pdf_output: PASSED -> SKIPPED oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_png_output: PASSED -> SKIPPED oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_svg_output: PASSED -> SKIPPED (From OE-Core rev: 982798ef96e3a32bf15341bdd3bb7c4356709412) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: add python_hatchling supportTim Orling2023-10-301-1/+5
| | | | | | | | | | | | One of the newer PEP-517 backends to be added was python_hatchling.bbclass but it was not included in the recent improvements. Add selftest for 'jsonschema' pypi package. (From OE-Core rev: d99b4883b4fee82bc588fd235ba90fedf1550cb8) Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/sstatesig.py: dump locked.sigs.inc only when explicitly asked via -S ↵Alexander Kanavin2023-10-271-1/+1
| | | | | | | | | | | | | | | | | | | | lockedsigs This was writing out locked-sigs.inc into cwd with every 'bitbake -S' invocation. When the intent is only to to get task stamps (-S none), or print the difference between them (-S printdiff), the file is unnecessary clutter. A couple of selftests/scripts were however relying on this, so they're adjusted to explicitly request the file. eSDK code calls dump_lockedsigs() separately via oe.copy_buildsystem.generate_locked_sigs() and so isn't affected. (From OE-Core rev: ad57c3cac2a8d3e60222e3cca0685f582dcea135) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool/create_buildsys_python: add PEP517 supportJulien Stephan2023-10-271-1/+267
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add basic support for PEP517 [1] for the 3 following backends that are supported by bitbake: - setuptools.build_meta - poetry.core.masonry.api - flit_core.buildapi If a pyproject.toml file is found, use it to create the recipe, otherwise fallback to the old setup.py method. Some projects can declare a minimal pyproject.toml file, and put all the metadata in setup.py/setup.cfg/requirements.txt .. theses cases are not handled. If a pyproject.toml file is found, assumes it has all necessary metadata. As for the old setup.py method, version numbers for dependencies are not handled. Some features may be missing, such as the extra dependencies. [YOCTO #14737] [1]: https://peps.python.org/pep-0517/ (From OE-Core rev: c7d8d15b2d0a9ecd210bd247fa0df31d9f458873) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool/create_buildsys_python: refactor code for futur PEP517 additionJulien Stephan2023-10-271-349/+371
| | | | | | | | | | | | | | | | In order to prepare the support for pyproject.toml (PEP517 [1]) enabled projects, refactor the code and move setup.py specific code into a specific class in order to allow sharing the PythonRecipeHandler class No functionnal changes expected [1]: https://peps.python.org/pep-0517/#source-tree (From OE-Core rev: 2281e93347da4129062cfb40710df03c87c63168) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool/create_buildsys_python: prefix created recipes with python3-Julien Stephan2023-10-271-0/+5
| | | | | | | | | | | | | | | By convention, all python recipes start with "python3-" so update create_buildsys_python to do this This rule doesn't apply for packages already starting with "python" Update recipetool's selftest accordingly (From OE-Core rev: b0d87440e610b80f763d09784d4a90a148bb3e7b) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool/create_buildsys_python: fix license noteJulien Stephan2023-10-271-1/+1
| | | | | | | | | | | | | | | | | License field of setup is not always standardized, so we usually use the classifier to determine the correct license format to use in the recipe. A warning note is added above the LICENSE field of the create recipe in case a license is provided in setup. But when the plugin is called, "LICENSE =" is not yet present so we can never display this note. Replace the "LICENSE =" condition with "##LICENSE_PLACEHOLDER##" to actually be able to display the note message (From OE-Core rev: b7c26ca2028aa60f740464de85a11a01a531f32e) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/resulttool: make additional info more compactAlexis Lothoré2023-10-231-4/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since "matched" and "improved" tests are not as important as regressions, reduce the place they take in the regression report: - merge "matched" and "improved" tests, while removing the label - add a single line of additional info per pair Those changes make the "Matches and improvements" look like the following sample: oeselftest_almalinux-9.2_qemux86-64_20230910083156 oeselftest_almalinux-8.8_qemux86-64_20231018010951 -> +7 test(s) present oeselftest_almalinux-9.2_qemux86-64_20230911010538 oeselftest_debian-11_qemux86-64_20231017150459 oeselftest_debian-11_qemux86-64_20230910012927 oeselftest_debian-11_qemux86-64_20231017151319 -> +7 test(s) present [...] (From OE-Core rev: 6de4426d9a7da67deed7d3a3918892fb56238ff3) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/resulttool: rearrange regressions report orderAlexis Lothoré2023-10-231-2/+6
| | | | | | | | | | | | | | Regressions reports currently reports matching pairs and improved pairs first, then regressions. Change order to print regressions first, which is the most valuable info in the report, and then print improvements and matches at the bottom. (From OE-Core rev: 599267467430e70fa4dc8ba6b2a8b126bf6da359) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/resulttool: limit the number of changes displayed per testAlexis Lothoré2023-10-231-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | Most of the changes list generated in regression reports fall in one of the two following categories: - there is only a few (<10) changes listed and the info is valuable/relevant - the list is huge (> 100 ? 1000 ?) and basically tells us that the whole tests category suffers the same status (test missing, test failing, test skipped, etc) Prevent those huge, worthless lists by limiting the output for each test group: - current default limit is arbitrarily set to 50 - limit can still be overriden with a new "-l"/"--limit" flag, either with custom value, or with 0 to print the whole lists of changes - limit is applied per test family: currently it distinguishes only types of ptests, but it can be adapted to other kind of tests (From OE-Core rev: cec118406f3ad81cb4709f6e6ae1cef65799658e) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: fix a typo in help outputAndré Draszik2023-10-101-1/+1
| | | | | | | (From OE-Core rev: 1c35beb935d42e200370b54f9aa3848b940966dd) Signed-off-by: André Draszik <git@andred.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool/upgrade: check all git config locationsMarcus Flyckt2023-10-081-1/+1
| | | | | | | | | | | | | | | | | Fixes [YOCTO #15222] In some situations its more practical to keep git configuration at `/etc/gitconfig` instead of `$HOME/.gitconfig` (e.g., when mounting git configuration into a docker container). This change makes `devtool upgrade` consider any available git configuration instead of only checking `--global`. (From OE-Core rev: 30a9f7de45050c8bac49d4b37419cc2e067a75fa) Signed-off-by: Marcus Flyckt <marcus.flyckt@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool/create_buildsys_python: use importlib instead of impChris Laplante2023-10-061-3/+2
| | | | | | | | | | | 'imp' was deprecated in Python 3.4 and removed in 3.12. The piece of importlib we use has been around since 3.3. (From OE-Core rev: 457f0dad87b4e45a53865b5ad2c150215bd74019) Signed-off-by: Chris Laplante <chris.laplante@agilent.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Add console parameters to qemux86 canned-wksRichard Purdie2023-10-041-1/+1
| | | | | | | | | | | Currently our wic test images boot up without kernel output on the consoles which means we have no way to debug if anything goes wrong. Add the console parameters runqemu would have added if the kernel wasn't built into an image to improve our chances of debugging. (From OE-Core rev: 63ea1efdaaf1173ef4f2f69b5a3403afef4b556a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: bootimg-partition: Fix file name in debug messageDaniel Semkowicz2023-10-011-1/+1
| | | | | | | | | | Debug message about using custom configuration file includes file name with incorrect extension. Correct file name to "extlinux.conf". (From OE-Core rev: dd63e1520454b2d53a48b72eaae126059af9809b) Signed-off-by: Daniel Semkowicz <dse@thaumatec.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool/devtool: Ensure server knows about changed filesRichard Purdie2023-09-185-1/+6
| | | | | | | | | Bitbake has changed to require notification when metadata changes in the middle of tinfoil sessions. Add the required function calls at the places metadata is changed. (From OE-Core rev: e5574163ab49a8f51b2b34fd37acfd1cad9b7595) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool/build_sdk: Drop unused importsRichard Purdie2023-09-181-1/+1
| | | | | | | | Drop some unused imports. (From OE-Core rev: 432446ef402ff42fe0c90172b77376fa5981524a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* build-sysroots: target or native sysroot population need to be selected ↵Alexander Kanavin2023-09-091-1/+2
| | | | | | | | | | | | | | | | | explicitly Running them in parallel is prone to races as postinsts from target sysroots rely on executables from native sysroots which may or may not be fully prepared yet. This was observed for example here: https://autobuilder.yoctoproject.org/typhoon/#/builders/146/builds/468/steps/12/logs/stdio https://autobuilder.yoctoproject.org/typhoon/#/builders/147/builds/467/steps/12/logs/stdio (From OE-Core rev: 38d7a2e45b883cf999a86af05bcc0eaa875bb47c) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Add gpt-hybrid partition layoutJoshua Watt2023-09-023-17/+69
| | | | | | | | | | | | | | | | | | | | | | | Add support for formatting a disk with a hybrid MBR & GPT partition scheme. In this scheme, the primary partitioning method is GPT, but a valid MBR header is also written than can point to a subset of the GPT partitions on the disk (any partitions marked with the `--mbr` flag will be included in this MBR). The primary purpose of this method is to allow for SoCs that can only find a bootloader in an MBR partition to use GPT once the bootloader is running. As an example, older versions of the Raspberry Pi firmware can only parse MBR partitions to find a kernel (or other bootloader like u-boot), but once those have booted GPT partitions can be used. In addition to the partitions annotated with the `--mbr`, a "protective" GPT partition of type 0xEE is added, as the existence of such a partition is the indication to tooling that this a hybrid MBR and that the GPT partition table should be parsed instead. (From OE-Core rev: e50e4c2a5ada6947b3503ca4d8e9c30d359e8a5d) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipes/classes/scripts: Drop SRCPV usage in OE-CoreRichard Purdie2023-08-242-2/+2
| | | | | | | | Now that SRCPV isn't needed we can simplify things in a few places... (From OE-Core rev: 843f82a246a535c353e08072f252d1dc78217872) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: fix wrong attempt to create file system in upartitioned regionsMarkus Niebel2023-08-211-1/+1
| | | | | | | | | | | | | | | | The kickstart parser defaults fstype to "vfat". This leads to an attempt to create an empty file system even for regions configured with "--no-table" if used without fstype when no --sourceparams given. The fix tests for fstype "none" or no_table in Partition prepare method. This will omit the file system creation an the potential error for small region with --no-table option. (From OE-Core rev: db771a4cd36bf291a8b68edfd905e03243f2c8b3) Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool/report: Avoid divide by zeroRichard Purdie2023-08-151-1/+4
| | | | | | | | Avoid a divide by zero traceback if unfortunate test counts are encountered. (From OE-Core rev: c5aeea53dfacb53dedb8445cb3523dc3a8cb6dca) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: bootimg-efi: Stop hardcoding VMA offsetsAlexandre Belloni2023-08-091-14/+49
| | | | | | | | | | | | | | | | Section VMA's are currently hardcoded. This doesn't work anymore starting with systemd-boot v254. Follow the actually solution to this which is documented here: https://wiki.archlinux.org/title/Unified_kernel_image#Manually This is also used by dracut. Later on, we may want to switch to ukify instead but this is not ready yet. (From OE-Core rev: 3abf99a6c6bde2fb8770f54dba609b35f6c6ee5a) Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/resulttool: define custom string for "not found" test resultsAlexis Lothoré2023-08-041-0/+1
| | | | | | | | | | | | | | | | | | | Whenever a test result is present in base test result but absent from target test results, we have an entry in regression report looking like the following one: ptestresult.apr.testfile: PASSED -> None The "None" status may be a bit confusing, so replace it with a custom string which really states what "None" means in this context: ptestresult.apr.testfile: PASSED -> No matching test result (From OE-Core rev: b5f6da6e13f3484f51dfa07f6b3500aea7a21825) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>