Commit Graph

200 Commits

Author SHA1 Message Date
Richard Purdie
ffae400179 meta/lib+scripts: Convert to SPDX license headers
This adds SPDX license headers in place of the wide assortment of things
currently in our script headers. We default to GPL-2.0-only except for the
oeqa code where it was clearly submitted and marked as MIT on the most part
or some scripts which had the "or later" GPL versioning.

The patch also drops other obsolete bits of file headers where they were
encoountered such as editor modelines, obsolete maintainer information or
the phrase "All rights reserved" which is now obsolete and not required in
copyright headers (in this case its actually confusing for licensing as all
rights were not reserved).

More work is needed for OE-Core but this takes care of the bulk of the scripts
and meta/lib directories.

The top level LICENSE files are tweaked to match the new structure and the
SPDX naming.

(From OE-Core rev: f8c9c511b5f1b7dbd45b77f345cb6c048ae6763e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-09 16:31:55 +01:00
Alexander Kanavin
a3c4aaf9b3 lib/oe/package_manager.py: turn nativesdk postinst warnings into notes
The warnings deal with two specific cases of failure:
1) unable to execute nativesdk postinsts for mingw SDKs because
they need to be run under wine
2) unable to execute target postinsts when there is no qemu
usermode support for the target

Neither of these should be a big problem as mingw issue was never
found to problematic, and target postinsts deal with things that
are needed at runtime and not at build time which is the purpose
of SDKs.

The specific reason to do this is to reduce the amount of warnings
shown by the Yocto autobuilder, to zero eventually.

(From OE-Core rev: cbc32fcd9b52e750600cce9dd84b33e3ce612eae)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-25 10:43:07 +00:00
Alejandro del Castillo
d8e12f2bfc OpkgPM: use --add-ignore-recommends to process BAD_RECOMMENDATIONS
Currently, BAD_RECOMMENDATIONS on the opkg backed relies on editing the
opkg status file (it sets BAD_RECOMMENDATIONS pkg want state to
deinstalled and pinned). This is brittle, and not consistent across the
different solver backends. Use new --add-ignore-recommends flag instead.

(From OE-Core rev: 0d11e813ba9b4e8de9e6e5099ff85f5d914243bc)

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-08 10:57:19 +00:00
Angus Lees
dbb832b8cf package_manager.py: Use data.tar.xz for ipkg too
Commit b95b6ba1a2959e2294a8848fa35f20163388eb06 changed package_ipk.bbclass
to xz when building packages.  This updates OpkgDpkgPM.extract() accordingly.

(From OE-Core rev: c09a22c421a57701f6b943eb50b9bae1545e5b39)

Signed-off-by: Angus Lees <gus@inodes.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-06 08:29:06 +00:00
Alexander Kanavin
32309ba1de lib/oe/package_manager: turn postinst_intercept warnings into failures for nativesdk
The few cases where they failed should be now all fixed. The only allowed
exception is when building mingw32 SDKs, as there is currently no support for running
postinst_intercepts through wine.

(From OE-Core rev: 3dd2fea51110950ec3d8c444f599ff855b4b936c)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-26 13:39:37 +00:00
Richard Purdie
cd4b8a8553 meta: Fix Deprecated warnings from regexs
Fix handling of escape characters in regexs and hence fix python
Deprecation warnings which will be problematic in python 3.8.

Note that some show up as:

"""
meta/classes/package.bbclass:1293: DeprecationWarning: invalid escape sequence \.  

"""

where the problem isn't on 1293 in package.bbclass but in some _prepend to a
package.bbclass function in a different file like mesa.inc, often from
do_package_split() calls.

(From OE-Core rev: 4b1c0c7d5525fc4cea9e0f02ec54e92a6fbc6199)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-16 15:35:07 +00:00
Alexander Kanavin
e858593584 rpm: produce sane amount of logging when creating a rootfs
Previously there was lots of irrelevant noise in the logs,
because we also wanted to be able to debug postinst issues
easily. I have adjusted the logging levels so that
postinst info is still written to the logs, but other
things are not.

