Commit Graph

132 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 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
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
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
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
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
Hongxu Jia af9e8e9132 package_manager.py: support ipk incremental image generation
Add the following three functions to OpkgPM class:
- The 'dummy_install' is used to dummy install pkgs, and returns the log
  of output;
- The 'backup_packaging_data' is used to back up the current opkg
  database;
- The 'recover_packaging_data' is used to recover the opkg database
  which backed up by the previous image creation;

Tweak 'remove' function in OpkgPM class, which the options for remove
with dependencies was incorrect.

Tweak 'handle_bad_recommendations' function in OpkgPM class:
- Fix none value check;
- Add the existance check of opkg status file;

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

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
Martin Jansa 7c75e86c2d package_manager.py: Fix $i -> %s in bb.note
* change the text a bit, because I have trouble parsing two
  verbs at the beginning of sentence.

(From OE-Core rev: 9837d194682f46e3a0363765bd6b317180a4cda0)

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-02-20 14:28:12 +00:00
Laurentiu Palcu 1988f7186b package_manager.py: fix installed package list creation for Opkg/Dpkg
Small error in the package list creation routine. Buildhistory was
supposed to use this but was never called. Hence, it escaped tests...

(From OE-Core rev: eaa1994ad22730cec8e8c57736915da6b45a416e)

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-02-20 14:28:10 +00:00
Richard Purdie 4dcd9d6cee lib/oe/package_manager: Make empty package directories non-fatal
Its perfectly reasonable to call -c package-index with empty package
directories. This ensures the builds don't fail in such cases,
resolving autobuilder failures.

(From OE-Core rev: 11e2aaf2d751277e3e99ac2acbbeff2b7227be94)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-16 16:31:01 +00:00
Laurentiu Palcu 155f8a4c54 package_manager.py: move multilib prefix list computation function to RpmIndexer
Since the code from anonymous function in rootfs_rpm.bbclass has been
removed, MULTILIB_PREFIX_LIST variable was never set. Hence not all
directories got indexed.

This commit will move the multilib prefix list computation function from
RpmPM class to RpmIndexer, since the indexer needs it too. I was hoping
to avoid this but, unfortunately, I couldn't.

(From OE-Core rev: d3ba249aa1bf68aaeed226e934a4f4d5b7a19286)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-14 22:58:45 +00:00
Laurentiu Palcu a0a0450981 package_manager.py, rootfs.py, sdk.py: add Indexer class
Because the package-index.bb needs to create package indexes outside
do_rootfs environment, move the indexing capability out of
PackageManager class to a smaller Indexer class.

This commit:
 * simply moves the indexing functions for ipk/deb with no changes;
 * rewrites the RPM indexing function so that it can be easily moved out
   of the PackageManager class;
 * removes some RPM duplicate code, moves it into a method inside
   RpmPM class and changes the RpmPM constructor so that the new method
   is effective;

(From OE-Core rev: d339d6f48f81330e94162f333aad76f3c65d6bfd)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-14 12:30:19 +00:00
Laurentiu Palcu b2c7cc7fe5 image.py, package_manager.py, rootfs.py: dump command output on error
Print the entire command output in case of errors.

(From OE-Core rev: 2253c9ac2caa61dee0bd4fea04d4d77b79be7b36)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:44 +00:00
Laurentiu Palcu 12f47c23df lib/oe/package_manager.py: RpmPM: fix issue with multilib builds
Use python sets instead of lists, to avoid duplicates. When doing a
multilib build, "smart channel --add" fails because it tries to add
'all' channel twice.

(From OE-Core rev: 730d675090eec5c03e444f0448d96a52035d0bef)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:44 +00:00
Laurentiu Palcu 847591e41a lib/oe/package_manager.py: check that package list is not empty
If we're just attempting to install packages and the package list is
empty, just return.

(From OE-Core rev: 8bf5d80e3502a71fdda688aace0799b47ae19b3b)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:44 +00:00
Laurentiu Palcu f4fa44cf91 rootfs.py, package_manager.py, sdk.py: Fix building from feeds feature for opkg
When using opkg as the PM backend, one has the option to provide custom
feeds to create the rootfs from.

This commit:
 * fixes this in the refactored code;
 * moves the custom config creation code to python;
 * clean up the package-ipk.bbclass;

(From OE-Core rev: 19c538f57c8fa7c566e88a6dbe13ea4826d4f26c)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:44 +00:00
Laurentiu Palcu ab8cbf35d6 lib/oe/package_manager.py: OpkgPM, bad recommendation handling change
The following commit:

rootfs_ipk: Ensure that BAD_RECOMMENDATIONS are honoured for all
architectures

changed the way BAD_RECOMMENDATIONS are handled. Make the change in the
new code too.

(From OE-Core rev: 7e518e399da51de3b159bd6804735b2f14c39357)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:44 +00:00
Laurentiu Palcu 8af55651ae lib/oe/package_manager.py: do not use stamps
Using stamps shortens rootfs/image creation because the package indexes
are not created again if no new package was installed in the deploy dir.
Unfortunately, there are some syncronization issues with
do_package_write_*() and the indexes are not properly created.

Will have to revisit this issue in the near future. For now, lose it.

