Commit Graph

46 Commits

Author SHA1 Message Date
Richard Purdie bfd0a39bdf classes: Drop now unneeded update_data calls
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>
2017-02-15 09:29:55 -08:00
Richard Purdie 2bb0b1d9b5 utils: Avoid need to relocate wrapper scripts
Whilst the path to the executable is dynamically determined, the passed in
environment variables or parameters are not relocatable and rely on the sstate
remapping code. In the recipe specific sysroot case this has become more costly.

This patch translates such paths into relocatable entries which means that
a sed replacement at final installation isn't needed.

(From OE-Core rev: 3e02a7cda0ba70e3f9886c5cce37d71361280b11)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 23:47:33 +00:00
Richard Purdie a49ee524a9 utils: Factor out common multilib datastore creation function
This code is already used in two places and we need it in others so
turn it into its own function.

(From OE-Core rev: 2a57e1334ff261a7ab45084be0f217e2acfe99af)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22 09:05:39 +00:00
Richard Purdie 022a8b58c8 meta/scripts: Various getVar/getVarFlag expansion parameter fixes
There were a few straggling expansion parameter removals left for
getVar/getVarFlag where the odd whitespace meant they were missed
on previous passes. There were also some plain broken ussages such
as:

d.getVar('ALTERNATIVE_TARGET', old_name, True)
path = d.getVar('PATH', d, True)
d.getVar('IMAGE_ROOTFS', 'True')

which I've corrected (they happend to work by luck).