[YOCTO #13119]

(From OE-Core rev: ffb7b8f70937a7d95814c1a99527d5ea7cbf7cee)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-14 11:35:55 +00:00
Alexander Kanavin
00822848f5 package_manager.py: fix the message used to catch failing postinsts from dnf
Latest dnf versions have tweaked it.

(From OE-Core rev: 477db7cf4a6a0d06554c9d1539a01fed7c5cb389)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-22 12:02:57 +00:00
Richard Purdie
e2af21d119 lib/oe/package_manager: Avoid race problems when calling list_pkgs()
list_pkgs() for rpm calls RpmPM() which would try and create a copy of the
package feed. This can be called for example from buildhistory whilst some
other task may be working on an SDK or image construction, causing the package
feed to disappear part way through an operation.

Avoid the need to copy the package index just to list the installed
packages, avoiding the race.

(From OE-Core rev: d05fa49e06034913e22c223803c98cb265e2ae58)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-16 11:46:07 +00:00
Alexey Brodkin
ef63723965 locale: Allow usage of cross-localedef for ARC
With this it's possible to build locale data for ARC
and not do it instead on the first boot.

(From OE-Core rev: f13c303491dc8850126ea14baedc7b63b7b5ecf4)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-14 11:14:40 +00:00
Mingli Yu
f3e21c3b6e package_manager.py: correct the deploydir when packagefeed-stability inherited
After create_packages_dir added in below commit:
85e72e1 package_manager: Filter to only rpms we depend upon

When add below line into conf/local.conf
INHERIT += "packagefeed-stability"

There comes below error when do_rootfs
Exception: FileExistsError: [Errno 17] File exists: '/$Prj/tmp/deploy/rpm-prediff/i586/initscripts-1.0-r155.i586.rpm' -> '/$Prj/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/oe-rootfs-repo/rpm-prediff/i586/initscripts-1.0-r155.i586.rpm'

def create_packages_dir(d, subrepo_dir, deploydir, taskname, filterbydependencies):
  [snip]
  bb.utils.remove(subrepo_dir, recurse=True)
  [snip]

In create_packages_dir function, there is a logic
as bb.utils.remove(subrepo_dir, recurse=True) to
clean subrepo_dir which is actually as example is
/$Prj/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/oe-rootfs-repo/rpm.

But currently when inherit packagefeed-stability class,
the deploydir should be /$Prj/tmp/deploy/rpm-prediff,
not the default /$Prj/tmp/deploy/rpm.

If use /$Prj/tmp/deploy/rpm, then result in the
logic as below:
os.link("/$Prj/tmp/deploy/rpm-prediff/i586/initscripts-1.0-r155.i586.rpm", "/$Prj/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/oe-rootfs-repo/rpm-prediff/i586/initscripts-1.0-r155.i586.rpm")

Update to the actual deploydir to guarantee the logic
as below:
os.link("/$Prj/tmp/deploy/rpm-prediff/i586/initscripts-1.0-r155.i586.rpm", "/$Prj/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/oe-rootfs-repo/rpm/i586/initscripts-1.0-r155.i586.rpm")

(From OE-Core rev: 3b17052611e640fb3db5d03c06ab87185a12be58)

Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-28 08:31:57 +00:00
Ross Burton
1de82d5fc0 package_manager: handle remove() with no packages
If remove() is called with an empty package list, ensure we do nothing instead
of calling the underlying package manager with an invalid command line.

[ YOCTO #12900 ]

(From OE-Core rev: 715ec20c433cb4ed5fde938c33a42b2a296e4e56)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-18 23:26:35 +01:00
Ross Burton
8c5f73e78c package_manager: implement PACKAGE_EXCLUDE for opkg
opkg has supported the --add-exclude option to install since 0.3.0, so use it to
implement support for PACKAGE_EXCLUDE.

(From OE-Core rev: 6cc99d48c57cb22104980d0d758540e06cb7b80d)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-18 10:56:55 +01:00
Max Krummenacher
8c0a33f326 package_manager: use normalized path when doing the filtered copy
The linking/copying of the package files failes if the deploy dir is set
in a non normalized way e.g. like this DEPLOY_DIR = "${TOPDIR}/../deploy"

Then the simple string replacement which is used to calculated the link
destination from the link source fails, as the link source is normalized
but the deploydir prefix is not.

Normalizing deploydir fixes this.

(From OE-Core rev: e0ebfaa92bbfd3158b48e28dfb6435890c73bef3)

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-21 18:45:46 -07:00
Kai Kang
444b3139cd package_manager.py: add noarch to buildarch_compat
It fails to run rpmbuild to build a noarch package on target when it
contains 'BuildArch: noarch' in the spec file:

| error: No compatible architectures found for build

Add 'noarch' to buildarch_compat in configure file rpmrc to fix it.

(From OE-Core rev: 2bdddb458bcc779d595e972f60a719aeb1c1b6d5)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-05 18:00:25 +01:00
Alexander Kanavin
5e3a07180b lib/oe/package_manager: turn postinst failure warnings into bitbake failures
Sumo release provides a transition period so that deferrals to first boot
via 'exit 1' can be converted to pkg_postinst_ontarget(). For the next release
however, postinst script failures should be treated as such.

[YOCTO #12607]

(From OE-Core rev: 42acb0ebde4e88bcdf34a541b700f19d8607abb0)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-04 11:03:55 +01:00
Christopher Larson
85518a2001 oe.package_manager: support loading intercepts from multiple paths
- if POSTINST_INTERCEPTS is set, use the listed intercept files, or
- if POSTINST_INTERCEPTS_PATH is set, load from the listed paths, or
- if POSTINST_INTERCEPTS_DIR is set, load from it (for compatibility), or
- load from ${COREBASE}/meta/postinst-intercepts

(From OE-Core rev: 9ba2f2b1df277b2b881f68166d9cd1c19db66e23)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-16 09:49:39 +01:00
Richard Purdie
0bccf1dab1 package_manager: Add definitions for riscv machines
Add definitions to the locale table for riscv architecture.

(From OE-Core rev: 624f6fd50da764cde71eb24e40742a48fa65d13c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-15 21:45:58 +01:00
Richard Purdie
26a786f869 package_manager/sdk: Use filtered copies of the deploy ipk/deb directories
Similar to rpm, use copies of the ipk/deb directories for rootfs construction.
This means the image creation code can no longer "see" recipes wich aren't in its
dependency chain which is good for a variety of reasons including determinism,
incompatible recipe (e.g. systemd/sysvinit) package conflicts and locking
performance.

(From OE-Core rev: c7c5f4065c102fde4e11d138fb0b6e25bffe0379)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-15 09:44:33 +01:00
Richard Purdie
ad6b737029 package_manager: Remove rpm specific pieces of create_packages_dir()
This function is generic, tweak the variable names and move out the rpm specific
directory name to make it truly generic and reusable for deb/ipk.

(From OE-Core rev: dba876639b1fb8ea3ccb182c91e19966c4052115)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-15 09:44:33 +01:00
Richard Purdie
65c8154f21 image: Add locale archive optimisation
Refactor the locale archive function from the SDK to also make it work during
general image creation. This reduces the size of the locales from 900MB to 220MB
in core-image-lsb-sdk.

The exception handling around subprocess was dropped as the standard subprocess
exception printing is better handled than the catchall exception.

(From OE-Core rev: 8ffd93bdb09b0a4a84b27dafcd684c6abba392ed)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-15 09:44:33 +01:00
Richard Purdie
adea90740d package/package_manager: multiprocess_exec -> multiprocess_launch
After this replacement, the parent exception handling works so we don't
need subprocess wrapping with bb.error in the underlying functions.

The underlying contexts also have better module handling so the imports
can be cleaned up.

(From OE-Core rev: aa8260adf53139d776a2affe6118d28b295c1fab)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-24 11:52:27 +01:00
Joe Slater
058119da17 postinst-intercepts: do not execute any variant of delay_to_first_boot
As of commit 2c5c6e3ff we create multilib variants of intercept
hooks but we did not account for delay_to_first_boot variants.
This was covered up until commit a335e7867, but will now cause
an error.

(From OE-Core rev: 77f7c75481dceec36b7373f277c3bac811de9ef2)

Signed-off-by: Joe Slater <joe.slater@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-02 21:37:47 +01:00
Alexander Kanavin
4699d29ac2 package_manager.py: rework postinst_intercept failures
Previously a warning was printed regardless of context and nature
of the failure, and because it was only a warning, it was mostly ignored.

Now, the following is considered when a failure happens:
1) whether we are installing packages into a target image, or populating
a SDK with host or target packages.
2) whether the failure was due to qemu not supporting the target machine.

Accordingly, warnings, notes, and failures are printed, and postponing
to first boot happens if possible.

(From OE-Core rev: a335e78672b1e1ae3ea6427f6a805218e513bb52)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18 11:07:58 +01:00
Alexander Kanavin
ce12d183bb package_manager.py: get rid of ROOTFS_RPM_DEBUG in RpmPM()
This was undocumented, and it's better to just always enable
full debug output, as this allows immediate generation of logs
with full diagnostics when things go not as expected.

Also, change the output of dnf from note to debug level; this
does not affect what is written to log file, but does reduce the
verbosity of bitbake -v.

(From OE-Core rev: 9128fd1396729a71b4832a597cf070c2be922d63)

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>
2018-05-29 21:07:16 +01:00
Ross Burton
f0fe88b89f package_manager: expand the removal list for RPM
If package management is disabled we remove the state and configuration for the
package manager after the rootfs has been populated.  This list wasn't complete
and the DNF/RPM configuration files were left behind.

As we've added files to the list (and not just directories), expand the
backup/restore package management state code to handle this.

(From OE-Core rev: c8a6422457b4d29e6afd1e193b8b921287472137)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-22 13:13:32 +01:00
Alexander Kanavin
b897982679 package_manager.py: do not hardcode the task name when referring to log files
This can be do_rootfs or do_populate_sdk, or anything else.

(From OE-Core rev: e2e05a327e51339d45b53e0276c287ab314e3385)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-05 14:49:07 +01:00
Alexander Kanavin
ae66103939 package_manager.py: move intercept running logic from rootfs class to PackageManager class
This allows running the intercepts when creating SDKs, which previously
wasn't possible, as SDK code does not use the rootfs class, and calls
into PackageManager methods directly.

(From OE-Core rev: f830388c5e9125f385a42acd7365d1235967b57c)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-05 14:49:07 +01:00
Alexander Kanavin
19cd7a1776 package_manager.py: move postinst_intercept dir initialization from RootFS to PackageManager class
This will allow handling postinst_intercepts when populating SDKs (which
use PackageManager class directly, and do not utilize RootFS class).

(From OE-Core rev: 9454fd328040fd58c981d028a74fcf181bde8e89)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-05 14:49:07 +01:00
Alexander Kanavin
b224c4e152 package_manager.py: move target_rootfs property to common ancestor class
This will be useful when also moving postinst_intercept handling to
package manager class from rootfs class.

(From OE-Core rev: a4cd69bdd5b9dfa1125887f4d9038d41996e39c7)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-05 14:49:07 +01:00
Manjukumar Matha
18ba941eb0 package_manager.py: Skip gpgcheck while using dnf on target
By default, RPM_SIGN_PACKAGES is not defined. Add gpgcheck=0 to
oe-remote-repo.repo file, otherwise dnf will complain during
install operation on target

Note, RPM_SIGN_PACKAGES is set only when you inherit sign_rpm explicitly

(From OE-Core rev: 002a71eaa7606828c399972d8fd35e19e7b71929)

Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-05 14:49:07 +01:00
Alexander Kanavin
dad8f073e3 package-index: index also subdirectories when using rpm
Previously only the top-level index was created, which did not
work if PACKAGE_FEED_ARCHS whitelisting (or explicitly listing
architectures in dnf repo files by hand) was in use:
https://lists.yoctoproject.org/pipermail/yocto/2018-March/040327.html
https://bugzilla.yoctoproject.org/show_bug.cgi?id=12419

[YOCTO #12419]

(From OE-Core rev: f2a568ddb22f38114fdbc1d389c7556386ebb1fa)

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>
2018-03-20 09:59:32 +00:00
Ross Burton
11032bebe8 package_manager: format pydoc comments properly
(From OE-Core rev: b2770ec717d2b3cfc475c0cf7fa372fdb2f691a9)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-20 09:59:32 +00:00
Alexander Kanavin
cd005e2d5b meta/lib/oe/package_manager.py: warn about failing scriptlets for all package types
Previously this was done only for rpm packages; now also ipk/deb scriptlet
failures are reported.

In the future this will become a hard error, but it can't yet happen
due to the legacy 'exit 1' way of deferring scriptlet execution to first boot which
needs a deprecation period.

(From OE-Core rev: a36671faf6e0b7623185b0e22814a786d5444592)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-15 06:27:18 -07:00
Niko Mauno
0d4459e708 package_manager.py: Explicit complementary fail
When running bitbake -c populate_sdk <image_name>, it is expected that
packages matching SDKIMAGE_INSTALL_COMPLEMENTARY name mask (unless
declared in PACKAGE_EXCLUDE_COMPLEMENTARY) are installed to resulting
SDK. Underlying mechanism issues a package manager install call for set
of complementary packages. However the mechanism doesn't seem to inform
the user all too obviously in case the package manager command behind
install_complementary() method fails -- and since it is combined with
attempt_only=True option, user might end up wondering why several *-dev,
*-dbg packages are missing from resulting SDK.

Improve associated install() method behaviour in affected OpkgPM and
DpkgPM classes so that a problematic state of affairs becomes directly
obvious for bitbake user, resulting in shell output like:

  WARNING: someimage-1.0-r0 do_populate_sdk: Unable to install packages.
  Command '...' returned 1:
  Collected errors:
   * Solver encountered 1 problem(s):
   * Problem 1/1:
   *   - package somepkg-dev-1.0-r0.x86 requires somepkg = 1.0-r0, but
         none of the providers can be installed
   *
   * Solution 1:
   *   - allow deinstallation of someotherpkg-1.1-r1.x86

   *   - do not ask to install a package providing somepkg-dev

   * Solution 2:
   *   - do not ask to install a package providing somepkg-dev

(From OE-Core rev: 2502bd591c37bf532d02dc6b37fc1e8b5224fb0a)

Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-08 10:39:33 -08:00
Jason Wessel
22318836f6 package_manager.py: Print offending package instead of non-sense trace
If you have a package that does not generate a manifest due to using a
noexec rule, the package name should be printed so the problem can be
tracked down.  With out the patch you get an error that makes it look
more like the package_manager is broken as shown below.

oe-core/meta/lib/oe/package_manager.py', lineno: 534, function: create_packages_dir
     0530:
     0531:    for dep in rpmdeps:
     0532:        c = taskdepdata[dep][0]
     0533:        manifest, d2 = oe.sstatesig.find_sstate_manifest(c, taskdepdata[dep][2], taskname, d, multilibs)
 *** 0534:        if not os.path.exists(manifest):
     0535:            continue
     0536:        with open(manifest, "r") as f:
     0537:            for l in f:
     0538:                l = l.strip()
File: '/usr/lib/python3.5/genericpath.py', lineno: 19, function: exists
     0015:# This is false for dangling symbolic links on systems that support them.
     0016:def exists(path):
     0017:    """Test whether a path exists.  Returns False for broken symbolic links"""
     0018:    try:
 *** 0019:        os.stat(path)
     0020:    except OSError:
     0021:        return False
     0022:    return True
     0023:
Exception: TypeError: stat: can't specify None for path argument

(From OE-Core rev: 21924fdba286e5962b1680601664dc0491527e25)

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-07 06:34:51 -08:00
Ross Burton
8994767745 package-manager: add install_glob()
(From OE-Core rev: 8d1b530c82de386d4183f5673c060b9d416a3835)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-01 22:18:47 +00:00
Ross Burton
b194e2f15f package_manager: improve install_complementary
- 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)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-01 22:18:47 +00:00
Richard Purdie
3eff72cc1f sstatesig/staging/package_manager: Create common sstate manifest code
Create a common function for locating task manifest files rather than
several implementations with missing pieces.

(From OE-Core rev: 68150bac7444f089f19c789e9f6602d59f605d7a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-01 22:13:55 +00:00
Richard Purdie
6a07697a6d package_manager: Filter to only rpms we depend upon
Currently do_rootfs gets to see all rpms in the deploy directory. This filters
that view to only rpms which the image recipe has actual depends upon which
potentially removes some sources of confusion in the image construction.

This makes builds more reproducibile and also fixes contamination issues
where dnf picks up packages it shouldn't be able to 'see'.

[YOCTO #12039]

(From OE-Core rev: 85e72e129362db896b0d368077033e4a2e373cf9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-01 22:13:55 +00:00
Alexander Kanavin
7bc55b2960 meta/lib/oe/package_manager.py: deprecate 'exit 1' as a way to defer to first boot
'exit 1' is not optimal for two reasons:

1) Code is hard to read; it is not obvious that it means 'defer what follows to first boot'.
2) Worse, this hides actual errors in the scriptlets; there is no difference between scriptlet
failing because it's intended to be run on target and scriptlet failing because there's a bug or
a regression somewhere.

The new, supported way is to place the code that has to run on target into pkg_postinst_ontarget(),
or, if a more fine-tuned control is required, call 'postinst-intercepts defer_to_first_boot' from
pkg_postinst() to explicitly request deferral to first boot.

(From OE-Core rev: d12cf56e9ff2a4f13dfbef9290ea5647b52b3f6d)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-30 11:50:12 +00:00
Richard Purdie
902b77bf91 lib/oe/package_manager/sdk: Ensure do_populate_sdk_ext and do_populate_sdk repos don't conflict
The repository indexes updated during do_populate_sdk_ext and do_populate_sdk
can conflcit. Add the missing lockfile calls for deb/ipk and in the rpm case,
ensure different directories are used for the index for the two sdk cases.

(From OE-Core rev: 5e5569c962c9ebc898eeb5044214e95117b190e1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-22 10:39:10 +00:00
Richard Purdie
0d0984e1e6 nativesdk/sdk: Update sdk dummy providers
When we migrated rpm v5 -> v4, we lost the ability to drop "per file"
dependencies from the rpm backend for things like "/bin/bash" and
"/usr/bin/env" which meant the sdks were becomming 'bloated'.

This restores the functionality using a dummy package, similarly to
the way the buildtools perl issue was addressed. It also removes
the non-functional old code so as not to confuse people in future.

I ran into this problem trying to filter dependencies to only rpms
a build directly depends upon and it turns out we have some determinism issues
in this area so this is something key to fix.

(From OE-Core rev: 9d490dc01dcedb216129b22cbe17a6c99efc4f5c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-11 10:26:06 +00:00
Robert Yang
c60a2c3ffe package_manager.py: remove obsolete MULTILIB_ARCHS
It had been removed since 2011:

commit b774bf44ef004276da12a83ebd69715c00b596ac
Author: Lianhao Lu <lianhao.lu@intel.com>
Date:   Tue Aug 16 16:26:49 2011 +0800

    package(_ipk).bbclass: opkg using ALL_MULTILIB_PACKAGE_ARCHS

(From OE-Core rev: e03cfb5a04e359c0bacb002dc80f3348301445d3)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-06 22:32:22 +00:00
Robert Yang
70c122402f package_manager.py: print running dnf command
This can make debug easier, for example, makes it easy to run the
command mannually.

(From OE-Core rev: 220b912237da78d257c5310bd07db89489afede1)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-06 22:32:22 +00:00
Ross Burton
eeb79f4e18 package_manager: force dnf to refresh the cache
DNF has a time-based cache policy (and a great sense of humour) so it's possible
that 'dnf makecache' won't actually refresh any caches.  Force the cache updates
by passing --refresh.

(From OE-Core rev: a6e34b6aa194a27db9667af1fb0195ac8fb563f5)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-02 11:25:34 +00:00
Otavio Salvador
48d2dc6711 lib/oe/package_manager.py (rpm): Allow use of non-signed packages
When we wish to use the package feed for local development, it does
not uses GPG signed feeds by default but dnf uses package signature
check. We need to configure the GPG signature check out so it works
out of box.

With this patch, installing non-signed packages works:

$: dnf install <package>

(From OE-Core rev: bceafe23cbe12a1ab0628b70865cb8867c7d7ee1)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-10-07 23:20:40 +01:00
Mikko Ylinen
edb4d9984b package_manager: rpm: improve logging
To be able to better debug remove() behaviour, add more logging
to rpm calls via bb.note(). The change also makes remove() logging
more consistent with other package managers' remove() (e.g., opkg).

(From OE-Core rev: 1a90c97616698050529e169a83e6f07a255687df)

Signed-off-by: Mikko Ylinen <mikko.ylinen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-10-07 23:20:39 +01:00
Ming Liu
307f25c23e meta: drop True option to getVar calls
Search made with the following regex: getVar ?\((.*), True\).

(From OE-Core rev: dbc0eaf478feb3f752ae22fd184984494fc85d0a)

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-26 11:05:01 +01:00
Richard Purdie
91f9752cf1 package_manager: Clean up horrible 'None' return values
If this fails the exception will now be raised. Lets use that and drop
all this 'None' return value ugliness.

(From OE-Core rev: b3c63b3b816179b96f1ed9b5baaf6e1f1c3c7b80)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-02 00:52:10 +01:00