Commit Graph

129 Commits

Author SHA1 Message Date
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
Christopher Larson d0b0cf6cff buildhistory: fix latest_srcrev in the common case
buildhistory was writing srcrevs.values() as SRCREV when only one
srcrev/branch exists. This returns a view of the dictionary values in python
3, and used to return a list in python 2, neither of which is an appropriate
value for SRCREV. It was resulting in latest_srcrev files like this:

    # SRCREV = "346584bf6e38232be8773c24fd7dedcbd7b3d9ed"
    SRCREV = "dict_values(['346584bf6e38232be8773c24fd7dedcbd7b3d9ed'])"

Which in turn would result in invalid output in buildhistory-collect-srcrevs.
Fix by calling `next(iter())` on the `.values()`

(From OE-Core rev: ef826a395612400924bbe49859d256b237ff59e1)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-28 16:15:18 +01: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
Ross Burton 95403e3ecd buildhistory: output package variables in a repeatable order
This code was outputting variables by iterating a dictionary.  In Py2 this
always results in the same iteration order but with Py3 the order changes every
execution, which resulted in buildhistory having to store diffs where fields
were simply re-ordered.

(From OE-Core rev: f9faa8df85317d12743134a44576b4882a9fb22a)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:32 +01:00
Paul Eggleton dd8540550f classes/buildhistory: ensure eSDK sstate lists sorted secondarily by name
I got fed up with seeing items dance around in sstate-package-sizes.txt
in the buildhistory git repo simply because they have the same size.
Let's sort the list first by size and then also by name to ensure items
with the same size are deterministically sorted.

