Commit Graph

138 Commits

Author SHA1 Message Date
Peter Kjellerstedt e56ff20931 buildhistory.bbclass: Improve the generated depends.dot file
* Convert incorrectly formatted dependencies such as:
    "bar -> "foo" ">=" "1.2.3"
  into dependencies with edge labels:
    "bar -> "foo" [label=">= 1.2.3"]
* Remove rpmlib() and config() dependencies such as:
    "foo" -> "rpmlib(CompressedFileNames)" [label="<= 3.0.4-1"]
  and:
    "base-files" -> "config(base-files)" [label="= 3.0.14-r89.49"]
* Remove the trailing semicolon that was added to each line. It fills
  no purpose.

(From OE-Core rev: 99ef2f26cf498e1693a947bb44e40c31c20ec525)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31 17:57:11 +01:00
Paul Eggleton 00a859afd0 classes/buildhistory: fix failures collecting output signatures
It's possible for tasks to stage symlinks that point to non-existent
files; an example is ncurses-native.do_populate_sysroot. There wasn't
any error checking here so this broke the build when "task" was included
in BUILDHISTORY_FEATURES. In any case we shouldn't be following symlinks
and getting the sha256sum of the link target - we need concern ourselves
only with the target path, so check if the file is a link and sha256 the
target path instead if it is. If it's neither a regular file nor a
symlink (perhaps a pipe or a device), just skip it.

(From OE-Core rev: f60520d97f53dafe783f61eb58fe249798a1e1be)

(From OE-Core rev: 66a0d184d8f55a8da03de9fedb18d166b80b198b)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-27 22:36:43 +01:00
Paul Eggleton 3df7ee4755 classes/buildhistory: save output file signatures for sstate tasks
Save a file per task listing sha256sums for each file staged, i.e.
the output of the task. Some caveats:

1) This only covers sstate tasks since it uses SSTATEPOSTUNPACKFUNCS,
   however those are generally the most interesting in terms of output
   anyway.
2) The signature is taken before applying any relocations, so any
   relocated files will actually have different signatures, but that's
   churn that you probably won't want to see here.
3) At the moment if you run the same build twice without sstate you will
   very likely see changes in the output for certain tasks due to things
   like timestamps being present in the binary output. Fixing that is
   a general Linux ecosystem problem - see this page for our efforts to
   resolve it on our side:
     https://wiki.yoctoproject.org/wiki/Reproducible_Builds

NOTE: you need to set your BUILDHISTORY_FEATURES value to include
"task" to enable collection of these signatures as it is is disabled by
default.

(From OE-Core rev: ca5d1273432e20059ab66d721a9eb314a54e81e7)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-11 18:10:18 +01:00
Paul Eggleton 6774995322 classes/buildhistory: write out task signatures on every build
If we want to determine what changed since the last build, one angle
from which to look at it is to check the signatures. However, if we
don't actually have the signatures from the last build we don't have
anywhere to start. Save the signatures on each build in order to give us
the starting point.

NOTE: you need to set your BUILDHISTORY_FEATURES value to include
"task" to enable collection of these signatures as it is is disabled by
default.

(From OE-Core rev: 11f68f65c46c5bc26ddeeade3021e83b3a7f895a)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-11 18:10:17 +01:00
Patrick Ohly 874a46b6a7 buildhistory.bbclass: do not influence sstate of do_rootfs
Enabling or disabling buildhistory caused a rebuild of images, which
is undesirable. For example, it prevented image reuse from a main
build with buildhistory in a following oe-selftest where buildhistory
must be disabled.

The reason are the additional ROOTFS_POSTUNINSTALL_COMMAND and
ROOTFS_POSTUNINSTALL_COMMAND entries. Those need to be excluded both
via vardepvalueexclude and vardepsexclude.

(From OE-Core rev: e4c28ea05ef4514deb3d19e8e33f81d352712455)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-11 18:10:17 +01:00
Mikko Rapeli c52fe3a77a buildhistory.bbclass: add layer name to source recipe data
It is useful to know which layer provided a given recipe and its
binary packages.

Many projects combine a number of layers and some of them
also provide same recipe names in which case bitbake
can prioritize between them. buildhistory can record
the decision by saving the layer from where the recipe
was taken from.

Also, if a project is split to sub projects which maintain
recipes in different meta layers, then meta layer specific
summaries of e.g. disk usage can be calculated if
source recipes meta layer name is recorded for example in
buildhistory.

If source layer is not in build history, then layer providing
the recipe can be exported from build environment using
'bitbake-layers show-recipes', but it takes a long time to execute
since all recipes are parsed again and requires full source tree
with correct build configuration.

This patch exports the name of layer as configured in BBFILE_COLLECTIONS
append of its layer.conf. 'bitbake-layers show-recipes' exports the
meta layers directory path name. For several open source layers
these are different, e.g. meta-openembedded/meta-perl/conf/layer.conf
is perl-layer, poky/meta/conf/layer.conf is core,
poky/meta-skeleton/conf/layer.conf is skeleton etc.

(From OE-Core rev: d8e59d1f840e4282859ad14397d1c06516b8eb11)

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>
2017-03-22 11:35:22 +00:00
Aníbal Limón aac3ad4785 buildhistory.bbclass: Only execute get_extra_sdkinfo when sdk is enabled
If sdk ins't in BUILDHISTORY_FEATURES the get_extra_sdkinfo fails
because no information about sdk is generated in buildhistory repo.

(From OE-Core rev: e6a0ea6146171635c49b18e00b4b11a9a7ff20ee)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-08 11:52:56 +00:00
Mikko Rapeli f1475ed582 buildhistory.bbclass: use tabs as separator in installed-package-sizes.txt
All other fields are separated by tabs except KiB and binary package
name. This helps users, *cough managers*, who import this file into
MS Excel to calculate file system usage summaries.

(From OE-Core rev: e26bed8493d7b096740cd6fff2e72ab27d48a933)

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>
2017-03-04 23:18:19 +00:00
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
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