Commit Graph

139 Commits

Author SHA1 Message Date
Richard Purdie f01b909a26 package_ipk: Clean up Source entry in ipk packages
There is the potential for sensitive information to leak through the urls
there and removing it brings this into the behavior of the other package
backends since filtering it is likely error prone.

Since ipks don't appear to be generated at all if we don't set this, set
the field to the recipe name used (basename only, no paths). This avoids
information leaking. We may want to drop the field if opkg can allow that
at a future point but the recipe name is a suitable identifier for now.

Reported-by: Andrej Valek <andrej.valek@siemens.com>
(From OE-Core rev: 0b5e0d072f93a958e4211a8aeb2fd8cc3c25cc21)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-16 10:21:02 +01:00
Mariano Lopez 78971cee15 package_ipk.bbclass: Replace empty lines in DESCRIPTION with '.'
opkg uses empty lines as separator for next package and if an ipk file was
packaged with empty lines in DESCRIPTION opkg won't be able to handle such ipk
file, this happens at execution time.

This commit will replace empty lines in DESCRIPTION with a '.' when generating
an ipk package to avoid this issue.

[YOCTO #10677]

(From OE-Core rev: 3e678d9b6a9eaeed76ce538d7f6ecf9f423864bc)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-10 23:00:42 +01:00
Richard Purdie bfd0a39bdf classes: Drop now unneeded update_data calls
Now that the datastore works dynamically we don't need the update_data calls
so we can just remove them. They're not actually done anything at all for
a while.

(From OE-Core rev: 8de0c5d3bd01919e2bf0394f9c485936d6098cec)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 09:29:55 -08:00
Richard Purdie 2628a65ffe package_ipk: Clean up pointless exception handling
The exception handling in this function seemed mildly crazy. Python will
given perfectly good or in several cases better information if we let its
standard traceback/exception handling happen. Remove the pointless code.

(From OE-Core rev: 61390438aec4a1f9beb4d332821cc6cda82e0379)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22 09:05:39 +00:00
Richard Purdie 596c9eff21 package_ipk: Improve failure debug output
Currently if the dpkg-deb command fails you see an error message like this:

ERROR: nss-3.27.1-r0 do_package_write_ipk: opkg-build execution failed
ERROR: nss-3.27.1-r0 do_package_write_ipk: Function failed: do_package_ipk

which is pretty much useless. If we use subprocess.check_output, we see a
traceback and then:

Exception: subprocess.CalledProcessError: Command '<cmd>' returned non-zero exit status 1

Subprocess output:
<output>

which is much easier to debug from.

(From OE-Core rev: 64c8366a805e9cf0168ea2331c50c8d6a70c6dc4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22 09:05:39 +00:00
Richard Purdie bc7162a46c classes/package*: Add support for PACKAGE_WRITE_DEPS
Add a new variable to allow markup of postinstall (and preinst)
script dependnecies on native/cross tools.

If your postinstall can execute at rootfs creation time rather than on
target but depends on a native tool in order to execute, you need to
list that tool in PACKAGE_WRITE_DEPENDS.

(From OE-Core rev: aff8ca95b8303a4a2a5600c0d8ec0a50ad677258)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:49 +00:00
Joshua Lock c4e2c59088 meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Ulf Magnusson 9efdd605c9 package_ipk.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: 01e3ac73860a24710852383a15bb5d01db13de57)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:04 +01:00
Robert Yang b8e2bab119 meta: cleanup d.getVar(var, 1)
(From OE-Core rev: 79fe476be233015c1c90e9c3fb4572267b5551d1)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-14 22:22:07 +01:00
Robert Yang cbf7902030 package_deb.bbclass/package_ipk.bbclass: sort RPROVIDES
The dict.fromkeys() creates a dict without order, there might be a
problem when build the same recipe again, for example:

- First build of make:
  Provides: es-translation, make-locale
- Second build of acl:
  Provides: make-locale, es-translation

They are exactly the same Provides, but tools like "diff" doesn't think
so. Sort RPROVIDES will fix the problem.

(From OE-Core rev: 3506172d7d9f8d92362b6ebb75582b7c3e662dae)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:28 +01:00
Ross Burton 792fd38885 package_ipk: restore cwd after packaging
opkg-build needs to be executed in the root of the package, so save and restore
the current directory so this task doesn't modify the state.

(From OE-Core rev: 43dac97f397143abf61fc1c105ea0e4f2fffb90b)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 18:11:10 +01:00
Richard Purdie 297438e965 classes/lib: Convert to use python3 octal syntax
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>
2016-06-02 08:24:00 +01:00
Ioan-Adrian Ratiu 2fccd8aa1c gpg_sign: add local ipk package signing functionality
Implement ipk signing inside the sign_ipk bbclass using the gpg_sign
module and configure signing similar to how rpm does it. sign_ipk uses
gpg_sign's detach_sign because its functionality is identical to package
feed signing.

IPK signing process is a bit different from rpm:
    - Signatures are stored outside ipk files; opkg connects to a feed
server and downloads them to verify a package.
    - Signatures are of two types (both supported by opkg): binary or
ascii armoured. By default we sign using ascii armoured.
    - Public keys are stored on targets to verify ipks using the
opkg-keyrings recipe.

(From OE-Core rev: a40f27aa7802e8a0bd87a5417e35adbface62d05)

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-11 16:50:45 +00:00
Vladimir Zapolskiy 4515186bc4 package_ipk: allow to specify OPKG_ARGS in local.conf
If user specific parameters to opkg are set in local.conf, they are
rewritten in package_ipk.bbclass and ignored, instead append
package_ipk specific arguments to the user defined ones.

The change is needed, if a user has to pass an alternative path to a
temporary directory for opkg, e.g.

  OPKG_ARGS = "--tmp-dir=${TOPDIR}/tmp-opkg"

The default /tmp directory may be unusable for do_rootfs task, for
example if there is no enough space or /tmp is mounted with noexec
mount option, then an alternative path allows to complete do_rootfs
and fix the problems like this:

  ERROR: Unable to install packages.
  ...
  sh: /tmp/opkg-5jPLag/run-postinsts-UsUtaI/preinst: /bin/sh: bad interpreter: Permission denied
  sh: /tmp/opkg-5jPLag/base-files-4hFwQS/preinst: /bin/sh: bad interpreter: Permission denied
  sh: /tmp/opkg-5jPLag/run-postinsts-UsUtaI/preinst: /bin/sh: bad interpreter: Permission denied
  sh: /tmp/opkg-5jPLag/busybox-syslog-sJmfbw/preinst: /bin/sh: bad interpreter: Permission denied
  ...

(From OE-Core rev: 0be4c30aaf03de58d8037a89e342ca0b379a0881)

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-09 08:48:24 +00:00
Richard Purdie 66b7dfb73d package_*.bbclass: Ensure OVERRIDES doesn't change sstate signature
Changes to OVERRIDES (e.g. from changing MACHINE) should not change
the sstate signatures of do_package_write_*. Exclude the variable
explicitly in the package classes to avoid this.

(From OE-Core rev: 5826a9260138c437f87ba1a9f84d5c08442b997d)

(From OE-Core rev: 59ccabdfb59a3e0917585dafab7a1e7c71330996)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 12:36:01 +01:00
Richard Purdie 00765258a2 package_ipk/deb: Drop version information from RPROVIDES
In some scenarios rpm needs version information from RPROVIDES. We can
add this to the metadata where needed however we need to stop it entering
the ipk/deb packages. This data is not needed due to the way opkg/dpkg
handle the data.

This patch ensures that data isn't used.

(From OE-Core rev: c68b975693c10899ce50b4d8c2aa3985ca890ce3)

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
Richard Purdie af377d6e0c package_ipk/deb/rpm: Improve OVERRIDES handling
(From OE-Core rev: 59ca90114fb0b770d9d79e548b7e52aa0c089e48)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-16 14:21:29 +01:00
Chen Qi 0aa5ea1251 packaging: allow globs in CONFFILES
Allow globs in CONFFILES.

This patch changes the way of CONFFILES handling. After this  change,
the CONFFILES can take the same form as FILES. That means, we don't
have to list a bunch of files for CONFFILES. It will just be expanded
like the FILES variable.

We don't assume default value for CONFFILES in OE. But distro vendors could
provide a default value for CONFFILES in their distro configuration file
like below.

    CONFFILES = "${sysconfdir}"

In this way, files under /etc are treated as configuration files by
default. Of course, setting CONFFILES in recipes take precedence over
the CONFFILES. For example, if the recipe author decides that package A
should only treat files under ${sysconfdir}/default/ as config files,
he/she can write like this.

    CONFFILES_A = "${sysconfdir}/default"

[YOCTO #5200]

(From OE-Core rev: 0d446ef0e5bbca7058eec7259e34f2a1637dfab1)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-19 07:51:38 +00:00
Mark Hatle 09a51b9976 package_ipk.bbclass: Fix SRC_URI whitespace handling
The SRC_URI may contain whitespace, but be otherwise empty.  This can happen
in the case:

MYSRC = ""
MYSRC_arm = "file://myarm.patch"
SRC_URI += "${MYSRC}"

Unless we strip blank spaces, to determine if it is empty, we can end up
generating a "Source: " line which in invalid.  This leads to the error:

  invalid Source: field is speified in the generated CONTROL file

(From OE-Core rev: 16cedc3bce6fc37543e9ef053cd7c589e523ca1c)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-06 16:03:13 +01:00
Paul Barker 1306f263ed package_ipk.bbclass: Support hierarchical feed
This patch allows for an optional new layout for ipk feed directories which I've
called a 'hierarchical feed' and is based on how Debian pools package files. It
is disabled by default and is enabled by setting IPK_HIERARCHICAL_FEED to "1".

In the traditional feed layout, package files are placed in <outdir>/<arch>/.
This can lead to several thousand files existing in a single directory which is
often a problem if developers want to upload a package feed to a shared web
hosting provider. For example, in my case, listing files via FTP only shows the
first 2000 files, breaking my scripts which attempt to upload only new and
changed files via FTP.

In the hierarchical feed, package files are written to
<outdir>/<arch>/<pkg_prefix>/<pkg_subdir>, where pkg_prefix is the first letter
of the package file name for non-lib packages or "lib" plus the 4th letter of
the package file name for lib packages (eg, 'l' for less, 'libc' for libc6).
pkg_subdir is the root of the package file name, discarding the version and
architecture parts and the common suffixes '-dbg', '-dev', '-doc', '-staticdev',
'-locale' and '-locale-*' which are listed in meta/conf/bitbake.conf.

This change relies on recent patches to opkg-utils which support hierarchical
package feeds.

Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-23 22:06:10 +01:00
Richard Purdie 0f757af31f package_*.bbclass: Simplify addtask
The package_write task was previously removed. Remove a remaining superfluous
reference to it.

(From OE-Core rev: 76bbf9e8f07f3e6f20c890dd4c82c72641e2ca88)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-30 10:10:33 +01:00
Richard Purdie 458496829b package: Drop do_package_write task
The reasons this task was introduced are lost in the mists of time. It
allowed for the a single "package_write" task instead of spelling out
the explicit package backends, however in all but one case we do that
anyway.

As such as might as well give in and delete the task, converting that
single reference into explicit dependencies.

This gives bitbake a bit less work to to when processing the runqueue
since there are less tasks (but more dependencies in some cases).

(From OE-Core rev: cf70e15f063716f3227d467ab1f4bfc0018286f6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-25 08:01:09 +00:00
Laurentiu Palcu 4cc0a43449 package_*.bbclass: remove references to the old bash indexing routines
Package indexing is done in python and package-index.bb uses the new
routines.

(From OE-Core rev: 2ab1a2bccfbb4ed90fe3b877d1be80817ba32099)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-14 12:30:20 +00:00
Paul Eggleton f9623968f0 conf/bitbake.conf: default HOMEPAGE to blank instead of unknown
The default value for HOMEPAGE of "unknown" has been in place since the
early OE-Classic days, but it doesn't really make sense - "unknown" is
not a valid URL and it just means we have to explicitly check for this
hardcoded string if we're displaying the value in some form of UI, such
as Toaster.

This has required some changes to the packaging classes as they
previously did not expect the value to be blank.

(From OE-Core rev: 244e1d73ef58e92d73c098044c66bd784644b933)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:56:56 +00:00
Laurentiu Palcu f52391a919 Cleanup image,rootfs_ipk,package_ipk bbclass files
This commit cleans up the functions that were ported to python.

(From OE-Core rev: d950ef40a3eae4b54cc62828e66d84a62d78c447)

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 ab14336a25 package_(deb|ipk).bbclass: remove the stamp when creating package from cache
If the packages are created from cache, we need to remove the stamp so
that we re-generate the index files at do_rootfs time.

(From OE-Core rev: dc06a91144b79a152eb481f6d36f6c328321b7c4)

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
Leonid Borisenko 66055fbedd package_{ipk, deb, rpm}.bbclass: support additional user-defined metadata
Additional metadata from user-defined variable is written into
control/spec file of binary package.

Three variables are searched for adiitional package metadata:

  * PACKAGE_ADD_METADATA_<PKGTYPE>_<PN>
  * PACKAGE_ADD_METADATA_<PKGTYPE>
  * PACKAGE_ADD_METADATA

First found variable with defined value wins.

<PN> is a package name. <PKGTYPE> is a distinct name of specific
package type:

  * IPK for .ipk packages
  * DEB for .deb packages
  * RPM for .rpm packages

Variable can contain multiple [one-line] metadata fields separated by
literal sequence '\n'. Separator can be redefined through variable flag
'separator'. In package control/spec file separator is replaced by
newline character.

(From OE-Core rev: 773d7352309241e15ef5acadcbe416bdd7d45c18)

Signed-off-by: Leonid Borisenko <ive.found@gmail.com>
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-01-28 00:52:32 +00:00
Richard Purdie 480bf037ae sstate: Get rid of crazy name mapping
When originally developed, it was thought a task may have more than one associated
sstate archive. The way the code has grown that idea is now not possible or needed.
We can therefore assume one sstate archive per task and drop the crazy name
mapping code. Simpler is better in this case.

The downside is that various sstate archives will change name so this forces a cache
rebuild. Given the other sstate changes going in at this time, this isn't really
a bad thing as things would rebuild anyway.

(From OE-Core rev: 5afe86a6854b21692fd97c5fc7fab50dbc068acb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-18 17:08:05 +00:00
Richard Purdie 0331fc2805 package_deb/package_ipk: Cleanup control file handling/races
If you Ctrl+C ppackage_write_{deb/ipk} control files can get left lying around
and make it into another packaging format. This ensures we cleanup all known
control files before starting packaging. We can simplify some of the globbing
as a result.

(From OE-Core rev: 7f8c728c82a17621461be2114c1afab3713a808e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-06 11:02:27 +00:00
Richard Purdie 554c892ccf meta: Don't use deprecated bitbake API
These have been deprecated for a long time, convert the remaining
references to the correct modules and prepare for removal of the
compatibility support from bitbake.

(From OE-Core rev: 6a39835af2b2b3c7797fe05479341d71a3f3aaf6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-01 15:51:42 +01:00
Mark Hatle db60ee702f package_ipk: Add support for PACKAGE_EXCLUDE
This uses the new --add-exclude arguments in opkg-cl, to list the excluded
packages.

If an excluded package is needed for the install to resolve,
an error will be generated.  Recommended packages will not
generate an error.

(From OE-Core rev: 6d7f5581bbfaf174edb77d92846e720e8057481c)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-22 18:30:01 +01:00
Mark Hatle e58d0fdb66 package_ipk: Add support for NO_RECOMMENDATIONS
Uses the opkg --no-install-recommends option.

(From OE-Core rev: e36c9947c82be034133a27db6e0f7a769daeb185)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-22 18:30:01 +01:00
Robert Yang 33cd81e18b package_ipk.bbclass: make DESCRIPTION support newline
The recipe's DESCRIPTION is wrapped automatically by textwrap, make it
support newline ("\n") to let the user can wrap it manually, e.g.:

DESCRIPTION = "Foo1\nFoo2"

In the past, it would be:
Foo1\nFoo2

Now:
Foo1
Foo2

[YOCTO #4348]

(From OE-Core rev: dff04de2de8bb159fd6912e29794eadd75d5d92a)

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>
2013-07-10 09:42:03 +01:00
Richard Purdie 950b505ca1 package_*.bbclass: Drop fakeroot from setscene calls
Back in 2010, I added these in commit: http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=36f1ae42fe13dae174b7fb5eb85dc49d7d7b516b
however the package_write tasks sstate only consists of package files and no
fakeroot privileges are needed to write these out, only originally create them.

We can therefore drop these for some small performance gains and a less
convoluted depenency chain.

(From OE-Core rev: 3c760ce4dc15d85be07aafbfea896e7276e0c2c4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-07 16:48:31 +01:00
Richard Purdie 566628d8cd class/lib: Fix up various file access methods
There are various bits of cruft that have built up around our file accesses. This patch
cleans some of them up, specifically:

 * Remove pointless "from __builtin__ import file"
 * Use open(), not file()
 * Wrap file usage in a with container to ensure files are closed
 * Add missing .close() calls in some cases

(From OE-Core rev: a43e0a8ecd0441131e929daf998c3cd454d9c8f3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09 22:28:04 +01:00
Richard Purdie 277cae2b2c package_ipk: Ensure the status file exists
The postinstall for the opkg run-postinst hook checks for the existence of this
file. We therefore ensure it always exists during image generation.

(From OE-Core rev: 540cf355599e555615ed9684c3b480463588eb78)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-18 21:12:19 +01:00
Richard Purdie 554e3d2540 package/populate_sdk: Move functions from package_* to populate_sdk_*
This fixes build failures introduced with "classes/buildhistory: implement history
collection for SDK" by moving the functions to files where only the specific image
type which is enabled is inherited. The failures occured when multiple PACKAGE_CLASSES
were enabled.

(From OE-Core rev: 9a414a57ad69a426a8d8a2970c42ca7427240615)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-23 17:40:27 +00:00
Paul Eggleton 59e4815387 classes/buildhistory: implement history collection for SDKs
SDKs are constructed in a similar manner to images, and the contents can
be influenced by a number of different factors, thus tracking the
contents of produced SDKs when buildhistory is enabled can help detect
the same kinds of issues as with images.

This required adding POPULATE_SDK_POST_HOST_COMMAND and
SDK_POSTPROCESS_COMMAND variables so that data collection functions can
be injected at the appropriate points in the SDK construction process,
as well as moving the list_installed_packages and
rootfs_list_installed_depends functions from the rootfs_{rpm,ipk,deb} to
the package_{rpm,ipk,deb} classes so they can also be called during
do_populate_sdk as well as do_rootfs.

Implements [YOCTO #3964].

(From OE-Core rev: c3736064483d4840e38cb1b8c13d2dd3a26b36aa)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-23 11:41:13 +00:00
Christopher Larson b10f2a74e4 package_{ipk, deb, rpm}: drop the TARGET_OS conditional
The tclibc file for uclibc already empties IMAGE_LINGUAS, so there's no point
to this conditional as far as I can tell, and it can cause issues for certain
values of TARGET_OS.

(From OE-Core rev: 0fdda5840452c7715ed775d5d18d9f850396f483)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-22 16:54:38 +00:00
Richard Purdie ba110d3b69 package_rpm/dev/ipk/tar: Drop unused functions
The package_xxx_install functions date from a different era and are not used by
anything. In the rpm case, they're simply unimplemented, in the tar case they're
using broken whitespace and deprecated functions. We might as well clean
out the old broken unused code.

(From OE-Core rev: 3684036213c9b1c27389260b7a1e3441c6bd659d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-17 22:32:03 +00:00
Richard Purdie 74938e387c package_rpm/deb/ipk: Error if we don't find packages when creating the package index
If for whatever reason the package directory is empty of packages, it
makes sense to error early rather than later in what become much
more obtuse errors. This adds in a sanity check to each of the packaging
backends. It also removes the duplicate createrepo call since the
core index creation function now uses this directly after the switch
to smart.

(From OE-Core rev: 721ef058b37604e100021ec7a90ad2f745d83916)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-17 22:32:03 +00:00
Ross Burton 70b731c6f0 package_ipk: check CONFFILES exist before adding them to metadata
opkg-build verifies that conffiles exist, so verify that the specified files
actually exist before writing them to conffiles.

This mirrors the behaviour of FILES and package_rpm's CONFFILES handling.

(From OE-Core rev: fb87edc881009cf4d582cd95c248884551fe07fe)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-15 12:17:35 +00:00
Laurentiu Palcu e52c8b833e package_ipk, rootfs_ipk: remove the "set -x"
Comment the "set -x" lines since these will add a lot of extra, not
always necessary, debug messages in the log.do_rootfs.

[YOCTO #2599]

(From OE-Core rev: 5d8119f3d749073e355351e0e15f2703fad738f2)

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>
2013-02-06 09:37:24 +00:00
Martin Jansa 77b1409522 ipk: use OPKGLIBDIR in all places
* it's not recommended to change this value, because it breaks upgrade path on target
  (all old u-a alternatives are forgot in old OPKGLIBDIR value
* but make it consistent, so if someone really want to change that, then
  setting OPKGLIBDIR_distro in distro.conf would be enough
* without this there were at least 4 places to change:
  rootfs_ipk: opkglibdir variable (notice that I've removed /opkg from it to correspond
              with EXTRA_OECONF option used in opkg recipes
  package_ipk: ${target_rootfs}${localstatedir}/lib/opkg/ hardcoded in
               package_install_internal_ipk
  opkg-collateral: value in lists file
  opkg: EXTRA_OECONF for all 3 classes, FILES_libopkg, do_install
* validated with buildhistory that without OPKGLIBDIR explicitly set the
  output is the same and that after setting
  OPKGLIBDIR_forcevariable := "${libdir}"
  everything including empty directory from package_ipk is moved to
  libdir

(From OE-Core rev: cf0aa9c4fdae8855803e96b1922d54a2431795d3)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06 09:37:22 +00:00
Richard Purdie c9ea3c27e1 package_ipk/deb/rpm: Ensure deploy staging directory is empty before rerunning task
If we don't do this, stale files can build up, particularly with the PR
server.

(From OE-Core rev: c30ae39229b35d72e2205040d76754b5120fa878)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-30 14:09:09 +00:00
Richard Purdie 3247292683 Split do_packagedata task from do_package
Currently, do_rootfs has a dependency on all the do_package output being present
due to its usage of the pkgdata directories. This means that if you run:

bitbake xxxx-image -c rootfs

you end up having to fetch and unpack all the do_package data which is usually
large and inefficient. It also means rm_work has to leave all the do_package
data lying around so rootfs works.

This patch splits the actual creation of the pkgdata directory off into a separate
task, "packagedata" which happens immediately after do_package. We can then remap
the dependencies so this task is depended upon, not do_package. Sstate can then be
programmed not to require do_package at the appropriate times.

Whilst this patch doesn't do so, it opens the possibility of rm_work wiping
out the do_package output from WORKDIR as long as it also removed the do_package
stamp (both normal and setscene variants) and allowing more space savings
with rm_work which has been regularly requested.

(From OE-Core rev: 6107ee294afde395e39d084c33e8e94013c625a9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-25 12:42:47 +00:00
Richard Purdie 25bc944d30 rootfs_ipk/package_ipk: Simplify opkg commandline option variables
The current maze of IPKG_ARGS variables is hard to understand and worse,
not even used in some places. This simplifies the code and specifies the
options in one place.

(From OE-Core rev: 5e482b278c3775b0acecc621cf2d3b90ee516f26)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-07 17:13:12 +00:00
Martin Jansa 88a9f6db34 rootfs_ipk, package_ipk: drop --force-overwrite
* it was introduced in 2010 by 8c3a7ebac8
  but doesn't seem needed anymore
* also such do_rootfs failure is good indication that runtime packages
  installed are not sane, ignoring this error in do_rootfs just
  transfers the issue to end user when he does "opkg upgrade" later
  on device
* tested on SHR images with whole feed included and only issue was
  gstreamer/gst-plugins-* locale packages (and there is patch for this
  on oe-core ML)

(From OE-Core rev: 1f7d3a2e9071ff78170c06ebf58c7400a5ee09bf)

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>
2012-12-03 14:32:46 +00:00
Richard Purdie 34bd4e1743 opkg: Convert select-higher-version option to prefer-arch-to-version
This converts the option to maintain the existing behaviour unless the option is
specified. We do specify the option during the builds themselves to ensure what
the users expects is built.

(From OE-Core rev: 0cc479699fe885049625d54c712b500c1b719e75)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-02 17:10:33 +01:00