Commit Graph

688 Commits

Author SHA1 Message Date
Markus Lehtonen d5be8666a1 oe/gpg_sign: add 'armor' argument to detach_sign()
[YOCTO #9006]

(From OE-Core rev: ce653694a87fd77d79ec3d28ed3365a2c8e57ad6)

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-02-19 01:01:25 +00:00
Markus Lehtonen 03554b77cd oe/gpg_sign: add verify() method
A new method for verifying detached signatures.

[YOCTO #9006]

(From OE-Core rev: 4445c645c71151bd56ff7e133343a6f1e30cc3b3)

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-02-19 01:01:25 +00:00
Ross Burton 7a700f59d9 lib/qa.py: raise ValueError if file isn't an ELF
Instead of raising a generic Exception that can't be handled specifically, raise
a ValueError.  Also update the callers so any unexpected exceptions are not
ignored.

Also, rename isBigEngian() to isBigEndian().

(From OE-Core rev: c136652f9c0b35aafa393e63567daf029ae03929)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-16 11:17:10 +00:00
Ross Burton 334e1b5e0e lib/oe/qa: ELFFile: check that a path is a file before opening it
When opening an ELF file check that a filename points to a normal file before
attempting to open it, as if the file turns out to be something more exotic like
a FIFO it could hang forever.

(From OE-Core rev: 4b3576bc30d8f8cdcde25189def8b059fc92b27c)

(From OE-Core rev: d3af2058e2753516b9aaf7f6d71162363eea11d4)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-16 11:17:10 +00:00
Pascal Bach 36b43b233c lib/oe/terminal: set workdir for konsole terminal
It seems that if the --workdir option is not set konsole does open in the users
home directory. By setting --workdir . konsole opens in the recipes work
directory. This is the same behavior as observed for other consoles.
(Tested with Konsole 2.14.2 on Debian Jessie).

(From OE-Core rev: bd06944249c3de3f629c013e14f446464441c4da)

Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-14 11:42:19 +00:00
Paul Eggleton ddfe74447b devtool: commit for extra tasks that modify source when extracting
When extracting source for a recipe, if there are additional custom
tasks run that make changes to the source, create a commit in the
generated git branch so they are contained. This is particularly
useful for tasks that come before do_patch since otherwise the changes
might get incorporated in the first applied patch, but otherwise it
helps avoid the tree being dirty at any point.

Fixes [YOCTO #7626].

(From OE-Core rev: 997a77d9b20af1778b804778e5d8c8a7424f7582)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11 12:33:02 +00:00
Markus Lehtonen 8cb1e83a57 oe/gpg_sign: fix incorrect variable name
Prevents crash in signing if GPG_PATH is defined.

(From OE-Core rev: 0ecd748258abfe5ed9e9e2505aeb42b232389968)

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-02-11 12:27:46 +00:00
Ioan-Adrian Ratiu bbdbe00c2a package_manager.py: fix python indentation bug (opkg)
This if branch is causing the following error during do_rootfs:
"Exception: UnboundLocalError: local variable 'cfg_file' referenced
before assignment". This happends because the cfg_file variable is
defined at a deeper nesting level (just above the if branch).

(From OE-Core rev: 555981c10e6b7f5c2be7f2c3fefb89b1add72cab)

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-06 23:10:45 +00:00
Randy Witt f1f8447750 copy_buildsystem.py: Pass the nativelsb argument to gen-lockedsig-cache
If the nativelsb argument is not used, then create_locked_sstate_cache()
can get collisions when moving the files from the input_sstate_cache
to the output_sstate_cache.

The specific case where this was encountered was when a "universal"
nativelsb directory already existed in the input_sstate_cache.

(From OE-Core rev: 760f7178e0267f930c8af9cb59039e317149f944)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-06 23:10:44 +00:00
Chen Qi 090fb5146f copy_buildsystem: add ability to exclude layers
In some cases, we may have some kind of download layers in BBLAYERS, so
that we can set BB_NO_NETWORK to "1". This results in extremely large
extensible SDK. And we actually don't need these download layers in the
SDK.

Add a new variable, SDK_LAYERS_EXCLUDE, to enable users to explicitly
exclude some layers when generating the extensible SDK.

[YOCTO #8878]

(From OE-Core rev: acf1148bf3f4e489e9e2b0b8745753e1311ee812)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-04 23:39:01 +00:00
Richard Purdie 7fa6eeba1c classes/lib: Add expand parameter to getVarFlag
This sets the scene for removing the default False for expansion
from getVarFlag. This would later allow True to become the default.

On the most part this is an automatic translation with:

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

In this case, the default was False, but True was used since in most
cases here expansion would be expected.

(From OE-Core rev: 42a10788e89b07b14a150ced07113566cf99fcdd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-04 23:39:00 +00:00
Stefan Agner db81fc967a lib/oe/package_manager: remove package feed lists
Remove opkg package feed lists after generating the rootfs. The
lists have been generated by the local feed but are no longer
necessary after image generation. This still leaves the package
management fully usable (and hence is different from omitting
package-management from IMAGE_FEATURES).

(From OE-Core rev: 25477874ef737777cedc623a8e1c5aedf2f4bae1)

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-31 13:29:48 +00:00
Peter Kjellerstedt eb7e554cbd lib/oe/patch: Make GitApplyTree._applypatch() support read-only .git/hooks
Rather than modifying files in .git/hooks, which can be read-only
(e.g., if it is a link to a directory in /usr/share), move away the
entire .git/hooks directory temporarily.

(From OE-Core rev: a88d603b51a9ebb39210d54b667519acfbe465c3)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-30 11:37:01 +00:00
Markus Lehtonen bb971577ab meta/lib: new module for handling GPG signing
Add a new Python module (oe.gpg_sign) for handling GPG signing
operations, i.e. currently package and package feed signing. The purpose
is to be able to more easily support various signing backends and to be
able to centralise signing functionality into one place (e.g.  package
signing and sstate signing). Currently, only local signing with gpg is
implemented.

[YOCTO #8755]

(From OE-Core rev: 9b3dc1bd4b8336423a3f8f7db0ab5fa6fa0e7257)

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-26 22:31:58 +00:00
Richard Purdie a1c35f302d lib/oe/sdk: Partially revert "sdk.py: fix conflicts of packages"
OE-Core rev: f2b64f725803ad8be7c2876c531e057a4fe5ca7c (poky
1362986886) unintentionally broke opkg/dpkg
multilib support within the SDK by making things not honour
self.install_order. This reinstates that code for opkg/dpkg but
not rpm where the original problem was.

(From OE-Core rev: 98b585120137a3db07ed742a8f18223883ad6dc5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-24 09:40:34 +00:00
Joshua Lock 0aeb33f6e0 lib/oe/package_manager: prevent testing an undefined variable
This prevents an error in do_populate_sdk when building
buildtools-tarball with ipk as the package manager:

Exception: UnboundLocalError: local variable 'pkg' referenced
before assignment

(From OE-Core rev: f971ae290cbbc51ec3669b57c55b2b7c0bd9bc87)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-24 09:40:33 +00:00
Paul Eggleton 477fa84390 gen-lockedsig-cache: copy correct native sstate into ext SDK
When constructing the sstate-cache directory for the extensible SDK,
we were copying in any matching native sstate packages, and as the
signature doesn't actually change when the distro changes (since
NATIVELSBSTRING is just a path separator for the artifacts and is not
part of the signature) we ended up copying duplicated packages when the
distro changed e.g. upon host distro upgrade. Only search in the
NATIVELSBSTRING-named subdirectory for native packages and the issue
goes away.

Fixes [YOCTO #8885].

(From OE-Core rev: 6c6baf6aa1823b8b20123f505e45c2768a193ad5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-24 09:40:33 +00:00
Paul Eggleton d3a4f72896 classes/populate_sdk_ext: add option to bring in pkgdata for world
Add a variable SDK_INCLUDE_PKGDATA which you can set to "1" to include
pkgdata for all recipes in the world target. There are a couple of uses
for this:

1) If you use "devtool add" to add a recipe that builds something which
   depends on anything in world, the dependency can then be correctly
   mapped to the recipe providing it and that recipe can be added to
   DEPENDS, since we have the pkg-config and shared library dependency
   data within pkgdata.
2) You'll be able to search for these recipes and any files they
   package for the target with "devtool search" since that also uses
   pkgdata

This of course assumes you've tailored world through EXCLUDE_FROM_WORLD
to only include recipes you'd want built in your distro, but I think
that's a reasonable assumption; failing that there is a
WORLD_PKGDATA_EXCLUDE variable that you can set to exclude any recipes
you don't want.

Note that this patch relies on functionality implemented in a recent
BitBake patch and will not work without it.

Implements [YOCTO #8600].

(From OE-Core rev: 67149ea097d6fab7496b43e85a40853f40bd527e)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-24 09:40:32 +00:00
Mariano Lopez 571289df7b lib/oe/package_manager.py: Remove list() from PkgsList class
Now that the method list() is not used anymore, remove it.

[YOCTO #7427]

(From OE-Core rev: 01e7dfbce972cfb926668e5ee194c83838e1e1b6)

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
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
Mariano Lopez 03075f671c lib/oe/utils: Add function format_pkg_list()
The class PkgsList returns a dictionary with all the installed
packages, because the data structure is a dictionary there is
needed to format the data in order to write to a file.

The function format_pkg_list returns a formated sting with all
packages installed. The output will depend on the requested format
when calling the function.

[YOCTO #7427]

(From OE-Core rev: 25725e6e5fff8017aaf3a6fcd9b1b893c22630b5)

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
Mariano Lopez c708411f20 lib/oe/package_manager: Add list_pkgs() to PkgsList class
Currently the class PkgList returns a formated string of the
installed packages. It would be more clean to pass a standard
data structure to the callers instead to format the output
inside PkgsList class.

This patch adds list_pkgs() method to PkgsList class to get the
all the information for installed packages and return a dictionary
with the info.

[YOCTO #7427]

(From OE-Core rev: 6cbb144a86a8188fad102bb281fd9e8d0a4b9142)

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
Aníbal Limón b8ebac9794 DpkgRootfs: Fix logcheck_error false-positive when use multilib
Rootfs with dpkg was failing due to false-positive in logcheck_error
because current logic of DpkgPM handles missing dependencies failure
using apt-get -f install [1][2].

This support was broken due to addition of logcheck and don't take into
account dpkgpm cases, in order to fix add an attr for specify expected
errors regex'es by package manager.

[1] http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/lib/oe/rootfs.py#n659
[2] http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/lib/oe/package_manager.py#n2038

(From OE-Core rev: fa7a5ebef87883755491b847c2f4e1a7b021d585)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:31 +00:00
Matt Madison 4aeb69d35f package_manager.py: fixes for multilib deb packaging builds
* tmp/deploy/deb subdirectories do not get hyphens replaced
  with underscores, so don't do that translation when building
  the sources list.

* Fix MULTILIB_VARIANTS handling to be more general and
  work for all architectures

* Also include a fix for a warning generated by apt
  due to missing apt/preferences.d directory.

(From OE-Core rev: c3ee9b12ae704eadf02ff288d8035b5885d6218e)

Signed-off-by: Matt Madison <matt@madison.systems>
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>
2016-01-11 23:26:31 +00:00
Richard Purdie e306d5495a populate_sdk_ext: Change to include siginfo and non sstate task sigs
Right now, the locked task hashes list for the extensible SDK locks
down only the sstate tasks.

Whilst asthetically pleasing, this gives two problems:

* Half the task are left floating meaning checksum mismatches
  are a pain to debug
* The later code which copies relavent data files out the sstate
  cache can't use any of this data.

This patch modifies things so all the checksums are listed in the locked
file. An exclusion of tasks probably makes more sense for the library
function rather than an allowed list.

The only sstate task being deliberaly excluded here was do_package
so add in a function to explictly exclude those sstate object files.

The net result of this that siginfo files for all tasks are included in
the SDK, which means commands like "bitbake -S printdiff" now function.

(From OE-Core rev: 6b70479e47b8a8743d8b410d6bc08da1607a318e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:29 +00:00
Richard Purdie 0a4e1f968a image: Create separate tasks for rootfs construction
This patch splits the code in lib/oe/image into separate tasks, one per
image type. This removes the need for the simple task graph code and defers
to the bitbake task management code to handle this instead.

This is a good step forward in splitting up the monolithic code and starting
to make it more accessible to people.

It should also make it easier for people to hook in other tasks and processes
into the rootfs code.

Incidentally, the reason this code was all combined originally was due to
limitations of fakeroot where if you exited the session, you lost permissions
data. With pseudo this constraint was removed.

We did start to rework the rootfs/image code previously and got so far with
untangling it however we did prioritise some performance tweaks over splitting
into separate tasks and in hindsight, this was a mistake and should have been done
the other way around. That work was suspended due to changes in the people working
on the project but this split has always been intended, now is the time to finish
it IMO.

There were some side effects of doing this:

* The symlink for the manifest moves to the rootfs-postcommands class and into
  the manifest function.
* There is no seperate "symlink removal" and "symlink creation", they are merged
* The date/time stamps of the manifest and the built images can now be different since
  the tasks can be run separately and the datetime stamp will then be different
  between do_rootfs and the do_image_* tasks.

(From OE-Core rev: c2dab181c1cdabac3be6197f4b9ea4235cbbc140)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:29 +00:00
Richard Purdie fdced52387 image: Move pre/post process commands to bbclass
As the next step in splitting up do_image, move the pre and post processing
commands to separate tasks. This also creates the do_image_complete task
which acts as the end marker task for image generation.

(From OE-Core rev: 800528eaa421d451b596545125cb218e08989151)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:29 +00:00
Richard Purdie 1ee08426d7 sstatesig: Handle special case of gcc-source shared-workdir for printdiff
Often, bitbake -S printdiff would show that there was a checksum not found
which would turn out to be from gcc-source. This is due to it being a
shared-workdir recipe.

For now, hardcode the special case into the sstatesig code to stop people
(including me) puzzling over this.

If/as/when we add any other shared workdir recipes, we'll need to rethink
this.

(From OE-Core rev: f11342f0c838b520828927c9d69f7c17309c1b48)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 15:41:47 +00:00
Patrick Ohly c91078954e package_manager.py: add debugging support for rpm scriptlet execution
By default, smart is invoked with --log-level=warning, which hides all
output from pre/post install scriptlets. That makes it hard to debug
scriptlet failure or why they get postponed to first-boot via
/etc/rpm-postinst.

The new ROOTFS_RPM_DEBUG variabled is expected to be set to an integer in
local.conf an incrementally adds more output:
  0 = default, only warnings
  1 = --log-level=info (includes information about executing scriptlets and their output)
  2 = --log-level=debug
  3 = --log-level=debug plus dumps of scriplet content and command invocation

The default behavior is not changed yet, but it seems that level 1 would
be a better default.

(From OE-Core rev: 5cb597a19dbfe825e5b26d828e18644c9ee58f86)

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-28 09:25:19 +00:00
Mariano Lopez 9c0186fd57 rootfs.py: Change logic to unistall packages
In the current state some of the base utils (update-rc.d,
base-passwd, shadow, and update-alternatives) are unistalled
when there is no package manager in the image. Checking for
previous commits, the unistall of these utils were to be
done in a read-only filesystem.

It is a valid option to have these utils without a package
manager, and also make sense to remove them when building a
read-only filesystem.

This changes the check logic from having a package mananger
to if is a read-only filesystem to remove the utils.

Another change implemented with this patch is that delayed
post installs now doesn't depend if there is a package manager.
Also it is a valid option to have post install scripts without
package manger.

[YOCTO #8235]

(From OE-Core rev: 5aae19959a443c6ac4b0feef10715c8acf3c6376)

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>
2015-12-12 23:42:51 +00:00
Haris Okanovic 639cadd6f9 sdk.py / OpkgSdk: remove_packaging_data() after install
Run remove_packaging_data() on both host and target sysroots to wipe
opkg state after install, similar to what RpmSdk does.

Use case:

Opkg may download local package indexes (I.e. file:// URLs) by
sym-linking them into /var/lib/opkg/lists/ instead of copying [1].
This leaves behind broken symlinks under the lists directory when
using opkg to build SDK sysroots.

The -h option may be set via SDKTAROPTS in some configurations to create
symlink-less SDK archives for Windows file systems. Sysroots containing
broken symlinks will fail to archive under this configuration.

Testing:

Verified /var/lib/opkg/ is empty after running populate_sdk() in a Fido
based distribution.

[1] http://git.yoctoproject.org/cgit/cgit.cgi/opkg/commit/?h=opkg-0.3.x&id=f9022a8520fcde8f1b71424d26a652c218fce685

(From OE-Core rev: c8e0ec2da9ad4ce1c103966906a85f68c15400dd)

Signed-off-by: Haris Okanovic <haris.okanovic@ni.com>
Reviewed-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
Natinst-ReviewBoard-ID: 119065
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-09 08:48:25 +00:00
Leonardo Sandoval 6650357f13 lib/oe/package_manager: Introducing PACKAGE_FEED_BASE_PATHS/PACKAGE_FEED_ARCHS
The recently introduced PACKAGE_FEED_PREFIX is not flexible enough for
constructing URIs, because the same PREFIX is used for all PACKAGE_FEED_URIS.
Also, the string 'PREFIX' is confusing because it is not at the beginning of
the URI. The variable PACKAGE_FEED_BASE_PATHS replaces PACKAGE_FEED_PREFIX,
allowing multiple base paths to be appended on each PACKAGE_FEED_URIS. In the
other hand, a new variable called PACKAGE_FEED_ARCHS, similar in concept to
PACKAGE_BASE_PATHS, defines package architectures defined by the user.

To demonstrate the usage of the PACKAGE_FEED_URIS, PACKAGE_FEED_BASE_PATHS and
PACKAGE_FEED_ARCHS, let's assume these variables are set on local.conf

    PACKAGE_FEED_URIS = "https://example.com/packagerepos/release \
                         https://example.com/packagerepos/updates"
    PACKAGE_FEED_BASE_PATHS = "rpm rpm-dev"
    PACKAGE_FEED_ARCHS = "all core2-64"

the resulting feeds would be

    https://example.com/packagerepos/release/rpm/all
    https://example.com/packagerepos/release/rpm/core2-64
    https://example.com/packagerepos/release/rpm-dev/all
    https://example.com/packagerepos/release/rpm-dev/core2-64
    https://example.com/packagerepos/updates/rpm/all
    https://example.com/packagerepos/updates/rpm/core2-64
    https://example.com/packagerepos/updates/rpm-dev/all
    https://example.com/packagerepos/updates/rpm-dev/core2-64

(From OE-Core rev: 229723a20095e80bde29e4b3398047f62f972170)

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-12-09 08:48:25 +00:00
Paul Eggleton 1fbd76093d lib/oe/recipeutils: refactor patch_recipe_file() to use edit_metadata()
Use bb.utils.edit_metadata() to replace some of the logic in this
function; this avoids us effectively having two implementations of the
same thing. In the process fix the following issues:

* Insert values before any leading comments for the next variable
  instead of after them
* Insert overridden variables (e.g. RDEPENDS_${PN}) in the correct place
* Properly handle replacing varflag settings (e.g. SRC_URI[md5sum])

(From OE-Core rev: 0f81b83fc5fd908efa7f6b837137830ca65f6ed6)

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-01 21:32:04 +00:00
Paul Eggleton 21481bc17a lib/oe/recipeutils: check in validate_pn() for names instead of filenames
Ensure that the user specifies just the name portion instead of a file
name with extension. (We can't just look for . since there are recipe
names such as "glib-2.0" that legitimately contain .).

(From OE-Core rev: a4c6af737811adb2bca87e3896f8710738dd255e)

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-01 21:32:04 +00:00
Paul Eggleton a360fa7d51 lib/oe/patch: improve extraction of patch header
For patches that we have to extract the header information by hand (i.e.
will not apply with "git am"), make the following improvements:

* If we can't extract author/date/subject, then try to do so from the
  commit that added the patch in git (assuming the metadata is tracked
  by git)
* Take only first Signed-off-by line instead of last
* Accept any case for "Signed-off-by" in case author has typed it by
  hand
* Improve conditional - we can skip the other cases if one matches

Implements [YOCTO #7624].

(From OE-Core rev: 13ec296b5c35aefa2c44f64f8bd1ef54c4a0a731)

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-01 21:32:03 +00:00
Mike Crowe 804f5b83f3 image.py: avoid mkdir race when building multiple images
If multiple images are being built simultaneously against the same
sysroot then the call to os.makedirs in Image._write_wic_env can fail
with:

File: '.../meta/lib/oe/image.py', lineno: 341, function: _write_wic_env
     0337:        """
     0338:        stdir = self.d.getVar('STAGING_DIR_TARGET', True)
     0339:        outdir = os.path.join(stdir, 'imgdata')
     0340:        if not os.path.exists(outdir):
 *** 0341:            os.makedirs(outdir)
     0342:        basename = self.d.getVar('IMAGE_BASENAME', True)
     0343:        with open(os.path.join(outdir, basename) + '.env', 'w') as envf:
     0344:            for var in self.d.getVar('WICVARS', True).split():
     0345:                value = self.d.getVar(var, True)
File: '/usr/lib/python2.7/os.py', lineno: 157, function: makedirs
     0153:            if e.errno != errno.EEXIST:
     0154:                raise
     0155:        if tail == curdir:           # xxx/newdir/. exists if xxx/newdir exists
     0156:            return
 *** 0157:    mkdir(name, mode)
     0158:
     0159:def removedirs(name):
     0160:    """removedirs(path)
     0161:
Exception: OSError: [Errno 17] File exists: '.../tmp-glibc/sysroots/cheetah/imgdata'

Using bb.utils.mkdirhier() protects against this.

There's also little point in checking to see if the directory already
exists - we might as well just try and create it regardless.

Once the directory has been created, there's no race on the actual file
since the filename contains IMAGE_BASENAME.

(From OE-Core rev: e3f216eef1b7a8ecfd00317e60704cff472238ba)

Signed-off-by: Mike Crowe <mac@mcrowe.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:03 +00:00
Martin Jansa 312862f12a package_manager.py: define info_dir and status_file when OPKGLIBDIR isn't the default
* without this the do_rootfs task doesn't respect OPKGLIBDIR and
  info, status are created in different directory than opkg on
  target expects
* people who modify OPKGLIBDIR need to make sure that opkg.conf included
  in opkg package also sets info_dir and status_file options

(From OE-Core rev: 11f1956cf5d732cfed6d28c8c292b5053966895c)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:02 +00:00
Mike Crowe b00f73429a image.py: Avoid creating empty .env file in _write_wic_env
Creating a file for every image containing a few variables isn't
necessary if wic is not being used, so don't write the file if WICVARS
is empty.

(From OE-Core rev: d40779a7d3ce4f326c29ec7971731cab1f505a37)

Signed-off-by: Mike Crowe <mac@mcrowe.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:02 +00:00
Dariusz Pelowski a88505b450 lib/oe/terminal: use C locale when determining version
(From OE-Core rev: 5e5bf4f7e242494ed9c2cbc13bec7f21494db17c)

Signed-off-by: Dariusz Pelowski <dariusz.pelowski@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:02 +00:00
Paul Eggleton 2948169291 classes/populate_sdk_ext: tweak reporting of workspace exclusion
If you have a local workspace layer enabled when building the
extensible SDK, we explicitly exclude that from the SDK (mostly because
the SDK has its own for the user to use). Adjust the message we print
notifying the user of this so it's clear that we're excluding it from
the SDK, and scale it back from a warning to a note printed with
bb.plain().

(From OE-Core rev: 90f46f74a088a7b965d2205eceb9eff6f276dd38)

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-01 21:32:00 +00:00
Leonardo Sandoval e864f71f4c terminal: Open a new window instead of split on older tmux versions (<1.9)
If an old version is detected (<1.9), create a new window instead of split:
the reason is that there is no easy way to get the active pane height if no
nested formats are supported.

(From OE-Core rev: 457bd6297ae99627c5f596c3c09086d787d5a5ab)

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-11-25 08:08:08 +00:00
Mariano Lopez 49a465cd23 package_manager.py: Delete installed_pkgs.txt file
This change removes the file installed_pkgs.txt after it
was used for installation of complementary packages. This
file was causing confusion when left in the WORKDIR after
the build.

(From OE-Core rev: d0f3f3a294d509560bd12b93b26eeec65cfee314)

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>
2015-11-24 15:55:42 +00:00
Mariano Lopez ace895d162 rootfs.py: Stop using installed_pkgs.txt
The method _uninstall_unneeded uses the file installed_pkgs.txt,
this file is left after the build and can cause confusion. This
changes allow to get the installed packages using functions of
rootfs instead of the installed_pkgs.txt file. With this change
now is possible to remove the file without breaking anything.

[YOCTO #8444]

(From OE-Core rev: bf935ac16f6175673417dda92a619946b52fac87)

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>
2015-11-24 15:55:42 +00:00
Ross Burton ccb1616e54 lib/oe/distro_check: don't set empty proxy keys
If the proxies dictionary has a proxy set to None urllib will throw an exception
instead of not using a proxy (abridged stack):

File: '/home/ross/Yocto/poky/meta/lib/oe/distro_check.py', lineno: 43, function: get_links_from_url
 *** 0043:    with create_socket(url,d) as sock:
     0044:        webpage = sock.read()
File: '/home/ross/Yocto/poky/meta/lib/oe/distro_check.py', lineno: 5, function: create_socket
     0003:def create_socket(url, d):
     0004:    import urllib
 *** 0005:    socket = urllib.urlopen(url, proxies=get_proxies(d))
File: '/usr/lib/python2.7/urllib.py', lineno: 87, function: urlopen
     0086:    if data is None:
 *** 0087:        return opener.open(url)
File: '/usr/lib/python2.7/urllib.py', lineno: 203, function: open
     0201:        else:
     0202:            proxy = None
 *** 0203:        name = 'open_' + urltype
     0204:        self.type = urltype
     0205:        name = name.replace('-', '_')
Exception: TypeError: cannot concatenate 'str' and 'NoneType' objects

Filter out unset values so that the dictionary only has valid assignments in.

(From OE-Core rev: 2d91290ab5608dd1297d1c26ab807fc4574a8a6b)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-24 15:55:41 +00:00
Richard Purdie 8137a846fb lib/oe/copy_buildsystem: Don't expand BB_TASKDEPDATA
The value isn't a string so don't try and expand it.

(From OE-Core rev: ab87d3649c39326938d82d623efafb76905f770d)

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>
2015-11-24 15:55:41 +00:00
Richard Purdie fecb07755c classes: Ensure pass setVar/setVarFlag strings, not integers
This doesn't cause any issues right now but it make sense to standardise
on consistently using strings in the data store.

(From OE-Core rev: 99203fbe5ad470ef65cff93cec9d7f332883b5ee)

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>
2015-11-24 15:50:26 +00:00
Ross Burton d18d902fae lib/oe/rootfs: tell intercepts where the native sysroot is
Some intercepts may want to access files in the native sysroot that are not on
$PATH (such as something in $libexecdir) but any use of STAGING_DIR_NATIVE in
the postinst that calls the intercept will be "baked" into the package, so if
sstate is reused it will use paths that may not exist.

Solve this by exporting the location of the native sysroot in the environment so
the postinst and intercept can use an environment variable instead of a bitbake
variable.

(From OE-Core rev: 646599a1f3d39238ba8009993750a46ae220e762)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:30 +00:00
Ed Bartosh 8a555fe74a rootfs.py: add more info to the warning message
Since the log_check_regex can potentially be false positive it
makes sense to print the whole line where error is found.
This way user will be able to see the error and understand
if it's valid or not.

[YOCTO: #7789]

(From OE-Core rev: f9cf31525fc885e1a0f65bd55654631257f87078)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:25 +00:00
Markus Lehtonen 579e2547b8 package_manager: fail if signed feeds are enabled for ipk or dpkg
Signed package feeds are not yet implemented for these package formats.

(From OE-Core rev: 49a5c8700deddac744ccfa033bebf7971f92e14b)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:25 +00:00
Markus Lehtonen dbb9af6b0b package_manager: support GPG_PATH variable
If defined, use GPG_PATH as the gpg home directory when signing package
feeds. This setting is only used by package_manager if package feed
singning has been enabled, i.e.  PACKAGE_FEED_SIGN="1".

(From OE-Core rev: 2c94853e4c8e92ac5fe4af7b25e2ce8853a4025b)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:24 +00:00
Benjamin Esquivel 409e6e02ff populate SDK: prepare calling of bb.utils for exceptions
bb.utils.remove, bb.utils.movefile and bb.utils.mkdirhier can throw
exceptions that need handling and proper error messages
more work is required for these methods to handle properly the
exceptions that can be raised within the various OS calls they make
but this is a start to at least not hide the errors in the requested
operations

[YOCTO#8213]

(From OE-Core rev: 2e81dbdce6f92908c4d4c980af032516581178de)

Signed-off-by: Benjamin Esquivel <benjamin.esquivel@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-21 22:56:03 +01:00
Paul Eggleton db55d31dc2 devtool: handle virtual providers
For modify / extract / upgrade, if the specified "recipe" is not
actually a recipe but a virtual target such as virtual/kernel, map it
correctly to the actual recipe and make sure we use that name within the
workspace. Thanks to Chris Larson for reminding me this was still broken
and for a hint on how to fix it.

(From OE-Core rev: 1f7752282ffb47d2621030ddb2fa42a5e491d6d2)

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-10-21 22:56:03 +01:00
Otavio Salvador 556c0ea92e lib/oe/image.py: Fix dependency handling for compressed types
The dependency code needs to also include the dependency of base
types. For example:

 - sdcard.gz image with ext4

The dependency chain needs to include:

 - sdcard
 - ext4
 - gz

Until this change, the ext4 dependency were not being taken into
account when using the compressed one.

(From OE-Core rev: 10e5df3503632a6e1c54612055b19f7258c3ae2f)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-14 18:08:37 +03:00
Leonardo Sandoval f385ed1a06 lib/oe/distro_check: Remove '_proxy' on dict values used by urllib.open
There are two ways to pass the proxies values into urllib.open: exporting
the environment variables *_proxy and passing as dictionary into the
urllib.open call. The latter is currenty used and values should not have
the '_proxy' string, so removing it. Also, ignore uppercase proxies, these
are not taken into account by the library.

Tested on a network with proxy, adding 'inherit +="distrodata"' on local.conf
with the following commands

    for distrotask in distrodataall distro_checkall checklicenseall; do
        bitbake universe -c $distrotask
    done

[YOCTO #7567]

(From OE-Core rev: 92fb327b08e4f9cfb2400610c2983afe579b3592)

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-10-12 14:36:30 +01:00
Mark Hatle a0d9d2d727 lib/oe/image.py: Add image generation for companion debug filesystem
The companion debug filesystem, enabled with IMAGE_GEN_DEBUGFS, was
creating the companion filesystem but was missing the code to actually
package it into a usable filesystem.

The code (and associated documentation) will allow the debugfs to generate a
companion tarball or other image.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-07 00:11:16 +01:00
Andre McCurdy 8ee9a933a5 package_manager.py: sort output of OpkgPkgsList().list
Without explicit sorting, the output generated by OpkgPkgsList().list
follows the order of packages in /var/lib/opkg/status, which appears
to be "random". Add sorting to make OpkgPkgsList().list behaviour
consistent with that of RpmPkgsList().list.

(From OE-Core rev: f06fb68a07b82e4b8f25d5cdf556cf8893ddf208)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-07 00:09:11 +01:00
Leonardo Sandoval 12cd705b28 distrodata: Take account proxies on distrodata tasks
Proxies defined in the enviroment where not taken into account
on the distrodata tasks. This commit implied passing the datastore
into the distro_check library and context manager for the
urllib.urlopen function.

One way to run distrodata tasks is using 'universe' as target and the
'all' distrodata task:

      $ bitbake universe -c distrodataall
      $ bitbake universe -c distro_checkall
      $ bitbake universe -c checklicenseall

Logs are located under TMPDIR/log

[YOCTO #7567]

(From OE-Core rev: 7d1c3470bb06e43245ccb7f067121de606506430)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 15:07:48 +01:00
Richard Purdie 2c196955a8 lib/oe/sstate: Add tasks_resolved handler for virtual/xxx mappings
In SIGGEN_EXCLUDERECIPES_ABISAFE and SIGGEN_EXCLUDE_SAFE_RECIPE_DEP
we really need to be able to use virtual/xxx namespaces but this
currently doesn't work.

To make this work, we need to translate them into the resolved
providers. After such a hook was added to bitbake, we can add
this translation here.

(From OE-Core rev: 0a6d0d040ab7f885b667a34f4ddcc775d135c07c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:35 +01:00
Richard Purdie c9ea0c619d lib/oe/package_manager: Handle empty package list in opkg case
If you build buildtools-tarball with opkg as the package manager, it
passes in an empty target packages list and fails.

This allows the code to cope with an empty package list (in sync
with the rpm backend).

(From OE-Core rev: b460afb12bb16a4b56d800c953c5f5c7da0bff84)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:35 +01:00
Markus Lehtonen 31c3078a63 oe.patch.GitApplyTree: add paths argument to extractPatches
Makes it possible to define which paths are included in the patches.

(From OE-Core rev: 640e57b423e5a8f0e4572eac985f87139780f247)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:31 +01:00
Markus Lehtonen d5e2dd47db recipeutils: implement get_recipe_local_files()
(From OE-Core rev: c94cf6e6e8a0645c822a708a432901dcb5ce5bf4)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:31 +01:00
Alex Franco 2bbec5645e Empty image:rootfs.py:handle empty PACKAGE_INSTALL
rootfs.py: added a test in DpkgOpkgRootfs which skips the
get package post installs step (get_pkgs_postinsts), when
PACKAGE_INSTALL is empty.

[YOCTO #7664]

(From OE-Core rev: 2d5fb43ec647e8445fc8e8a5caba771c0361a539)

Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-28 12:00:28 +01:00
Alexander Kanavin 5cc44fe4fd recipeutils.py: don't hardcode the upstream version as 1.0 when SRC_URI is empty or absent
Instead, simply return the version of the recipe, so that the upstream
version checker will declare that they match.

(From OE-Core rev: 10c948a67546dd4ed2ac00b5210ef4b3eeca9401)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-28 12:00:24 +01:00
Robert Yang eb7b1a58ce package_manager.py: make rpm install mutilib pkgs corectly
When configure multilib, "bitbake <image_bb> -c populate_sdk" should
install all arch toolchains (for example, 32 and 64bit), but rpm not
handle the multilib requires correctly, for example:
lib32-packagegroup-core-standalone-sdk-target requires lib32-libc6, rpm
may pull in libc6 rather than lib32-libc6, there are the similar issue
when:

IMAGE_INSTALL_append += "lib32-packagegroup-foo foo"

Use bitbake to expand the RDEPENDS will fix the problem since bitbake
knows mlprefix and handle it well, but rpm doesn't.

This patch only affects when:
IMAGE_INSTALL = "lib32-foo foo"
Doesn't affect:
IMAGE_INSTALL = "lib32-foo1 lib32-foo2"
Or:
IMAGE_INSTALL = "foo1 foo2"

[YOCTO #8089]

(From OE-Core rev: fc469e51475b5272b4047d4713eb99529193ac8a)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-28 12:00:15 +01:00
Paul Eggleton 99fc284545 devtool / lib/oe/recipeutils: ensure we can parse without bbappends
These functions ostensibly allowed parsing a recipe without bbappends
but this clearly hadn't been tested because a variable was unassigned in
both of them in that case.

(From OE-Core rev: d2bb9f08303bb120e811c03af2f5339e8f262cfa)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:15 +01:00
Paul Eggleton e0b9a96002 lib/oe/patch: fix for git am not cleaning up after itself
Unfortunately it appears that under certain circumstances, a failed
git am followed by git am --abort won't clean up any changes the patch
might have made - this was seen when running "devtool extract" on the
unzip recipe; unzip-6.0_overflow3.diff has a malformed date as far as
git am is concerned but it triggers this condition. Add a
git reset --hard HEAD followed by git clean -f in order to recover from
this scenario.

(From OE-Core rev: 21fdbd76f458b70a6646dd6d0749e3a465ebd320)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:13 +01:00
Paul Eggleton 374e1fed0e lib/oe/recipeutils: properly split unexpanded variable values
Variables such as SRC_URI which are space-separated may also contain
Python expressions (${@...}) which themselves contain spaces that
shouldn't be split when splitting the value into items. In order to
ensure this we need to use a custom splitting function instead of just
string.split().

This issue could be seen when doing "devtool modify sudo", adding a
commit to the resulting source repository then "devtool update-recipe" -
the Python expression in SRC_URI was being unnecessarily broken onto
multiple lines.

Fixes [YOCTO #8046].

(From OE-Core rev: bbec2ee98a08270c681189a6ba26beb1034d3e2f)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:11 +01:00
Patrick Williams 18845508a2 image.py: Ensure base image size is an integer
There is a floating point multiplication done of a base image size
and an "overhead factor", which is currently rounded up to the next
integer.  If the multiplication results in a whole number, the value
will still be a float.  When this float is used to generate a shell
script, a buggy script is generated.

Fix this by always forcing to an integer.

(From OE-Core rev: bf74a002b8fa18d94cec93f0341cbe74cc010ca7)

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-18 09:05:29 +01:00
Mike Looijmans 722aa22d15 image.py: Allow IMAGE_LINK_NAME to be empty
When IMAGE_LINK_NAME is empty, OE will try to create a "blank" link instead
of just skipping it. The code checks for "link_name is not None" which will
never evaluate to true. Change the test to a simple "if link_name:" so it
no longer attempt to create links when the variable is an empty string.

(From OE-Core rev: 7f03dd50de76f0b5c3a10c514e920615ffaa846c)

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-14 20:46:35 +01:00
Paul Eggleton 3a9e230b7a classes/sstate: break out function to get sstate manifest filename
It is useful in a few different contexts to see which files have been
written out by an sstate task; break out a function that lets us get the
path to the manifest file easily.

(From OE-Core rev: 090196dd2d8f4306b34b239e78c39d37cc86034c)

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-09-12 22:48:45 +01:00
Khem Raj 21fffdeea3 rootfs: Conditionally uninstall update-rc.d
update-rc.d is now needed by systemd to interact with sysv
scripts, so if we have a mixed system, then we can not uninstall
update-rc.d as it is going to break systemd functionality, we check for
sysvinit and sytemd in distro and also ensure that its not building an
image with readonly rootfs

(From OE-Core rev: 5dd5b8adc225d5c703d85fc0187ae65ff6067b58)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-11 23:28:36 +01:00
Richard Purdie 4cccac9af0 Revert "rootfs: Do not uninstall update-rc.d"
This reverts commit acf90b6c299afe9e9c8fa33c3c6992bfcf40fbbf.

(Reverted to apply the better v2 of the patch)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-11 23:28:35 +01:00
Martin Jansa 79bf3f7155 rootfs.py: show intercept script output in log.do_rootfs
* without this the output wasn't shown anywhere even when the bb.warn
  says:
  "See log for details!"

(From OE-Core rev: a3c322b42c7a14584a80e04519c34689ec813210)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:46 +01:00
Robert Yang 525979f3f6 package_manager.py: search provides when not found by pkgname
Fixed when:
PACKAGE_CLASSES = "package_rpm"
IMAGE_INSTALL_append = " perl-module-warnings-register"

$ bitbake core-image-minimal
[snip]
ERROR: perl-module-warnings-register not found in the base feeds
[snip]

And it works well when PACKAGE_CLASSES = "package_ipk" since perl
provides perl-module-warnings-register, the "smart install
perl-module-warnings-register" also works well, this was because
_search_pkg_name_in_feeds() only searched pkg name, but no provides,
this patch fixes the problem.

(From OE-Core rev: 476f9ab6e37bd516919862835e6e00c960a9e242)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:45 +01:00
Khem Raj a0590d1ada rootfs: Do not uninstall update-rc.d
update-rc.d is now needed by systemd to interact with sysv
scripts, so if we have a mixed system, then we can not uninstall
update-rc.d as it is going to break systemd functionality

(From OE-Core rev: acf90b6c299afe9e9c8fa33c3c6992bfcf40fbbf)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:45 +01:00
Qi.Chen@windriver.com d7efdfeb5b copy_buildsystem: make sure bitbake directory is copied
The previous code assumes that bitbake/ directory is under the core layer.
This is the case for Yocto project. But users might clone oe-core and bitbake
separately. So we use bb.__file__ to locate the bitbake directory to make sure
it's copied into the extensible SDK.

(From OE-Core rev: 1be1db87343a48e9c25297245a2749d9df25d23c)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:41 +01:00
Martin Jansa ae00b59200 rootfs.py: Allow to override postinst-intercepts location
* useful when we need to overlay/extend intercept scripts from oe-core

(From OE-Core rev: 7d08d2d5c0ae686e3bb8732ea82f30fd189b1cd8)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:38 +01:00
Leonardo Sandoval 338c3257f6 lib/oe/package_manager: Include PACKAGE_FEED_PREFIX instead of hardcode paths
Instead of hardcode paths (/rpm/, /ipk/, /deb/), use a user-defined prefix
when creating the URI feeds. URIs now will have the following syntax:

    PACKAGE_FEED_URIS_1/PACKAGE_FEED_PREFIX
    PACKAGE_FEED_URIS_2/PACKAGE_FEED_PREFIX
    .

where PACKAGE_FEED_URIS = "PACKAGE_FEED_URIS_1 PACKAGE_FEED_URIS_2 ...."

[YOCTO #5407]

(From OE-Core rev: 467b823b163653a6fa8d46734174004abdb48cf9)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-04 16:23:49 +01:00
Jian Liu 1362986886 sdk.py: fix conflicts of packages
If packages are conveyed to smart to install at the same time,
conflicts will not happen.
Try to install packages into sdk image at the same time.

This patch is not so perfect. For example,
  IMAGE_INSTALL += "lib32-ncurses"
  IMAGE_INSTALL += "ncurses-dev"
 ncurses-dev and lib32-ncurses-dev will have conflicts during packages installation.

(From OE-Core rev: f2b64f725803ad8be7c2876c531e057a4fe5ca7c)

Signed-off-by: Jian Liu <jian.liu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-04 16:23:48 +01:00
Ed Bartosh a3fec07654 image.py: rename _write_env -> _write_wic_env
Renamed this function as it's too generic name for it.
It writes variables, which are used by wic to .env file,
so _write_wic_env is better name for it.

Thanks Christopher Larson for poining out to this.

(From OE-Core rev: f8c7542164ebbe29613532c93ddc34c94238453c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:31 +01:00
Markus Lehtonen 59c7c7bfcb package_manager: support for signed RPM package feeds
This change makes it possible to create GPG signed RPM package feeds -
i.e. package feed with GPG signed metadata (repodata). All deployed RPM
repositories will be signed and the GPG public key is copied to the rpm
deployment directory.

In order to enable the new feature one needs to define four variables in
bitbake configuration.
1. 'PACKAGE_FEED_SIGN = "1"' enabling the feature
2. 'PACKAGE_FEED_GPG_NAME = "<key_id>"' defining the GPG key to use for
   signing
3. 'PACKAGE_FEED_GPG_PASSPHRASE_FILE = "<path_to_file>"' pointing to a
   file containing the passphrase for the secret signing key
4. 'PACKAGE_FEED_GPG_PUBKEY = "<path_to_pubkey>"' pointing to the
   corresponding public key (in "armor" format)
The user may define "GPG_BIN" in the bitbake configuration in order to
specify a specific the gpg binary/wrapper to use for signing.

[YOCTO #8134]

(From OE-Core rev: a576eea1eb5ed54e2f72d5f7c3e5d6a723382485)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:20 +01:00
Markus Lehtonen 752736ae9f package_rpm: support signing of rpm packages
This patch adds a new bbclass for generating rpm packages that are
signed with a user defined key. The packages are signed as part of the
"package_write_rpm" task.

In order to enable the feature you need to
1. 'INHERIT += " sign_rpm"' in bitbake config (e.g. local or
   distro)
2. Create a file that contains the passphrase to your gpg secret key
3. 'RPM_GPG_PASSPHRASE_FILE = "<path_to_file>" in bitbake config,
   pointing to the passphrase file created in 2.
4. Define GPG key name to use by either defining
   'RPM_GPG_NAME = "<key_id>" in bitbake config OR by defining
   %_gpg_name <key_id> in your ~/.oerpmmacros file
5. 'RPM_GPG_PUBKEY = "<path_to_pubkey>" in bitbake config pointing to
   the public key (in "armor" format)

The user may optionally define "GPG_BIN" variable in the bitbake
configuration in order to specify a specific gpg binary/wrapper to use.

The sign_rpm.bbclass implements a simple scenario of locally signing the
packages. It could be replaced by a more advanced class that would
utilize a separate signing server for signing the packages, for example.

[YOCTO #8134]

(From OE-Core rev: 75f5f11b19ba1bf8743caf9ee7c99a3c67f4b266)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:19 +01:00
Alejandro del Castillo d6b1171131 opkg: upgrade to v0.3.0
Changes required:
- Rename opkg-cl to opkg
- Add libarchive dependency
- Drop backport patches
- Drop obsolete directory options
- Add patch to handle empty index files

Based on initial work by Paul Barker.

(From OE-Core rev: 1dd2a9ea54f5a5497e23814f144f35ff15430d71)

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
CC: Paul Barker <paul@paulbarker.me.uk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:14 +01:00
Ed Bartosh 7770281354 image.py: write bitbake variables to .env file
Write set of bitbake variables used by wic into
build/tmp/sysroots/<machine>/imagedata/<image>.env

List of variables is defined in WICVARS variable in
meta/classes/image_types.bbclass.

This is needed for wic to be able to get bitbake variables without
running 'bitbake -e'.

(From OE-Core rev: 861ce6c5d4836df1a783be3b01d2de56117c9863)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 23:26:24 +01:00
Ed Bartosh 9badc1c640 image.py: add script output to the rootfs log
Let's add output of image creation script to the bitbake log
as it can contain useful information.

One good example of such an information is wic report about
artifacts and .wks file used for image creation.

(From OE-Core rev: fd6eba587e39142134aeb9044393c08a3f79d28c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 12:36:09 +01:00
Ed Bartosh 5bcc423953 image.py: set bitbake variable ROOTFS_SIZE
This variable is going to be used by wic to set partition
size. Setting it in image.py makes it possible for wic to
use it without calculating it again.

(From OE-Core rev: af37bb8ae71c4f932e2126bb620b3fb2b11cc466)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 12:36:09 +01:00
Paul Eggleton 9253e927d7 lib/oe/patch: handle patches that delete files with older git
When running "git add" on a directory with older git versions, deleted
files aren't added to what is to be committed unless you explicitly
specify the -A option. The result of this is that when applying a patch
from a recipe which doesn't apply with "git am" (and we fall back to
applying the patch through other means then "git add" following by
a "git commit") these deletes weren't committed with the patch, leaving
them sitting deleted but not committed at the end.

This should fix test_devtool_modify_native (which unwittingly exercises
this scenario by attempting to run "devtool modify" on apt-native) on
machines with older git versions.

(From OE-Core rev: 367ffba394bb815d776f48a367d5d7e5ea9b3bba)

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:02 +01:00
Alex Franco 9b6bf6a41f Empty image: package list splitting and iteration
A few short fixes to splitting/iteration done over package lists
in license.bbclass, package_manager.py and rootfs.py.

[YOCTO #7664]

(From OE-Core rev: a902e98c5938f52ec960e0518e0ceaf8f5ee610c)

Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-29 13:38:05 +01:00
Paul Eggleton 0f23a3af8e lib/oe/recipeutils: avoid parsing in get_var_files()
Let's have the caller do this and then the function is a bit more
flexible (e.g. we can choose to parse with bbappends or not); fix up
calls to this function appropriately (of which there are only two, both
within devtool).

(From OE-Core rev: 6ba969f1ac5a1a0e277a21287fc5ae1622a6b14e)

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-19 18:05:40 +01:00
Juro Bystricky 407d156245 IMAGES_FSTYPES: default to EXT4
The following IMAGES_FSTYPES defaulted to ext3:
"vmdk", "vdi", "qcow2", "live", "iso", "hddimg"

This patch changes the default for those IMAGES_FSTYPES to
ext4 in order to bring the images more in line with other BSPs.

Besides improvements in performance and reliability ext4 provides
additional functionality as well (option to turn off the journaling,
dynamic resizing of VDI volumes etc.).

(From OE-Core rev: 2b56d671d2f0ef22786c97e29e1215eb80c94490)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-16 22:40:51 +01:00
Joshua Lock c8b7f09f20 lib/oe/package_manager: fix opkg feed generation
The insert_feed_uris() method of OpkgPM was creating an initial
entry in the feeds list which pointed to the root of the ipk
directory, however the on-device package manager can't consume
this feed resulting in runtime errors - therefore we remove the
code to generate that initial feed uri.

(From OE-Core rev: 18e5dcfc610a255e490e4425f11213b8e14c6e00)

Signed-off-by: Joshua Lock <joshua.lock@collabora.co.uk>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-14 08:30:33 +01:00
Alexander Kanavin 309982f60a recipeutils.py: allow all characters in regexes used to parse version strings
Previously only numeric characters were matches and anything else was
discarded, so 4.0-rc3, 2005e, 1.0.2a and similar versions got truncated.

(From OE-Core rev: ab609c471d85be3248b789c8ab2813957cd97e29)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-10 12:40:32 -07:00
Robert Yang aaf1033ad8 rootfs.py: fix PRE/POSTPROCESS_COMMANDS for rpm and deb
The rpm didn't run RPM_PREPROCESS_COMMANDS or RPM_POSTPROCESS_COMMANDS,
the similar to deb, this patch fix the problem.

And fix a typo:
DEB_POSTPROCESS_COMMAND -> DEB_POSTPROCESS_COMMANDS

(From OE-Core rev: aadfac366bd2cae37357e15bf4fc28c159d71b32)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 22:24:19 +01:00
Richard Purdie 7f654dc513 lib/oe/classextend: Fix nativesdk double name mapping
Handle the case a name has already been extended in the nativesdk case
(avoids double name extensions which can happen with nativesdk-gcc).

(From OE-Core rev: 608ceb14ebc144102a0f9c2d449d9cb54b8f77b9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-31 10:32:36 +01:00
Aníbal Limón 6deffe1258 recipeutils.py: get_recipe_pv_without_srcpv remove prefixes from pv
Some recipes uses v or r prefixes in versions that makes wrong
comparisions over recipes like lz4 r123 > 128.

(From OE-Core rev: f7d250c97f40a737df9020180852d2ee87ca06b3)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-23 08:48:37 +01:00
Aníbal Limón 74240ccbfa oe/recipeutils.py: get_recipe_upstream_info update to get revision
Bitbake fetcher latest_versionstring now returns a tuple with (version,
 revision) that helps SCM's like git to build current upstream version.

[YOCTO #7605]

(From OE-Core rev: 7ede979950fd265026c74526d8448627fd0a8c08)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-23 08:48:37 +01:00
Aníbal Limón e28c1eb708 oe/recipeutils.py: get_recipe_upstream_info only use sfx and pfx when exits
Don't use pfx and sfx when not exist because cause formatting errors
like 2.9HASH instead of 2.9+gitAUTOINC+HASH.

(From OE-Core rev: 382833cc7e7603241838e18e429f69da0c2ee4ac)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-23 08:48:37 +01:00
Richard Purdie fbec9200fd lib/oe/package_manager: Use log-level warning instead of quiet
quiet means that no warnings are shown on the console and really is too
quiet for our needs. This is more verbose but that is better than too
little and does aid debugging things when they go wrong.

(From OE-Core rev: 9de391260e4491a4852410adf1009a1fa0c72a5c)

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>
2015-07-20 10:40:41 +01:00
Paul Eggleton 723411dd92 lib/oe/recipeutils: fix replace_dir_vars to return the correct variables
If we sort by length of name here we get the variables we are interested
in first. I've tested this with all of the variables we care about (the
ones at the top of bitbake.conf) and it returns the right results.

This fixes the failures we've been seeing in the oe-selftest
test_recipetool_appendfile_* tests.

(From OE-Core rev: 95c54512c9fcdbaa419891e46fd99102722ba3d8)

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-07-16 15:09:25 +01:00
Aníbal Limón 75c877b3cc oe/recipeutils.py: get_recipe_upstream_version returns 1.0 when not SRC_URI
Recipes that don't have SRC_URI means that don't use upstream sources
so returns 1.0.

(From OE-Core rev: 92f2481cf88e7b626cfe604134c9d020d06bd32c)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-12 22:55:45 +01:00
Richard Purdie b60521c9b3 lib/oe/recipeutils: Ensure order of data store doesn't influence the result
The order of the keys from the data store is not prescribed. If
target_datadir comes before datadir the selftests fail since the 'wrong'
variable is used for substitutions. This highlights an issue with the
replace_dir_vars() function. Fix this.

(From OE-Core rev: d47c496aa058f5b18d03a68bcd79e5c8607de34f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-12 22:55:38 +01:00
Saul Wold 38d8f2eb9f rootfs.py: Add check for kernel modules before running depmod
Add a check for kernel modules so we don't un-necessarily run the depmods, this
will also handle the case with linux-dummy does not place the kernel-abiversion
since it also does not have kernel modules.

[YOCTO #7884]

(From OE-Core rev: 1b696a45ddb00fbe1d993b19339071486d0cfef2)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:39 +01:00
Christopher Larson 83a6611248 oe.recipeutils: fix line.split error in bbappend_recipe
Cc: Paul Eggleton <paul.eggleton@linux.intel.com>
(From OE-Core rev: 8d18c2e71b0fcb047831a67d93f4b489aff1b77d)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27 22:42:55 +01:00
Aníbal Limón b2c9e7347a oe/rootfs.py: DpkgRootfs/OpkgRootfs add support for dependency handling in postinsts scripts.
The old code don't take into account package dependencies causing
undefined execution order in postinsts scripts, in order to fix:

Add DpkgOpkgRootfs class for store common operations in DpkgRootfs
and OpkgRootfs.

Add _get_delayed_postinsts_common method that process Depends from
status file in dpkg/opkg and resolve dependency order causing an
execption if found circular dependencies.

[YOCTO #5318]

(From OE-Core rev: ed52d1040ee8be0bfa080d5679c583b1012bb575)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27 22:42:52 +01:00
Leonardo Sandoval a8ae7317e2 terminal.py: Allow devshell/menuconfig on recent gnome-terminal
Recent versions of gnome-terminal does not support non-UTF8 charset:
https://bugzilla.gnome.org/show_bug.cgi?id=732127 as a result, devshell and
menuconfig tasks silently hang  (error found on trace log of 'strace -f -v
-s 8192 -e write=2 bitbake -c devshell quilt-native': "Non UTF-8 locale
(ANSI_X3.4-1968) is not supported!"). As a workaround, clearing the LC_ALL
environment variable so it uses the locale. Once fixed on the gnome-terminal
project, this should be removed.

Tested on gnome-terminal versions:

       GNOME Terminal 3.4.1.1
       GNOME Terminal 3.14.2 (Default on Ubuntu 15.04)

[YOCTO #7791]

(From OE-Core rev: ec79684a1eb594099d342a416ba3f5ad0b342a53)

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-06-27 22:42:51 +01:00
Richard Purdie d85231ef14 lib/oe/patch: Fix git patch application for source in subdirectory
Similarly to:
http://git.yoctoproject.org/cgit.cgi/poky/commit/meta/lib/oe/patch.py?id=f205ccaf48ac36f4b26efc4aeb2e9d2939b28646
we need to fix patch application for source which is in a subdirectory.

Passing "." as the git directory or work-dir appears to work (or is ignored)
in some versions of git but does not work in others, probably quite correctly.

Since we have reporoot from the above patch, pass this in directly.

This bug caused this sanity test failure on some machines:

FAIL: test_devtool_modify_git (oeqa.selftest.devtool.DevtoolTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/devtool.py", line 390, in test_devtool_modify_git
    self.assertEqual(result.output.strip(), "", 'Created git repo is not clean')
AssertionError: '?? util/mkelfImage/patches/' != '' : Created git repo is not clean

since git apply would fail, it would then fall back to quilt
and the git tree would be left unclean.

[YOCTO #7911]

(From OE-Core rev: 91d76e632336d6af96f24bcf92be25f41a216856)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-26 09:27:30 +01:00
Aníbal Limón 615b351bf4 oe/utils.py: Add support for init/end helper functions in ThreadWorker.
Add init/end helper functions for ThreadWorker also pass ThreadWorker
as first argument to init/end/func functions this enables per-thread
storage handling.

classes/sstate.bbclass: Add thread_worker argument to checkstatus
function.

(From OE-Core rev: 08c50d62b520c8405f034e3d7adeea89e06226ee)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-26 09:27:30 +01:00
Aníbal Limón 3fa32158c4 oe/utils.py: Fix thread leakage in ThreadPool
In order to fix Thread leakage caused by not call join() in Threads,

Pass num_tasks in ThreadPool for add all the tasks into a Queue this
enable catch of Queue.Empty exception and exit the threads.

classes/sstate.bbclass: Change checkstatus function to match new
ThreadPool operation.

(From OE-Core rev: 524d92ed7b53bef933527095e82f378b934f25ef)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-26 09:27:30 +01:00
Richard Purdie 86d30d756a meta: Add explict getVar param for (non) expansion
Rather than just use d.getVar(X), use the more explict d.getVar(X, False)
since at some point in the future, having the default of expansion would
be nice. This is the first step towards that.

This patch was mostly made using the command:

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

(From OE-Core rev: ab7c1d239b122c8e549e8112c88fd46c9e2b061b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23 11:57:25 +01:00
Juro Bystricky a13c51e751 image: Support for VDI
Added support for VirtualBox VDI format. The support was
implemented by merging with the already existing VMDK support
for VM player by creating a new class image-vm.bbclass.
This class replaces the previous VMDK only image-vmdk.class.

(From OE-Core rev: 0a3e8eb9f592c3f1edd2c7521855f7406541651a)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-11 23:59:13 +01:00
Paul Eggleton 0090170e77 lib/oe/rootfs: tidy up log warning reporting
* bb.warn() should only be called once per warning - UIs such as Toaster
  assume that this is the case, so adjust the output accordingly. (It's
  tricky here because we have to include "log_check" on every line or
  we'll end up looping forever as the log checking code's own messages
  retrigger the log check, sigh...)
* Iterating over a file already splits by line, there's no need to do it
  manually.

(From OE-Core rev: 8dfdd329f0137cab8cab97e1d0c1181810fe5b32)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-11 23:59:09 +01:00
Aníbal Limón a8c746743e recipeutils: Improve get_recipe_pv_without_srcpv function
Use pv instead of rd this make the function more generic and
avoid copy recipe data.

(From OE-Core rev: c1c3c9a4fbaf01a905f79b0970f98ccb221a3935)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-08 17:34:05 +01:00
Aníbal Limón 8c6bd8a843 recipeutils: Add get_recipe_upstream_version and get_recipe_pv_without_srcpv functions
The get_recipe_upstream_version functions tries to get the current
version of recipe in upstream it uses bb.fetch2 latest_versionstring
method also latest_revision when is SCM.

The get_recipe_pv_without_srcpv discards the SRCPV in SCM's recipe like
git it returns a tuple with the version, prefix and suffix of a PV.

(From OE-Core rev: d1683b5bb584e2b09bda76bf8523b12636d91d73)

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>
2015-06-03 16:38:45 +01:00
Richard Purdie 5331bbc1ac oe/utils: Add simple threaded pool implementation
Python 2.7 doesn't have a threaded pool implementation, just a multiprocessing
one. We have need of a threaded implementation so add some simple class code
to support this.

(From OE-Core rev: 44ae778fefca5112900b870be7a485360c50bc2e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-03 16:38:45 +01:00
Mark Hatle 7a7c6b021f image.bbclass: Add a method for creating a companion debug filesystem
The companion debug filesystem contains only the package database and the
complementary *-dbg packages for the main filesystem component.  This is
useful in a production environment to produce a companion filesystem capable
of remote system debugging, without requiring corresponding debug symbols or
source code on the device.

(From OE-Core rev: 1a6ed48c65f922c66b005aa966d7ee4878ee95e3)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>

If dbg pkgs have already been installed to the rootfs image,
the installation to companion debug filesystem will fail,
because both of image creation make use of the same pm
database.

In this situation, try to copy installed dbg files from rootfs
image to companion debug filesystem.

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Acked-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-24 07:19:21 +01:00
Ross Burton a60aeca3f5 utils: add helper to perform the intersection of two string lists
Useful for e.g. generating a COMBINED_FEATURES list from DISTRO_FEATURES and
MACHINE_FEATURES.

(From OE-Core rev: c5b6f672b88f5f42fe0bd59d28104b8dc9ee9a6e)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-24 07:19:19 +01:00
Peter Seebach 65c0027940 rootfs.py: Make set -x not break rootfs creation
The rootfs logfile check errors out if it finds an "exit 1" in
a log. But consider the shell idiom:
	if ! $command; then exit 1; fi
and consider a postinstall script with a "set -x" for debugging
purposes (to get log output in /var/log/postinstall.log.)

Solution: Ignore lines prefixed with a +, because those show shell
code even if a specific fragment won't be executed.

(From OE-Core rev: f23f129dba66144abf8fe8450320e01fa4c02f5c)

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-24 07:19:18 +01:00
Ed Bartosh a0cbb5ba31 rootfs.py: Improve rpm log_check_regex
Current regex can cause false negatives if paths in bitbake log files
contain "ERR" or "Fail". do_rootfs fails with return code 1 in
this case.

Improved regexp is based on error messages produced by rpm.
Those are found by analyzing rpm source code.

[YOCTO #7789]

(From OE-Core rev: 38871dc0295fb2516e1c8b1dc9948c2d2fc4d2cd)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-22 13:29:47 +01:00
Paul Eggleton fbfc06a969 recipetool: add appendfile subcommand
Locating which recipe provides a file in an image that you want to
modify and then figuring out how to bbappend the recipe in order to
replace it can be a tedious process. Thus, add a new appendfile
subcommand to recipetool, providing the ability to create a bbappend
file to add/replace any file in the target system. Without the -r
option, it will search for the recipe packaging the specified file
(using pkgdata from previously built recipes). The bbappend will be
created at the appropriate path within the specified layer directory
(which may or may not be in your bblayers.conf) or if one already exists
it will be updated appropriately.

Fairly extensive oe-selftest tests are also provided.

Implements [YOCTO #6447].

(From OE-Core rev: dd2aa93b3c13d2c6464ef0fda59620c7dba450bb)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-20 21:41:04 +01:00
Paul Eggleton 2298b4a03e lib/oe/patch: use with open() for all file operations
with open(...)... is preferred for reading/writing files as it is neater
and takes care of closing the file for you.

(From OE-Core rev: 99ac382d84667eb496dc510d3277b8c55b237738)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-20 21:41:04 +01:00
Paul Eggleton 5796fe4591 lib/oe/recipeutils: add a parse_recipe_simple() function
Add a function that simply parses a recipe by name and optionally the
bbappends that apply to it. (Note that if you're using tinfoil you need
to have initialised it with config_only=False so that it can map the
recipe name to a recipe file.)

(From OE-Core rev: a8f221f6c6c0562a5ed06438231c2906e542fb7b)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-16 22:31:51 +01:00
Aníbal Limón b394cd4c7e license: Add support for handle INCOMPATIBLE_LICENSE in manifest creation
When INCOMPATIBLE_LICENSE's is specified it need to be removed from
license.manifest and also avoid copy to target image.

Add ManifestVisitor that walk the license string searching for
INCOMPATIBLE_LICENSE's if found remove it.

[YOCTO #6765]

(From OE-Core rev: d1278570041029d7c9fc6ce657e9a1701a421841)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-09 22:28:14 +01:00
Aníbal Limón bb3469f9d3 license: Split visit_string in LicenseVisitor
Create get_elements and visit_elements in LicenseVisitor based
on visit_string this allow to do modifications on elements before
parsing with AST.

(From OE-Core rev: c16cf0a0331d128e4ba7341fe28510a9bfb7ee16)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-09 22:28:14 +01:00
Aníbal Limón 8c7082de0a license_class: Generalize license_ok function
Add dont_want_licenses as parameter to license_ok function and move it
to oe.license module in order to use in other modules.

(From OE-Core rev: 243fe3a4583a21ad6c0b2a26196ed18d41740f7a)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-09 22:28:14 +01:00
Ed Bartosh 74dc93651f split_and_strip_files: regroup hardlinks to make build deterministic
Reverted 7c0fd561bad0250a00cef63e3d787573112a59cf

Created separate group of hardlinks for the files inside
the same package. This should prevent stripped files to be
populated outside of package directories.

This turns out not to be straightforward and has overlap with the
other hardlink handling code in this area. The code is condensed
into a more concise and documented form.

[Original patch from Ed with tweaks from RP]

[YOCTO #7586]

(From OE-Core rev: 82d00f7254b7d3bb6a167d675d798134884d1b19)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-29 10:58:55 +01:00
Richard Purdie 9eb4222e36 lib/oe/package: Improve strip subprocess handling
Currently if the strip process fails, we get a message but don't know why. This adds
code to show the return value and any error output.

(From OE-Core rev: 85e8fb1c7a3baac5633ecdfb36113aec7f4235cb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-29 10:58:55 +01:00
Paul Eggleton f1f9fab266 devtool: handle . in recipe name
Names such as glib-2.0 are valid (and used) recipe names, so we need to
support them.

Fixes [YOCTO #7643].

(From OE-Core rev: b9fd8d4d4dfae72de2e81e9b14de072e12cecdcf)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-27 15:05:52 +01:00
Markus Lehtonen ca1f4d7279 devtool: include bbappends in recipe parsing
In order to get correct metadata, SRCREV for example.

Fixes [YOCTO #7648].

(From OE-Core rev: 8b1794559dd7fd956716179d628e61cffdce1686)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-27 15:05:52 +01:00
Paul Eggleton d92970f7c1 lib/oe/package_manager: avoid traceback with no packages
If you were using deb packaging, had buildhistory enabled and produced
an SDK that contained no packages in one of the sysroots (such as with
uninative-tarball) then the do_populate_sdk was failing with a python
traceback because there were no fields to split in the output line.

(From OE-Core rev: a0eb3ebbc82133ad239a752a4a85d154be31a311)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-19 13:34:43 +01:00
Jean-Benoit MARTIN eb6d324d60 package_manager: RpmPM: Fix scriptlet for rpm 4
Path of rpm post install script is different between rpm 4 and 5

(From OE-Core rev: a880669f767532ce3c39eb160fa9deb9fce29677)

Signed-off-by: Jean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-13 22:33:22 +01:00
Christopher Larson 5ef9f03858 oe.sstatesig: align swspec handling with sstate.bbclass
The logic tries to remove the -native suffix from pn to handle this (though it
doesn't succeed, as it doesn't assign the new pn to the variable), but we need
to do more for the swspec tasks than just not set the extrapath, we also need
to change from SSTATE_PKGSPEC to SSTATE_SWSPEC. Alter to correct the spec for
these cases, and also add preconfigure to align with the current logic in
sstate.bbclass, which includes that task as well in the list of tasks to
adjust to use swspec.

[YOCTO #7563]

(From OE-Core rev: c9105597763be4bf5bc0ec97cc999566d0f10678)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-08 10:53:16 +01:00
Jun Zhu dd90ccfa82 meta/lib/oe/utils.py: Corrected the return value of both_contain()
oe.utils.both_contain() should return the result as "checkvalue" or "",
but the latest implement returns as "set(['checkvalue'])" or "";

It causes that bitbake.conf generates the wrong result of COMBINED_FEATURES,
which contains the common components in both DISTRO_FEATURE and MACHINE_FEATURES.

For example, build in Dizzy branch, COMBINED_FEATURES is "alsa usbhost ...",
but recently, COMBINED_FEATURES is like "set(['alsa']) set(['usbhost']) ...".

(From OE-Core rev: c4ca9dbd4191fcff08e75035e3d276490ed80b05)

Signed-off-by: Jun Zhu <R01007@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-08 10:53:15 +01:00
Ed Bartosh b544b4b236 package_manager: call createrepo with --dbpath pointing inside WORKDIR
Rpm database in staging area is used only by createrepo.
createrepo fails with the error
"rpmdb: BDB0060 PANIC: fatal region error detected"
if rpm database is broken during previous run of createrepo.

Made createrepo to create rpm db in $WORKDIR/rpmdb/ from scratch
for every build and architecture. This should potentially fix the
failure as every run of createrepo will be using separate db.

[YOCTO #6571]

(From OE-Core rev: fbaddd724855a829698d853a70eee86118d6a5e7)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-02 12:02:37 +01:00
Andreas Oberritter 14098e37c8 package_deb: DpkgIndexer use apt-ftparchive that needs a valid config
Since we have support of log checking in deb/ipk [1] rootfs generation
in non Debian-based hosts fails because apt-ftparchive generates a
Warning when not find /etc/apt/apt.conf.d/ (available in Debian-based
hosts).

package_manager.py: DpkgPMIndexer add support for generate and export apt
configuration.

[1] http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=86aec93902af2e2d7d73ca9a643707fcca45055c

(From OE-Core rev: 331a7bbb1cd6781c93644a378d340deddcdb8bd2)

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-25 12:39:45 +00:00
Andreas Oberritter ce9226f97c rootfs.py: Also uninstall update-alternatives and shadow for read-only-rootfs
This brings back commit d41097a970e9bfa553cd4bc3c9fad4b9073d7bd5,
which got lost during transition from image.bbclass to rootfs.py.

(From OE-Core rev: f4932e2e640764d16f1f6d398390ebfb376f4cf1)

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-25 12:39:38 +00:00
Ed Bartosh 3acdd43b2f lib/oe/lsb.py: Prioritize parsing of /etc/os-release
Moved parsing of /etc/os-release before parsing of
/etc/SuSE-release as /etc/SuSE-release is deprecated in
recent releases of OpenSuSE.

Here is the quote from /etc/SuSE-release:
/etc/SuSE-release is deprecated and will be removed in the future,
use /etc/os-release instead

(From OE-Core rev: b3852bebb850048389994993e3717e54020c662f)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-22 14:42:18 +00:00
Chen Qi 86aec93902 rootfs.py: add log checking ability for deb and ipk
Extract the common codes of log checking and add the ability of log
checking for deb and ipk package backend.

(From OE-Core rev: d995871b433643958845e1d476813fa12888100e)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-22 14:42:16 +00:00
Chen Qi f4d90ecf88 rootfs.py: two changes regarding log checking
This patch involves two changes.

1. Extend the regular expression to also catch '^WARNING:' in _log_check_warn.
   Warnings from bb.note or bbnote begin with 'WARNING:'. So if we decide to
   catch warnings at rootfs time, we should not ignore those produced by
   the build system itself.

2. Delay _log_check in rootfs process so that more warnings are likely to be
   catched. Note that we should at least delay the _log_check after the
   execution of ROOTFS_POSTPROCESS_COMMANDS, because we want to catch warnings
   there.

(From OE-Core rev: 4c9213dffb71510ba99a0665f620e9de4a2dfeb5)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-22 14:42:15 +00:00
Saul Wold 2ab66b85ec package_manager: Create variable for install_dir_name
This patch creates a variable for the install_dir name so it can be
something other than /install, also by doing this we can correctly
clean up the empty directories (/install/tmp) during the clean-up
phase. The new default is /oe_install so as to not conflict with other
possible packages that might use /install to place files.

[YOCTO #7353]

(From OE-Core rev: 335effec42099666d0fb433b31981edcb0dae9a0)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-20 23:55:58 +00:00
Fabrice Coulon 1e34e71e0f meta/lib/oe/package.py: fix files ownership in packages
This fix solves the problem with the ownership of files in packages.
The do_install task was producing correct and expected output but when
the files were being put in, e.g. a rpm package, the ownership could
be different than that in the do_install task.

[YOCTO #7428]

(From OE-Core rev: 1a50cc5aeafff0d8ee6c4a41dd2770ecd31455f0)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Fabrice Coulon <fabrice.coulon@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-20 11:03:46 +00:00
Chen Qi 38382e0f15 rootfs.py: fix logic error so that warnings are checked
The following commit caused log checking for warnings not working for RPM
rootfs.

    rootfs.py: ignore "NOTE:" when catching warnings

The problem is that checking for warnings is always skipped because the
following statement is always true.

    if 'log_check' or 'NOTE:' in line:

This patch fixes the above problem so that warning checking in RPM rootfs
can work again.

(From OE-Core rev: 3e9e2ce380a73b50cbfc1995e361cfe879de6a8a)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-16 17:41:57 +00:00
Cristian Iorga ca3a3c0541 meta/lib/oe/utils.py: properly implement both_contain()
oe.utils.both_contain() just does a find() on the value
rather than splitting the value and then looking in the
list of split items. The result is that if you add a
feature to MACHINE_FEATURES that itself has a substring
that matches one of the values looked for when building
COMBINED_FEATURES, you end up with an incomprehensible
error (here with "ext2i" in MACHINE_FEATURES):

ERROR: Nothing RPROVIDES 'packagegroup-base-ext2'
(but /home/balister/src/oe-core/oe-core/meta/recipes-core/
/packagegroups/packagegroup-base.bb RDEPENDS on or otherwise requires it)

Fix [YOCTO #6888].

(From OE-Core rev: e7375f73bd8052d012e35d4ebaee09a55417581f)

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-10 10:47:39 +00:00
Paul Eggleton 6d7cf8e9dd lib/oe/terminal: fix konsole terminal support for KDE 4.x
It seems that the --nofork option genuinely stops konsole from going
into the background now; I'm not sure when this changed but it does seem
to be working so we can use it. (Tested with Konsole 2.10 and 2.14.2).

Fixes [YOCTO #4934].

(From OE-Core rev: 49b21abf1020b2eefbbec98415c3d7de8827c993)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-26 07:47:50 +00:00
Paul Eggleton f160730bbd lib/oe/terminal: fix regressions
Fix up some issues introduced by OE-Core commit
818c94f5b9882c2028ef9f056714a0a3c9045551:

* If we want to support versions with more than two parts, versions with
  only one part, or versions with non-integer parts, then we have to
  stay with strings. We can use distutils.version.LooseVersion() to help
  with comparisons.
* We don't want a warning when launching gnome-terminal 3.10+ and
  logger.warn() doesn't take a first integer parameter anyway
  (logger.debug() does).
* Also clean up tabs.

(From OE-Core rev: 565d4a144ab3b8fe04950392497de1e0cf1152a5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-26 07:47:50 +00:00
Sven Ebenfeld 43afafeffa terminal.py: No --disable-factory for gnome-terminal >= 3.10
--disable-factory has been disabled in earlier versions of gnome-terminal
but from version 3.10 it raises an error and quits. This makes devshell
unusable with gnome-terminal >= 3.10. This patch checks for the version and
removes --disable-factory if you have the terminal version 3.10 or higher.

(From OE-Core rev: 818c94f5b9882c2028ef9f056714a0a3c9045551)

Signed-off-by: Sven Ebenfeld <sven.ebenfeld@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-24 23:34:19 +00:00
Randy Witt 1118c12bdf copy_buildsystem.py: Add methods to copy shared state.
Added the helper functions necessary to copy the sstate from the
current build, and generate the file to "lock" it.

(From OE-Core rev: f704b0ad26bbca868c4ac40addb92dcd212f586f)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-24 17:41:43 +00:00
Randy Witt d5d4b70a5d copy_buildsystem.py: Add a way to copy buildsystem to a directory.
This file provides a way to take bitbake and the layers in the
current build and copy them to a target specified.

(From OE-Core rev: 3dc52164fb560ccbe5c203a4587f6286c8fc0389)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-24 17:41:43 +00:00
Paul Eggleton 91a9b3f114 sstatesig: Add ability to filter list of tasks for locked-sigs.inc
(From OE-Core rev: ed4287a60b33cb597eb7fa13b3855a528315b3b0)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-24 17:41:42 +00:00
Paul Eggleton 6015deb9f3 lib/oe/recipeutils: minor improvements to patch_recipe()
* Ensure it knows where to put SRCREV and S
* Handle prepend/append and functions in general

(From OE-Core rev: a770c3764efa857a8b1f0ce4b398277cd483a6af)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-23 17:35:29 +00:00
Paul Eggleton f205ccaf48 lib/oe/patch: fix PATCHTOOL = "git" with source in a subdirectory
For recipes that have their actual source in a subdirectory of what is
fetched (e.g. mkelfimage), we need to find the root of the repository
within the GitApplyTree code that attempts to set up the required git
hooks and use that, rather than expecting the root to be the same as
${S}.

(From OE-Core rev: d820303f64ea610338ec11ffd79269e7831d1da9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-23 17:35:27 +00:00
Richard Purdie e011e92e8c lib/oe/package_manager: Performance tweak in regex usage
Profiling a core-image-sato-sdk rootfs, we're spending over 40s
compiling the same regex over and over again, roughly around 5 million
times.

This is suboptimal, fix for a 40s improvement on a 18.5minute task execution
time.

(From OE-Core rev: d0244702752f54fb74be427af1663e46bfff9a5d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-21 22:05:36 +00:00
Chen Qi aa48c4ff4a package_manager.py: use 'purge' instead of 'remove' in case of deb
We need to use 'purge' instead of 'remove' for debian package backend when
removing packages at rootfs time. This is because that 'remove' command for
'dpkg' and 'apt-get' does not remove configuration files.

(From OE-Core rev: 14e8d826c4a5231ef331d8064d150737fe3ed656)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-17 22:35:02 +00:00
Paul Eggleton fdb5639e90 lib/oe/package_manager: support exclusion from complementary glob process by regex
Sometimes you do not want certain packages to be installed when
installing complementary packages, e.g. when using dev-pkgs in
IMAGE_FEATURES you may not want to install all packages from a
particular multilib. This introduces a new PACKAGE_EXCLUDE_COMPLEMENTARY
variable to allow specifying regexes to match packages to exclude.

(From OE-Core rev: d4fe8f639d87d5ff35e50d07d41d0c1e9f12c4e3)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-17 14:20:45 +00: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
Saul Wold af7fc22af0 lib/oe/lsb.py: Fix up for dash
Remove the leading -e when using dash which does not use -e with echo

(From OE-Core rev: 105280d58f7be50e5aee6a33ef1aa89dd6485cbf)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-14 08:41:00 +00:00
Ricardo Neri 4870290ee5 rootfs.py: ignore "NOTE:" when catching warnings
The script looks for any warn|Warn pattern in the log. However,
it may happen that the warn|Warn pattern appears as part of the name
of the objects described in the NOTE lines of the log. Thus, to avoid
false positives, ignore the line if it contains the word "NOTE:"

(From OE-Core rev: 0387d0957909a9977efd8b2008e4d1c6d81ceb2a)

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-14 08:40:57 +00:00
Dan McGregor 7c3b9a9a9f terminal.py: add tmux new window option
Add a new terminal type that makes a new window in the running tmux
session instead of splitting the window. 80x25 is not enough to run
menuconfig inside a split window, so add the option to create a new
window instead.

Use the new window option by default when the split window would be
less than 19 lines high.

(From OE-Core rev: d7ef9e49b1c687279f6eb2c7abc32ff915714177)

Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-08 08:00:26 +00:00
Paul Eggleton 30a5c9edc6 classes/license: tweak license format messages
Strictly speaking not all of these characters are operators, so reword
the message to describe them as separators. Also use the standard
"recipename: message" format.

(From OE-Core rev: 9e5da3e83f2a5d43620e07a31728b7427329d8f4)

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-02-08 08:00:25 +00:00
Rodrigo Chiossi da35877db8 lib/oe/terminal: add support for Terminology terminal emulator
Terminology is the default Enlightenment terminal emulator

(From OE-Core rev: f3da8570a977809fadb08315f384726b80f5ee01)

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-03 14:53:54 +00:00
Chen Qi 4385b3cc9d package_manager.py: fix rootfs failure with multilib enabled
With the current code, if we use debian package backend and enable
multilib support, the do_rootfs process would always fail with error
messages like below.

    E: Unable to locate package packagegroup-core-boot

This patch fixes the above problem.

(From OE-Core rev: d140d556ae30b6dbd0ffce8882c3e22b17050820)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-03 14:53:54 +00:00
Alejandro Hernandez 57647c9cbb terminal.py: fixes launching multiple windows of gnome-terminal
When resolving a patch, a new process of gnome-terminal
is created for every patch to be resolved, it "waits"
for the previous one to end, instead of launching
multiple windows at the same time.

[YOCTO #7254]

(From OE-Core rev: b457e0b028418260aee25858b8af8938dd038fac)

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>
2015-02-03 14:53:53 +00:00
Dan McGregor 491d1db8d1 image.bbclass: make kernel depmod data optional
This allows an image to skip the creation of kernel depmod
data. It is useful for creating an image that will run as a
container image inside a host with no knowledge of the parent's
kernel.

(From OE-Core rev: ca641aedff5f6bd155796ead02cb2eb871f8c17a)

Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-03 14:53:53 +00:00
Paul Eggleton ca232b5c7b lib/oe/image.py: add error checking for missing IMAGE_CMD
An invalid value in IMAGE_FSTYPES was triggering a traceback. Add a
check and a reasonable error message instead.

(From OE-Core rev: f38c35b925d6eab0d5a41b8592b0eb8b0a3b7b72)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-03 14:53:51 +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
Paul Eggleton 124f0419b9 lib/oe/rootfs.py: rename _uninstall_uneeded to fix spelling error
Rename it to _uninstall_unneeded.

(From OE-Core rev: cb217f442b8143d88112bebe4011051efbd905a3)

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
Richard Purdie 3f15d8a807 kernel: Fix depmod for multilib
Using populate_sysroot for this data was a nice idea but flawed as it
doesn't work in multilib builds. Instead we can use PKGDATA_DIR since
this is consistent over multilib builds. It also turns out to be
slightly neater code too. Hopefully this resolves the problem once and
for all.

(From OE-Core rev: 6cccae3ca54c1177a1d91d23c3e151d74e735ee9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-29 15:36:52 +00:00
Richard Purdie 11ef55a93b kernel/image/depmodwrapper: Fixups for depmod
With the rpm package backend enabled, running:

bitbake <image>
bitbake virtual/kernel -c clean
bitbake <image> -c rootfs -f

results in an image with incorrect kernel module dependency information.
The problem is that the System.map and kernel-abiversion files are needed
for depmod and after the recent kernel changes, these are no longer in
sstate.

Its reasonable to require the kernel to unpack/build if you're
about to build a module against it. It is not reasonable to require this
just to build a rootfs.

Therefore stash the needed files specifically for depmod.

Also fix some STAGING_KERNEL_DIR references which were incorrect, found
whilst sorting through his change.

(From OE-Core rev: b851504dcf5e147c9efb1c7b6a4d22c1a1a87cd7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-23 14:32:02 +00:00
Richard Purdie 8bab098c36 lib/oe/package: Ensure strip breaks hardlinks
Normally, strip preserves hardlinks which in the case of the way our hardlink
rather than copy functionality works, is a disadvantage and leads to non-deterministic
builds. This adds a move into place after the strip operation to ensure hardlinks
are broken and we bring back build determinism.

(From OE-Core rev: 7c0fd561bad0250a00cef63e3d787573112a59cf)

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>
2015-01-23 11:36:31 +00:00
Pau Espin Pedrol 6f196670e8 lib/oe/sdk.py: Add SDKIMAGE_INSTALL_COMPLEMENTARY capabilities to DpkgSdk
Creating an SDK by means of do_populate_sdk, complementary packages
(SDKIMAGE_FEATURES = "dev-pkgs dbg-pkgs") are not installed when using
the deb packaging system.

The reason is that the call to install the complementary packages is missing
from the deb backend. This patch fixes that.

[YOCTO #7160]

(From OE-Core rev: 0bcca69ea97ac51acf290f8f1da1bde715ab51c4)

(From OE-Core rev: 6755935e58b0414870adb7c7abab1aa331596209)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-23 11:36:25 +00:00
Richard Purdie 1dfb9033e0 lib/oe/rootfs.py: Fix reference to abiversion file location
With the changes to kernel layout, we need to refer to the correct
location of the kernel abiversion file.

Thanks to Saul, Randy, Darren and Bruce to figuring out the issue.

(From OE-Core rev: 6541799c2e9a5a1586676c207d62f885c70e24dc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-16 23:16:15 +00:00
Otavio Salvador 01c7d083ef lib/oe/image.py: Handle compressed IMAGE_TYPEDEP values
When computing the dependency graph for the image generation, we need
to take into account the compression type and identify the base type
it relates to. This allow for a more robust graph generation even when
using composed image types.

(From OE-Core rev: 6e7d1de6cc99ed2def346dc40310573f5f0ce5ca)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-25 08:18:12 +00:00
Paul Eggleton db73bcc3b8 lib/oe: add recipeutils module
Add a module to help provide utility functions for dealing with recipes.
This would typically be used by external tools.

Substantial portions of this module were borrowed from the OE Layer
index code; other functions originally contributed by
Markus Lehtonen <markus.lehtonen@intel.com>.

(From OE-Core rev: fd970c3b42b39601f379300d83354d42d5a536ba)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-21 12:37:56 +00:00
Paul Eggleton 12bb32e766 lib/oe/patch: add support for extracting patches from git tree
When patches from a recipe have been written out to a git tree, we also
want to be able to do the reverse so we can update the patches next to
the recipe. This is implemented by adding a comment to each commit
message (using git hooks) which we can extract later on.

(From OE-Core rev: 765b7bad50eae5b79d13a3f4988dc440c3d9787f)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-21 12:37:56 +00:00
Paul Eggleton 50e771d114 lib/oe/patch.py: abort "git am" if it fails
If we don't do this, you may still be in the git am resolution mode at
the end of applying patches, which is not desirable.

(From OE-Core rev: 630a393d01950a0d00b5d30ac376472911e50ff9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-21 12:37:56 +00:00
Paul Eggleton 37db9e62f0 lib/oe/patch: use --keep-cr with git am
Preserving carriage returns is important where the patch contains them.

(From OE-Core rev: 1cfcae0cd0bc776f5bb91a75bb8ffdad3d7bf200)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-21 12:37:56 +00:00
Paul Eggleton 400933b050 lib/oe/patch: auto-commit when falling back from git am
When PATCHTOOL = "git", if we're not able to use "git am" to apply a
patch and fall back to "git apply" or "patch", it is desirable to
actually commit the changes, attempting to preserve (and interpret) the
patch header as part of the commit message if present. As a bonus, the
code for extracting the commit message is callable externally in case it
is useful elsewhere.

(From OE-Core rev: 8c522846093809a8deb866079e73fa317266c80e)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-21 12:37:56 +00:00
Paul Eggleton e03c04758b lib/oe/patch: fall back to patch if git apply fails
When PATCHTOOL = "git", git apply doesn't support fuzzy application, so
if a patch requires that it's better to be able to apply it rather than
just failing.

(From OE-Core rev: a8143f33d3104adcd10968e3b05df2024e723f5a)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-21 12:37:56 +00:00
Paul Eggleton de8730ce2d classes/package: move read_shlib_providers() to a common unit
This allows us to use this function elsewhere in the code.

(From OE-Core rev: 657cff8a0f0e5db171b2ed9388a790ee0b135842)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-21 12:37:56 +00:00
Ross Burton 615fb3b2f2 package_manager.py: fix arguments to string format
Multiple arguments to string formats need to be in a tuple.

Reported by Lorenz <lqb.list@gmail.com>.

(From OE-Core rev: e30a4650beabac215b6d867070b7acdb3601a4d7)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-05 18:01:06 +00:00
Hongxu Jia 5007319cd2 package_manager.py: check the result of create_index
While invoking create_index failed, there was no error output
and didn't break the build until the package installation.
...
|ERROR: run-postinsts not found in the base feeds (qemux86 i586 x86
noarch any all).
...

The reason is we used multiprocessing to execute create_index, and
did not check its invoking result.

(From OE-Core rev: d8921e4ea68647dfcf02ae046c9e09bf59f3e6e4)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-03 12:23:59 +00:00
Jackie Huang 2cdcd4bfdf classextend: Do not extend for that already have multilib prefix
If a BSP supports two or more multilibs, for example:

    MULTILIBS = "multilib:lib32 multilib:lib64"

and a variable is already extended to include multilib variants,
for example in populate_sdk_base:

    commit 396371588c7fd2d691ca9c39cd02287e43cb665b
    Author: Richard Purdie <richard.purdie@linuxfoundation.org>
    Date: Thu Jul 24 22:09:09 2014 +0100

    populate_sdk_base: Extend TOOLCHAIN_TARGET_TASK to include multilib variants

    Most people expect the toolchain from a multilib build to contain multilib
    components. This change makes that happen and is easy for users to override
    should they want something different.

    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

The mapping clsextend.map_depends_variable("TOOLCHAIN_TARGET_TASK")
ends up with a wrong double extended package name like:

    lib32-lib64-packagegroup-core-standalone-sdk-target

This patch avoid such issues.

(From OE-Core rev: c4e9b2aa894d59fe951038b3b73795b6891df70a)

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-11-12 15:38:31 +00:00
Aníbal Limón 1d19791828 package_manager: DpkgPM fix populate_sdk
DpkgPM change all_arch_list variable set from PACKAGE_ARCHS to passed
archs variable because is different when is executed from rootfs.py
and sdk.py.

Credits to: Ricardo Ribalda <ricardo.ribalda@gmail.com>

(From OE-Core rev: f6fb8c16f49fd9a2b124ad55f5c4fed82d7e6dca)

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>
2014-11-09 10:21:22 +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
Hongxu Jia f948dbf2e7 rootfs.py: tweak inner warn message catching
The fix filters out irrelevant messages, and makes the catching more
accurate, the inner warn message in do_rootfs usually comes from the
output of complementary install, and pattern the format to catch it.

Here is the example of irrelevant messages:
...
|WARNING: log_check: There is a warn message in the logfile
|WARNING: log_check: Matched keyword: [warn]
|WARNING: log_check: `tmp/deploy/rpm/core2_64/pam-plugin-warn
-1.1.6-r5.0.core2_64.rpm' -> `tmp/work/intel_x86_64-wrs-linux/
wrlinux-image-installer/1.0-r0/rootfs/Packages.intel/./core2_64/
pam-plugin-warn-1.1.6-r5.0.core2_64.rpm'
...

(From OE-Core rev: 4ceb3b5f928af7f631294c83b83e3a3c89cbf890)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-11-04 10:27:13 +00:00
Paul Barker 365947e9d1 package_manager: Fix BAD_RECOMMENDATIONS for opkg
In package_manager.py, when using opkg as the packager, the command 'opkg <args>
info <pkg>' is called to get information about each pkg in BAD_RECOMMENDATIONS
in a format that can be written to the status file. The 'Status: ...' line is
modified and all other lines are passed through. Changing the verbosity level
argument for this command will change what it written into the status file.
Crucially, with the default verbosity level, no blank lines are being printed by
the opkg command and so no blank lines are being written to the status file to
separate each package entry.

The package parsing code in opkg expects package entries in the status file to
be separated by at least one blank line. If no blank line is seen, the next
package entry is interpreted as a continuation of the last package entry, but
the new values overwrite the old values.

So with the default verbosity level, a blank line follows some package entries
and these are parsed. The others are dropped due to the lack of blank lines. As
the verbosity increases, more debugging messages add blank lines and more
packages are parsed.

The solution to ensure that this works correctly regardless of the verbosity
level is simply add a blank line after the output of 'opkg info' is written to
the status file, ensuring that the next package is separated from the current
package.

[YOCTO #6816]

(From OE-Core rev: 3fa24eee41c26fecd5e4f680082288ec772d2de9)

Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
Cc: Chris Carr <chris.carr@ge.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-11-04 10:27:10 +00:00
Hongxu Jia 8619d93726 multilib.bbclass/package_manager.py: fix <multilib>-meta-toolchain build failure
There is a failure to build lib32-meta-toolchain:
...
|ERROR: lib32-packagegroup-core-standalone-sdk-target not found in the base
feeds (qemux86_64 x86 noarch any all).
...

In package_manager.py, the variable 'DEFAULTTUNE_virtclass-multilib-lib32'
is used to process multilib image/toolchain. But for the build of lib32-
meta-toolchain, the value of 'DEFAULTTUNE_virtclass-multilib-lib32' is
deleted. In 'bitbake lib32-meta-toolchain -e', we got:
...
|# $DEFAULTTUNE_virtclass-multilib-lib32 [2 operations]
|#   set? /home/jiahongxu/yocto/build-20141010-yocto/conf/local.conf:237
|#     "x86"
|#   del data_smart.py:406 [finalize]
|#     ""
|# pre-expansion value:
|#   "None"
...

The commit 899d45b90061eb3cf3e71029072eee42cd80930c in oe-core deleted
it at DataSmart.finalize
...
Author: Richard Purdie <richard.purdie@linuxfoundation.org>
Date:   Tue May 31 23:52:50 2011 +0100

    bitbake/data_smart: Change overrides behaviour to remove
       expanded variables from the datastore
...

We add an internal variable 'DEFAULTTUNE_ML_<multilib>', assign it with the
value of 'DEFAULTTUNE_virtclass-multilib-lib32' before deleting.

For rpm backend in package_manager.py, we use DEFAULTTUNE_virtclass-multilib
-lib32 first, if it is not available, and try to use DEFAULTTUNE_ML_<multilib>

[YOCTO #6842]

(From OE-Core rev: 9c59d3d8b538d3a98ff4b5e5b189a4a23a85da2d)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-11-04 10:27:09 +00:00
Pascal Bach c97194b0b1 image.py: Fix error in graph sorting
The graph sorting algorithm for image dependencies does a look for an
occurrence of a searched string instead of comparing the chunk to the
searched string. This leads to the problem that ubifs is recognized as ubi aswell.

This fixes this by splitting up the string into chunks.

(From OE-Core rev: cec9725c540c2d54c27092e40d159694cea75b5f)

Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-30 13:01:22 +00:00
Chong Lu d7cb96f28d python-smartpm: Add checking for "rpm-ignoresize" option
The do_rootfs takes a very long time when build host has mounted many NFS
devices. syscall lstat() was being called on every filesystem mounted on the
build host during building.
The reason for the lstat() is that rpm is verifying that enough free disk space
is available to do the install. However, since the install is into the target
rootfs it should not matter how much free space there is in the host mounts.
Add checking for "rpm-ignoresize", by it, smart can make whether RPM skip
checking for diskspace when install a rpm package.

(From OE-Core rev: fc0668a019eca422540ceab3efcd2b2a27dd79e0)

Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-24 17:36:14 +01:00
Hongxu Jia ea8a7c5d34 sdk.py: fix write target sdk manifest failed based on ipk
bitbake meta-toolchain
ls tmp/deploy/sdk/poky-glibc-x86_64-meta-toolchain-i586-toolchain-1.7.manifest -al
...
|-rw-rw-r-- 1 root root 0 Oct 10 15:05 tmp/deploy/sdk/poky-glibc-x86_64-
meta-toolchain-i586-toolchain-1.7.manifest
...

The manifest is empty, the reason is target's ipk config path is
d.getVar('IPKGCONF_TARGET') rather than d.getVar('IPKGCONF_Target')

(From OE-Core rev: 81b3cc448f040dcb4c2f2b05983231ac53270663)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-10 16:44:33 +01:00
Anibal Limon c34775f886 deb_packaging: Added support for multilib
The Package Manager implementation for deb didn't
take a look about multilib enabled variants.

Changes are made for generate apt.conf, sources.list and
debian repo index Release and Packages files.

[YOCTO #1502]

(From OE-Core rev: b5fb879b351cc23977f3e441f758101551297566)

Signed-off-by: Anibal Limon <anibal.ezau.limon.belmares@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-30 14:33:31 +01:00
Hongxu Jia 3b92eb93ee rootfs.py: catch inner warn message
Package managements (smart/apt-get/opkg-cl) generate some warn messages
to stdout, and we need to catch them and output by bb.warn.

Here is an example, while invoking smart to attempt install doc packages,
if install failed, it generates warn message to stdout.
...
|warning: Can't install util-linux-doc-2.24.2-r1@i586: Can't
install util-linux-doc-2.24.2-r1@i586: no package provides info
...

The fix catches it and outputs:
...
|WARNING: log_check: There is a warn message in the logfile
|WARNING: log_check: Matched keyword: [warn]
|WARNING: log_check: warning: Can't install util-linux-doc-2.24.2-r1@
i586: Can't install util-linux-doc-2.24.2-r1@i586: no package provides
info
...

(From OE-Core rev: f8d725f49f2be4b854f523a5ee3a5c4357e67e30)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-30 14:10:34 +01:00
Hongxu Jia 280b6d0011 sstatesig: fix overrides behaviour to remove SIGGEN_LOCKEDSIGS_i586
Require a sig file which SIGGEN_LOCKEDSIGS_i586 is not null, but
the actual SIGGEN_LOCKEDSIGS_i586 is null.
Invoking 'bitbake -e' and we got:
...
 3935 # $SIGGEN_LOCKEDSIGS_i586 [2 operations]
 3936 #   set /path/to/locked-sigs.inc:8576
 3938 #   del data_smart.py:406 [finalize]
 3939 #     ""
...

It was caused by the following commit:
...
(Bitbake rev: 899d45b90061eb3cf3e71029072eee42cd80930c)
Author: Richard Purdie <richard.purdie@linuxfoundation.org>
Date:   Tue May 31 23:52:50 2011 +0100

    bitbake/data_smart: Change overrides behaviour to remove expanded
      variables from the datastore
...

We add prefix 't-' to type to workaround the overrides behaviour.

(From OE-Core rev: f6a39cc957bf85ff43513f0b76afc3b2c9c906b6)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-17 22:00:26 +01:00
Randy Witt f9723a36d7 sstatesig.py: Replace '_'s with '-'s in SSTATE_LOCKEDSIGS* names.
Using underscores in the "types" parts of the variable names can cause
unexpected issues with overrides. For example, if you have both
SSTATE_LOCKEDSIGS_x86_64 and SSTATE_LOCKEDSIGS_x86_64_i586, and i586
is in OVERRIDES, then you lose all of the contents in
SSTATE_LOCKEDSIGS_x86_64 and thus don't get some of the locked sstate.

Using '-'s in the variable names instead, eliminates these issues.

(From OE-Core rev: 6662c412a949a9f6b602c848e6303b19db7e5272)

(From OE-Core rev: 65f558a6f762fb13224091dc22903b58eeb9b392)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-17 22:00:26 +01:00
Hongxu Jia abf0e7e53f sstatesig: Improve the support for locked down sstate cache usage
Add code in the sstate hash validation code to ensure it really did
install these from sstate since if it didn't should to warn/abort
the build. The judgment condition is:
1) If a build is replaced by locked sstate-cache, it will triger a
   warn/error;
2) If objects are not used from the locked cache, it will triger a
   warn/error;
3) Use SIGGEN_LOCKEDSIGS_CHECK_LEVEL variable controls whether this
   is just a warning or a fatal error or nothing to report.

[YOCTO #6639]

(From OE-Core rev: 305912dce61c4fed0cbf631aa98a9e6f29db88e4)

(From OE-Core rev: 1683815695f39d4bad352348913f927ac8a1bcf5)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-17 22:00:25 +01:00
Richard Purdie a08d7dc9b2 sstatesig: Improve to handle locking of multiple machines
Instead of a single monolithic SIGGEN_LOCKEDSIGS, split this into
separate variables, one per sstate package architecture. Add in
a new SIGGEN_LOCKEDSIGS_TYPES variable which lists the package
architectures to load in.

SIGGEN_LOCKEDSIGS_TYPES is made machine specific using overrides.

Also sort the hashes in the lists by PN to make diffing them easier.

(From OE-Core rev: d8b0ce35981931a39e7db9d8e78de6e009b34688)

(From OE-Core rev: b42f305ce38b9e0f1a2b7cb9586bbabcd2d27429)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-17 22:00:25 +01:00
Richard Purdie c5cc4993f0 sstatesig/sstate: Add support for locked down sstate cache usage
I've been giving things some thought, specifically why sstate doesn't
get used more and why we have people requesting external toolchains. I'm
guessing the issue is that people don't like how often sstate can change
and the lack of an easy way to lock it down.

Locking it down is actually quite easy so patch implements some basics
of how you can do this (for example to a specific toolchain). With an
addition like this to local.conf (or wherever):

SIGGEN_LOCKEDSIGS = "\
gcc-cross:do_populate_sysroot:a8d91b35b98e1494957a2ddaf4598956 \
eglibc:do_populate_sysroot:13e8c68553dc61f9d67564f13b9b2d67 \
eglibc:do_packagedata:bfca0db1782c719d373f8636282596ee \
gcc-cross:do_packagedata:4b601ff4f67601395ee49c46701122f6 \
"

the code at the end of the email will force the hashes to those values
for the recipes mentioned. The system would then find and use those
specific objects from the sstate cache instead of trying to build
anything.

Obviously this is a little simplistic, you might need to put an override
against this to only apply those revisions for a specific architecture
for example. You'd also probably want to put code in the sstate hash
validation code to ensure it really did install these from sstate since
if it didn't you'd want to abort the build.

This patch also implements support to add to bitbake -S which dumps the
locked sstate checksums for each task into a ready prepared include file
locked-sigs.inc (currently placed into cwd). There is a function,
bb.parse.siggen.dump_lockedsigs() which can be called to trigger the
same functionality from task space.

A warning is added to sstate.bbclass through a call back into the siggen
class to warn if objects are not used from the locked cache. The
SIGGEN_ENFORCE_LOCKEDSIGS variable controls whether this is just a warning
or a fatal error.

A script is provided to generate sstate directory from a locked-sigs file.

(From OE-Core rev: 7e14784f2493a19c6bfe3ec3f05a5cf9797a2f22)

(From OE-Core rev: 884d4fa3e77cf32836f14a113c11489076f4a84d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-17 22:00:25 +01:00
Robert Yang d06839e7dd package_manager.py: use RPM_PREFER_ELF_ARCH
Use RPM_PREFER_ELF_ARCH to instead of RPM_PREFER_COLOR as rpm upstream
suggested, and use "4" to instead of "3" since it is a bit mask (not
enumeration), so we need "4" here.

(From OE-Core rev: 8dcfa7143a6690455c3bd5772621f142f2d9e559)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-10 11:33:22 +01:00
Kévin THIERRY e7a78bdc97 package_manager: RpmPkgsList: determine rpm version
Do not set the rpm_version to 5 if it is not provided, instead
determine the real rpm version.

(From OE-Core rev: 48beaee2e5b2b4ae35c596c19f8a38e0ff4427e9)

(From OE-Core rev: fe4ad726d0dc63be73f885598e216b8eb927668a)

Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org>
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>
2014-09-10 11:33:22 +01:00
Richard Purdie 45907b6d7f package_manager: Add rpm v4 support
Currently the package manager code only supports rpm v5. To be useful outside
of OE or with OE layers using v4, it makes sense to add in rpm v4 support. This
takes a patch from "Bartosh, Eduard" <eduard.bartosh@intel.com> and enhances
it to also include versions of the workarounds from poky-eurogiciel to
allow rpm v4 usage with the class for image construction.

(From OE-Core rev: fe21804c296bbb8b2b8b0c29e6e4890bc17f07fc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-03 11:09:03 +01:00
Ed Bartosh cc0a0614e8 package_manager.py: enable smart non-interactive mode
Added --quiet option to smart command line.
Without this option smart 1.4.1 turns into interactive mode, i.e.
start asking questions and expecting answers.

Internally within smart, this changes the default UI to one which
just prints to stderr, the naming of the parameter is a little
odd but does what we need.

(From OE-Core rev: 7a8d88b73d35ac86198a1092c49b33c378416a03)

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-31 23:40:47 +01:00
Peter Kjellerstedt 3b47aa11c2 lib/oe/utils: Make multiprocess_exec() return anything
The variable "results" was accidentally used for multiple different
things at the same time, which unintentionally discarded anything that
was supposed to be returned from the function...

(From OE-Core rev: abf4eb613eba0892a5f240de7aa3a9a1b2879354)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-29 23:44:37 +01:00
Richard Purdie c490ba0a93 sstatesig: Only squash dependencies for allarch packagegroups
The idea of squashing packagegroup dependencies was to avoid allarch
packages rebuilding upon tune/arch changes. Now that the allarch class
inclusion is conditional, we can narrow down the packagegroup squashing
to be specifically applied to allarch recipes.

(From OE-Core rev: bd8018792155ae842952432900c8431feeaffe30)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-25 08:57:44 +01:00
Richard Purdie be1b198076 lib/oe/utils: Add utils function for multiprocess execution
Our usage of multitprocessing is problematic. In particular, there is a bug
in python 2.7 multiprocessing where signals are not handled until command
completion instead of immediately.

This factors the multiprocess code into a function which is enhanced with
a workaround to ensure immediate signal handling and also better SIGINT
handling which should happen in the parent, not the children to ensure
clean exits. The workaround for the signals is being added to the core
bb.utils function so it can benefit all users.

package_manager is then converted to use the new code.

(From OE-Core rev: 72d153a3a90d31d9f4e41d77da24e44ccb33c56e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-23 09:31:41 +01:00
Christopher Larson d7fea14b1f oe.package_manager: fix use of PACKAGE_EXCLUDE for dpkg
It was iterating over the variable character-by-character rather than
word-by-word.

(From OE-Core rev: 207f2cc0b0fc53b22e1dedfa26905ab143fb0de6)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 17:43:44 +01:00
Robert Yang a9c8767a17 package_manager.py: set preferred ABI for rpm
When using the RPM packaging backend to generate a rootfs there needs to
be a way to configure the preferred ABI to resolve ELF file conflicts.

Currently RPM resolves ELF file conflicts with the last-installed wins.
Using SMART it's difficult to know what the last installed will be.

There are three specific policies that can be selected:
1: ELF32 wins
2: ELF64 wins
3: ELF64 N32 wins (mips64 or mips64el only)

Another option "0" is uncontrollable, which means that if two are being
installed at once Elf64 is preferred, but if they're being installed in
two different transactions, last in wins, so we don't document it.

Add RPM_PREFER_COLOR to let the user config the preferred ABI.

[YOCTO #4073]

(From OE-Core rev: f56d7be2c35cedcd763ba66913982aa4c425d561)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-02 09:26:16 +01:00
Richard Purdie addeef1dc9 lib/oe/rootfs: Improve error message whitespace
[YOCTO #6493]

(From OE-Core rev: 91ca6b1b2e009381d8e813906654c0958eee7efc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-28 12:21:24 +01:00
Richard Purdie 42470aa22d lib/oe/classextend: Avoid early expansion of PR values
Variables like RDEPENDS can contain EXTENDPKGV which in turn uses AUTOPR
based values. This gets set during do_package execution so we want to
defer expansion until then. The only way we can do this in the RDEPENDS
(and friends) mapping code is to subsitute a dummy value, then change it
back again. Horrible but I can't see any other way.

This resolves multilib build failures with inconsistent PR values.

(From OE-Core rev: 5aea553e6eaa3b9647f26944976d2a9da79cba42)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-25 15:33:58 +01:00
Roxana Ciobanu 56bfda20f4 image.bbclass/rootfs.py: add variables to rootfs[vardeps]
Added base variables and package backend specific variables to
rootfs[vardeps] in order for rootfs to rebuild when changes are made.

Set some variables as [func] to inform bitbake that they are shell
scripts, so that it invokes its shell dependency parsing. Without
marking them as functions, changes in the actual function body would
not trigger rootfs rebuilds.

[YOCTO #6502]

(From OE-Core rev: b8b6214b885a0757f0e628937f8fe21c92c45155)

Signed-off-by: Roxana Ciobanu <roxana.ciobanu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-23 21:59:13 +01:00
Saul Wold 4d2ac6f6df rootfs: Remove the extraneous install directory
The /install/tmp diectory is created during installation by
the smart package manager, we need to clean it up here

[YOCTO #6497]

(From OE-Core rev: d4f4ad5edd8914e696722c1a1c3ba7de091d4c19)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-19 00:18:21 +01:00
Robert Yang 1cb9f7b00b lib/oe/image.py: check the rootfs size against IMAGE_ROOTFS_MAXSIZE
* Check the rootfs size against IMAGE_ROOTFS_MAXSIZE (if set)
* Add comments for IMAGE_ROOTFS_SIZE to not confuse with IMAGE_ROOTFS_MAXSIZE

[YOCTO #2610]

(From OE-Core rev: 6acd4fc8d5e642b5c6c75fcc40dd8f37caf7ddcf)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-10 17:38:35 +01:00
Mark Hatle 2c59db6318 lib/oe/package_manager.py: Fix _pkg_translate_smart_to_oe function
File: '/home/mhatle/git/oss/oe-core/meta/lib/oe/package_manager.py', lineno: 278, function: _pkg_translate_smart_to_oe
     0274:
     0275:            if found == 1 and fixed_arch == fixed_cmp_arch:
     0276:                break
     0277:        #bb.note('%s, %s -> %s, %s' % (pkg, arch, new_pkg, new_arch))
 *** 0278:        return new_pkg, new_arch
     0279:
     0280:    def _list_pkg_deps(self):
     0281:        cmd = [bb.utils.which(os.getenv('PATH'), "rpmresolve"),
     0282:               "-t", self.image_rpmlib]
Exception: UnboundLocalError: local variable 'new_arch' referenced before assignment

(From OE-Core rev: acd8bfc9378df0a2e1d6ea3858675b9fe350946d)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-03 17:41:17 +01:00
Mark Hatle 94dbe8515d lib/oe/package_manager.py: Add processing for alternative SDK_OS
For the meta-mingw layer, we need to process alternative SDK_OS, since this
is not a Linux based OS.

(From OE-Core rev: b31e015d2e379c24610948d345c5970545887468)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-25 13:51:47 +01:00
Mark Hatle d9cdeac6d7 populate_sdk: Fix TOOLCHAIN_TARGET_TASK_ATTEMPTONLY implementation
The variable was only partially implemented, and the part that was there
was named incorrectly to, missing the 'TASK' piece.

(From OE-Core rev: d0cb34cfe9a51fd8bc1e6e28c8eda60a25adc1ec)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-25 13:51:47 +01:00
Richard Purdie 3df8773ed9 sstatesig: Add try/except around the stat calls
Its possible sstate symlinks to other sstate mirrors which then my get
removed/cleaned. If we find invalid symlinks, skip over them rather
than error with a backtrace.

(From OE-Core rev: 5ed9bb42abf93aa084dd23ca68cc996a94a51a10)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-19 17:55:11 +01:00
Chen Qi 51d450f0a7 rootfs.py: change the logic in _uninstall_unneeded
Previously, if we have 'package-management' and 'read-only-rootfs'
both in IMAGE_FEATRUES, we would meet the following error at system
start-up.

	rm: can't remove '/etc/rcS.d/S99run-postinsts': Read-only file system

However, what's really expected is that when there's no postinstall
script at system start-up, the /etc/rcS.d/S99run-postinsts should not
even be there.

Whether or not to remove the init script symlinks to run-postinsts should
not depend on whether we have 'package-management' in IMAGE_FEATURES; rather,
it should only depend on whether we have any postinstall script left to run
at system start-up.

This patch changes the _uninstall_unneeded function based on the logic
stated above.

[YOCTO #6257]

(From OE-Core rev: 6c2f7ecee754ff3f29fdde17c0363f5d138057ff)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-13 12:31:37 +01:00
Richard Purdie 3caca17be1 classextend: Fix crosssdk remapping for multilib
Multilib builds only require one crosssdk toolchain. We therefore shouldn't
be remapping crosssdk names. This resolves build failures looking for
weird multilib crosssdk toolchains.

(From OE-Core rev: aa8b93e2db06866529d20939452f81fb9e18aaab)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-01 14:29:30 +01:00
Richard Purdie 963c8ea99d sstatesig: Move saferecipedeps handling to be earlier
We want to use the saferecipedeps handling code to allow gcc-cross-* to
work on multiple different tunes. Its currently in target only code
so it needs to be earlier to allow it to work on native-> target
dependencies.

This change has no effect on existing uses but makes gcc-cross become
shared as desired.

(From OE-Core rev: 9e03db2dfab0b534b86fd48c9190b2d7d0d21238)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-29 17:53:40 +01:00
Richard Purdie bc19e915fb classes/lib/oe: Fix cross/crosssdk references
With the renaming of the cross packages, its no longer possible to use
endswith("-cross") and similar to detect cross packages. Replace these
references with other techniques.

This resolves certain build from sstate failures which were due to the
system believing cross packages were target packages and therefore
dependency handling was altered.

(From OE-Core rev: 91edf4cac223298e50a4b8e59dd19f1b272e3418)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-11 12:27:22 +01:00
Ricardo Ribalda Delgado bc1f98def1 package_manager: Fix NoneType Object on do_populate_sdk
PACKAGE_EXCLUDE can be not defined or empty, leading to a build error.

File: '/var/lib/jenkins/jobs/qt5022-cesium/workspace/repo/yocto/meta/lib/oe/package_manager.py', lineno: 1649, function: _create_configs
     1645:                    "Pin-Priority: %d\n\n" % (arch, priority))
     1646:
     1647:                priority += 5
     1648:
 *** 1649:            for pkg in self.d.getVar('PACKAGE_EXCLUDE', True).split():
     1650:                prefs_file.write(
     1651:                    "Package: %s\n"
     1652:                    "Pin: release *\n"
     1653:                    "Pin-Priority: -1\n\n" % pkg)
Exception: AttributeError: 'NoneType' object has no attribute 'split'

ERROR: Function failed: do_populate_sdk
ERROR: Logfile of failure stored in: /var/lib/jenkins/jobs/qt5022-cesium/workspace/build/tmp/work/bobcat_64-poky-linux/meta-toolchain/1.0-r7/temp/log.do_populate_sdk.21363
NOTE: recipe meta-toolchain-1.0-r7: task do_populate_sdk: Failed
(From OE-Core rev: 26314886c3712f980ccc589b014a8f1802193b56)

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-08 13:00:34 +01:00
Ricardo Ribalda Delgado c100f0a3da package_manager: Fix Argument list too long
Function buildhistory_list_installed_image fails with error "Argument
list too long". This patch uses a temporal file to pass the package list
to opkg-query-helper.py

File: '/var/lib/jenkins/jobs/qt5022-cesium/workspace/repo/yocto/meta/lib/oe/package_manager.py', lineno: 421, function: list
     0417:            try:
     0418:                output = subprocess.check_output("echo -e '%s' | %s" %
     0419:                                                 (output, opkg_query_cmd),
     0420:                                                 stderr=subprocess.STDOUT,
 *** 0421:                                                 shell=True)
     0422:            except subprocess.CalledProcessError as e:
     0423:                bb.fatal("Cannot compute packages dependencies. Command '%s' "
     0424:                         "returned %d:\n%s" % (e.cmd, e.returncode, e.output))
     0425:
Exception: OSError: [Errno 7] Argument list too long

ERROR: Function failed: buildhistory_list_installed_image
ERROR: Logfile of failure stored in: /var/lib/jenkins/jobs/qt5022-cesium/workspace/build/tmp/work/qt5022-poky-linux/qimage-dev/1.0-r0/temp/log.do_rootfs.16747
NOTE: recipe qimage-dev-1.0-r0: task do_rootfs: Failed
ERROR: Task 7 (/var/lib/jenkins/jobs/qt5022-cesium/workspace/repo/yocto/../qtec/meta-qt5022/recipes-core/images/qimage-dev.bb, do_rootfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 4999 tasks of which 30 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory
Auto packing the repository for optimum performance.

Summary: 1 task failed:
  /var/lib/jenkins/jobs/qt5022-cesium/workspace/repo/yocto/../qtec/meta-qt5022/recipes-core/images/qimage-dev.bb, do_rootfs
Summary: There were 74 WARNING messages shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

(From OE-Core rev: 36cba6e00d76462e4ae314dd2af0b47472835538)

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-08 13:00:34 +01:00
Richard Purdie 560e0a1f0a lib/oe/sdk: Ensure target directory exists before creating the link
(From OE-Core rev: d8096433c27643f39eeb29d34e20328a39981fd6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-30 16:39:07 +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
Andreas Müller bb3f5ce741 make menuconfig work for recent xfce environment
xfce terminal was renamed 'Terminal' -> 'xfce4-teminal' mainline end of 2012,
so the distros supporting 'Terminal' will dissapear. The distros not
mentionied in  __init__ do (e.g fedora 19 - tested) fail - or will fail
sooner or later.

(From OE-Core rev: d07f3812ec371da6f18fa1dd920cdde470bd89ad)

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-23 11:43:27 +01:00
Matthieu Crapet 69a88dabbe rootfs.py: introduce USE_DEVFS check
Since commit a83144bac8d67704ff66f5dc0fc56f5b63979694 (2014-02-11), USE_DEVFS is not considered anymore.
For compatibility, let's restore USE_DEVFS semantic.
Also add USE_DEVFS to documentation.conf.

(From OE-Core rev: d12a5e38a02abe3feb3db8ae5ffd9a5005124294)

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-04-04 11:53:51 +01:00
Richard Purdie b8584fe5c6 sstatesig: Anchor inherits class tests
There was a nasty sstate hash corruption issue occurring where the
fact the testimage bbclass was inherited meant that the checksum
changed due to testimage.bbclass being confused with image.bbclass.

This patch anchors the bbclass names to avoid this confusion.

(From OE-Core rev: 943a75a4f3b6877e4092dae14b59b7afef8cad3d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-30 23:52:59 +01:00
Laurentiu Palcu 5b594449f7 image.py: check file exists before deleting
When RM_OLD_IMAGE = "1", we delete old images but we didn't check they
actually exist...

[YOCTO #6029]

(From OE-Core rev: 8910d3cc94899ab4d509e681b438ae96218fa777)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-30 10:10:33 +01:00
Laurentiu Palcu a56d8e9ede rootfs.py: add new cleanup method
This commit adds a new _cleanup() internal method that will be called at
the end of rootfs creation, so that each backend can delete various
files that were probably generated during rootfs postprocess execution,
etc.

[YOCTO #6049]

(From OE-Core rev: 6151d69875f3f4f097b6e2fdef2a0f3ab391e2fd)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-30 10:10:32 +01:00
Laurentiu Palcu a5994c0837 package_manager.py: leave the __db.00* files in place
Do not delete the __db.00* files in the PackageManager class. Leave this
operation up to the client classes. One side effect of this deletion was
the following message appearing in the output of the next rpm command
executed:

rpmdb: BDB1540 configured environment flags incompatible with existing
environment

We might also gain some time here by not deleting/creating those files
very often.

[YOCTO #6049]

(From OE-Core rev: 12e300f0af2a27c15d80298d3fbb27b092c35154)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-30 10:10:32 +01:00
Richard Purdie 68f3a571f4 apt/package_mamager: Ensure WORKDIR is used for lists directory
The native sysroot should not be used as a store for the lists files since
multiple images running at once would conflict over this. Instead redirect
this to WORKDIR. This means some extra directories need to be created.

Also create apt.conf.d to silence some warnings.

(From OE-Core rev: dc4abfc8f99c08e0c1ac9d098ce17838d0eda028)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-27 09:42:06 +00:00
Richard Purdie b503d35e7e package_manager: Fix apt-ftparchive index creation problems
a) There were missing parameters to the release and package commands (".")

b) The commands need to be executed as one block since they build upon each other

(From OE-Core rev: a3965b76ed4361455c89c982761263be03e1a8e5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-27 09:42:06 +00:00
Richard Purdie da097095c6 package_manager: Ensure we don't process directories twice
Processing directories twice is both pointless and introduces a race condition.
When building the list, ensure duplicates (like "all" and "noarch") are handled
correctly.

(From OE-Core rev: 4c487543422ae471a01a573bab44e3f6a6d2497a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-27 09:42:06 +00:00
Laurentiu Palcu 483d5a4f31 rootfs.py, sdk.py: adjust/create the wrappers for creating installed packages list
Since we created a new PkgsList object that will deal with listing the
installed packages in a rootfs, use the new class both for images and
SDKs in the wrapper functions.

The old list_installed_packages() wrapper listed only the packages inside
an image rootfs. It didn't deal with target/host SDK rootfs's.

(From OE-Core rev: 8fc18e67504db5b6df3fdd239c6187a71af52656)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-21 12:05:52 +00:00
Laurentiu Palcu d91e35640d package_manager.py: create separate class for installed packages listing
This commit creates a new class that has the only purpose to generate
various listings of installed packages in the rootfs.

Basically, the methods involved in listing the installed packages, that
were part of each backend PM class implementation, were moved to this
new class.

This change avoids instantiating a new PM object just to get the list of
installed packages in a certain rootfs.

(From OE-Core rev: a7290ed13378826723d1edc7e828eab848eaad10)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-21 12:05:52 +00:00
Ricardo Ribalda Delgado aec1194c12 package_manager: Use apt-ftparchive for deb packages
Use apt-ftparchive to create a Release file compatible with SecureApt.

apt-ftparchive is also a more efficient replacement of
dpkg-scanpackages:

root@neopili:~/curro/qtec/qt5022/build-qt5022-cesium/build/tmp/deploy/deb/bobcat
_64# time PSEUDO_UNLOAD=1 apt-ftparchive packages . >/tmp/kkk
real 0m26.873s
user 0m20.968s
sys 0m1.212s

root@neopili:~/curro/qtec/qt5022/build-qt5022-cesium/build/tmp/deploy/deb/bobcat
_64# time PSEUDO_UNLOAD=1 dpkg-scanpackages . >/tmp/kkk
dpkg-scanpackages: info: Wrote 6022 entries to output Packages file.
real 0m59.721s
user 0m16.668s
sys 0m11.164s

apt-ftparchive is not compatible with libpseudo. The calls to ftw()
returns the path in absolute format instead of relative. This
produces
wrong Packages and Release files.

ie:
MD5Sum:
d20227a958f6870137ce0e41b7b84307             1453
/home/ricardo/curro/qtec/qt5022/build-qt5022-cesium/build/tmp/deploy/deb/all/Release

This is why it is called with PSEUDO_UNLOAD.

(From OE-Core rev: c9899a7605f15f7f1ae30c4624d53c7da825b00a)

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-19 14:19:07 +00:00
Christopher Larson e73f0f145c lib/oe: turn oe into a namespace package
This will let folks extend the oe package with modules from other layers.
Given openembedded consists of more than just oe-core, I think this makes
sense, and adds some useful flexibility.

(From OE-Core rev: 8dfd28925fc47d8a4a1f10ec65df665c8326edc4)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-17 14:01:41 +00:00
David Nyström 7af3eb8434 do_rootfs: Added PACKAGE_FEED_URIS functionality
Adding a common interface to add predefined package manager
channels to prebuilt rootfs:es.

Adding PACKAGE_FEED_URIS = "http://myre.po/repo/, will
assume repo directories named (rpm,ipk,deb) as subdirectories
and statically add them to the rootfs, using the same PKG_ARCHs
as the build which produced the images.

Tested with RPM, IPK and DEB.

deb feed functionality seem broken, is anyone using this ?

(From OE-Core rev: 9b8811045546ad67b4695d980f09636d5506e50c)

Signed-off-by: David Nyström <david.c.nystrom@gmail.com>
Signed-off-by: David Nyström <david.nystrom@enea.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-07 15:05:07 +00:00
Martin Jansa ff8d8fbc9e package.py: use subprocess.Popen for rpmdeps call
* I've noticed errors like this in log.do_package:

  DEBUG: Executing python function package_do_filedeps
  sh: 1: Syntax error: "(" unexpected
  sh: 1: Syntax error: "(" unexpected
  DEBUG: Python function package_do_filedeps finished

  which are actually caused by some filenames included in package
  containing '()' characters

  Maybe we should change meta/classes/package.bbclass to
  fail when some filedeprunner call fails like this and fix
  filedeprunner to escape '()' and other possibly dangerous chars
  it's called like this:
  processed = list(pool.imap(oe.package.filedeprunner, pkglist))

* don't use shell=True
* show the command when it fails and let do_package task to fail

(From OE-Core rev: 148c04c1bf39ca0d21288fdce61c51dc8e1c3226)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-07 14:58:46 +00:00
Laurentiu Palcu 01e5d7bc53 package_manager.py: make list_installed() list pkg dependencies too
list_installed("deps") will now return the package dependencies.

(From OE-Core rev: b16cd9eaa8190dc678af9d98a9bc4fb690809c5f)

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-07 14:58:46 +00:00
Ross Burton b4455d8c61 lib/oe: drop custom implementation of oe.path.relative
As we now require Python 2.7 and os.path.relpath() was added in 2.6 we can now
drop the reimplementation in oe.path.

oe.path.relative is simple now a wrapper that changes the order of the arguments
and it's use discouraged.

(From OE-Core rev: 1a03cd16401d2926bba902ffc5df30911b5c9394)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-07 14:58:44 +00:00
Laurentiu Palcu a820b3f78e image.py, rootfs.py, package_manager.py: redirect stderr to stdout when calling check_output()
If a command executed with subprocess.check_output() fails, the
subprocess.CalledProcessError.output contains only STDOUT and the user
needs to check the log.do_rootfs to see any other details.

This commit forwards stderr to stdout so that, in case of failure, the
entire error output will be displayed in terminal.

[YOCTO #5902]

(From OE-Core rev: 4661f1441429952f30e19cebd93dc42ce31fd868)

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-07 14:45:21 +00:00
Paul Eggleton d14090ab73 Rename PACKAGE_GROUP variable to FEATURE_PACKAGES
Since tasks were renamed to packagegroups some time ago, this variable
name implies that its usage is necessarily related to them which is not
the case. Rename the variable to more closely represent what it does
(whilst still providing backwards-compatibility with a warning for
PACKAGE_GROUP).

(From OE-Core rev: d703e07ea5056624101e1bc48f10d25b602635e9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-07 14:45:21 +00:00
Laurentiu Palcu 97289f7579 package_manager.py: RpmPM: don't add smart channel if already added
Make sure the channel was not already added, before attempting to add.

[YOCTO #5890]

(From OE-Core rev: 0574f5390fb8958db5864f41a7bd8037ac046ac5)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-05 15:50:20 +00:00
Laurentiu Palcu 61b8503f25 Revert "lib/oe/package_manager.py: RpmPM: fix issue with multilib builds"
Converting a list to a set does not keep the order of the items, as they
were added, which might result in the wrong packages being installed in
the final image...

This reverts commit 12f47c23df.

[YOCTO #5890]

(From OE-Core rev: 495cce9c9e63484c740aa669facb995b0ef74f85)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-05 15:50:20 +00:00
Laurentiu Palcu 16d271c14b package_manager.py: create index files for all backends in PACKAGE_CLASSES
The previous implementation was checking IMAGE_PKGTYPE and created the
index files just for the backend used to create the image. Apparently,
'bitbake package-index' should attempt to create the index files for all
backends specified in PACKAGE_CLASSES.

[YOCTO #5827]

(From OE-Core rev: 0521d48a1612bfc735e2c86acc9b685c1dc389ef)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-25 17:50:26 +00:00
Jonathan Liu 824cc75426 package_manager.py: correctly handle empty opkg-query-helper.py output
If the output from opkg-query-helper.py is empty, output.split('\n')
would result in a list containing one element which is an empty string
while iterating over each line in the output. An exception is then
thrown by the line:

    pkg, pkg_file, pkg_arch = line.split()

with the message:

    Exception: ValueError: need more than 0 values to unpack

To avoid this, we add a condition to only split the output if it isn't
empty.

(From OE-Core rev: ee7b75c895e77ab20f728423c8efc2ced92265e8)

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-25 08:03:32 +00:00
Richard Purdie 61890967ed lib/oe/rootfs: Fix LDCONFIGDEPEND check
We shouldn't be running this if it expands to None or "" or False
so update the code accordingly.

(From OE-Core rev: 255079780729f0dd9df6f35302169e0c8480eced)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-25 08:01:09 +00:00
Hongxu Jia 6ffc156550 manifest.py: remove redundant import line
The import oe.package_manager line is redundant, let's remove it.

(From OE-Core rev: ade1f3ce34489bba5a7ab23793c1d82559150583)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-21 16:14:15 +00:00
Hongxu Jia 3ccc90c9d0 rootfs.py: tweak _multilib_sanity_test for ipk incremental image generation
The _multilib_sanity_test installs multilib packages in a temporary
root fs, and compare with the current image to figure out duplicated
files that come from different packages.

While incremental image generation enabled and the previous image
was existed, there was an Multilib check error:
...
ERROR: Multilib check error: duplicate files tmp/work/qemux86_64-poky-
linux/core-image-minimal/1.0-r0/multilib/lib32/lib/libc.so.6 tmp/work/
qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/lib/libc.so.6
is not the same
...

The reason is the file in the existing image has been prelinked by
previous image generation and the file in a temporary root fs is not
prelinked, even though both of them came from the same package, the
Multilib check failed.

[YOCTO #1894]
(From OE-Core rev: 8d813f614cdfda31c85bbaf133f2822f90a4a78a)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-21 16:14:15 +00:00
Hongxu Jia ec87d0c8b9 rootfs.py: support BAD_RECOMMENDATIONS for ipk incremental image generation
While incremental image generation enabled and the previous image is
existed, if BAD_RECOMMENDATIONS is changed, the operation on the
existing image is complicated, so remove the old image in this situation.

The same with PACKAGE_EXCLUDE and NO_RECOMMENDATIONS.

[YOCTO #1894]
(From OE-Core rev: 0566de3fa424af3bdfadcd0a08ce4c214abda083)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-21 16:14:15 +00:00
Hongxu Jia 1d4462db62 rootfs.py: support ipk incremental image generation
The incremental image generation is based on the previous existing
image, adds new packages, upgrades existing packages, and removes unused
packages.

[YOCTO #1894]
(From OE-Core rev: adf587e55c0f9bc74f0bef415273c937401baebb)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-21 16:14:15 +00:00