summaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
Commit message (Collapse)AuthorAgeFilesLines
* sstate.bbclass: provide an exception for useradd scenarioMaxin B. John2017-10-161-1/+2
| | | | | | | | | | | | | | | Packages, which depend on users/groups created from other packages, needs "shadow-native" as a build time dependency. So, add an exception to the "shadow-native" from otherwise discarded native/cross tools dependency. Fixes [YOCTO #11960] (From OE-Core rev: 979699b55214933e0f11727a2fb9bfda8a3a3870) Signed-off-by: Maxin B. John <maxin.john@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: rework source extraction so that dependencies are handledPaul Eggleton2017-09-181-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since it was first implemented, devtool's source extraction (as used by the devtool modify, extract and upgrade subcommands) ignored other recipe dependencies - so for example if you ran devtool modify on a recipe that fetches from svn or is compressed using xz then it would fail if those dependencies hadn't been built first. Now that we can execute tasks in the normal way (i.e. tinfoil.build_targets()) then we can rework it to use that. This is slightly tricky in that the source extraction needs to insert some logic in between tasks; luckily we can use a helper class that conditionally adds prefuncs to make that possible. Some side-effects / aspects of this change worth noting: * Operations are a little slower because we have to go through the task dependency graph generation and other startup processing. There's not really any way to avoid this though. * devtool extract didn't used to require a workspace, now it does because it needs to create a temporary bbappend for the recipe. (As with other commands the workspace be created on the fly if it doesn't already exist.) * I want any existing sysroot files and stamps to be left alone during extraction since we are running the tasks off to the side, and especially devtool extract should be able to be used without touching these. However, this was hampered by the automatic removal process in sstate.bbclass triggered by bb.event.ReachableStamps when the task signatures change, thus I had to introduce a way to disable this removal on a per-recipe basis (we still want it to function for any dependencies that we aren't working on). To implement this I elected to use a file written to tmp/sstate-control which gets deleted automatically after reading so that there's less chance of stale files affecting future sessions. I could have used a variable but this would have needed to be whitelisted and I'd have to have poked its value in using the setVariable command. Fixes [YOCTO #11198]. (From OE-Core rev: 830dbd66992cbb9e731b48d56fddf8f220349666) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: Improve SSTATE_SKIP_CREATIONRichard Purdie2017-07-311-6/+4
| | | | | | | | | | | | | | | | Currently, dummy archives are created for skipped sstate tasks. We relied on these never being installed (the setscene task is missing) however this leads to odd behaviour as for example the setscene stamps are never looked at. Rather than trying to continue with the two separate behaviours, really skip package creation. We do need the file manipulation steps to install files under sstate control from a manifest perspective so we only skip at the final creation step. (From OE-Core rev: 1e95fc5419a131a5e4091b8ff01639de99284399) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: Fix return value checks from subprocess.call()'sMikko Rapeli2017-06-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Python function subprocess.call() returns the return value of the executed process. If return values are not checked, errors may go unnoticed and bad things can happen. Change all callers of subprocess.call() which do not check for the return value to use subprocess.check_call() which raises CalledProcessError if the subprocess returns with non-zero value. https://docs.python.org/2/library/subprocess.html#using-the-subprocess-module All users of the function were found with: $ git grep "subprocess\.call" | \ egrep -v 'if.*subprocess\.call|=\ +subprocess\.call|return.*subprocess\.call' Tested similar patch on top of yocto jethro. Only compile tested core-image-minimal on poky master branch. (From OE-Core rev: 578c8205fd14c48c6d30ef2889d86f1b4aee060a) Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: Ensure native/cross recipes have relocation of HOSTTOOLS_DIRRichard Purdie2017-05-121-1/+1
| | | | | | | | | | The previous change to relocate HOSTTOOLS wasn't complete as some files, particularly in gcc stashed build directories were not being correctly relocated. This patch addresses the issue. (From OE-Core rev: 21dd36cc12a033b012544c5d15a6f8afd84dabc9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate.bbclass, staging.bbclass: Handle HOSTTOOLS_DIR when restoring statePeter Kjellerstedt2017-05-011-1/+1
| | | | | | | | | | | Paths to host tools that have been copied to ${HOSTTOOLS_DIR} may end up in the sstate cache. They thus need to be corrected when restoring from the sstate cache. (From OE-Core rev: f8671aecf05a286dd2b34b07bb5fbbe0c31e26d0) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* base-passwd/useradd: Various improvements to useradd with RSSRichard Purdie2017-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently there are multiple issues with useradd: * If base-passwd rebuilds, it wipes out recipe specific user/group additions to sysroots and causes errors * If recipe A adds a user and recipe B depends on A, it can't see any of the users/groups A adds. This patch changes base-passwd so it always works as a postinst script within the sysroot and copies in the master files, then runs any postinst-useradd-* scripts afterwards to add additional user/groups. The postinst-useradd-* scripts are tweaked so that if /etc/passwd doesn't exist they just exit, knowning they'll be executed later. We also add a dummy entry to the dummy passwd file from pseudo so we can avoid this too. There is a problem where if recipe A adds a user and recipe B depends on A but doesn't care about users, it may not have a dependency on the useradd/groupadd tools which would therefore not be available in B's sysroot. We therefore also tweak postinst-useradd-* scripts so that if the tools aren't present we simply don't add users. If you need the users, you add a dependency on the tools in the recipe and they'll be added. We add postinst-* to SSTATE_SCAN_FILES since almost any postinst script of this kind is going to need relocation help. We also ensure that the postinst-useradd script is written into the sstate object as the current script was only being added in a recipe local way. Thanks to Peter Kjellerstedt <pkj@axis.com> and Patrick Ohly for some pieces of this patch. [Yocto #11124] (From OE-Core rev: 1b5afaf437f7a1107d4edca8eeb668b9618a5488) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate.bbclass: check if mirror directory is writableEd Bartosh2017-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | Commit 51edde653707e7a3cd2186082458f01f32cd1996 makes a wrong assumption that SSTATE_MIRRORS have write permissions. A mirror is by definition outside of it's user control. In my use case it happens I does not have permissions to update the access time of the dereferenced symbolic-link file. Checked if file is writable before changing its atime. Thanks to Paulo Neves for the patch. [YOCTO #11307] (From OE-Core rev: b8f26c011d5ed888d85fef040bd821400d54c8fe) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: Skip glibc do_stash_locale and gcc do_gcc_stash_builddir tasksRichard Purdie2017-04-101-0/+4
| | | | | | | | | | We never need these tasks as dependencies of other sstate tasks since they're only ever needed to build artefacts so we can always skip them and save some time/space. (From OE-Core rev: 246df3df4b7da4b75de0745938438124c2b1d4a5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: Ensure installation directory is empty before executionRichard Purdie2017-03-221-0/+5
| | | | | | | | | | | | | | | | | | When you enable the systemd DISTRO_FEATURE, opkg-native contains systemd units which have a relocation fixme list. When systemd isn't in DISTRO_FEATURES, there are no fixmes required. Unfortunately as sstate isn't cleaning up its installation directory before use, if you install the systemd version, then install the non-systemd version from sstate, it would leave behind the fixme file from the systemd version and breakage results as it would try and fixup files which don't exist. The solution is to ensure the unpack/install directory is clean before use. It does raise other questions about opkg-native, systemd and DISTRO_FEATURES but there is an underlying sstate issue here too which would cause missing file failures. (From OE-Core rev: d1d55041e38b12d40f896834b56475ea19a6047f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_rpm.bbclass: make architecture-independent .rpm packages "noarch" ↵Alexander Kanavin2017-03-141-1/+1
| | | | | | | | | | | instead of "all" Too many places in dnf/rpm4 stack make that assumption; let's not fight against it. (From OE-Core rev: 341810aff923ace6b1cc1e15e19383c4f8773b51) Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate.bbclass: update .siginfo atimeEd Bartosh2017-03-101-0/+2
| | | | | | | | | | | | | | | | | | | .siginfo files are not being accessed from local or NFS-mounted sstate mirrors when sstate package is installed, so their atime is not updated. If sstate mirror is cleaned based on access time, they get deleted, even though they are still being used. Updated atime of .siginfo symlinks with 'touch -a'. This command dereferences symlinks pointing to the local mirror and updates atime of the .siginfo file on the mirror. [YOCTO #10857] (From OE-Core rev: fb1499a42756faeef025122bbde98bc14f4ae61e) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel, license, sstate, rootfs.py: Remove deploy directory READMEMike Crowe2017-03-011-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | It isn't clear that the README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt file in the deploy directory warrants the complexity it brings elsewhere. Let's just remove it entirely. In particular, if two do_image_complete tasks run in parallel they risk both trying to put their image into ${DEPLOY_DIR_IMAGE} at the same time. Both will contain a README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt file. In theory this should be safe because "cp -alf" will just cause one to overwrite the other. Unfortunately, coreutils cp also has a race[1] which means that if one copy creates the file at just the wrong point the other will fail with: cp: cannot create hard link ‘..../tmp-glibc/deploy/images/pantera/README_-_DO_NOT_DELETE_FILES_IN_THIS_D.txt’ to +‘..../tmp-glibc/work/rage_against-oe-linux-gnueabi/my-own-image/1.0-r0/deploy-my-own-image-complete/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt’: File exists [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25680 (From OE-Core rev: 71e9e88847d7000781642ea6187ebd8f40dfdcfe) Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes: Drop now unneeded update_data callsRichard Purdie2017-02-151-2/+0
| | | | | | | | | | Now that the datastore works dynamically we don't need the update_data calls so we can just remove them. They're not actually done anything at all for a while. (From OE-Core rev: 8de0c5d3bd01919e2bf0394f9c485936d6098cec) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: Make absolute symlinks an errorRichard Purdie2017-02-091-30/+12
| | | | | | | | | | | | The current relocation code is broken, at least in the native case. Fixing it would mean trying pass in new data on sstate tasks about the relative positioning of symlinks compared to the sstate relocation paths. Whilst we could do this, right now I'm favouring making this an error and fixing the small number of problematic recipes we have in OE-Core (3). (From OE-Core rev: cf94de4ddee3e5072da8608c9151301fcec02cd0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate/staging: Batch log messages for performanceRichard Purdie2017-02-011-4/+10
| | | | | | | | | | | | | | | | | | | According to profile data, repeated calls to bb.debug and bb.note in the extend_recipe_sysroot() codepath were accounting for 75% of the time (1.5s) in calls from tasks like do_image_complete. This batches up the log messages into one call into the logging system which gives similar behaviour to disabling the logging but retains the debug information. Since setscene_depvalid is also called from bitbake's setscene code, we have to be a little creative with the function parameters and leave the other debug output mechanism in place. This should hopefully speed up recipe specific sysroots. (From OE-Core rev: 3b0af8dc0f796345d1f1ba77ea35bbd090a5feb3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: Make SSTATE_SCAN_CMD vars configurable using weak defaults.Kristian Amlie2017-01-311-7/+2
| | | | | | | | | | | | | | | For this we move them out of the python section so they can be overridden on a per-recipe basis. The motivation for this change is that not all tool chains need the path modifications provided by the command, and these will provide alternative or empty commands. The Go compiler is such an example. (From OE-Core rev: 7d2a2160336413736dd4640f5b84ba4d74bb00f5) Signed-off-by: Kristian Amlie <kristian.amlie@mender.io> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: Allow sstate_clean_manifest to take a prefixRichard Purdie2017-01-281-1/+3
| | | | | | | | | | Manifest files containing the same duplicated prefix are wasteful on space and ultimately this costs build time. Add support for manifest files with common prefixes removed and use the prefix if the path isn't absolute. (From OE-Core rev: 71e8c98238d627f9665faee9d7c226b9c07bd256) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/oeqa: Replace subprocess.check_call() with check_output()Richard Purdie2017-01-231-2/+2
| | | | | | | | | | If you use subprocess.check_output() the traceback will contain the output when the command fails which is very useful for debugging. There is no good reason not to use this everywhere. (From OE-Core rev: ad750dd1cc9d789abe723daddd098ce41d8547f5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Switch to Recipe Specific SysrootsRichard Purdie2017-01-231-41/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is comparatively large and invasive. It does only do one thing, switching the system to build using recipe specific sysroots and where changes could be isolated from it, that has been done. With the current single sysroot approach, its possible for software to find things which aren't in their dependencies. This leads to a determinism problem and is a growing issue in several of the market segments where OE makes sense. The way to solve this problem for OE is to have seperate sysroots for each recipe and these will only contain the dependencies for that recipe. Its worth noting that this is not task specific sysroots and that OE's dependencies do vary enormously by task. This did result in some implementation challenges. There is nothing stopping the implementation of task specific sysroots at some later point based on this work but that as deemed a bridge too far right now. Implementation details: * Rather than installing the sysroot artefacts into a combined sysroots, they are now placed in TMPDIR/sysroot-components/PACKAGE_ARCH/PN. * WORKDIR/recipe-sysroot and WORKDIR/recipe-sysroot-native are built by hardlinking in files from the sysroot-component trees. These new directories are known as RECIPE_SYSROOT and RECIPE_SYSROOT_NATIVE. * This construction is primarily done by a new do_prepare_recipe_sysroot task which runs before do_configure and consists of a call to the extend_recipe_sysroot function. * Other tasks need things in the sysroot before/after this, e.g. do_patch needs quilt-native and do_package_write_deb needs dpkg-native. The code therefore inspects the dependencies for each task and adds extend_recipe_sysroot as a prefunc if it has populate_sysroot dependencies. * We have to do a search/replace 'fixme' operation on the files installed into the sysroot to change hardcoded paths into the correct ones. We create a fixmepath file in the component directory which lists the files which need this operation. * Some files have "postinstall" commands which need to run against them, e.g. gdk-pixbuf each time a new loader is added. These are handled by adding files in bindir with the name prefixed by "postinst-" and are run in each sysroot as its created if they're present. This did mean most sstate postinstalls have to be rewritten but there shouldn't be many of them. * Since a recipe can have multiple tasks and these tasks can run against each other at the same time we have to have a lock when we perform write operations against the sysroot. We also have to maintain manifests of what we install against a task checksum of the dependency. If the checksum changes, we remove its files and then add the new ones. * The autotools logic for filtering the view of m4 files is no longer needed (and was the model for the way extend_recipe_sysroot works). * For autotools, we used to build a combined m4 macros directory which had both the native and target m4 files. We can no longer do this so we use the target sysroot as the default and add the native sysroot as an extra backup include path. If we don't do this, we'd have to build target pkg-config before we could built anything using pkg-config for example (ditto gettext). Such dependencies would be painful so we haven't required that. * PKDDATA_DIR was moved out the sysroot and works as before using sstate to build a hybrid copy for each machine. The paths therefore changed, the behaviour did not. * The ccache class had to be reworked to function with rss. * The TCBOOTSTRAP sysroot for compiler bootstrap is no longer needed but the -initial data does have to be filtered out from the main recipe sysroots. Putting "-initial" in a normal recipe name therefore remains a bad idea. * The logic in insane needed tweaks to deal with the new path layout, as did the debug source file extraction code in package.bbclass. * The logic in sstate.bbclass had to be rewritten since it previously only performed search and replace on extracted sstate and we now need this to happen even if the compiled path was "correct". This in theory could cause a mild performance issue but since the sysroot data was the main data that needed this and we'd have to do it there regardless with rss, I've opted just to change the way the class for everything. The built output used to build the sstate output is now retained and installed rather than deleted. * The search and replace logic used in sstate objects also seemed weak/incorrect and didn't hold up against testing. This has been rewritten too. There are some assumptions made about paths, we save the 'proper' search and replace operations to fixmepath.cmd but then ignore this. What is here works but is a little hardcoded and an area for future improvement. * In order to work with eSDK we need a way to build something that looks like the old style sysroot. "bitbake build-sysroots" will construct such a sysroot based on everything in the components directory that matches the current MACHINE. It will allow transition of external tools and can built target or native variants or both. It also supports a clean task. I'd suggest not relying on this for anything other than transitional purposes though. To see XXX in that sysroot, you'd have to have built that in a previous bitbake invocation. * pseudo is run out of its components directory. This is fine as its statically linked. * The hacks for wayland to see allarch dependencies in the multilib case are no longer needed and can be dropped. * wic needed more extensive changes to work with rss and the fixes are in a separate commit series * Various oe-selftest tweaks were needed since tests did assume the location to binaries and the combined sysroot in several cases. * Most missing dependencies this work found have been sent out as separate patches as they were found but a few tweaks are still included here. * A late addition is that extend_recipe_sysroot became multilib aware and able to populate multilib sysroots. I had hoped not to have to add that complexity but the meta-environment recipe forced my hand. That implementation can probably be neater but this is on the list of things to cleanup later at this point. In summary, the impact people will likely see after this change: * Recipes may fail with missing dependencies, particularly native tools like gettext-native, glib-2.0-native and libxml2.0-native. Some hosts have these installed and will mask these errors * Any recipe/class using SSTATEPOSTINSTFUNCS will need that code rewriting into a postinst * There was a separate patch series dealing with roots postinst native dependency issues. Any postinst which expects native tools at rootfs time will need to mark that dependency with PACKAGE_WRITE_DEPS. There could well be other issues. This has been tested repeatedly against our autobuilders and oe-selftest and issues found have been fixed. We believe at least OE-Core is in good shape but that doesn't mean we've found all the issues. Also, the logging is a bit chatty at the moment. It does help if something goes wrong and goes to the task logfiles, not the console so I've intentionally left this like that for now. We can turn it down easily enough in due course. (From OE-Core rev: 809746f56df4b91af014bf6a3f28997d6698ac78) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: Drop the depchain isPostDep() checksRichard Purdie2017-01-201-9/+7
| | | | | | | | | | | | | The dependencies of do_package_write_* tasks are either going to be packaging tools needed to build the packages, or, native tools needed at postinst time. Now we've formalised this dependency pattern, drop the hardcoded list and work based on the rule. The package creation tools are usually the same tools needed at rootfs/postinst time anyway so the difference is moot. (From OE-Core rev: 8082c6aabf838a2cc5253d2bb1bd8867f2e1ba6a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Revert "classes/sstate: add a mode to error if sstate package unavailable"Paul Eggleton2017-01-201-23/+0
| | | | | | | | | | | | | | | | | | | | | It turns out that this check cannot work. We don't have the information to know whether an sstate package is really needed at this point in the execution, so we check the availability for things that we won't actually end up needing later on. Thus we can't fail if some of these aren't found or we'll get needless failures. This check was intended to give earlier more accurate errors when sstate artifacts failed to download, but that's not practical so we'll rely solely on the task execution check that was added within the runqueue. This reverts most of commit 9e711b54487c3141d7264b8cf0d74f9465020190 (we still need to allow BB_SETSCENE_ENFORCE through from the external environment since the eSDK relies upon that.) (From OE-Core rev: ff29ac6901d04487312f554d9e62250a18729c6c) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: Fix EXTRA_STAGING_FIXMES handlingRichard Purdie2017-01-201-0/+1
| | | | | | | | | | The code wasn't working properly, tweak so that it works as expected and the grep expression includes the right patterns. Not sure this code has ever worked prior to this. (From OE-Core rev: 6a46a974611c5262efefc21a11adb736c0fb206a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/sstate: fix file conflict messagePaul Eggleton2017-01-091-10/+12
| | | | | | | | | | | | | | | | | | | | | | * Fix not decoding output from grep ("Matched in b'manifest...') * Fix showing "Matched in b''" if no match (show "not matched to any task" instead) * Drop the filtering out of .populate-sysroot from matched manifest names - it should have been .populate_sysroot so it doesn't work, and in any case the value of removing the task name is questionable given that we aren't removing it for any other task, and that the rest of the filename isn't only the task name, we might as well have the whole thing. At least then you can do a find on that exact name without wildcards and find it. * Fix indenting of file list entries and indent "matched in" further underneath * Minor punctuation fixes (From OE-Core rev: 4675ce43496898fccbac738835d7e92b1cca648e) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/sstate: handle filenames containing square bracketsPaul Eggleton2017-01-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | If a recipe installs a file or directory whose name contains square brackets [ ] that form a valid glob expression and that file then they won't be correctly removed from the sysroot, because we pass each path in the sstate manifest to our oe.path.remove() function which calls glob.glob() on the path passed into it and the expression won't actually match the original filename. Since we don't expect to put any wildcarded expressions in the sstate manifests, and we already have a try...except around this, we can actually use os.remove() here instead. Similarly, when we pass existing file paths to "grep" looking through the manifests, we don't want those paths to be treated as regexes - so use grep's -F command line switch. Fixes [YOCTO #10836]. (From OE-Core rev: fd8a57861024fc82e15a2a4ec8c20ed0ebb242f6) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: remove True option to getVarFlag callsJoshua Lock2016-12-161-7/+7
| | | | | | | | | | | | | | | getVarFlag() now defaults to expanding by default, thus remove the True option from getVarFlag() calls with a regex search and replace. Search made with the following regex: getVarFlag ?\(( ?[^,()]*, ?[^,()]*), True\) (From OE-Core rev: 2dea9e490a98377010b3d4118d054814c317a735) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: remove True option to getVar callsJoshua Lock2016-12-161-57/+57
| | | | | | | | | | | | | getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) (From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: Ensure we don't remove sigbasedata filesRichard Purdie2016-11-041-1/+1
| | | | | | | | | We don't remove sigdata files, we also shouldn't remove sigbasedata files as this hinders debugging. (From OE-Core rev: 1ebd85f8dfe45b92c0137547c05e013e340f9cec) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/sstate.bbclass: Enable thread lock when checkstatusAníbal Limón2016-10-051-0/+4
| | | | | | | | | | | | | | The checkstatus function fires an event to notify bitbake UI about the progress of the task, this function is implemented using ThreadPool and is causing event lose when multiple threads tries to fire an event (writes over socket/fd). [YOCTO #10330] (From OE-Core rev: 6e0bb9d141438c0051c32b0d3a247915b71ccb82) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate.bbclass: Use bb.fatal() instead of raising FuncFailedUlf Magnusson2016-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This sets a good example and avoids unnecessarily contributing to perceived complexity and cargo culting. Motivating quote below: < kergoth> the *original* intent was for the function/task to error via whatever appropriate means, bb.fatal, whatever, and funcfailed was what you'd catch if you were calling exec_func/exec_task. that is, it's what those functions raise, not what metadata functions should be raising < kergoth> it didn't end up being used that way < kergoth> but there's really never a reason to raise it yourself FuncFailed.__init__ takes a 'name' argument rather than a 'msg' argument, which also shows that the original purpose got lost. (From OE-Core rev: 33611b69c221cf875eba1c7cb599c256825ae470) Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: Add postrm command supportRichard Purdie2016-09-161-0/+11
| | | | | | | | | | | | | | There are some issues in sstate which can't be handled by file removal alone. Currently there is no way to execute a command against sstate and doing so is potentially problematic for things like dependencies. This patch adds a mechanism where any "postrm" script is executed if its present allowing some openjade/sgml issues to be resolved. [YOCTO #8273] (From OE-Core rev: 2268efd0cd3ddb40870c4c424d10444ba86d2849) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate.bbclass: normalize whitelisted pathsMax Krummenacher2016-09-141-0/+1
| | | | | | | | | | | | | | | | | | | | Without this a whitelisted path containing /../ breaks the test for a file allowed to be provided by more than one recipe. Noticed when local.conf contains: DEPLOY_DIR = "${TOPDIR}/../deploy" |ERROR: core-image-minimal-1.0-r0 do_image_complete: The recipe | core-image-minimal is trying to install files into a shared area when those | files already exist. Those files and their manifest location are: | .../poky/deploy/images/qemux86/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt | Matched in b'manifest-qemux86-linux-yocto.deploy' (From OE-Core rev: d82acf20541463b14a811788d28fb1db3539885b) Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: Avoid duplicate README file errors for sdk under sstate controlRichard Purdie2016-09-041-0/+2
| | | | | | (From OE-Core rev: 4bd3a90c8fb034b4d899d0560d75d81f56e27e0a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate.bbclass: skip packaging if SSTATE_SKIP_CREATION is setEd Bartosh2016-09-031-0/+2
| | | | | | | | | | | | SSTATE_SKIP_CREATION variable will be used to skip creation of sstate .tgz files. It makes sense for image creation tasks as tarring images and keeping them in sstate would consume a lot of disk space. (From OE-Core rev: 7e821ccd221916ae8482b9113df2de704f4a99a4) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta-extsdk-toolchain: add meta-recipe to install toolchain into eSDKPaul Eggleton2016-07-261-0/+3
| | | | | | | | | | | | | | | | | | Add a meta-recipe to bring the toolchain into the extensible SDK. This was modelled on meta-ide-support but some adjustments were needed to the dependency validation function in sstate.bbclass to ensure that all of the toolchain gets installed into the sysroot. With this, after installing a minimal eSDK you only need to run the following after sourcing the environment setup script to get the toolchain: devtool sdk-install meta-extsdk-toolchain Addresses [YOCTO #9257]. (From OE-Core rev: 8110806b1b5534ae830a4fdd1a5293c86a712d0b) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate.bbclass: make PV to depend on PV variable valueEd Bartosh2016-07-201-0/+3
| | | | | | | | | | | | | | | | | | | | | Currently PV is defined in meta/conf/bitbake.conf as a python expression: "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}". As FILE is whitelisted it causes PV to not depend on it. This causes sstate code to not detect that PV changes when recipe filename changes. Making PV to explicitly depend on PV variable value overrides default behaviour. Instead of depending on python expression bitbake depends on evaluated value of PV variable, which should fix the above mentioned issue. [YOCTO #9806] (From OE-Core rev: 918646ca803d56004fb0ab7c21e86cc9cb14513d) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/sstate: add a mode to error if sstate package unavailablePaul Eggleton2016-07-081-0/+23
| | | | | | | | | | | | | | If BB_SETSCENE_ENFORCE is set to "1" and an sstate package fails to download outside of the whitelist specified by BB_SETSCENE_ENFORCE_WHITELIST, then fail immediately so you can tell that the problem was caused by failing to restore the task from sstate. Part of the implementation of [YOCTO #9367]. (From OE-Core rev: 9e711b54487c3141d7264b8cf0d74f9465020190) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/sstate: show progress during sstate object availability checkPaul Eggleton2016-07-081-2/+4
| | | | | | | | | | | | | | Show progress through bitbake's standard terminal UI when checking for shared state object availability, since this can take some time if there are a large number of tasks to be executed and/or the network connection is slow. Part of the implementation for [YOCTO #5853]. (From OE-Core rev: 1a064385d6921ec90b33c9064dafaab11a36267c) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/lib: Convert to use python3 octal syntaxRichard Purdie2016-06-021-3/+3
| | | | | | | | The syntax for octal values changed in python3, adapt to it. (From OE-Core rev: 737a095fcde773a36e0fee1f27b74aaa88062386) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate.bbclass: Don't create symlinks, download to the correct locationRandy Witt2016-05-251-9/+3
| | | | | | | | | | | | | | Previously the sstate was all downloaded to the same directory and then symlinks were added in the directories that pointed to the siginfo and sstate in the parent directory. This change makes it so that now the files are just downloaded to the correct location without the need for symlinks. (From OE-Core rev: 55d25ed6b30ed7105d3b6421fbf2a03cea009a59) Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: Ensure we sort the value used for SSTATETASKS for determinismRichard Purdie2016-05-171-1/+1
| | | | | | | | | This avoids 'basehash changed' errors with python 3 but could break build determinism in general. (From OE-Core rev: 488f88fc12eea9788e5db1de354f0118e2c58878) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstatesig.py: Split single locked sigs check into multiple checksRandy Witt2016-04-091-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add the SIGGEN_LOCKEDSIGS_TASKSIG_CHECK and SIGGEN_LOCKEDSIGS_SSTATE_EXISTS_CHECK variables to replace SIGGEN_LOCKEDSIGS_CHECK_LEVEL. SIGGEN_LOCKEDSIGS_TASKSIG_CHECK will no control whether there is a warning or error if a task's hash in the locked signature file doesn't match the computed hash from the current metadata. SIGGEN_LOCKEDSIGS_SSTATE_EXISTS_CHECK will control whther there is a warning or error if a task that supports sstate is in the locked signature file, but no sstate exists for the task. Previously you could only have warning/errors for both controlled by SIGGEN_LOCKEDSIGS_CHECK_LEVEL. This was an issue in the extensible sdk, because we know sstate won't exist for certain items in the reverse dependencies list for tasks. However, we still want to error if task signatures don't match. [YOCTO #9195] (From OE-Core rev: 0fe2a5e5ffd01e926d0f3d4c78ad9910296e2d1a) Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* useradd.bbclass: remove user/group created by the package in clean* taskMaxin B. John2016-04-061-0/+5
| | | | | | | | | | | | | | | | At present, if a recipe is built which creates users/groups via useradd.bbclass, those users/groups are not removed from sysroot when the recipe/package is cleaned using clean/cleansstate/cleanall or when a recipe is rebuild and 'unstaged' from the the sysroot. The "userdel_sysroot_sstate()" provides that functionality. [YOCTO #9262] (From OE-Core rev: b5304ce438666a7418746f4ddd32703ae3188089) Signed-off-by: Maxin B. John <maxin.john@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: Allow late expansion of NATIVELSBSTRINGRichard Purdie2016-03-071-2/+6
| | | | | | | | | | | uninative needs to adjust NATIVELSBSTRING fairly late in the configuration parsing process but the sstate code encodes it into variables. Since this string doesn't vary on a per recipe basis, we defer its expansion until usage time. (From OE-Core rev: fb680ab8b3cf7aba9b579403b1aeb96d30762320) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cml1/sstate: Fix missing getVar parameterRichard Purdie2016-02-191-2/+2
| | | | | | (From OE-Core rev: 84065e9b33e6d401e4e50436665838be2d0267ad) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate.bbclass: use oe.gpg_sign for gpg signingMarkus Lehtonen2016-02-191-21/+17
| | | | | | | | | | [YOCTO #9006] (From OE-Core rev: a3916b29c8c3d0b1570c40c0ed3a1a15c43925bb) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: Add ca-certificates-native to postinst recipes listMing Liu2016-02-161-1/+1
| | | | | | | | (From OE-Core rev: a6426479f6348524a904ba28c16c1e3c8793cb08) Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: Ensure populate_lic sstate objects are cleanedRichard Purdie2016-02-101-0/+1
| | | | | | | | | | | do_cleansstate wasn't cleaning do_populate_lic sstate objects in the native/cross case since the wildcard path entry wasn't being cleared at the same time as the path extra prefix. Fix by clearing it at the same time. (From OE-Core rev: af72c507f5e20acf64b7431cee989af9908ef199) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: Fix SSTATE_SWSPEC only used by populate_lic tasksRichard Purdie2016-02-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This variable is only used by populate_lic tasks (gcc-source overrides it) and refers to BPN. In recipes like gcc, where there are multiple variants, it is resulting in sstate objects which encode PN (they install into a PN subdir) but the sstate object reflects BPN. This leads to corruption between then and eventually, warnings from image builds like: WARNING: The license listed GPLv3 was not in the licenses collected for recipe gcc WARNING: The license listed GPL-3.0-with-GCC-exception was not in the licenses collected for recipe gcc WARNING: The license listed GPLv3 was not in the licenses collected for recipe gcc WARNING: The license listed NCSA was not in the licenses collected for recipe gcc-sanitizers WARNING: The license listed MIT was not in the licenses collected for recipe gcc-sanitizers WARNING: The license listed GPL-3.0-with-GCC-exception was not in the licenses collected for recipe gcc WARNING: The license listed GPLv3 was not in the licenses collected for recipe gcc WARNING: The license listed NCSA was not in the licenses collected for recipe gcc-sanitizers By referring to PN, as used by license.bbclass, this issue is resolved. (From OE-Core rev: dd4a319efcfa1174ba0f48fd15cb446280c426e4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: Revert using -m option to tar in sstateRichard Purdie2016-02-011-1/+1
| | | | | | | | | | | | | | | | | In http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=2d89cff42af2bb0049224bfaaebaa2b21966169f we added a workaround for dealing with lack of time sync between build machines and their users. This has turned out to cause problems for people who rely on timestamps being preserved in sstate output. Since our autobuilders are all in time sync with ntp, revert the commit. [YOCTO #8996] (From OE-Core rev: 004a8bffdb501a99530dab2bc1c5f3d44b97b8f7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>