summaryrefslogtreecommitdiffstats
path: root/meta/classes/base.bbclass
AgeCommit message (Collapse)Author
2014-02-13kernel.bbclass, base.bbclass: Fix support for old kernel configurationOtavio Salvador
This solves a regression introduced by OE-Core:9b75f6a (kernel: use oldnoconfig before yes '' | make oldconfig). The original oe_runmake explicitly calls 'die' command in case of failure so the fallback code never runs. The fallback code needs to handle the oe_runmake return code to call the backward compatible callback so we introduced a new command called oe_runmake_call which is used by oe_runmake. This does not change the functional behaviour of oe_runmake so it avoids any change except for the code which does need to handle the oe_runmake exit code. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-14base bbclass: add support for lz4 compressed archivesKoen Kooi
Signed-off-by: Koen Kooi <koen.kooi@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-06base.bbclass: pull in file-native for src.rpmChristopher Larson
Unpacking an src.rpm uses rpm2cpio.sh, which requires 'file'. Without this, builds of rpm on a host without 'file' installed will fail with very strange messages. Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-29base/gcc-common: Ensure umask setting is consistent for shared workdirRichard Purdie
gcc has cross and target components with a shared workdir. The unpack umask settings need to match for all of these. We need to use strings in each case to ensure the sstate code matches them correctly. This patch tweaks various things to ensure the change adding the unpack umask change doesn't break the compiler builds. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-27base.bbclass: Set umask 022 also for do_unpack taskMartin Jansa
* when git checkouts files from fetched clone it respects system umask and creates files with different permissions, if such files are copied to packages, resulting target images have also different permissions on them. * we need reproducible builds across different builders with different system umask, so set 022 umask [YOCTO #5590] Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-22base.bbclass: Fix incorrect setting of multilib PREFERRED_PROVIDER_virtual_pkgLei Liu
PREFERRED_PROVIDER_virtual_pkg has been incorrectly set with more than one multilib prefixes. For example, if we have two alternative multilibs lib64 and lib32, PREFERRED_PROVIDER_virtual_pkg will be set to lib32-lib64-pkg or lib64-lib32-pkg, depending on which multilib shows up first in the list. Signed-off-by: Lei Liu <lei.liu2@windriver.com> Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-24base.bbclass: fix nondeterministic PACKAGECONFIG processing orderChristopher Larson
The PACKAGECONFIG flags were iterated over using dict.items(), but this returns the items in an undefined order. As this order determines the EXTRA_OECONF append order, we can get EXTRA_OECONF which are functionally equivalent, but whose contents differ, resulting in not using shared state archives we should be using. Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-01meta: Don't use deprecated bitbake APIRichard Purdie
These have been deprecated for a long time, convert the remaining references to the correct modules and prepare for removal of the compatibility support from bitbake. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-13blacklist.bbclass: Avoid blacklist specific handle in base.bbclassOtavio Salvador
base.bbclass had code which handled the PNBLACKLIST in case of multilib use. This is better to be done in the blacklist.bbclass so it has all logic in a single place. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-08-05base.bbclass: Fix PACKAGECONFIG usage commentOtavio Salvador
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-06-20base.bbclass: Ensure finalised data is displayed in build bannerRichard Purdie
The build banner displayed at the start of builds can be misleading since the data store has not been finalised. As easy way to illustrate this is to use something like: DEFAULTTUNE = "i586" DEFAULTTUNE_<machineoverride> = "core2" and the banner will display the i586 tune yet the core2 tune will be used. We can avoid this if we finalise a copy of the data before displaying it. [YOCTO #4225] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-14classes/conf: Add eventmasks for event handlersRichard Purdie
Now that bitbake supports masking events for event handlers, lets use this so event handlers are only called for events they care about. This lets us simplify the code indentation a bit at least as well as mildly improving the event handling performance. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-07base/useradd/sstate: Ensure do_package setscene has correct fakeroot ↵Richard Purdie
dependencies The do_package_setscene task needs to depend on fakeroot in order to correctly install its files. We can whitelist the dependency in the sstate handling code for some performance improvements since we only need this if we're installing the package from sstate. Also use an append operator in base.bbclass for clarity. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09base.bbclass: Drop unused/obsolete importRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09clases/lib: Use modern exception syntaxRichard Purdie
Update older code to use modern exception handling syntax which is the form accepted by python 3. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-09base.bbclass: Fix matching of MACHINEOVERRIDES in COMPATIBLE_MACHINEOtavio Salvador
The use of SOC_FAMILY here is old code and SOC_FAMILY is now implemented by MACHINEOVERRIDES behind the scenes. It therefore makes more sense to use the replacement value in this code. Just like SOC_FAMILY, this is a ":" delimited variable so we should iterate over the components, not use the value directly. Finally, MACHINEOVERRIDES contains MACHINE so we don't need to check that directly. This makes the functionality match what most users would expect it to do and is also compatible with the way things previously worked. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-03base.bbclass: Update the preferred_ml_updatesMark Hatle
When processing the blacklists, we should avoid cross-canadian packages, as they will not have any multilib prefixes to expand. Similarly look for "virtual/nativesdk-" in addition to the existing "nativesdk-". These items should also be ignored. Finally, in order to avoid undeterministic variable key expansion, such as: MYVAR = "foo" PREFERRED_PROVIDER_${MYVAR} = "bar" PREFERRED_PROVIDER_foo = "foobar" during the multilib processing of PREFERRED_VERSION and PREFERRED_PROVIDER, the code was changed to rename the variable key, to the final key. This along with the existing code avoids the problems. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-03-28base.bbclass: When we use fakeroot, also use it for devshellRichard Purdie
Its generally useful for devshell to end up in the fakeroot environment. If a user needs to exit it, PSEUDO_UNLOAD=1 <command> works, its usually harder to enter the envionment. [YOCTO #3374] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-18package: Add cachedpath optimisationRichard Purdie
Currently, various standard library operations like os.walk(), os.path.isdir() and os.path.islink() each call stat or lstat which involves a syscall into the kernel. There is no caching since they could conceivably have changed on disk. The result is that for something like the do_package task of the kernel we're spending over two minutes making 868,000 individual stat calls for 23,000 files. This is suboptimal. This patch adds lib/oe/cachedpath.py which are a set of replacement functions for these operations which use cached stat data rather than hitting the kernel each time. It gives a nice performance improvement halving the build time of the kernel do_package. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-09base.bbclass: don't backfill features that already existRoss Burton
It's too easy to cause rebuilds because the DISTRO_FEATURES have changed in meaningless ways (such as re-ordering or duplicate items). Help stop this by checking if the feature to be back-filled is already present. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-11base.bbclass: Remove generate_git_config()Darren Hart
git no longer supports the use of GIT_CONFIG which defeats the purpose of GIT_CORE_CONFIG and the generate_git_config() function. Remove it. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-08base.bbclass: remove redundant setting of MAKEBernhard Reutner-Fischer
oe_runmake() tried to set MAKE a second time, remove it since this is (nowadays?) redundant WRT the normal export MAKE= in the generated scripts. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-02-08base.bbclass: Commentary typo fixBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-02-06package.bbclass: Multithread per file dependency generation codeRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-25base.bblass : Add support for cmake to PACKAGECONFIG.Philip Balister
The cmake class uses EXTRA_OECMAKE to adjust the cmake configuration. This patch adds support for this, if the cmake class is used by the recipe. Signed-off-by: Philip Balister <philip@balister.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-24base: make feature backfilling happen earlierRichard Purdie
Backfilling DISTRO_FEATURES and MACHINE_FEATURES with _append statements happens too late to use those variables with conditional inherits, like this: inherit ${@base_contains('DISTRO_FEATURES','sysvinit','update-rc.d_real','',d)} Instead, do the backfilling at ConfigParse time so that it happens earlier in the parse, which results in that inherit behaving as expected when sysvinit was backfilled. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-18base.bbclass: improve the incompatible license logic a bitChristopher Larson
Handle the potential case where the recipe level LICENSE contains an incompatible license, but all of its emitted packages are in fact compatible. Without this adjustment, it would skip such a recipe. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-18base.bbclass: use debug messages for INCOMPATIBLE_LICENSEChristopher Larson
Spamming potentially over a screenful of messages due to their INCOMPATIBLE_LICENSE selection seems a bit unnecessary. If the distro was configured that way, the user likely won't care, and if the user set it, they likely know the implications, so make the messages debug instead. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-11base/license.bbclass: handle multiple INCOMPATIBLE_LICENSEsAndy Ross
Allow INCOMPATIBLE_LICENSE to be a whitespace-separated list of incompatible license strings and/or glob patterns. Also fix wildcarding: the string in INCOMPATIBLE_LICENSE was clearly intended to match with wildcards (e.g. "*GPLv3" to match both GPLv3 and LGPLv3), but this was broken because of a bug in return_spdx() which would die with a runtime error when there was no SPDXLICENSEMAP entry for the string. Signed-off-by: Andy Ross <andy.ross@windriver.com> Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-12-07base.bbclass: Remove implicit dependency on license.bbclassRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-26base.bbclass: Drop P and PN from FILESPATHRichard Purdie
In the interests of simplifying things, remove P and PN from FILESPATH, instead relying on the BP and BPN versions which work in 99% of cases. In any problematic case such as a -native only recipe, either the patch directory can be renamed or the recipe can set FILESPATH specifically. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-26bitbake.conf: Simplify FILESPATHRichard Purdie
Files are very rarely, if ever placed in ${PF}. If a recipe needs to do this, it can easily append to FILESPATH so it makes sense to drop this from the default search path. Equally, using FILE_DIR as part of the search path leads to 'bad' SRC_URI entries and/or file layouts which are not preferred. I'm therefore of the opinion we should also remove this from FILESPATH and encourage people to cleanup any places this breaks my correcting the layouts to match the standard or worst case adding to FILESPATH in recipes that need it. These changes work towards making the system more friendly as users won't be greeted with huge search paths we rearely use making the "correct" layout more obvious. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-26multilib - crosssdk: Stop building multilib for crosssdk packagesMark Hatle
Crosssdk packages are not actually multilib packages, so treat them the same as other nativesdk packages in the multilib, base, and classextend components. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-10-26multilib: Add support for cross-canadian multilib packagesMark Hatle
Add support for the generation of cross-canadian packages. Each cross-canadian package has: PN = "pkg-cross-canadian-${TRANSLATED_TARGET_ARCH}" in order for that to be evaluated properly with multilibs enabled, it was necessary to detect both the presence of the cross-canadian packages and then update the vars using the OVERRIDE for the multilib. Additional checks were made to ensure that any dependency that sais "cross-canadian" did not get prefixed with the MLPREFIX. Also, make sure that even when building multilib cross-canadian packages, we only use the single SDK PACKAGE_ARCH, we don't want or need variants. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-10-22base.bbclass: Add PKGTRIPLETS and PKGMLTRIPLETS variablesRichard Purdie
These variables correspond to the PACKAGE_ARCH list combined with the TARGET_VENDOR and TARGET_OS values. These can be used to traverse the pkgdata structure. Setting these once in base.bbclass stops pkgdata needing to recalculate the values and is also useful for the reworked shlibs code in a patch that will follow this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-31nativesdk: Switch to using nativesdk as a prefix, not a suffixRichard Purdie
As discussed on the mailing lists, using a suffix to package names is hard and has lead to many recipes having to do PKGSUFFIX games. Its looking extremely hard to scale nativesdk much further without hacking many recipes. By comparison, using a prefix like multilib does works much better and doesn't involve "hacking" as many recipes. This change converts nativesdk to use a prefix using the existing multilib infrastructure. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-21meta/classes: Various python whitespace fixesRichard Purdie
It was pointed out we have a number of weird indentations in the python functions. This patch cleans up 3, 7 and other weird indentations for the core bbclass files. It also fixes some wierd (odd) shell function indentation which my searches picked up. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-19base.bbclass: fix PACKAGECONFIG handling codeYao Zhao
PACKAGECONFIG flag code only handles that when it has 3 or 4 items in flag, it may have a stale data if some flags doesn't need DEPENDS and RDEPENDS. Signed-off-by: Yao Zhao <yao.zhao@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-08-17base.bbclass: Work even when there's no PNBLACKLIST entriesPeter Seebach
It turns out that the result of getVarFlags is not a list, it's a dict. So "getVarFlags(...) or []" does not reliably produce something with a .items. This escaped detection because our local build environment never ends up running builds without PNBLACKLIST entries. Signed-off-by: Peter Seebach <peter.seebach@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-15base.bbclass: Expand PNBLACKLIST across multilibs tooPeter Seebach
The PNBLACKLIST feature does not currently work with multilibs, because they have different ${PN}. The obvious thing to do is to do this at the same point that we do the PREFERRED_PROVIDER and PREFERRED_VERSION fixups. (Making the PNBLACKLIST check do the for-each-multilib check requires it to do the multilib list generation repeatedly.) Signed-off-by: Peter Seebach <peter.seebach@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-08-15base.bbclass: allow specifying an lsb distro hook via the metadataChristopher Larson
This is useful when you have a rather large set of compatible distros. For example: Centos 5.4, 5.5, 5.6, etc, RHEL server 5.x, RHEL workstation 5.x. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-07-27base.bbclass: Set the NATIVELSBSTRING variable to represent the distro we're ↵Richard Purdie
running on This can then be used by the sstate code to mark native and cross packages as being specific to a given distro. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-07-26base/perlnative/pythonnative/gzipnative: Add a new variable to enable easier ↵Richard Purdie
handling of native path issues If something is listed in ASSUME_PROVIDED but also manually built (like bzip2-native and bzip2-replacement-native), we need to ensure that the installed binaries are only accessed for things which list the provider in DEPENDS. This patch adds a generic mechanism to handle this instead of everything reinventing the wheel. EXTRANATIVEPATH += "perl-native" will ensure that ${STAGING_BINDIR_NATIVE}/perl-native is added to PATH. This means that: a) Such providers should install to ${bindir}/xxx-native b) Should PROVIDE += "xxxx-replacement-native" c) That users should DEPEND on xxx-replacement-native and have EXTRANATIVEPATH += "xxx-native" This patch enables this at the core level, the bzip2 recipe still needs adjusting to work like this along with adjustment of the users of bzip2-replacement-native (python-native?). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19Remove a number of unneeded import os/bb callsRichard Purdie
The bb and os modules are always imported so having these extra import calls are a waste of space/execution time. They also set a bad example for people copy and pasting code so clean them up. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19Convert tab indentation in python functions into four-spaceRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-17base.bbclass: add GNUmakefile to the list of possible makefile namesRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-07-03base.bbclass: Add cross-canadian-${TRANSLATED_TARGET_ARCH} to the license ↵Mark Hatle
exclusion list This appears to be an oversight in the original implementation. All of the host package types were being ignored except for the SDK cross-canadian type. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2012-05-30ccache: Separate out into its own classRichard Purdie
Currently, ccache is used if it is present. When building from scratch it gives no performance improvement and creates a ton of empty directories even when its not in use. This change moves ccache support to a bbclass file which the user can choose to enable. This should make builds more determinstic and make it easier/clearer to the end user when its being used and when it is not. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-24classes/base: add checksum file list at parse timePaul Eggleton
Connect the new fetcher file checksum code so that we get a list of the files to be checksummed at parse time. The file-checksums flag will not be read unless we are using a version of BitBake that supports the function we call within it, so it is safe to include this change even when the metadata will still be used with older versions of BitBake. Implements [YOCTO #2044]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2012-05-03base.bbclass: use isinstance for base_eventhandlerChristopher Larson
Signed-off-by: Christopher Larson <kergoth@gmail.com>