summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/package_manager.py
Commit message (Collapse)AuthorAgeFilesLines
* package_manager: fix install_glob to use morty sdk pkgdirArmin Kuster2018-04-051-1/+1
| | | | | | | (From OE-Core rev: c8ffc0a4456065479240de18e6080e90a7ee85c1) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package-manager: add install_glob()Ross Burton2018-04-051-0/+23
| | | | | | | | | | | | | | (From OE-Core rev: 8d1b530c82de386d4183f5673c060b9d416a3835) (From OE-Core rev: b9a7821086b5165fda9f1c8a7c79a7997803f2a6) (From OE-Core rev: c01a2c01a0c78a72ed715ac31a4578013ff44231) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> [Fixup for getVar True bit] Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager: improve install_complementaryRoss Burton2018-04-051-2/+2
| | | | | | | | | | | | | | | | | - No need to use bb.utils.which() as subprocess will search $PATH - Clarity flow by moving the install inside the try/except (From OE-Core rev: f4d22b7195dd8f08fe26dd353c7e860208e87d6a) (From OE-Core rev: 1267df89164d7dcbbf77668ac49452bd0df87b54) (From OE-Core rev: fdc95793dff3dbfa49faa19c51c7e8c9cd67dc6c) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> [Fixup do to merge conflict] Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager: flush installed_pkgs file before oe-pkgdata-util uses itMartin Jansa2018-04-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * since this commit: commit f5a1013ffa9815f22e13989e2bcb83f966e7ce2c Author: Ross Burton <ross.burton@intel.com> Date: Tue Apr 18 16:19:12 2017 +0100 package_manager: don't race on a file when installing complementary packages the file isn't closed before oe-pkgdata-util uses it and this temporary file might look empty to oe-pkgdata-util, because it wasn't flushed yet. Which resulted in almost empty debugfs tarballs and no locale packages in regular rootfs. * without this change: 124K May 30 07:41 core-image-full-cmdline-raspberrypi3-64-20170530054003-dbg.rootfs.tar.gz * with this change: 173M May 30 07:29 core-image-full-cmdline-raspberrypi3-64-20170530052715-dbg.rootfs.tar.gz (From OE-Core rev: 9b34200048b3d2b477a19b7ddc8d447f873adbb2) (From OE-Core rev: 667c43354e38c2fec1829089de0b7de076498e85) 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> (cherry picked from commit 877d38db08aa7060d16405443cf70539c559fe82) Signed-off-by: Anders Darander <anders@chargestorm.se> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager: don't race on a file when installing complementary packagesRoss Burton2018-04-051-25/+22
| | | | | | | | | | | | | | | | | | | | | | | PackageManager.install_complementary() uses WORKDIR/installed_pkgs.txt as a temporary file but if two tasks are executing for the same recipe which uses this file (e.g. bitbake my-image my-image:do_populate_sdk) then it's possible for the file to be overwritten or deleted. Instead of using a static filename, use tempfile to generate a unique name and ensure it is cleaned up when finished. Also move the glob generation/expansion earlier in the function as if there are no globs to install, we don't need to generate a package list. (From OE-Core rev: f5a1013ffa9815f22e13989e2bcb83f966e7ce2c) (From OE-Core rev: b02b54192ce71606aac30c21f3ff2199fa70a529) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> [Fixup do to merge conflicts] Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/package_manager/sdk: Ensure do_populate_sdk_ext and do_populate_sdk ↵Richard Purdie2018-04-051-1/+2
| | | | | | | | | | | | | | | repos don't conflict (From OE-Core rev: c9c0927bb6e71253cbdd5b6b780dca829526e1d8) (From OE-Core rev: a18942b0b3b848ccfa4bc50c56a565c279da9d74) (From OE-Core rev: 94e21cf21f8d8adad352ef2f94d4f75e36cd843a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> [Fixup do to merge conflicts] Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/package_manager: bail if createrepo can't be foundRoss Burton2018-04-051-0/+4
| | | | | | | | | | | | | | | | | If createrepo isn't found then the errors later are mysterious, so explicitly check and error out early if it isn't there. (From OE-Core rev: e09636bbb3ea8ec58984197fd9c691bb908efe00) (From OE-Core rev: c87361fc886432a9db584712bf3e41ecd0541960) (From OE-Core rev: 0adc876ed8be21190510a91220f9755c8e9df021) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> [Fixup do to merge conflicts] Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager: remove strings and migrate to direct arraysStephano Cetola2018-04-051-119/+114
| | | | | | | | | | | | | | | | | | When using subprocess call and check_output, it is better to use arrays rather than strings when possible to avoid whitespace and quoting problems. [ YOCTO #9342 ] (From OE-Core rev: b12cec9a5ef14ecb02be7feec65508cf5d65c795) (From OE-Core rev: 60ba1d424636bdd5700ec3ee0acec5c19550b884) Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/package_manager: .deb pre/postinst argsLinus Wallgren2018-04-051-6/+11
| | | | | | | | | | | | | | | | | | | | The debian policy manual and MaintainerScripts wiki page states that the postinst script is supposed to be called with the `configure` argument at first install, likewise the preinst script is supposed to be called with the `install` argument on first install. https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html https://wiki.debian.org/MaintainerScripts (From OE-Core rev: 3d9c3aae54589794ce3484fa1b21d1af2bd32661) (From OE-Core rev: ba59b6416f24ad53f1caccf9185b46cb60da213a) Signed-off-by: Linus Wallgren <linus.wallgren@scypho.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager.py: respect OPKGLIBDIRMartin Jansa2017-05-181-7/+14
| | | | | | | | | | | | | | | | | | | | * respect it for incremental rootfs generation * add lists_dir option to opkg.conf * also fix setting info_dir and status_file when they use default value, the problem is that self.opkg_dir is already prefixed with rootfs directory, comparing it with /var/lib/opkg always returned false and the options were appended to config file unnecessary * with opkg 0.3.4 we can use VARDIR prefix added in: commit d2a8e23dc669adc398f4bb8bcfcabfcf925708f7 Author: Florin Gherendi <floring2502@gmail.com> Date: Mon Dec 19 12:25:38 2016 +0200 libopkg: make the /var and /etc directories configurable at compile time. (From OE-Core rev: f1d21d1d408d89cc3bd59cd30ab10c902863c7c0) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager.py: correctly remove all dependent packagesSamuli Piippo2016-11-161-1/+1
| | | | | | | | | | | | | | | Do not use --force-depends when trying to remove all dependent packages, as it removes only the selected package and not the dependent packages. (From OE-Core rev: a82e8725902086dab785a0b14305927dae1e4e8d) (From OE-Core rev: 0666c66b2719f59e556c12d5875dea696006ed0b) Signed-off-by: Samuli Piippo <samuli.piippo@qt.io> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager.py: Allow multiple regexps in PACKAGE_EXCLUDE_COMPLEMENTARYPeter Kjellerstedt2016-10-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The PACKAGE_EXCLUDE_COMPLEMENTARY variable can currently only contain one regular expression. This makes it hard to add to it from different configuration files and recipes. Allowing it to contain multiple, whitespace separated regular expressions should be backwards compatible as it is assumed that whitespace is not used in package names and thus is not used in any existing instances of the variable. After this change, the following three examples should be equivalent: PACKAGE_EXCLUDE_COMPLEMENTARY = "foo|bar" PACKAGE_EXCLUDE_COMPLEMENTARY = "foo bar" PACKAGE_EXCLUDE_COMPLEMENTARY = "foo" PACKAGE_EXCLUDE_COMPLEMENTARY += "bar" (From OE-Core rev: a5f7e98a94e96d40b1276c85249619aa8d7be847) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager.py: Allow a leading - in PACKAGE_EXCLUDE_COMPLEMENTARYPeter Kjellerstedt2016-10-061-1/+1
| | | | | | | | | | | | | | | | | | | | This allows a regular expression specified in PACKAGE_EXCLUDE_COMPLEMENTARY to have a leading dash. Without this, the dash was treated by oe-pkgdata-util as the beginning of a command line argument. E.g., if PACKAGE_EXCLUDE_COMPLEMENTARY = "-foo$", it resulted in an error like: ERROR: <imagename>-1.0-r0 do_populate_sdk: Could not compute complementary packages list. Command '<topdir>/scripts/oe-pkgdata-util -p <builddir>/tmp/sysroots/<machine>/pkgdata glob <workdir>/installed_pkgs.txt *-dev *-dbg -x -foo$' returned 2: ERROR: argument -x/--exclude: expected one argument usage: oe-pkgdata-util glob [-h] [-x EXCLUDE] pkglistfile glob [glob ...] (From OE-Core rev: ac4ca41d3a27356d46c0c39053e74d3519b24c44) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager.py: Change diagnostic messages per IRCMark Hatle2016-09-201-8/+12
| | | | | | | | | | | | | Based on a discussion with IRC user: Ulfalizer It was suggested that removing the diagnostic list, and replacing it with a simple hint to what might be causing the problem was a better solution. (From OE-Core rev: ca78313665b23bd7fee85f034acfe1eb1009bd65) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager.py: Adjust error message orderMark Hatle2016-09-201-4/+4
| | | | | | | | | | | | Move the debug before the error (as it can take many pages.) This makes it much easier for the user to see the actual error message as it is still on the screen. (From OE-Core rev: d643fb2a9cb5bd0d8b0105e9d44b989a49ffa963) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager.py: fix bitbake package-index failedHongxu Jia2016-09-161-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the following commit in oe-core move RPM metadata from DEPLOY_DIR to WORKDIR. ----------- commit a92c196449c516fe51786d429078bbb1213bb029 Author: Stephano Cetola <stephano.cetola@linux.intel.com> Date: Wed Aug 10 13:03:16 2016 -0700 Allow for simultaneous do_rootfs tasks with rpm Give each rootfs its own RPM channel to use. This puts the RPM metadata in a private subdirectory of $WORKDIR, rather than living in DEPLOY_DIR where other tasks may race with it. ----------- In the modification of 'class RpmIndexer, it should not directly set arch_dir with WORKDIR. It caused 'bitbake package-index' could not work correctly. Assign WORKDIR as input parameter at RpmIndexer initial time could fix the issue. (From OE-Core rev: 3c8c8501d0a19b566a94a9e06afe40642b444958) 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>
* Allow for simultaneous do_rootfs tasks with rpmuninative-1.3Stephano Cetola2016-08-121-3/+14
| | | | | | | | | | | | | | | | | | | | | | Give each rootfs its own RPM channel to use. This puts the RPM metadata in a private subdirectory of $WORKDIR, rather than living in DEPLOY_DIR where other tasks may race with it. This allows us to reduce the time that the rpm.lock is held to only the time needed to hardlink the RPMs, allowing the majority of the rootfs operation to run in parallel. Also, this fixes the smart tests by generating an index for all packages at the time of the test, rather than using the one provided by the rootfs process. Original credit for the enhancement should go to Steven Walter stevenrwalter@gmail.com. (From OE-Core rev: a92c196449c516fe51786d429078bbb1213bb029) Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager.py: Avoid installing an empty package listMark Hatle2016-07-211-0/+3
| | | | | | | | | | | | | | | It is possible in an attempt only install, that everything listed is not available to be installed. This will have the effect of clearing the package list. However, we only check for an empty package list at the beginning of the function. We need to also check before running the install, otherwise we can fail due to 'error: no package(s) given". (From OE-Core rev: 9ae6a2830dacb3c335754a6da91bd5cc30546b31) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/package_manager: keep platform_extra and default_platform_extra lists ↵Bill Randle2016-07-011-6/+7
| | | | | | | | | | | | | | | | | | ordered In RpmPM:insert_feeds_uris, the paths are kept in sets, which are unordered, but they are later used to set the priority for the Smart channels, so unexpected results could occur. Change the sets to lists and use the same code as in create_configs() to add items to the list, rather than the set operators. [YOCTO #9717] (From OE-Core rev: ce4137f4bb955207fede0c4ef338835d9a461f59) Signed-off-by: Bill Randle <william.c.randle@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager.py: specify tmpdir for opkgChen Qi2016-06-231-1/+1
| | | | | | | | | | | | | | | Specify tmpdir for opkg via '-t' option so that opkg does not use the default 'TMPDIR' which usually is '/tmp' on build host. This would solve race problems like below. sh: /tmp/opkg-rOG6Tl/opkg-intercept-iPoEp5/depmod: Permission denied (From OE-Core rev: 5665e284b7e7ee071201664dc50a3412bd4ac8cd) 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>
* package_manager: Fix multilib package arch ordering issuesRichard Purdie2016-06-211-8/+4
| | | | | | | | | | | | | | | | | | | | | Order is not preserved in dict() and this code depends on the order of these lists of package architectures used when multilibs are enabled. This caused 'random' breakage where sometimes the correct order was present and sometimes it wasn't. Use collections.OrderedDict() to avoid this problem. Kudos to Bill Randle and Alejandro Hernandez who did most of the work debugging this, I simply took the problem they identified and wrote a patch to fix it. This unblocks the M1 build but this code needs auditing as there are clearly other ordering issues (e.g. the set() usage). [YOCTO #9717] (From OE-Core rev: 61a33582dfc964d612d20d34734a787d873e312c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe/lib/pacakge_manager.py: Update missing pipeline decodingMariano Lopez2016-06-071-2/+2
| | | | | | | | | | | | Adds decoding needed by some commands output later used as strings. [YOCTO #9702] (From OE-Core rev: 0440b5ace411c61f802376d4e1c9eac93e72d65f) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/package_manager: adapt for Python 3Ross Burton2016-06-051-2/+2
| | | | | | | | | | string.rstrip() doesn't exist in Python 3, so use the .rstrip method on the object itself instead. (From OE-Core rev: 554719e3f65e468f89a96d4869766d3ff7a8012e) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/lib: Complete transition to python3Richard Purdie2016-06-021-8/+3
| | | | | | | | | This patch contains all the other misc pieces of the transition to python3 which didn't make sense to be broken into individual patches. (From OE-Core rev: fcd6b38bab8517d83e1ed48eef1bca9a9a190f57) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/lib: Update to explictly create lists where neededRichard Purdie2016-06-021-3/+3
| | | | | | | | | Iterators now return views, not lists in python3. Where we need lists, handle this explicitly. (From OE-Core rev: caebd862bac7eed725e0f0321bf50793671b5312) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/lib: Update to use python3 command pipeline decodingRichard Purdie2016-06-021-43/+45
| | | | | | | | | | | In python3, strings are unicode by default. We need to encode/decode from command pipelines and other places where we interface with the real world using the correct locales. This patch updates various call sites to use the correct encoding/decodings. (From OE-Core rev: bb4685af1bffe17b3aa92a6d21398f38a44ea874) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/lib: Convert to use python3 octal syntaxRichard Purdie2016-06-021-2/+2
| | | | | | | | The syntax for octal values changed in python3, adapt to it. (From OE-Core rev: 737a095fcde773a36e0fee1f27b74aaa88062386) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/package_manager.py: Add pkgpath to dict returned by package_infoMariano Lopez2016-05-301-17/+24
| | | | | | | | | | | | | | Having the package path with all the other package info allows to reuse more code and have this information outside the package manager, without additional processing. [YOCTO #8536] (From OE-Core rev: 343f762792cbfccffaf3aa901289f9bb0f8cef3d) 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>
* package_manager: no need to output Note: in bb.note() callsRoss Burton2016-05-221-8/+8
| | | | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager.py: Add extract() method for RPM package managerMariano Lopez2016-05-141-0/+85
| | | | | | | | | | | | This new method extract the content of RPM file to a tmpdir, without actually installing the package. [YOCTO #9569] (From OE-Core rev: 5f5c2a0fac5ad2baca162902410064375e8c610c) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager.py: Add extract() method for opkg and dpkgMariano Lopez2016-05-141-6/+134
| | | | | | | | | | | | | | | | | | Sometimes it is needed to have the content of a package outside the recipe context. This new method extract the content of an IPK/DEB file to a tmpdir, without actually installing the package. A new OpkgDpkgPM class was added to share the code for opkg and dpkg. There were need some changes to opkg_query() in order to use it with apt-cache output. Also set default values to avoid UnboundLocalError [YOCTO #9569] (From OE-Core rev: 7d214b34e11dc57316ed5c1c7747c4601286f6d2) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager.py: Move opkg_query() outside of Indexer classMariano Lopez2016-05-141-53/+51
| | | | | | | | | | | | | | | When using the opkg and apt-get package managers the function opkg_query() can be useful when query for package information. This change moves the function outside the Indexer class so the Indexer, OpkgPM, DpkgPM can benefit from it. [YOCTO #9569] (From OE-Core rev: 799bc1d1c747aad02b6d844bf55abfbd3ecc034c) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager.py: better error handling in opkg's package listingPatrick Ohly2016-04-051-6/+9
| | | | | | | | | | | | | | | opkg does not return a non-zero exit code even if it found errors. When that happens, parsing the output leads to strange follow-up errors. To avoid this we need to check explicitly for non-empty stderr. Reporting only that on a failure also leads to shorter error messages (stdout may be very large). (From OE-Core rev: 7d9e915224a9bc451fddfbbfad533d9b06e9987d) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/package_manager: remove RPM4 support codeJoshua Lock2016-03-201-56/+38
| | | | | | | | | | | Simplify the RPM code by removing support for RPM 4 now that we've dropped the RPM 4 recipe. (From OE-Core rev: 7db6f0a402948ce489bafadf2e389802f764f122) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager.py: Fix race condition in OpkgIndexer.write_index()Mariano Lopez2016-03-121-4/+4
| | | | | | | | | | | | | | | | When writing the index using ipk packages there could be a race condition when populate the index. This happens because the architectures are repeated (specially all) and the commands generated to write the index run in parallel. This change avoid the duplication of commands using a set instead of a list. [YOCTO #8924] (From OE-Core rev: 74adb14b0002e20099cc2c34e01862e8ddb8e013) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sign_package_feed: add feed signature typeIoan-Adrian Ratiu2016-03-111-2/+8
| | | | | | | | | | Signing package feeds will default to ascii armored signatures (ASC) the other option being binary (BIN). This is for both rpm and ipk backends. (From OE-Core rev: 862a3892feb2628282e1d6f2e4498a7a3bd60cbf) Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager: sign IPK package feedsIoan-Adrian Ratiu2016-03-111-2/+12
| | | | | | | | | Create gpg signed ipk package feeds using the gpg backend if configured (From OE-Core rev: a2ee831cfb688bc64c071f75a1dff8a963abe287) Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rpm: Uprev to rpm-5.4.16 (pre) and rpm-5.4+cvs to current CVS headMark Hatle2016-03-091-5/+9
| | | | | | | | | | | | | | | | | | | | | | meta/lib/oe/package_manager.py was also updated. This ensures that any diagnostic messages are ignored from the output of rpmresolve. The patches have been split into bug fixes (things that belong upstream) and local changes that are OE specific. The following patches are obsolete and have been removed: rpm-remove-sykcparse-decl.patch fstack-protector-configure-check.patch rpm-disable-Wno-override-init.patch rpm-lua-fix-print.patch rpm-rpmpgp-fix.patch verify-fix-broken-logic-for-ghost-avoidance-Mark-Hat.patch (From OE-Core rev: ee97e53fcceabc6ef4ddc68f38c5fa0e05c5d9a8) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* signing-keys: Make signing keys the only publisher of keysRandy Witt2016-02-261-10/+0
| | | | | | | | | | | | | Previously the keys were put into the os-release package. The package indexing code was also deploying the keys rather than only using the keys. This change makes signing-keys.bb the only publisher of the keys and also uses standard tasks that already have sstate. (From OE-Core rev: 1e38068ac38dfd067655dfd41464e28439179306) Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sign_rpm.bbclass: do not store key details in signer instanceMarkus Lehtonen2016-02-191-5/+4
| | | | | | | | | | | | | Refactor the LocalSigner class. Do not store keyid or passphrase file in the signer object as they are only needed for some of the methods. For example, the newly added verify() method does not need any key parameters and export_pubkey only uses keyid. (From OE-Core rev: e2412294b6b1d3a80ee97a0706613349edc51d33) 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>
* package_manager.py: fix python indentation bug (opkg)Ioan-Adrian Ratiu2016-02-061-8/+8
| | | | | | | | | | | | 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>
* lib/oe/package_manager: remove package feed listsStefan Agner2016-01-311-3/+8
| | | | | | | | | | | | | 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>
* meta/lib: new module for handling GPG signingMarkus Lehtonen2016-01-261-20/+11
| | | | | | | | | | | | | | | | | 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>
* lib/oe/package_manager: prevent testing an undefined variableJoshua Lock2016-01-241-0/+1
| | | | | | | | | | | | | 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>
* lib/oe/package_manager.py: Remove list() from PkgsList classMariano Lopez2016-01-201-153/+0
| | | | | | | | | | | | 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>
* lib/oe/rootfs: Use list_pkgs() instead of list()Mariano Lopez2016-01-201-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* lib/oe/package_manager: Add list_pkgs() to PkgsList classMariano Lopez2016-01-201-0/+135
| | | | | | | | | | | | | | | | | | | 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>
* package_manager.py: fixes for multilib deb packaging buildsMatt Madison2016-01-111-6/+11
| | | | | | | | | | | | | | | | | | | * 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>
* package_manager.py: add debugging support for rpm scriptlet executionPatrick Ohly2015-12-281-5/+30
| | | | | | | | | | | | | | | | | | | | | | | 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>
* lib/oe/package_manager: Introducing PACKAGE_FEED_BASE_PATHS/PACKAGE_FEED_ARCHSLeonardo Sandoval2015-12-091-55/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>