summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
AgeCommit message (Collapse)Author
16 hoursimage*.bbclass, kernel*.bbclass: create version-less artifacts and versioned ↵Martin Jansa
hard links * instead of versioned artifacts and version-less symlinks * We used to create the actual artifact files with some version in the filename and then created symlink without any version which was updated to point to the latest one created. In some scenarios it's useful to create all artifacts - typically rootfs and kernel images with the same version - like release build even when the kernel itself wasn't modified since the previous release. If we include the release version in the regular _NAME variables then we'll need to re-run do_deploy and do_image which will cause kernel to be rebuilt and image to be re-created even when the only change since last build was the version number. With this change we can re-use kernel and image from sstate when nothing was changed and run only very fast do_deploy_links task which just adds another hard link to existing artifact from sstate. * This is already used by various LGE builds as do_webos_deploy_fixup() https://github.com/webosose/meta-webosose/blob/master/meta-webos/classes/webos_deploy.bbclass but injecting this task in all the right places is difficult and sometimes requires whole bbclass to be duplicated. Having simpler way of versioning artifacts directly in oe-core might be useful for others. * move IMAGE_VERSION_SUFFIX from _NAME variables to _LINK_NAME that way e.g. kernel.do_deploy can be reused from sstate to provide "version-less" artifacts and then very fast do_deploy_links task just adds links with consistent suffixes (by default the version from the recipe but could be easily set to e.g. some release name when building some products). * create hard links instead of symlinks, so that whatever version the filename says is really there * some IMAGE_FSTYPES might need the "version-less" IMAGE_NAME file to be removed first or they might either append or update the content of the image instead of creating new image file from scratch - I have seen this only with one proprietary format we generate with our own tool, so hopefully this isn't very common * this is basically the mechanism are using in webOS with WEBOS_IMAGE_NAME_SUFFIX which is for official builds set from jenkins job and then all artifacts (images as well as corresponding kernel files) have the same version string) * without this, you can still easily set the variables to contain the version from jenkins job (excluded from sstate signature like DATETIME currently is to prevent rebuilding it everytime even when the content didn't change) but then when kernel is reused from sstate you can have version 1.0 used on kernel artifacts and 2.0 on image artifacts. * if you don't exclude the version string with vardepsexclude, then you get the right version in the filenames but for cost of re-executing do_deploy every single time, which with rm_work will cause all kernel tasks to be re-executed (together with everything which depends on it like external modules etc). * the implementation "from outside" is a bit tricky as shown in webOS OSE, because first you need to reverse the meaning of IMAGE_NAME and IMAGE_LINK_NAME like here, but also replace all symlinks with hardlinks and then adjust all recipes/bbclasses to depend on our do_deploy_fixup task instead of the original do_deploy see the variable modifications: https://github.com/webosose/meta-webosose/blob/a35e81622aae1066591e44a132d01297ff478248/meta-webos/conf/distro/include/webos.inc#L65 and then various bbclasses to hook do_webos_deploy_fixup task creating the hardlinks for possible artifacts: https://github.com/webosose/meta-webosose/blob/a35e81622aae1066591e44a132d01297ff478248/meta-webos/classes/webos_deploy.bbclass https://github.com/webosose/meta-webosose/blob/a35e81622aae1066591e44a132d01297ff478248/meta-webos/classes/kernel.bbclass https://github.com/webosose/meta-webosose/blob/a35e81622aae1066591e44a132d01297ff478248/meta-webos/classes/image.bbclass so hopefully with all these changes in oe-core other project can achieve the same just by setting one variable IMAGE_VERSION_SUFFIX * drop ${PKGE}-${PKGV}-${PR} from kernel artifacts names (this is the latest build) and add it only in hardlinks created in do_deploy_links so that we can use PKGR there again (because these links are generally used only by human operators and they don't have their own TASKHASH or the IMAGE_VERSION_SUFFIX might be set to some release name which they do understand * this allows to drop package_get_auto_pr from kernel do_deploy as well, leaving only 2 EXTENDPRAUTO bumps for each kernel build (do_package and do_deploy_links, unfortunatelly these will still have different value, so if you're looking for the exact kernel image in deploy directory based on kernel image package version seen on the device the EXTENDPRAUTO part of PR will be different). [YOCTO #12937] Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
7 daysclasses/lib/scripts: Initial WORKDIR -> UNPACKDIR updatesRichard Purdie
Work through the initial issues I found where we need to change WORKDIR to UNPACKDIR. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
7 daysbase/bitbake.conf: Introduce UNPACKDIRRichard Purdie
Having the unpack directory hardcoded to WORKDIR makes it really hard to make any changes to the unpack process to try and allow for cleanup for example. As a first step toward unraveling the intertwined location usages, add a variable, UNPACKDIR which is where the fetcher is asked to unpack fetched sources. It defaults to the existing value of WORKDIR at this point. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-04-04sstatesig: fix netrc.NetrcParseError exceptionJose Quaresma
Looks like sometimes the e.filename and the e.lineno is not properly set by the netrc and this can cause TypeError. | File "/poky/meta/lib/oe/sstatesig.py", line 342, in init_rundepcheck | bb.warn("Error parsing %s:%d: %s" % (e.filename, e.lineno, e.msg)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | TypeError: %d format: a real number is required, not NoneType Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-30oe/package: enhance objdump command call with llvmlixiaoyong
Replace `${HOST_PREFIX}objdump` with `${OBJDUMP}`. When utilizing llvm for compiling packages, the invocation of GNU objdump will consistently occur during package precess. This behavior is unfriendly to llvm. So prefer `${OBJDUMP}` over `${HOST_PREFIX}objdump`. Signed-off-by: lixiaoyong <lixiaoyong19@huawei.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-30bblayers/makesetup.py: Move git utility functions to oe.buildcfg moduleJermain Horsman
This allows other classes to make use of these as well. Includes a git describe and git toplevel function and functions to get info for git remotes. Signed-off-by: Jermain Horsman <jermain.horsman@nedap.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-26sstatesig: Warn on bad .netrcJoshua Watt
If there is an error parsing .netrc, warn the user Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-23sstatesig: Set hash server credentials from bitbake variablesJoshua Watt
Allows the hash server credentials to be specified in bitbake variables. If omitted, the users .netrc will be checked Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-24lib/oe/package: fix LOCALE_PATHS scan to create locale packagesJonathan GUILLOT
split_locales() must only check subdirectories in paths added to LOCALE_PATHS to avoid creating weird packages based on filenames also present in paths. Without such a filter, cups recipe adding ${datadir}/cups/templates to LOCALE_PATHS creates the following incorrect packages: - cups-locale-add-class.tmpl - cups-locale-add-printer.tmpl - cups-locale-admin.tmpl Signed-off-by: Jonathan GUILLOT <jonathan@joggee.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-19lib/oe/patch: Use git notes to store the filenames for the patchesPeter Kjellerstedt
The old way of keeping track of the filenames for the patches that correspond to the commits was to add a special comment line to the end of the commit message, e.g., "%% original patch: <filename>", using a temporary git hook. This method had some drawbacks, e.g.: * It caused problems if one wanted to push the commits upstream as the comment line had to be manually removed. * The comment line would end up in patches if someone used git format-path rather than devtool finish to generate the patches. * The comment line could interfere with global Git hooks used to validate the format of the Git commit message. * When regenerating patches with `devtool finish --force-patch-refresh`, the process typically resulted in adding empty lines to the end of the commit messages in the updated patches. A better way of keeping track of the patch filenames is to use Git notes. This way the commit messages remain unaffected, but the information is still shown when, e.g., doing `git log`. A special Git notes space, refs/notes/devtool, is used to not intefere with the default Git notes. It is configured to be shown in, e.g., `git log` and to survive rewrites (i.e., `git commit --amend` and `git rebase`). Since there is no longer any need for a temporary Git hook, the code that manipulated the .git/hooks directory has also been removed. To avoid potential problems due to global Git hooks, --no-verify was added to the `git commit` command. To not cause troubles for those who have done `devtool modify` for a recipe with the old solution and then do `devtool finish` with the new solution, the code will fall back to look for the old strings in the commit message if no Git note can be found. While not technically motivated like above, the way to keep track of ignored commits is also changed to use Git notes to avoid having different methods to store similar information. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-19lib/oe/patch: Add GitApplyTree.commitIgnored()Peter Kjellerstedt
This function can be used to create a commit that devtool will ignore when creating/updating the patches. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-19lib/oe/patch: Make extractPatches() not extract ignored commitsPeter Kjellerstedt
If a commit is marked with "%% ignore" it means it is used by devtool to keep track of changes to the source code that are not the result of running do_patch(). These changes need to actually be ignored when extracting the patches as they typically make no sense as actual patches in a recipe. This also adds a new test for oe-selftest that verifies that there are no patches generated from ignored commits. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-19sstatesig: Implement new siggen APIJoshua Watt
Implements the new API required for querying unihashes in parallel Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-14lib/oe/package: add LOCALE_PATHS to add define all locations for localesJonathan GUILLOT
Some packages may contain localized files not located in default path ${datadir}/locale. Add the new variable LOCALE_PATHS to allow a recipe to define extra paths or even fully override the scanned directories. LOCALE_PATHS is set at ${datadir}/locale by default to keep the exact same behavior for the recipes which did not need modification. Signed-off-by: Jonathan GUILLOT <jonathan@joggee.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-14lib/oe/package: replace in place PN-locale-* packages in PACKAGESJonathan GUILLOT
split_locales() removes PN-locale from PACKAGES and adds PN-locale-* to the end. As the PN-locale package typically appears before PN base package, it may result in paths not installed in PN-locale-* packages if already catched by PN. Now insert PN-locale-* exactly where PN-locale was existing in list to avoid such an issue. Signed-off-by: Jonathan GUILLOT <jonathan@joggee.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-13ipk: Remove temporary package lists during SDK creationPhilip Lorenz
The temporary package lists used during SDK creation should not be shipped as part of the SDK (in particular because due to the opkg local file download optimization they are actually symlinks into the build directory). Remove them by calling the respective helper method during the SDK build. Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de>
2024-02-08package_manager: ipk: add OPKG_MAKE_INDEX_EXTRA_PARAMS variableMartin Jansa
* can be used to pass e.g. -f param to preserve user-defined fields in the index as added in: https://git.yoctoproject.org/opkg-utils/commit/opkg-make-index?id=13f6281d24e17199e0fef6c2984419372ea0f86f * otherwise it will show a lot of messages like: "Lost field Author <value>" for every package in the feed Signed-off-by: Martin Jansa <martin.jansa@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-23cve_check: cleanup loggingRoss Burton
Primarily list the number of patches found, useful when debugging. Also clean up some bad escaping that caused warnings and use re.IGNORECASE instead of manually doing case-insenstive rang matches. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-23cve_check: handle CVE_STATUS being set to the empty stringRoss Burton
Handle CVE_STATUS[...] being set to an empty string just as if it was not set at all. This is needed for evaluated CVE_STATUS values to work, i.e. when setting not-applicable-config if a PACKAGECONFIG is disabled. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-19reproducible: Fix race with externalsrc/devtool over lockfileRichard Purdie
We occasionally see races over the lockfile used by externalsrc/devtool when walking files for the source_date_epock calculation. Skip this file if present to avoid the issues and fix a real issue where SDE could be contaminated too. [YOCTO #14921] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-18rootfs-postcommands: Try and improve ordering constraintsRichard Purdie
The current code is in race to see who can set things last. This isn't scalable or sustainable and problemtic in the face of inherit ordering changes. Move the ordering issue into the actual code execution, which isn't ideal but the best of several bad options and at least lets us drop the anonymous python. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-18rootfs: Fix MULTILIB_RE_ALLOW to be inherit order independentRichard Purdie
This variable is only used by the ipk backend with multilibs. In order to make it work correctly regardless of inherit order, change the string to be space delimeted, set using += and add in the regex '|' sperator at the end of processing. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-15package.py: fix Darwin supportEtienne Cordonnier
- 'subprocess.Popen([d.expand("${HOST_PREFIX}otool)' requires text-mode (a more readable alias for the universal_newlines parameter), since otool produces text and the code 'out.split("\n")' expects a string, not a bytes object. otool is used on MacOS only, so this error isn't triggered on Linux. - use 'startswith("darwin")' in order to support all darwin versions and not just specific versions (meta-darwin supports darwin21 at the moment). Signed-off-by: Dominik Schnitzer <dominik@snap.com> Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-10rootfs.py: check depmodwrapper execution resultYang Xu
The execution result of depmodwrapper is not checked which makes depmod generation failed sliently and hard to detect. So check exection result and stop building if depmodwrapper failed. Signed-off-by: Yang Xu <yang.xu@mediatek.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2024-01-05lib/sstatesig/find_siginfo: raise an error instead of returning None when ↵Alexander Kanavin
obtaining mtime Suppressing the error and returning None can result in a delayed failure: https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/6254/steps/14/logs/stdio https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/6262/steps/14/logs/stdio It is not clear why the os.stat() error occurs to begin with (it shouldn't), so rather than adding further workarounds, let's get diagnostics at the source first, so we understand what is going on. Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-05sstatesig: Add version information for find_sigingfoRichard Purdie
Since we're changing the return values of the function, add a version so bitbake can ensure it is using a compatible function. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-05sstatesig/find_siginfo: unify a disjointed APIAlexander Kanavin
find_siginfo() returns two different data structures depending on whether its third argument (list of hashes to find) is empty or not: - a dict of timestamps keyed by path - a dict of paths keyed by hash This is not a good API design; it's much better to return a dict of dicts that include both timestamp and path, keyed by hash. Then the API consumer can decide how they want to use these fields, particularly for additional diagnostics or informational output. I also took the opportunity to add a binary field that tells if the match came from sstate or local stamps dir, which will help prioritize local stamps when looking up most recent task signatures. Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-24lib/prservice: Improve lock handling robustnessRichard Purdie
It is possible we could crash holding a lock whilst parsing in this code. Switch to use utils.fileslocked() in the with expression to avoid this. This may be causing some of our strange intermittent failures in PRServ tests. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-24lib/packagedata.py: Add API to iterate over rprovidesJoshua Watt
Adds an API that makes it easier to iterate over the package data for a all providers of a runtime dependency. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-23lib/packagedata.py: Fix broken symlinks for providers with a '/'Joshua Watt
If a package had a provider with a '/' in it (e.g. "/bin/sh", "/bin/bash", etc.), the generated symlinks were broken due to being at a hard coded depth. Use oe.path.relsymlink() instead to make a correct relative symbolic link Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-23lib/oe/path.py: Add relsymlink()Joshua Watt
Adds API to make a relative symbolic link between two directories. The arguments are the same as oe.path.symlink() Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-23ipk: Switch to using zstd compressionJoshua Watt
Converts IPK package generation to use zstd instead of xz. zstd has a much larger compression/speed tradeoff range allowing users to choose what suits them best, and fast decompression speeds. It also continues to support parallel compression as xz did. A new variable called ZSTD_DEFAULTS is provided to set the defaults for places that want to use zstd for compression; the zst image conversion command is also modified to use this. Finally, in order for this to function properly, opkg must include zstd support, so it is enabled all the time with no PACKAGECONFIG to turn it off. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-09sstatesig/find_siginfo: special-case gcc-source when looking in sstate cachesAlexander Kanavin
This is already done for local stamps just above, and will allow enabling the full selftest that compares gcc-source signatures via printdiff (that is, both local stamp and sstate variants). Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-08lib/oe/recipeutils: Avoid wrapping any SRC_URI[sha*sum] variablesPeter Kjellerstedt
Before, a variable such as SRC_URI[sha512sum] would end up as: SRC_URI[sha512sum] = "45ff3abce4dab24a8090409e6d7bb26afa7fa7812a51e067 \ 28c2aa47d5b4de610d97ba4609cf13d9173087bd909fdf377235eee988a6fdcf52abb7 \ 0341c40b5b" when updated by patch_recipe_lines(). 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>
2023-12-06gdb/systemd: enable minidebuginfo support conditionallyEtienne Cordonnier
Enabling minidebuginfo is not useful if gdb and systemd-coredump are unable to parse it. In order to parse it, gdb needs xz support. Systemd needs coredump enabled, as well as elfutil enabled as well (systemd-coredump loads libdw which is part of elfutils using dlopen). Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06recipeutils: bbappend_recipe: allow to patch the recipe itselfJulien Stephan
Add a new parameter update_original_recipe to allow to patch a recipe instead of creating/updating a bbappend 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>
2023-12-06recipeutils: bbappend_recipe: remove old srcuri entry if parameters are ↵Julien Stephan
different Currently we do not add a new src_ury entry if the entry already exists AND the parameters are the same. I believe that when an entry already exist with different parameters, we should remove it and add the new entry otherwise we end up with two entries with different parameters 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>
2023-12-06recipeutils: bbappend_recipe: add a way to specify the name of the file to addJulien Stephan
bbappend_recipe can take a dict of source files to add to SRC_URI where the key is the full path to the file to be added and the value is a dict Add a new optionnal entry "newname" to specify the name of the newly added file 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>
2023-12-06recipeutils: bbappend_recipe: fix docstringJulien Stephan
Add missing patchdir key in docstring description for srcfiles parameters. Also fix typo: value --> key in srcfile docstring description 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>
2023-12-06recipeutils: bbappend_recipe: fix undefined variableJulien Stephan
In the case get_bbappend_path returns None (could not find the layer containing the recipe) the error message tries to print the recipefile, but it is not defined. Fix it. 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>
2023-12-06lib/oe/patch: handle creating patches for CRLF sourcesYoann Congal
Using devtool to patch CRLF based sources creates patch files which have mixed end of lines : LF for headers and CRLF for source context and modified lines. Python open(..., newline=None) (default for newline arg)does detect end-of-line in this mixed file but only outputs LF EOL data. This result in patch files that does not apply on the original sources. Switching to open(..., newline='') allows to detect end-of-line but keep the original end-of-line intact. This generate correct patches for CRLF based sources. Fixes [YOCTO #15285] Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-01devtool: add support for git submodulesJulien Stephan
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 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>
2023-11-30lib/oe/recipeutils.py: remove trailing white-spacesJulien Stephan
Remove useless trailing white-spaces Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-11-22lib/oe/patch: ensure os.chdir restoring always happensRoss Burton
If we chdir(), do the chdir back to the original directory in a finally block so they always run. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-20bitbake.conf: Drop oldincludedirRichard Purdie
Autoconf defines this as: "The directory for installing C header files for non-GCC compilers." Whilst this is something autoconf does allow changing, I find it hard to believe it has much use in the wild now and that headers don't get split like this in reality, it would probably only be useful on really old unixes.. The values are the same in our configuration anyway. Drop the value and just use includedir everywhere. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-11-08sstate: Ensure sstate searches update file mtimeRichard Purdie
Commands like "bitbake XXX -S printdiff" search for sstate files but don't download them. This means that local files aren't touched as the download code would do, meaning the sstate cleanup scripts can delete them. This can then lead to obtuse build failures. Have the search code touch local files in the same way as the main code paths would to avoid these files disappearing. Move the function to a common touch() function in lib/oe instead of duplicating code. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-05lib/oe/path: Deploy files can start only with a dotVyacheslav Yurkov
There might be only hidden files deployed. In that case we don't need a generic wildcard present in copy command, otherwise it fails with: Exception: subprocess.CalledProcessError: Command 'cp -afl --preserve=xattr ./.??* ./* <BUILDDIR>/tmp/deploy/images/qemux86-64' returned non-zero exit status 1. Subprocess output: cp: cannot stat './*': No such file or directory Signed-off-by: Vyacheslav Yurkov <Vyacheslav.Yurkov@wika.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-11-05lib/oe/buildcfg.py: Remove unused parameterJermain Horsman
Several functions included the 'd' parameter but never used it, additionally the value passed is always None. Signed-off-by: Jermain Horsman <jermain.horsman@nedap.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-11-05lib/oe/buildcfg.py: Include missing importJermain Horsman
get_layer_revisions() uses the os.path module but it is not included in the imports. Signed-off-by: Jermain Horsman <jermain.horsman@nedap.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-11-05meta/lib/oe/copy_buildsystem.py: do not derefence symlinksAlexander Kanavin
This was added (I think) for the purpose of supporting layers that refer to items outside of the layer via relative symlinks: https://git.yoctoproject.org/poky-contrib/commit/?id=d31d1ad4e566e42d0bbcf1f41ac25e33181fb517 I do not think copying the link target into the layer that references it is the correct solution: rather the original target should be included into the SDK with the same relative path. This change is done for the sake of preserving symlinks that are referencing things inside the layer as they are; particularly the content of scripts/esdk-tools/. Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>