(From OE-Core rev: 276f2a8a072ce243daa74210934ee63046e9c480)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:44 +00:00
Laurentiu Palcu 365b77909d lib/oe/package_manager.py: OpkgPM/DpkgPM fixes
This commit:
 * adds missing mark_packages() function for OpkgPM. This is needed to
 * manually change the packages installation status in the status file;
 * fix OpkgPM remove_packaging_data() issue;
 * fix OpkgPM handle_bad_recommendations() issue;
 * improve OpkgPM/DpkgPM mark_packages() regex pattern;
 * fix DpkgPM list_installed() problem;
 * fix DpkgPM _create_configs() problem: status file should not be
   truncated if it already exists/

(From OE-Core rev: d50a40100763dcbfabec2c147fdfcb46aa909329)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:43 +00:00
Laurentiu Palcu ce12c1bf9f lib/oe/package_manager.py: DpkgPM, use lock on deploy dir
Lock deploy directory against concurrent index creation.

(From OE-Core rev: 127d19b84e78b5e650d0e6d7eaf29a8b7d799e5e)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:43 +00:00
Laurentiu Palcu 65a28699c8 lib/oe/package_manager.py: RpmPM fixes
This commit:
 * fixes a crash when handling interecept hook failures which happened when
   MULTILIB_GLOBAL_VARIANTS was not set;
 * convert dashes to underscores and use sets (so that we make sure the
   items are unique) when creating RPM repos;
 * uses a regex pattern to search for packages in the feeds list. The
   old method could match also strings in the middle. For example: 'rpm'
   matched 'kernel-module-lttng-probe-rpm" in qemux86_64 feeds;
 * issue a bb.fatal if smart returns error while installing packages.
   Otherwise we might end up with an incomplete image...
 * fixes the /etc/rpm/platform file creation;

(From OE-Core rev: b98c7e4945f1c36a6e4f98144a3af4f3049450ae)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:43 +00:00
Hongxu Jia 4a6596d95f lib/oe/package_manager.py: moving global SCRIPTLET_FORMAT and DB_CONFIG_CONTENT to RpmPM
The tweak made the code looks better.

(From OE-Core rev: 8e06be633222635c549d7f067218e8b833e76bda)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:43 +00:00
Hongxu Jia c8f41d7e48 package_manger.py/rootfs.py: rename save_rpmpostinist with save_rpmpostinst
The tweak made the code looks better.

(From OE-Core rev: 61981755b4738ccc49be0e790de828f4166ef0e8)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:43 +00:00
Hongxu Jia 9c71ee080d lib/oe/package_manager.py: fix invoking rpm save_rpmpostinist failed
- Use self.target_rootfs instead of self.image_rootfs as saved dir;
- Remove redundant comment line;

(From OE-Core rev: 41d6edab676277afbcaa6cf41cd64a5663f09dc7)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:42 +00:00
Hongxu Jia c8103fba58 lib/oe/package_manager.py: support RpmPM
- Implementation RpmPM class
- Support rpm incremental image generation

(From OE-Core rev: ca5203d6b1bb0cbf7830ea4f46109c6867138efc)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:41 +00:00
Laurentiu Palcu 080ce63516 lib/oe/package_manager.py: fixes for dpkg backend
This commit contains the following fixes:
 * pass the apt config directory to the DpkgPM constructor, so one can
   instantiate this class multiple times and give it different config
   files (like for creating SDK);
 * change constructor argument name from 'dpkg_archs' to 'base_archs';
 * export APT_CONFIG environment variable before calling apt-get, not in
   constructor. If done in constructor, the last class instantiation,
   sets the environment, which is note desireable;

(From OE-Core rev: dc626cbcfd37c940bb8739b14d3ab8097e1760ea)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:40 +00:00
Laurentiu Palcu ed83ace10a lib/oe/package_manager.py: add support for opkg backend
Additionaly, the commit contains a couple of minor changes
(comments, error printing, etc).

(From OE-Core rev: ef3faaef6b1a25c943a8d5594ce55b0e558b62f3)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:39 +00:00
Laurentiu Palcu 2979098c57 lib/oe/package_manager.py: use the bitbake APT_ARGS variable
This commit will revert on using the bitbake APT_ARGS variable, so users
can alter the way apt is called without needing to change it in code.

(From OE-Core rev: ae337edc8ac441c947d1543c2800f37104a0be70)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:39 +00:00
Laurentiu Palcu 1b3e7f0e27 lib/oe/package_manager.py: add deploy dir locking mechanism
This is needed in order to serialize the index file creation when
multiple do_rootfs tasks are running in the same time.

(From OE-Core rev: cb03d15482569c2e56232c921526938dcecfdb68)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:39 +00:00
Laurentiu Palcu e1bb8a61a9 lib/oe/package_manager.py: add new package management library
This new library is intended to be used by the new python rootfs
creation code.

It implements the rpm/dpkg/opkg package management backends: RpmPM,
DpkgPM and OpkgPM.

The base API is this:
  update()
  install()
  install_complementary()
  remove()
  write_index()
  remove_packaging_data()
  list_installed()

All implementations have to provide these functions. Some backends may
need to implement additional functions though.

(From OE-Core rev: 224e5053044b4c7966fea3b8d199a3dfd4fe438e)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:38 +00:00