(From OE-Core rev: 7340c1ea677731d21351d47d935d9de7d7e2eda5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:32 +01:00
Paul Eggleton 82c7d0f200 classes/buildhistory: add additional variables for eSDK
Add SDK_INCLUDE_PKGDATA and SDK_INCLUDE_TOOLCHAIN to the variables that
we put into sdk-info.txt

(From OE-Core rev: 4bf5be6a1fc39f367bbb59e1787cb55e7b5835ae)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:31 +01:00
Richard Purdie 3b39971748 classes/lib: Complete transition to python3
This patch contains all the other misc pieces of the transition to
python3 which didn't make sense to be broken into individual patches.

(From OE-Core rev: fcd6b38bab8517d83e1ed48eef1bca9a9a190f57)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:01 +01:00
Richard Purdie 44e9a0d2fa classes/lib: Update to explictly create lists where needed
Iterators now return views, not lists in python3. Where we need
lists, handle this explicitly.

(From OE-Core rev: caebd862bac7eed725e0f0321bf50793671b5312)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:00 +01:00
Richard Purdie 8587bce564 classes/lib: Update to match python3 iter requirements
python3 standardises its use of iteration operations. Update
the code to match the for python3 requires.

(From OE-Core rev: 2476bdcbef591e951d11d57d53f1315848758571)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:00 +01:00
Richard Purdie a7309d5790 classes/lib: Update to use python3 command pipeline decoding
In python3, strings are unicode by default. We need to encode/decode
from command pipelines and other places where we interface with the
real world using the correct locales. This patch updates various
call sites to use the correct encoding/decodings.

(From OE-Core rev: bb4685af1bffe17b3aa92a6d21398f38a44ea874)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:00 +01:00
Ross Burton 632681209d buildhistory: don't alter SDK creation stamps
This class adds functions to the SDK creation hooks, so ensure that they're
ignored in task stamps.

(From OE-Core rev: b15b977d10b5165728c1238b8d67a73719d29d60)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-15 06:59:43 +01:00
Paul Eggleton b13184cccc classes/buildhistory: fix grammar in comments
Fix a minor grammatical error in the comments here.

(From OE-Core rev: ddc60aea113e587f27df03645620d6eb677ff28a)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-05 14:33:57 +01:00
Paul Eggleton e5c0a9f067 classes/buildhistory: fix filtering of depends-nokernel.dot
For images we produce a number of filtered dependency .dot files for
readability, the first of which is depends-nokernel.dot which filters
out just the kernel itself (not kernel modules). Unfortunately the
filter specifications hadn't been updated for the dash-to-underscore
removal or the 4.x kernel upgrade, thus the filtering wasn't actually
doing anything.

(From OE-Core rev: ec1077bed0c1538084bceeafb957abe725b13b76)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-05 14:33:57 +01:00
Paul Eggleton 4d364f27e7 classes/buildhistory: optimise getting package size list
Invoking oe-pkgdata-util in turn for every package in the list was slow
with a large image. Modify oe-pkgdata-util's read-value command to take
an option to read the list of packages from a file, as well as prefix
the value with the package name; we can then use this to get all of the
package sizes at once. This reduces the time to gather this information
from minutes to just a second or two.

Fixes [YOCTO #7339].

(From OE-Core rev: 51c24904cc1bc823bccc3f179b8d7a192dace168)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-05 14:33:57 +01:00
Patrick Ohly 0883affe7b buildhistory.bbclass: create image directory when needed
buildhistory_get_imageinfo() assumed that the buildhistory directory
for the image had already been created earlier. That assumption is not
true for special images (like the virtual swupd images from
meta-swupd) where the entire traditional do_rootfs/do_image is
skipped.

Creating files-in-image.txt still makes sense for such images, so
support them by creating the directory also in
buildhistory_get_imageinfo().

(From OE-Core rev: 723328319ee53235969ec9cce7ff5d7729dcf8d7)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-29 23:20:13 +01:00
Paul Eggleton 0eb52b91a7 classes/buildhistory: record a few more variables for extensible SDK
We've recently added SDK_EXT_TYPE and SDK_RECRDEP_TASKS and these will
have an effect on the size and functionality of the SDK, so record them
in sdk-info.txt.

(From OE-Core rev: 1be0ae80f97bdee758232ec5397c09d73d57e1e0)

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>
2016-03-12 22:11:48 +00:00
Patrick Ohly da13f0bce5 buildhistory.bbclass: remove out-dated information on request
buildhistory.bbclass by design is incremental: each build adds or
updates information. Information is never removed.

Sometimes it can be useful to reduce the information only to those
recipes that were build during a specific bitbake invocation, for
example when the invocation does a full world build.

This is now possible by setting BUILDHISTORY_RESET as explained in the
modified class. The comment on the variable also mentions the caveats
associated with using this mode.

In this mode, buildhistory.bbclass first moves all existing
information into a temporary directory called "old" inside the build
history directory. There the information is used for the "version
going backwards" QA check. Then when the build is complete and before
(potentially) committing to git, the temporary directory gets deleted.

Because information that has not changed during the build will be
reconstructed during full world rebuilds, a git log will then only
show real updates, additions and removals.

(From OE-Core rev: 51f4eb5bfcd25f7160e50314f433cad126aa3e9a)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-15 17:47:08 +00:00
Paul Eggleton 2eb19cc723 classes/buildhistory: fix for python function parsing change
Variable expressions are no longer expanded in python functions as of
BitBake commit 8bf33a8e92c0e188fa392030025756196c96fcbb, so we've now
got to do this explicitly here.

(From OE-Core rev: 60fd4ff61a4ad240a89d48553002901c10e93178)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-15 16:28:45 +00:00
Richard Purdie 5fc5996c23 buildhistory: Fix regex to handle versions without spaces
Its valid to have dependencies like XXX (=2.1) without spaces, as injected
by debian.bbclass. The code was breaking these into separate components
and destroying them so improve the regex to handle them.

(From OE-Core rev: 613e96b06202f31870be411ca45b44237ae55b1c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-14 11:42:19 +00:00
Markus Lehtonen 70814586bb buildhistory: fix the check for existence of a git repo
Previously, in order to determine the existence of an already
initialized Git repository we checked if a directory named '.git' was
present in the buildhistory dir. However, e.g. in the case of git
submodules '.git' may also be a regular file referencing some other
location which was causing unwanted behavior. This patch changes
buildhistory.bbclass to check for any file named '.git' which fixes
these problems.

[YOCTO #8911]

(From OE-Core rev: a5e931e0b1d941cc938fe2f49625c54b07fab0ce)

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>
2016-01-30 11:37:00 +00:00
Mariano Lopez 6ebda8e659 lib/oe/rootfs: Use list_pkgs() instead of list()
This patch changes the use list_pkgs() instead of list()
from class RpmPkgsList. The change is in two functions,
image_list_installed_packages from rootfs.py and
sdk_list_installed_packages from sdk.py.

With this change the functions calling the functions
listed above, must format the output as they required.
The formatting can be done using format_pkg_list() from
oe.utils.

The classes calling the afected functions are changed too
with this patch, to keep the same functionality using the
new data structure.

[YOCTO #7427]

(From OE-Core rev: 983ea373362514e5888bd1d7d9c4f136c94b00f2)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-20 17:07:15 +00:00
Paul Eggleton 4685c3378d classes/buildhistory: save auto.conf and bblayers.conf for extensible SDK
These form part of the configuration for the extensible SDK, we should
really be recording what goes into them.

(From OE-Core rev: bd1557bfd726e44c23ab6220867119c57ac6b596)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 11:54:51 +00:00
Paul Eggleton ae1fc966f7 classes/buildhistory: actually use KiB in extensible SDK sizes files
I was using bytes here for the sizes and writing out KiB as the suffix.
Change it to actually write out size values in KiB.

(From OE-Core rev: e6b1840ee9aeb933f86fd2a92a90b94c1bc9db7c)

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>
2016-01-07 13:40:20 +00:00
Paul Eggleton 35bd2544ec buildhistory: improve support for extensible SDK
* Ensure extensible SDK and standard SDK go into their own directories
* Record extra extensible SDK variables
* Write sstate-package-sizes.txt and sstate-task-sizes.txt files so you
  can analyse the size of the contents
* Add BUILDHISTORY_SDK_FILES (similar to BUILDHISTORY_IMAGE_FILES) and
  default it to pick up config files installed in the extensible SDK

(From OE-Core rev: 5f87ff116d9ccd5e95e638dfa84583169a3f99f3)

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>
2015-12-28 09:25:17 +00:00
Paul Eggleton ea0abcdd17 buildhistory: fix not recording SDK information
After OE-Core revision baa4e43a29e45df17eaa3456acc179b08d571db6 we lost
recording SDK the contents in buildhistory. This was due to the
SDK_POSTPROCESS_COMMAND variable being set with = in
populate_sdk_base.bbclass which overwrote any value set with += in
buildhistory.bbclass; to fix it, use _append in buildhistory.bbclass
instead.

Fixes [YOCTO #8839].

(From OE-Core rev: 11d1aa82ef4a00051e0a50a87a1efed1c50c73b5)

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>
2015-12-28 09:25:17 +00:00
Patrick Ohly eded9c26b3 buildhistory.bbclass: support extending the content of the build history
The idea behind the implementation of Yocto #8138 was that an
additional class can write additional files in the recipe directories,
for example by hooking into the functions of buildhistory.bbclass or
by implementing its own SSTATEPOSTINSTFUNCS function.

However, when these additional files get created before
buildhistory_emit_pkghistory(), they get removed again by that
function because it contains code which removes everything it does
not know about. The reason for that is that these unknown items
are probably obsolete.

This logic is the reason why the additional "kconfig" file from
buildhistory-extra.bbclass never showed up in the final build history.

To fix this, the hard-coded list of known files in
buildhistory_emit_pkghistory() must be turned into a variable which
derived classes can extend.

(From OE-Core rev: 97f77ea3313b0d79ae4a6090672a2a9344282262)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:01 +00:00
Maxin B. John a205c4ce1d bbclass: fix spelling mistakes
Fix some spelling mistakes in bbclass files

(From OE-Core rev: ed484c06f436eea62c5d0b1a2964f219f3e5cb61)

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>
2015-11-24 15:50:27 +00:00
Paul Eggleton 7cebff6bdc classes/buildhistory: split package history values only once
We don't actually use values we read in here that are likely to
contain = characters but we might as well split the value properly in
case we do in future.

(From OE-Core rev: afe100436bdeefb024b924ee27ad68830f085ff4)

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>
2015-11-16 11:39:39 +00:00
Paul Eggleton d14ffaf6a3 classes/buildhistory: add build result to commit message
We have the command in the commit message, we might as well have the
build result as well (succeeded/failed and whether or not it was
interrupted by the user). The interrupted part relies upon a change to
BitBake to extend the BuildCompleted event to include an attribute for
that, but will not fail if the attribute is not present.

(From OE-Core rev: 6ca7f5c0d0f024ae5d21368188e3428534cab2a4)

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>
2015-08-30 12:36:12 +01:00
Paul Eggleton 734411a9e6 classes/buildhistory: include metadata revisions in commit message
We do already commit these into the repository itself, but have them in
the commit message as well as a reference. As part of this, refactor out
running "git commit" into a separate function so we don't have to
duplicate the code in the two places we call it.

Implements [YOCTO #7966].

(From OE-Core rev: c77a068e534b274dee7fb8a2399ecafd33da0587)

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>
2015-08-30 12:36:12 +01:00
Paul Eggleton 2a08f4a0e5 classes/buildhistory: handle additional files at recipe level
Avoid an error when attempting to remove previous data if it's not a
subdirectory - we were assuming that anything that wasn't named "latest"
or "latest_srcrev" had to be a directory. This makes it possible to have
a buildhistory_emit_pkghistory_append which writes additional files at
the recipe level.

(From OE-Core rev: b018a046a578e41b105cf72b9fdeed0220ae3046)

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>
2015-08-30 12:36:11 +01:00
Paul Eggleton 846cb34afa classes/buildhistory: fix permissions in package file listing
If we want the correct file permissions to show up here as they would on
the target, we need to run the command under pseudo. Normally we'd set
the fakeroot varflag on the function and that would be enough, but it
turns out that setting fakeroot on a non-task function that you execute
using bb.build.exec_func() isn't working at the moment. Work around this
by simply using FAKEROOTENV and FAKEROOTCMD. Unfortunately that means we
have to duplicate the command for the two cases but I couldn't find a
better means of doing that that actually works.

(From OE-Core rev: 1380aa333ed90559f4a24d52aefc52cadb60646c)

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>
2015-08-30 12:36:11 +01:00
Paul Eggleton 1bfae0fd81 classes/buildhistory: tweak buildhistory_list_pkg_files
* Avoid using ${...} for shell variables (since they could be
  expanded as bitbake variables if present)
* Use files-in-package.txt rather than files-in-<packagename>.txt; the
  file is already in a subdirectory named with the package name and this
  naming is consistent with that of files-in-image.txt.

(From OE-Core rev: 6f3992728613c39403ef59bbcf1cb67d9e8c526b)

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>
2015-08-30 12:36:11 +01:00
Paul Eggleton 5d34d3257a classes/buildhistory: indent recently added function consistently
Shell functions use tabs in this file.

(From OE-Core rev: 14eba06baacca25213e35afa7bfd126fc1f5586a)

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>
2015-08-30 12:36:10 +01:00
Paul Eggleton ec412d5c76 classes/buildhistory: exclude . in file listings
We don't care about the permissions on the top-level directory in which
the files are contained, just everything under it; this also avoids
lists with just this entry in it for empty packages. Affects file
listings for both images and packages.

(From OE-Core rev: d503122646b1b148113a4be31b7e88723459dae6)

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>
2015-08-30 12:36:10 +01:00
Paul Eggleton e6c330c7e5 classes/buildhistory: ensure we push when "no changes" commits are made
If there aren't any changes, we still make a commit to the buildhistory
repo, but this wasn't being pushed if BUILDHISTORY_PUSH_REPO is set.
Move the push to the end to make it unconditional.

(From OE-Core rev: af2fc914975d06fdd75a65d4b00cf9f5c1610528)

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>
2015-08-30 12:36:09 +01:00
Leonardo Sandoval b250b5c7be buildhistory.bbclass: Check output folder is present before creating files-in-$pkg.txt
This is just a safe check to make sure the output folder is present, before
creating the files-in-$pkg.txt file.

(From OE-Core rev: d48233cb1fd84f1061a8ba3c15bacc180e93934c)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:16 +01:00
Leonardo Sandoval 01c9c7394d buildhistory.bbclass: Create a files-in-<pkg>.txt containg recipe's pkg files
A file similar (in format) to files-in-image.txt is created for each
recipe's build package. This would allow to easily see what the
recipe's package may install when including it into an image.

These files reside on the specific buildhistory recipe package (i.e.
buildhistory/packages/i586-poky-linux/busybox/busybox-dev/files-in-busybox-dev.txt
for busybox-dev package)

[YOCTO #5870]

(From OE-Core rev: e013fe79cdf67429ff986d8ee6af510b34b31c9d)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27 22:42:54 +01:00
Paul Eggleton 1b2332d338 classes/buildhistory: ensure that git user email and name are set
The git user.email and user.name settings must be set or the commit to
the buildhistory repo (when BUILDHISTORY_COMMIT is set to "1") will
fail. If the user hasn't set these, set some dummy values since the
actual value is unlikely to be particularly useful and it's far worse
for the commit not to be done leaving the repository in a partially set
up state.

Prompted by [YOCTO #6973].

(From OE-Core rev: f62255bfa6c5a322c867b7c4ea5686ea7bfab3fe)

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>
2015-05-24 07:19:18 +01:00
Paul Eggleton 9f03969994 oe-pkgdata-util: improve command-line usage
* Use argparse instead of optparse for standardised help output, options
  and a much cleaner code structure
* Look up pkgdata directory automatically so the user doesn't have to
  specify it
* Use standard logging

NOTE: this does mean a slight change in syntax - if you do want to
specify the pkgdata directory (usually only necessary if you're calling
it from within the build process) you need to use the parameter -p (or
 --pkgdata-dir) and specify this before the command, not after it.

Examples:

oe-pkgdata-util find-path /sbin/mke2fs
oe-pkgdata-util lookup-recipe libelf1
oe-pkgdata-util read-value PKGSIZE libc6
oe-pkgdata-util -p /home/user/oe/build/tmp/sysroots/qemux86-64/pkgdata read-value PKGSIZE libc6

(From OE-Core rev: 04dc571ac7c26f0dcf1a1fcd466482e22519998d)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-14 08:41:01 +00:00
Paul Eggleton 26e5b0f7b9 classes/image: ensure uninstalled packages do not appear in manifests
Since the rewrite of the image construction code in python a few
releases ago, we remove a couple of packages from the image as one of
the final steps when constructing the image (notably update-rc.d and
run-postinsts).  However, because of the order of operations, these
packages are still listed both in the buildhistory
installed_package*.txt files and in the manifest file created next to
the image, which is wrong.

There were two possible solutions to this: (1) change the order such
that the uninstallation occurs before calling ROOTFS_POSTPROCESS_COMMAND
or (2) add another hook variable in such that we can have the
package list collection code run at the right time. Because it's
currently possible (but very much not recommended) to install additional
packages within ROOTFS_POSTPROCESS_COMMAND, which may have postinstall
scripts and thus require the packages we would otherwise uninstall if we
were to take option 1, option 2 is really the least likely to cause
problems. Therefore, add ROOTFS_POSTUNINSTALL_COMMAND and make the image
and buildhistory classes use it.

Fixes [YOCTO #6479].

(From OE-Core rev: b198a189228648057c3be7d068598f50841b3bf9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-03 14:53:50 +00:00
Alejandro Hernandez ed3e25379c image-buildinfo.bbclass: new class, writes build information to image
Writes build information to target filesystem on /etc/build such as enabled
layers, their current status and commit.

squashspaces was moved to oe/utils.py to make it available to different classes
and avoid code duplication.

[YOCTO #6770]

(From OE-Core rev: c9cc652e88ddedddf8a2f23fb9b8c024616526d7)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-11-09 10:21:22 +00:00
Paul Eggleton a41d97a23b classes/buildhistory: fix for sstate class change
SSTATEPOSTINSTFUNCS is now set with = in sstate.bbclass, and because
the line here in buildhistory.bbclass ends up being parsed before that
we now need to use _append or the value we are adding will be wiped out.
This fixes buildhistory no longer recording package information since
OE-Core revision 9d659c6f20fa4a141b491c62a3ef0dfb1f896d9c.

(From OE-Core rev: b5c05b474554925524073023f3aac2532c87537f)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-10 13:52:31 +01:00
Martin Jansa e601c8b160 buildhistory: Restore parsing time optimalization
* it was added in:
  http://git.openembedded.org/openembedded-core/commit/meta/classes/buildhistory.bbclass?id=540a2a30be21c3eca4323efbe91e7dcfc31a4c97
* then accidentally removed in:
  http://git.openembedded.org/openembedded-core/commit/meta/classes/buildhistory.bbclass?id=6db6c74f2876df7a183990426bb4262972966441

(From OE-Core rev: cbd868c34718e8fd2a41f5382da71ee959ea4e71)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-25 10:26:00 +01:00
Martin Jansa 3223a704f9 buildhistory: rename build-id to build-id.txt and add more info
* use .txt extension like other reports (e.g. image-info.txt) it's
  also useful when looking at the file from web server which doesn't
  have text/plain as default content-type
* include whole BUILDCFG_HEADER/BUILDCFG_FUNCS instead of just layer
  info
* this makes it easier for distro to include more fields without the
  need to modify buildhistory.bbclass
* currently it adds following fields:
  Build Configuration:
  BB_VERSION        = "1.23.1"
  BUILD_SYS         = "x86_64-linux"
  NATIVELSBSTRING   = "Gentoo-2.2"
  TARGET_SYS        = "x86_64-oe-linux"
  MACHINE           = "qemux86-64"
  DISTRO            = "shr"
  DISTRO_VERSION    = "2013.07-next-20140725"
  TUNE_FEATURES     = "m64 core2"
  TARGET_FPU        = ""

(From OE-Core rev: 6db6c74f2876df7a183990426bb4262972966441)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-18 21:47:58 +01:00
Matthieu Crapet 77790c43b1 *.bbclass (shell): avoid pipe with sed
Replace:
cat <file> | sed -e xxx
By:
sed -e xxx <file>

(From OE-Core rev: e2026f5d32ac05396615224ac9ec927439e7e6b4)

Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-08 13:00:33 +01:00
Otavio Salvador 4c14b09498 Globally replace 'base_contains' calls with 'bb.utils.contains'
The base_contains is kept as a compatibility method and we ought to
not use it in OE-Core so we can remove it from base metadata in
future.

(From OE-Core rev: d83b16dbf0862be387f84228710cb165c6d2b03b)

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
Laurentiu Palcu 2cf83f49e3 buildhistory.bbclass: create proper dependency files for SDK
The old functions were calling the list_installed_packages() wrapper
function that only listed the packages in an image rootfs. Even for
target/host SDK. Also, a python crash was possible if 'bitbake -c
populate_sdk core-image-*' was called without calling 'bitbake
core-image-*' first. That's because the wrapper was always looking into
the image rootfs...

This commit fixes the problem and calls the right wrapper for image/sdk.

(From OE-Core rev: c1b1a6eb448aa1548e2ec669a9304b5a25bd8ba5)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-21 12:05:53 +00:00
Laurentiu Palcu 6029af2ec5 buildhistory.bbclass: Fix dependency files creation
Call the new python routines.

[YOCTO #5904]

(From OE-Core rev: 570baf4921a5b34cc97834e670b143073d136dea)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-11 20:28:56 -07:00
Paul Eggleton 229bcde8e4 classes/buildhistory: fix task signatures changing
Fix task signatures for recipes that add to SSTATEPOSTINSTFUNCS changing
when adding and removing INHERIT += "buildhistory" (really this time!)

This relies on the BitBake vardepvalueexclude feature, however it will
not fail without it - signatures will be changed in that case though.

Part of the fix for [YOCTO #5897].

(From OE-Core rev: 27c8a9a282358b9a8a330252ee2104b250777b38)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-07 14:49:32 +00:00