(From OE-Core rev: 688f7a64917a5ce5cbe12f8e5da4d47e265d240f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-09 13:39:11 +00:00
Joshua Lock c4e2c59088 meta: remove True option to getVar calls
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>
2016-12-16 10:23:23 +00:00
Stephano Cetola ef7828c9f2 utils.bbclass: add function to check for git config user
If attempting to patch a git repo without a proper git config setup,
an error will occur saying user.name/user.email are needed by git
am/apply. After some code was removed from kernel-yocto, it was
simple enough to reproduce this error by creating a kernel patch and
using a container to build.

This patch abstracts out functionality that existed in buildhistory
for use in other classes. It also adds a call to this functionality
to the kernel-yocto class.

Fixes [YOCTO #10346]

introduced in OE-core revision
0f698dfd1c8bbc0d53ae7977e26685a7a3df52a3

(From OE-Core rev: 25b43cb05c645e43f96bc18906441b8fdc272228)

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:43:57 +01:00
Richard Purdie 153da94000 utils: Add all_multilib_tune_list function
Its useful to be able to query a list of variables to obtain the values
in each multilib context. This adds such a function which works even
if called in the non-default recipe context.

(From OE-Core rev: 4202a09dece07c0d3f654c2b1ae504a031b4ee90)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-28 10:16:03 +01:00
Henry Bruce 4192e4bad5 utils.bbclass: Added error checking for oe_soinstall
Fixes [YOCTO #10146]

(From OE-Core rev: cd5d532bd2a3f409b9470591c8d6f6b21e5995dd)

Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-09 11:53:36 +01:00
Henry Bruce e9126926d4 utils.bbclass: Remove trailing whitespace
(From OE-Core rev: 1868db95819b45961cd7e8499ecace403e6bc91d)

Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-09 11:53:36 +01:00
Ross Burton ba736a3458 utils: check_app_exists: strip whitespace from binary when searching
It's possible that the binary to be searched for contains whitespace which will
cause the search to fail, so strip any whitespace before looking.

(From OE-Core rev: 9e920abdb0f3dcfd1a94a90461ec1ddfb2729d83)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-25 23:03:45 +01:00
Robert Yang 768c796850 utils.bbclass: note for deprecated base_contains
(From OE-Core rev: 1a0e56630c5c27d8899dd0979ae0b86bbe227881)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-29 07:58:45 +01:00
Richard Purdie 146905a33c utils: Handle MLPREFIX in all_multilib_tune_values()
MLPREFIX wasn't being set by the function correctly since its
not an overridden value but directly set. Handle this variable
explicitly so the function returns the expected values.

(From OE-Core rev: 99997043d4106cb8a93a5f4512f1ef6f063a1895)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 07:34:04 +01:00
Javier Viguera 2ca0339b39 utils.bbclass: fix create_cmdline_wrapper
Similar to commit 4569d74 for create_wrapper function, this commit fixes
hardcoded absolute build paths in create_cmdline_wrapper.

Otherwise we end up with incorrect paths in users of this function. For
example the 'file' wrapper in current released toolchain:

exec -a
/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-fsl-arm/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-file/5.18-r0/image//opt/poky/1.7.1/sysroots/x86_64-pokysdk-linux/usr/bin/file
`dirname $realpath`/file.real --magic-file
/opt/poky/1.7.1/sysroots/x86_64-pokysdk-linux/usr/share/misc/magic.mgc
"$@"

(From OE-Core rev: 49ab89eb9f83388e99069a4b53bdc4cba22bb6f3)

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-17 22:35:02 +00:00
Hongxu Jia 68bc4eb778 insane: add checking to standardize how .bbappend files do FILESEXTRAPATHS
When adding patches or config files from bbappend files, it requires
the use of FILESEXTRAPATHS, which has been an issue and failure point
for people starting to work with bitbake and oe-core.

We add checking to standardize how to use FILESEXTRAPATHS. Only the
format of:
  FILESEXTRAPATHS_append := ":${THISDIR}/Your_Files_Path" or
  FILESEXTRAPATHS_prepend := "${THISDIR}/Your_Files_Path:"
is acceptable.

[YOCTO #5412]

(From OE-Core rev: 69e083237e632f7d84a7b218dd12d1a5ad95a229)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-25 16:54:43 +01:00
Otavio Salvador 08a38a7865 Globally replace oe.utils.contains to bb.utils.contains
BitBake has the exact same code as oe.utils.contains so there's no
reason to duplicate it. We now rely on the bb.utils.contains code for
metadata.

(From OE-Core rev: 93499ebc46547f5bf6dcecd5a786ead9f726de28)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-25 17:19:19 +01:00
Richard Purdie ded3fc6b56 utils: Add hardlinkdir shell function
In a number of places it would be helpful to be able to copy trees of
files using hardlinks. This turns out to be harder than you'd expect
since there is no good single command that does this well and handles
all file types correctly.

Abstracting this into a function therefore makes sense, cpio seems
as good an option as any other.

(From OE-Core rev: 14ef03182e1e5fe7cf6b4112f29e6609631aa78d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-25 17:19:18 +01:00
Richard Purdie 0bd63125c3 utils.bbclass: Fix override ordering for FILESPATH
Currently the overrides are being applied backwards. This means something which is
platform specific is overriding something which is machine specific which
is clearly not intended.

This patch corrects the ordering to match the normal expected behaviour of
OVERRIDES.

Secondly, all overrides are being searched for each path in turn. What should
really happen is that we should look for the highest priority override (e.g. distro
or machine) in each layer, then move on to platform/tune (e.g. armv7a) and
then to arch (e.g. arm). This patch therefore also reverses the for loops
to achieve this behaviour and give the result the user would expect.

(From OE-Core rev: 92cbf7eeea553bfa24c7081473fa8bc4ebc1f552)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-14 16:55:22 +01:00
Richard Purdie 1bf8d83d5a utils: Update bb.which reference and other syntax cleanup
* bb.which -> bb.utiis.which()
* Use modern form of datastore access
* Use True, not 1
* Drop pointless imports

(From OE-Core rev: 106a4f5b41e5bdeabe588b9ba362f3693b1a9989)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-17 14:35:16 +01:00
Richard Purdie 2631eff585 utils.bbclass: Tweak create_wrapper
Currently the full path is specified to exec however this may incorporate a
build path which in the nativesdk case, is not transformed to a target system
path. This leads to failures due to incorrect paths.

This patch ensures the full build path is not encoded into the wrapper script.

(From OE-Core rev: 4569d7403638e4c1f637e3a6adb8dea620dc8543)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-18 17:33:14 +01:00
Ross Burton 3aaa4f78c6 utils.bbclass: ensure $0 is correct in wrapper scripts
Some packages (eg mesa) will invoke a tool with --version and do string matches
on the output (i.e. mesa does $LEX --version |grep "^flex ").  This doesn't work
with the combination of wrapper scripts and binaries that use $0 as they output
"flex.real".

Luckily bash's exec lets you set $0.  As we want to use this we can't use env,
but using export appears to work just as well.

(From OE-Core rev: e8d2a2a3646f964ec61ece62e14788cd7184dd01)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-30 21:10:23 +01:00
Richard Purdie f823f0a0c0 bitbake.conf/utils: Drop some OVERRIDES from FILESPATH
There are several overrides that don't make sense as part of FILESPATH. This
introduces FILESOVERRIDES and allows us to drop some of the pointless ones,
simplifying the files search path further and improving the user experience.

If needed by specific recipes, other overrides can be added back in for
specific cases.

(From OE-Core rev: b8b1b39961332c99d62ee466f7859bd62a0f806f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-11 15:58:36 +00:00
Richard Purdie 73ef532777 utils: Optimise looping in base_set_filespath
Calling split on the same expression, once per loop iteration is
inefficent and pointless, particularly in a function called by
every recipe during parsing.

(From OE-Core rev: 566c0e874fc1610f3f97737b5601ef22026c918a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-21 16:56:03 +00:00
Richard Purdie 68b7f18edd utils.bbclass: Fix documentation of create_cmdline_wrapper
(From OE-Core rev: 56160ca49dd546b7db07ae2021eefef7279b0f10)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-14 14:38:28 +00:00
Richard Purdie 48619958d5 meta/classes: Various python whitespace fixes
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.

(From OE-Core rev: 8385d6d74624000d68814f4e3266d47bc8885942)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-21 12:15:30 +01:00
Richard Purdie bfd279de32 Convert tab indentation in python functions into four-space
(From OE-Core rev: 604d46c686d06d62d5a07b9c7f4fa170f99307d8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19 10:24:50 +01:00
Richard Purdie 2717309501 utils.bbclass: add helper function to add all multilib variants of a specific package
This is useful for the scenario where we want to add 'gcc' to
the root file system for all multilib variants

(From OE-Core rev: 7cd54693363882854cd026ebe071e9f2e03d364e)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-09 16:58:58 +01:00
Robert Yang 70caf1e1bc utils.bbclass: remove the unused oe_system
The following functions in meta/classes/utils.bbclass were not
used by anyone, and they didn't work when I tried to use them:

def oe_popen_env(d):
def oe_run(d, cmd, **kwargs):
def oe_popen(d, cmd, **kwargs):
def oe_system(d, cmd, **kwargs):

There error was:
AttributeError: type object 'str' has no attribute 'getVar'

We have bitbake/lib/bb/process.py to instead, so remove them.

[YOCTO #2489]

(From OE-Core rev: 15ad62ab1be060d8a7cdc2d28167ea3af4cfd5d5)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-25 11:17:53 +01:00
Richard Purdie 7ad49364fd utils.bbclass: Testing via env in create_wrapper is a nice idea but breaks things
For example, pseudo-native wants to set LD_LIBRBARY_PATH but setting this
into the environment here causes the existing pseudo (running during do_install)
to poke into paths in /opt and this breaks builds.

The simplest fix is simply not to do this. Comments tweaks to match the code.

(From OE-Core rev: 1efa999ed02186c9c58cb48418e0c62ecdc82ac7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-26 10:05:14 +01:00
Richard Purdie 06f2f8ce0a meta: Convert getVar/getVarFlag(xxx, 1) -> (xxx, True)
Using "1" with getVar is bad coding style and "True" is preferred.
This patch is a sed over the meta directory of the form:

sed \
 -e 's:\(\.getVar([^,()]*, \)1 *):\1True):g' \
 -e 's:\(\.getVarFlag([^,()]*, [^,()]*, \)1 *):\1True):g' \
 -i `grep -ril getVar *`

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-05 10:22:56 -08:00
Richard Purdie c8dee9b92d Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:

sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`

(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10 11:51:19 +00:00
Martin Jansa ec63594a8e utils.bbclass: skip empty paths when handling FILESEXTRAPATHS
* if there is multiple .bbappend files with FILESEXTRAPATHS_prepend := "/:"
  then the one parsed last is causing trailing ':' and that's causing empty element in
  path = extrapaths.split(:) + path
* it's hard to keep all .bbappends from foreign layers to follow this rule, so it's better
  to be able to handle trailing ':'

(From OE-Core rev: 3b5591d423324da076d038ad335af47b616a7903)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-23 18:23:35 -07:00
Lianhao Lu 57bd62ad5c package(_ipk).bbclass: opkg using ALL_MULTILIB_PACKAGE_ARCHS
[YOCTO #1345]
The new variable ALL_MULTILIB_PACKAGE_ARCHS contains all the values of
PACKAGE_ARCHS for each multilib variants. The opkg backend now uses this
new value insteald of the PACKAGE_ARCHS to update the opkg indexes and
to generate the opkg configuration files. This allows the normal
packages and multilib packages may be installed into the same rootfs.

(From OE-Core rev: b774bf44ef004276da12a83ebd69715c00b596ac)

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-17 15:14:56 +01:00
Lianhao Lu 375cf1561c utils.bbclass/multilib.class: Added misc supporting functions.
1. Added variable MULTILIB_VARIANTS to store all the instance variants
for multilib extend.

2. Added function all_multilib_tune_values to collect the variable
values for all multilib instance.

3. multilib bbclass handler will save the orignal value of all variables
defined in MULTILIB_SAVE_VARNAME.

(From OE-Core rev: 18bba910e04bff75460f408e4557d4bae21ad592)

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-15 15:26:17 +01:00
Saul Wold 39130137e4 utils.bbclass: Don't forget to pass the cmdline options
This ensure that the command line options from the creation of the wrapper
are actaully passed into the wrapper.

(From OE-Core rev: 190b4f17f5fc9879e680278dd0e31e26e5f5bca0)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-27 12:02:45 +01:00
Darren Hart e94e86c2d7 utils.bbclass: make FILESEXTRAPATHS colon delimited
Fixes [YOCTO 1102]

Path variables are typically : delimited. White space is allowed in paths, so
is not a good choice for separating paths. Currently utils.bbclass performs the
following:

    extrapaths = (bb.data.getVar("FILESEXTRAPATHS", d, True) or "").split()

This splits FILESEXTRAPATHS on whitespace. It later splits overrides on : and
reassembles them all together as : delimited.

There is only one user of FILESEXTRAPATHS in oe-core (qt4-tools-native, which
uses : anyway) and none in oe.

Change the split() in utils.bbclass to split on : instead of whitespace. When
splitting on a defined string (":") we must be careful to handle the empty
string case which returns [''] instead of [].

Tested building qt4-tools-native and core-image-minimal for surgarbay from
meta-intel with a couple extra layers with FILESEXTRAPATHS modifications added.

(From OE-Core rev: a6a892f520d22ef8020c98528d38ee08f6cda034)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: Phil Blundell <pb@pbcl.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-27 16:55:16 +01:00
Saul Wold bc386f67b3 utils.bbclass: modify create_wrapper to correctly follow symlinks
This ensures you look up the symbolic link to get the full path

(From OE-Core rev: a10bd976f4cef54ac50b0c82f885c17a26e5989f)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-19 23:40:36 +01:00
Saul Wold ccfd344782 utils.bbclass: modify create_wrapper to correctly follow symlinks
This ensures you look up the symbolic link to get the full path

(From OE-Core rev: 9215d23fd26c62d250749b8084a52f383cb16fba)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-19 20:48:29 +01:00
Darren Hart fc934af7c8 logging: update existing oe* logging users to the bb* interface
The new bash logging class provides bbnote, bbwarn, bbfatal, and bbdebug
replacements (as well as bbplain and bberror) for the oe* equivalents. Use the
new bb* API in preparation to delete the oe* logging API.

This patch was automatically generated by a sed script. The result has been
visually inspected and used to build core-image-sato for qemux86.

(From OE-Core rev: a1f09fce5caba389d0484b169f0cde85d64514fa)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-04 00:54:37 +01:00
Saul Wold 9c63e3fd29 utils.bbclass: add new wrapper script
Add a new create_cmdline_wrapper() function that takes cmdline options
for commands that need different directories

Related to [BUGID #775

Signed-off-by: Saul Wold <sgw@linux.intel.com>
2011-02-25 16:20:31 -08:00
Richard Purdie 984e90f4d7 meta/classes: Update classes to use new fetcher API
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:37 +00:00
Scott Garman 14770205c1 staging.bbclass, utils.bbclass: remove la mangling code
libtool v2.4 --with-libtool-sysroot eliminates the need for
la mangling.

Based on Khem Raj's OE commits.

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
2011-01-21 01:36:15 -08:00
Richard Purdie edd290bd1a base/utils.bbclass: Drop former checksum code now bitbake is handling this for us
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-20 15:34:50 +00:00
Richard Purdie a9c46e44d4 base/utils.bbclass: Sync up overlapping functions
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-11-02 11:50:50 +00:00
Richard Purdie 26a4b23220 utils.bbclass: Add functions from OE.dev
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-11-02 10:33:52 +00:00
Joshua Lock e7fa3529f3 Update classes to use lib/oe
Adapt modifications from upstream to make Poky classes use lib/oe for the
common Python functionality.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-06 12:53:16 +01:00
Richard Purdie 9c5386c1fd base.bbclass: Split up as per the patch in OE.dev by Chris Larson making code more readable and modularised
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-19 23:12:06 +00:00