Commit Graph

257 Commits

Author SHA1 Message Date
Richard Purdie ed931d0314 package.bbclass: Improve package_fixsymlinks
Improve package_fixsymlinks so we don't handle RDEPENDS for every single package
in PACKAGES.

(From OE-Core rev: 20ff8feb95d54e4db646f8c0cb006ce187e288af)

(From OE-Core rev: ca2ee871f82dd0ba4122a8373e4efd21cec5722b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01 15:54:02 +00:00
Richard Purdie 398d62fd74 package.bbclass: Tweak PACKAGEFUNCS
Move package_rename_hook call into PACKAGEFUNCS and also move package_get_auto_pr
to a more appropriate execution point, grouping package metadata handling
functions together.

(From OE-Core rev: a3f41cfbc8923e54198d10db292a11ef2edda4d7)

(From OE-Core rev: 96d268166ab0d4640767bf3a0886358dcb663d0f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01 15:54:02 +00:00
Richard Purdie b369a3619e package.bbclass: Split out package_fixsymlinks function
The symlink handling code doesn't need to being part of populate_packages
and is logically separate so split it out into a separate function,
package_fixsymlinks.

(From OE-Core rev: fc964ed2b558b08327e2bc8c93ada80ca9d97337)

(From OE-Core rev: 08a194c13857b02a2febf9b1484b3cdd67a18160)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01 15:54:02 +00:00
Richard Purdie f955e4e482 package.bbclass: Move PKG handling code to emit_pkgdata
We only use the PKG variable in emit_pkgdata so we might as well move the
fallback code there, allowing restructuring of other parts of the metadata.

(From OE-Core rev: 0136ae9a5f719f0e7ba6e00bfd366c0e61b3b3f2)

(From OE-Core rev: df38695f0fbea10289e85fdcb7c2bdf566990577)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01 15:54:01 +00:00
Richard Purdie 8a0b4578ec package.bbclass: Avoid copying the datastore for FILES handling
There is no real point in adjusting overrides and creating a copy of the datastore,
just to access a single variable. We can do this just as easily with a slightly
more complicated getVar call. This improves performance.

(From OE-Core rev: 69f4351809359a0c7c38e8f233f3e3f7680ed2e2)

(From OE-Core rev: b5d65f5d5e5b26d3a2c673e899114c90bcaf6bc8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01 15:54:01 +00:00
Richard Purdie b0a2f55ccc package.bbclass: Check FILES once, not once per loop iteration
There is no need to check FILES in each loop iteration, we can just check it once
at the start when we read the variable.

(From OE-Core rev: 1bcc5cba12cbb1b846b433719d1b0820f5a97105)

(From OE-Core rev: 40542f7a46bfb8431e31eca9af06adb4b343d810)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01 15:54:01 +00:00
Richard Purdie ae8586c952 package.bbclass: Add a shortcut exit from the mkdir function
The mkdir function iterates over strings with many different operations,
even if ultimately the target already exists. This adds a check to the start
of the function so we don't waste time when the target already exists.

(From OE-Core rev: 06e188e673313f1eb9ae7d85ae64467c8d2a94b3)

(From OE-Core rev: 9509627e06ab4cf18c5bbf3f405ecf19a9f40287)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01 15:54:01 +00:00
Richard Purdie afb1b3fac8 package.bbclass: Improve kernel module handling
Currently the kernel module handling consists of several special cases
and has its own path walking. This refactors the code to handle them in
a more standardised way which is also a bit more efficient.

(From OE-Core rev: ad51b54f0afe8c56033137b7cf9ba398877b2651)

(From OE-Core rev: cb24a72e97afb43de5e1e79ff807fd9e184df6a2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01 15:54:01 +00:00
Richard Purdie fed8dfff1f package: Rename splitfile functions to something more descriptive
The splitfile and splitfile2 function names are confusing and the comments
are also misleading, hard to understand or plain incorrect. This tries to
improve things.

(From OE-Core rev: 46f3050a1f46f814e2d031e7e71600b2932d631c)

(From OE-Core rev: bc6f7085b42d8137957795e800e8b46d2f1eddac)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01 15:54:01 +00:00
Andreas Müller b71a16e8ac package.bbclass: remove RRECOMMENDS on base packages for locale packages
As long as we support only one locale package per recipe this leads to unwanted
packages in images. This patch was motivated by samba (meta-oe): only wanting
libsmbclient one gets full samba server into the image. For my standard image
the follwing package were removed by this patch:

-acl_2.2.51-r3_armv7a-vfp-neon.ipk
-alsa-states_0.2.0-r3_armv7a-vfp-neon.ipk
-alsa-utils_1.0.25-r3_armv7a-vfp-neon.ipk
-alsa-utils-aconnect_1.0.25-r3_armv7a-vfp-neon.ipk
-alsa-utils-alsaconf_1.0.25-r3_armv7a-vfp-neon.ipk
-alsa-utils-alsactl_1.0.25-r3_armv7a-vfp-neon.ipk
-alsa-utils-alsaloop_1.0.25-r3_armv7a-vfp-neon.ipk
 alsa-utils-alsamixer_1.0.25-r3_armv7a-vfp-neon.ipk
-alsa-utils-alsaucm_1.0.25-r3_armv7a-vfp-neon.ipk
-alsa-utils-amixer_1.0.25-r3_armv7a-vfp-neon.ipk
-alsa-utils-aplay_1.0.25-r3_armv7a-vfp-neon.ipk
-alsa-utils-aseqdump_1.0.25-r3_armv7a-vfp-neon.ipk
-alsa-utils-aseqnet_1.0.25-r3_armv7a-vfp-neon.ipk
-alsa-utils-iecset_1.0.25-r3_armv7a-vfp-neon.ipk
-alsa-utils-midi_1.0.25-r3_armv7a-vfp-neon.ipk
-alsa-utils-speakertest_1.0.25-r3_armv7a-vfp-neon.ipk
-attr_2.4.46-r4_armv7a-vfp-neon.ipk
-avahi_0.6.31-r7.1_armv7a-vfp-neon.ipk
-gtk-engines_2.20.2-r3_armv7a-vfp-neon.ipk
-pulseaudio_2.1-r15_armv7a-vfp-neon.ipk
-samba_3.6.8-r6_armv7a-vfp-neon.ipk
-vte_0.28.2-r5_armv7a-vfp-neon.ipk
-xz_5.1.2alpha-r0_armv7a-vfp-neon.ipk

Strange effect: For samba buildhistory's depends.dot says:
-samba -> libc6;
-samba -> libgcc1;
-samba -> libreadline6;
-samba -> libtalloc2;
-samba -> libtdb1;
-samba -> libwbclient0;
-samba -> libz1;
-samba -> update_rc_d;
-samba_locale_de -> samba [style=dotted];
 samba_locale_de -> virtual_locale_de [style=dotted];
-samba_locale_fr -> samba [style=dotted];
-samba_locale_fr -> samba [style=dotted];

This is conflicts to buildhistory's result on samba package not mentioning
any changes for samba package.

(From OE-Core rev: 50354ebece43a6c13f9ca592e7d230765a26fdf8)

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-28 12:29:30 +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
Constantin Musca 8aa508970a prserv: change PRSERV_HOST semantics
- remove PRSERV_PORT variable
- use 'hostname:port' as PRSERV_HOST format
- remove USE_PR_SERV variable
- one can activate PRS by setting PRSERV_HOST

[YOCTO #3744]

(From OE-Core rev: e00f49de8b1f79c3e07b887d257bd75a46052fa0)

Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-25 12:42:43 +00:00
Christopher Larson f63f387b83 package.bbclass: drop unnecessary and broken packages.remove()
(From OE-Core rev: 5480371d0473482437ce4350e6593f006101ef40)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-21 10:22:08 +00:00
Richard Purdie eabd8606f9 package.bbclass: Fix shlibs cross package-arch contamination
I found that if I had two packages architectures built (say core2 and i586),
that the shlibs data from i586 was being used in the core2 build. This
lead to odd dependency issues if the i586 build was out of date and core2
was being targetted.

When loading shlibs files, the last loaded wins so we need to iterate the
lists from least to strongest weighting, not the other way around. With this
patch applied, the contamination issue is resolved.

(From OE-Core rev: acd7b1c2ee9f3ff84c45a723dba5e0bc5f6a100c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-20 12:58:58 +00:00
Enrico Scholz 116fb4a72f package.bbclass: replace AUTOINC directly in PKGV
b27b438221e16ac3df6ac66d761b77e3bd43db67 introduced a regression when
PKGV is modified by the recipe.  E.g. when having something like

| PV = "1.7.33+gitr${SRCPV}"
| PKGV = "1.7.33+gitr${GITPKGV}"
| RDEPENDS_${PN}-subpkg += "${PN} (= ${EXTENDPKGV})"
| inherit gitpkgv

The resulting core package has

| Version: 1.7.33+git234+cd01e8c-r11

and because the subpackage has

| Depends: vdr (= 1.7.33+git0+cd01e8c18d494150730214f033f84e5282ce7639-r11)

image build fails with

|  * satisfy_dependencies_for: Cannot satisfy the following dependencies ...
|  *    vdr (= 1.7.33+git0+cd01e8c18d494150730214f033f84e5282ce7639-r11)

Patch avoids the 'PKGV = "cleanup(${PV})"' operation and replaces
AUTOINC directly within PKGV.  This might introduce a regression too
when 'AUTOINC' is added to PKGV intentionally but impact is small and
can be fixed trivially by using another string.

(From OE-Core rev: 6e46664085fa49bc204fc944ca23ed6383e2ec51)

Signed-off-by: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Cc: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-20 12:58:57 +00:00
Robert P. J. Day faf94a9d6d package.bbclass: Skip testing "packages" a second time.
Since the "packages" variable is already tested a few lines above in
the same routine:

    if len(packages) < 1:
        bb.debug(1, "No packages to build, skipping do_package")
        return

there is no point testing it again, and the error message doesn't even
refer to "packages", anyway.

(From OE-Core rev: 371fbacff47828cfff99f1152f9e269e27c474da)

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-07 11:09:44 +00:00
Constantin Musca 94516ced8d package.bbclass: don't prepend MLPREFIX to LOCALEBASEPN
- all the recipes that overwrite LOCALEBASEPN must consider
also the MLPREFIX
- if the LOCALEBASEPN variable is not overwritten then it will
have the correct prefix (LOCALEBASEPN ??= "${PN}")

(From OE-Core rev: 855d64a3091c5358e2e1a7f4247929515b068708)

Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-07 11:09:37 +00:00
Constantin Musca 1674541ed8 multilib: fix allarch/kernel/module-base multilib issues
- skip the non-packagegroup allarch recipes in multilib_virtclass_handler
- extend PROVIDES/RPROVIDES for allarch recipes which are not packagegroups
- use variants from MULTILIB_GLOBAL_VARIANTS (lib32 lib64 libx32) to create
additional pkgdata files for multilib allarch: ${pkgdatadir}/${variant}-${PN}
and ${pkgdatadir}/runtime/${variant}-${pkg}
- use variants from MULTILIB_VARIANTS to create additional pkgdata files
for multilib kernel/module-base recipes
- add a sanity check to determine if the current multilib is in
MULTILIB_GLOBAL_VARIANTS

[YOCTO #2918]
[YOCTO #3440]
[YOCTO #3565]
[YOCTO #3568]

(From OE-Core rev: bc4da2573dfb59ea2fc4af359701818df20f7663)

Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-31 09:43:25 +00:00
Constantin Musca 9240695462 package.bbclass: prepend MLPREFIX to LOCALEBASEPN
We need to prepend MLPREFIX to LOCALEBASEPN in order to
fully enable multilib

[YOCTO #3440]

(From OE-Core rev: 91fe09a9a8b317d27145efff4201f1138d6a45d4)

Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-11 15:58:35 +00:00
Ross Burton 3488973587 package.bbclass: make do_split_packages handle non-existent root directories
This function has different behaviour if the split directory doesn't exist
depending on the recursive argument: non-recursive uses os.listdirs which throws
an exception, recursive uses os.walk which doesn't.

do_split_packages should silently handle non-existent directories because it's
mainly used for plugin directories, which may end up being empty though changing
the distro configuration (for example, connman without wifi distro feature).

So, add an early exit if the split root doesn't exist.

(From OE-Core rev: 937101e3fdd6afd00f6f8a8be411a67110c4ae78)

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>
2012-12-11 15:54:36 +00:00
Constantin Musca 59a704679c prs: use the PRServer to replace the BB_URI_LOCALCOUNT functionality
- adapt the PRServer to generate an incremental number for every revision set
associated with a (PN, PV)
- use one incrementing value rather than several
- PV becomes 0.1+gitAUTOINC+deadbeefdecafbad_decafbaddeadbeef
- if PV contains 'AUTOINC' set PKGV to the same thing with AUTOINC replaced
with the "auto PR" value
- if the PRServer isn't running replace AUTOINC with 0 (no package feeds, but usual
image creation would work)
- use the PR table with "AUTOINC-${PV-without-SRCREVs}" as key
- modify prexport/primport to address the generated srcrev entries
- this patch addresses the following proposal:
http://lists.linuxtogo.org/pipermail/bitbake-devel/2012-November/003878.html

(From OE-Core rev: b27b438221e16ac3df6ac66d761b77e3bd43db67)

Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-06 12:31:16 +00:00
Richard Purdie 212397c87b package.bbclass: Adapt debugsrc code to workdir layout changes
With the change to WORKDIR layout, splutting PN and PV into two directories,
the debugsrc splutting code layout became suboptimal. This changes things to
include the information as it was before. Ideally this code would be written
to more generically support other layouts buts it not clear that the tools
would even support that right now so this is the best immediate fix.

(From OE-Core rev: 432cfbb403f0e864d1fad383c2bbb6f9bdb80770)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-21 09:10:02 +00:00
Richard Purdie d59d4306fc package: Hardlink debug source to improve performance
When copying the source files needed for the -dbg package, use hardlinks
where possible. This saves some disk space and hence helps performance
of the builds.

(From OE-Core rev: 6775feb9fe935ab01fd9cae2b2d3fce5824a9a72)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-23 12:28:31 +01:00
Richard Purdie 92b44ec00e package.bbclass: Exclude the PKGTRIPLETS variable
Without this, we'd rerun packaging for every machine since this variable contains
a machine specific component.

(From OE-Core rev: 61131828c59178c923b3d5b5fcacf0dbcba275a5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-22 14:59:29 +01:00
Richard Purdie a68c7c792e package.bbclass: Switch shlibs to pkgdata directory and make package non-machine specific
Currently, do_package is machine specific since the shlibs data is installed
into each machine specific sysroot. This change moves the shlibs data to the
pkgdata structure, at the expense of having to iterate over a set of shlibs
directories instead of a single one.

It turns out this isn't any particular hardship for the code and as a result,
do_package stops being machine specific leading to optimisations for builds
that use a common PACKAGE_ARCH.

(From OE-Core rev: cc088489d70fb27d460c3dbe35d6ea382123c134)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-22 09:47:47 +01:00
Richard Purdie a6f6d4faba package: Recommend virtual-locale-*, don't depend on it
The virtual-locale-* packages are provided by libc which may or
may not have a matching locale for any given recipes's provided locales.
Certainly, we shouldn't get a failure if the locale package isn't
available.

This patch therefore makes the dependency optional rather than
required, allowing the locale packages in question to install. This
resolves errors like:

	virtual-locale-eo is needed by bash-locale-eo-4.2-r5.i586
	virtual-locale-en+boldquot is needed by bash-locale-en+boldquot-4.2-r5.i586
	virtual-locale-en+quot is needed by bash-locale-en+quot-4.2-r5.i586

(From OE-Core rev: 2be67f95abaa7e8655a1ca8f4ffe66b3e099a650)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-18 12:13:12 +01:00
Richard Purdie 71030c6b37 package.bbclass: Fix regression in -dbg packages introduced by explode_dep_versions change
We need to iterate over the dictionary pulling out the values, not take the top
level keys. If we don't do this, we end up with dependencies on the values of
PACKAGES, not library dependencies.

(From OE-Core rev: 7219bca11f554fbe2ed30f1537491987d65e9316)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-03 10:02:22 +01:00
Richard Purdie 5fdbda6922 classes: Update to use corrected bb.utils.explode_dep_versions2 API
The bb.utils.explode_dep_versions function has issues where dependency information
can be lost. The API doesn't support maintaining the correct information so this
changes to use a new function which correctly handles the data.

This patch also fixes various points in the code to ensure that we do not have any
duplicates in things that use explode_dep_versions.

A new sanity test to test the contents of the R* variables is also added.

[Some changes from Mark Hatle <mark.hatle@windriver.com>]

(From OE-Core rev: 16a892431d0c0d03f8b561b92909cf2f11af4918)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-02 11:40:53 +01:00
Paul Eggleton 272cb74d70 Rename task to packagegroup
"Package group" is a much more appropriate name for these than task,
since we use the word task to describe units of work executed by
BitBake.

(From OE-Core rev: 424dcf7046e4ad09dcc664eb1992201195247fcf)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-04 12:52:55 +01:00
Tomas Frydrych 4759a71d3b package.bbclass: fix stripping for kernel modules
runstrip(path, elftype, d) does bitwise & on the elftype parameter, so it has
to be passed an integer. Passing None fails with: TypeError: unsupported
operand type(s) for &: 'NoneType' and 'int'.

(From OE-Core rev: 67f21c6c698464959c27c7e65ee537ab4c378944)

Signed-off-by: Tomas Frydrych <tomas@sleepfive.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-02 05:52:09 -07:00
Paul Eggleton bf64b6ec39 classes/package: document do_packages_split arguments
This function takes quite a number of arguments and can be tricky to use
properly; this is not made easier if it is undocumented, so document all
of the arguments. (No functional changes, comments only.)

(From OE-Core rev: 324fbcc047819b6948d13eda627ec898cb1f1eb8)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-22 13:59:54 +01:00
Richard Purdie 48619958d5 meta/classes: Various python whitespace fixes
It was pointed out we have a number of weird indentations in the python functions.
This patch cleans up 3, 7 and other weird indentations for the core bbclass files.

It also fixes some wierd (odd) shell function indentation which my searches picked up.

(From OE-Core rev: 8385d6d74624000d68814f4e3266d47bc8885942)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-21 12:15:30 +01:00
Laurentiu Palcu 21049ec964 package.bbclass: change RPATHs for cross-canadian binaries
When building the meta-toolchain, the binaries didn't get relocatable
RPATHs. They were hardcoded to the default path. Hence, if one had
already installed one SDK in the default path and one in another
location, the later toolchain's binaries would search and load libraries
from the first location, ending in a "Segmentation Fault".

[YOCTO #2927]

(From OE-Core rev: b40a03c43d5d9d738a9aa5b43b2ecfe74fc95018)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-17 13:06:42 +01:00
Paul Eggleton 06ad59cca9 classes/package: don't make locale pkgs depend on PN pkg if not in PACKAGES
If ${PN} is not in PACKAGES then don't add it as an RDEPENDS for each
locale package. This fixes the installation of gcc-runtime locale
packages, for example.

(From OE-Core rev: d36c3235b3022c07f064929f55114f808a7634f6)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-06 15:35:45 +01:00
Laurentiu Palcu e3a13b8d93 package.bbclass: change RPATHs for nativesdk packages
Change binaries RPATHs, to include $ORIGIN, to make them relocatable.

(From OE-Core rev: f6362c5248914485fc8bf3c3f0ca6cc962bf753e)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-02 15:28:39 +01:00
Martin Jansa 5ab3a11149 package.bbclass: fix TypeError in runstrip
* some packages have .ko files which are not elf, without this change
  it fails with TypeError, with this change only runstip fails and
  reports where:
  ERROR: runstrip: ''arm-oe-linux-gnueabi-strip'  '/OE/shr-core/tmp-eglibc/work/armv4t-oe-linux-gnueabi/emacs-23.4-r0/package/usr/share/emacs/23.4/etc/tutorials/TUTORIAL.ko'' strip command failed

(From OE-Core rev: a834ab8a6d53cae504fa112a89bab93d726539ec)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-31 11:59:05 +01:00
Paul Eggleton 22965c4715 classes/package: ensure pkgdata is cleaned out first
If do_package needs to be re-run and packages are removed/renamed as a
result, we want the corresponding stale pkgdata files to no longer be
present; for that we need to ensure all of the old pkgdata files are
cleaned out prior to creating the new ones. This is particularly
important now we rely on pkgdata more heavily (for complementary
packages, license manifest, etc.).

(From OE-Core rev: 5dee47b476a6f715ab02af5e758441a2a934eea3)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-29 10:16:16 +01:00
Richard Purdie 754d240d2c package.bbclass/eglibc-locale: Ensure the correct PN is used for locale packages
(From OE-Core rev: fc4b138948656d482603b80f8c8e86fdbb185df4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-28 09:20:53 +01:00
Paul Eggleton a5227e205b classes/package: reduce dbg package dependencies
Make dbg package dependencies added via DEPCHAIN_POST less aggressive -
only add dependencies on dbg packages for shared library dependencies.
This avoids dragging in extraneous packages (such as eglibc-dbg forcing
bash-dbg to be installed) whilst preserving the ability to easily debug
into shared libraries in use by an application by just requesting the
installation of the single dbg package for that application.

For task recipes however we preserve the previous behaviour, since when
you install task-xxx-dbg you expect the dbg packages for every package
in the task to be installed. Unfortunately not all of our tasks inherit
from task.bbclass so we just use a name match - this should be tidied up
later.

Fixes [YOCTO #2599].

(From OE-Core rev: 352522d474cb75992d7865545b6fbe4e157a5f99)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-28 09:20:52 +01:00
Paul Eggleton e95738004f classes/package: do not add self-dependencies to dev/dbg packages
Avoid adding dependencies to dev and dbg packages on themselves via the
DEPCHAIN_* handling code. These don't actually cause any problems, but
they do complicate dependency graphs.

(From OE-Core rev: ecdf7874470cff24cb23b7fd2723096b15aead31)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-26 18:53:04 +01:00
Andrei Gherzan 5334a93d26 package.bbclass: Create symlinks for packages with different packaged name
While generating license.manifest package information is searched in:
filename=`ls ${TMPDIR}/pkgdata/*/runtime/${pkg}| head -1`
This is ok as long as package name is the same as the package name
after packaging.
For example dbus is packaged as dbus-1. So, searching
ls ${TMPDIR}/pkgdata/*/runtime/dbus-1 will fail because there is no file
with this package name.

Create a symlink to the pkgdata file in a runtime-reverse directory so
that these reverse lookups are possible.

Fixes [YOCTO #2638].

(From OE-Core rev: 76ef414b8a017557cf5f3ad7b3ca8a324f7aad29)

Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-26 14:40:47 +01:00
Richard Purdie 73cf0335c4 Remove a number of unneeded import os/bb calls
The bb and os modules are always imported so having these extra import calls
are a waste of space/execution time. They also set a bad example for people
copy and pasting code so clean them up.

(From OE-Core rev: 7d674820958be3a7051ea619effe1a6061d9cbe2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19 12:24:50 +01:00
Richard Purdie bfd279de32 Convert tab indentation in python functions into four-space
(From OE-Core rev: 604d46c686d06d62d5a07b9c7f4fa170f99307d8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19 10:24:50 +01:00
Peter Seebach 07a9e9ee48 package.bbclass: Allow overriding of debugedit starting path
In the usual case, the computed path used for debugedit to fix
up path references for the target filesystem is correct. However,
prebuilt binary components, such as prebuilt toolchains, can
have debug paths that do not reflect paths within the local
build directory. Providing an override lets us continue to use
the standard debugedit logic in package.bbclass.

(From OE-Core rev: 32b1fde106bf423873a4a56e1111f230494e2d4a)

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-17 10:53:54 +01:00
Amy Fong b1c2b57b3e package install failure on systems without /sbin/ldconfig
Package install failures due to issues in post install rules.

package_do_shlibs only looks for libraries in a directory "lib", this should be
modified to the variable baselib.

ldconfig_postinst_fragment failure observed on systems without /sbin/ldconfig
        [ -x /sbin/ldconfig ] && /sbin/ldconfig
results in the post install rule returning a failure. Modify to
        if [ -x /sbin/ldconfig ]; then /sbin/ldconfig; fi

(From OE-Core rev: 3f85ab6d0d05a4e34fe73fa343d2b3b942fc69b7)

Signed-off-by: Amy Fong <amy.fong@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-17 10:53:53 +01:00
Saul Wold 0a1d5f5977 package.bbclass: enable the use of package_qa_handle_error
This will allow the reporting of these errors as either WARNINGs (default)
or ERRORs if installed_vs_shipped is added to the ERROR_QA of the policy
file (such as a <distro_name>.conf file.

V2: found the code I had intended to send instead of that other junk,
    was just not watching what I pushed on that one, sorry. (this is edit in
    no in the actual commit message)

(From OE-Core rev: 20d4205a4e408b6a99db392d4df458156113106a)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-04 17:40:35 +01:00
Mark Hatle 63c6f46b22 package.bbclass: Allow a package to skip per file dependency generation
Most of the time skipping per file dependency generation is a bad idea, but
when building a nativesdk or similar you may be required to pickup host
dependencies.  These host dependencies can not always be reconciled within
the scope of other nativesdk components, so if we skip them we can facilitate
this unique situation.

(From OE-Core rev: a1ca125de55a8e7cab402e2ba5737a56d4e890c2)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-03 14:55:00 +01:00
Richard Purdie 58977a94dd package.bbclass: Add missing PKGR, PKGV, PKGE and ALTERNATIVE variables from PACKAGEVARS
These variables all take package name extensions and should be considered in sstate
dependency processing.

This may also fix some multilib alternatives issues (unconfirmed).

[YOCTO #2056]

(From OE-Core rev: 64422f7c5da160050a5454817c8fa9d070104b34)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-02 16:47:45 +01:00
Richard Purdie b3e76b33f3 package.bbclass: Add warning about FILES containing '//'
'//' in a FILES variable causes hard to track down issues with
packaging. This adds a warning and attempts to auto-correct the issue to
try and make the problem more user friendly.

[YOCTO #2448]

(From OE-Core rev: 0e33e314b1d2d3779658696f13a274b20d698667)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-30 17:32:31 +01:00
Richard Purdie 0d9e893711 Revert "meta: replace os.popen with subprocess.Popen"
This reverts commit e83d8e58a6b107eea87df0ec233a1bc932b2c6e as the conversion
is not correct. Its replacing readlines() calls which generate an array with
what are effectively strings. There are split("\n") calls missing in many
cases so this needs to be reverted until it gets fixed.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-30 14:21:29 +01:00
Robert Yang 5996b2b58e meta: replace os.popen with subprocess.Popen
Replace os.popen with subprocess.Popen since the older function would
fail (more or less) silently if the executed program cannot be found

There are both bb.process.run() and bb.process.Popen() which wraps the
subprocess module, use it for simplifying the code.

Note: We don't need the "2>/dev/null" or "2>&1" since bb.process.run()
can handle it, it will raise exception when error occurs, we should
handle the exception ourselves if we want to ignore the error.

More info:
http://docs.python.org/library/subprocess.html#subprocess-replacements

[YOCTO #2454]

(From OE-Core rev: e83d8e58a6b107eea87df0ec233a1bc932b2c6ea)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-30 12:04:45 +01:00
Robert Yang e40995e569 meta: replace os.system with subprocess.call
Replace os.system with subprocess.call since the older function would
fail (more or less) silently if the executed program cannot be found

More info:
http://docs.python.org/library/subprocess.html#subprocess-replacements

[YOCTO #2454]

(From OE-Core rev: a07d03cc6f67c88feb9813ae7deb6e4a93552dfe)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-30 12:04:45 +01:00
Mark Hatle 6ac7e9b598 update-alternatives.bbclass: Refactor the implementation
Refactor in order to:
  * Deprecate the old interfaces, but keep them for compatibility
  * Provide a new, interface -- capable of working with split packages
  * Each update-alternative will now set proper "per-file" provides

Note: this adds a warning message when the older deprecated behavior is
used.  The older behavior has been fully tested using oe-core.

(From OE-Core rev: 309117d26de6a87b16406a44a0cefcbaaf7b5d7a)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-30 12:04:37 +01:00
Mark Hatle d03e29fec2 package.bbclass: Add additional debugging for dependencies
When trying to understand why a QA wanring such as:

ERROR: QA Issue: foo rdepends on bar-dev

it is very difficult to figure out where the bar-dev dependency
comes from, since many of them are added dynamically.

This adds a debug statement that says which dependency adds an
rdepends to the system.

Also, while doing this work, it was noted that the same dependencies
were being scanned for over and over.  Instead we shorten the list
by only added to the dep list if the dependency was not already there.

(From OE-Core rev: 257b9e371143421b78a6991ef5401e564918c164)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-25 11:18:03 +01:00
Lianhao Lu 8de572f95a (libc-)package.bbclass: Added MLPREFIX to locale packages.
Added multilib prefix to the locale related package names/dependencies.

(From OE-Core rev: a52f7cf2cc90d918e3250c410995dcc1f3bfd5ee)

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-18 15:25:10 +01:00
Richard Purdie c73779d150 package.bbclass: Drop dubious use of packages[0] from do_split_packages and do_split_locales
As the comment says, using packages[0] is rather broken and can be incorrect,
as demonstrated by the recent gdk-pixbuf change. Replacing it with PN is
a bit more correct and more likely to do what was originally intended
by this function.

(From OE-Core rev: 5d0144fe6bd1febc2d1e651bbcff891c80f20b88)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-12 11:23:35 +01:00
Richard Purdie a246af9bf7 package.bbclass: Drop EXPORT_FUNCTIONS use against mapping_rename_hook
The usage of this function renaming and it being called using
bb.build.exec_func() causes needless indirection loops, confusing log
files and seems generally pointless.

This simplification makes the process much simpler and faster. I can't
come up with a good reason why the export_functions functionality is
needed for this function.

(From OE-Core rev: 74daad03ca29a03b0005f7d2b90a0347d5b583a5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-11 18:03:31 +01:00
Richard Purdie 6123ee024b package.bbclass: Ensure kernel modules get stripped
Kernel modules are not marked as executable but we do expect to strip them.
This patch adds in missing code to ensure we do this. Without this images
are getting sigificantly bloated in size.

(From OE-Core rev: 00b0a5f2f51bb3f88bbb9ae558c2859e3c1c406c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-22 16:00:03 +01:00
Andrei Gherzan 00a6199b92 "The suite of statements in a function definition executes with a local namespace that is different from the global namespace. This means that all variables created within a function are local to that function. When the suite finishes, these working variables are discarded."
In this way the needs_ldconfig variable in linux_so never gets True in the statements
below this function. As global statement is generally discouraged, a return value
would be a clean and fast way to solve this issue.

[YOCTO #2205]

RP: Added logic to ensure the value doesn't get overwritten once set
(From OE-Core rev: 6d39af4f85220f20bad09b0fdd3ee0a7ec19c12d)

Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>---
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-11 12:57:17 +01:00
Robert P. J. Day 951aa5ea1f Various typoes fixed, all comments or output strings.
Typoes fixed: "enviroment", "editted", "spliting", "scheulder".

(From OE-Core rev: 17e981a857a51b0bec08c929e8539d36d83874b6)

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-26 12:13:05 +01:00
Elizabeth Flanagan bdf2d94c35 INCOMPATIBLE_LICENSE: support for spdx and pkg licenses
This adds a few things to the incompatible license functionality

1. INCOMPATIBLE_LICENSE was unable to distinguish any variation
within LICENSE (e.g. GPLv3 v. GPLv3.0). This now utilizes the
SPDXLICENSEMAP of the license indicated as INCOMPATIBLE_LICENSE

2. Given a recipe where the main LICENSE was incompatible but
a package of the recipe was compatible, the entire recipe would
be excluded. This allows us some finer grained control over what
exactly gets excluded.

(From OE-Core rev: a8d7246f7b13ef2636c325263c8bfa22552d7a57)

Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-25 12:23:38 +01:00
Robert Yang a80203625a package.bbclass: do not split debug pkg when no debugsources.list
We don't have to split the debug pkg if it is null (No debugsources.list
since the find-debuginfo.sh would not generate it for the null pkg).

Serval pkg's debug pkg is null, and there were a few errors: (53 pkgs
had such errors in a core-image-sato build):

log.do_package:sort: open failed: debugsources.list: No such file or directory

[YOCTO #2076]

(From OE-Core rev: f88e3f420b4e95ab5ba4a075df8ed65b817f8b45)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-14 13:17:44 +00:00
Andreas Oberritter b9027a9416 package.bbclass: sort dynamically generated packages
* do_split_packages and package_do_split_locales dynamically add
  packages in order of appearance of os.walk() or os.listdir().
  This order varies between multiple build hosts (and probably
  also between successive builds).
* Sort the list of dynamically added packages, to get a consistent
  and reproducible order.
* This reduces the diffs in buildhistory and improves
  comparability between builds.

(From OE-Core rev: 76f46391239d3e123cfde900c52ca12ac73fd84f)

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-13 11:45:12 +00:00
Richard Purdie 19b38a6486 package.bbclass: Drop python depends from rpmdeps
This python depends is added by rpmdeps every time it finds a python
script. This is not necessary since we handle this in otherways. It
also breaks things like nativesdk since the dependency is not renamed.
The easiest solution is just to ignore this dependency.

(From OE-Core rev: 5c8ad2638baac0501cecf38f8d3e8467d56afb8a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-11 18:27:45 +00:00
Richard Purdie b1aeaa8b0d meta: Replace bb.data.expand(xxx, d) -> d.expand(xxx)
sed \
 -e 's:bb.data.\(expand([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
 -i `grep -ril bb.data.expand *`

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-05 10:23:53 -08:00
Richard Purdie 06f2f8ce0a meta: Convert getVar/getVarFlag(xxx, 1) -> (xxx, True)
Using "1" with getVar is bad coding style and "True" is preferred.
This patch is a sed over the meta directory of the form:

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

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-05 10:22:56 -08:00
Richard Purdie d01dadfb87 meta/classes: Convert to use appendVar and appendVarFlags
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-05 10:22:36 -08:00
Richard Purdie 7c46f0b109 package.bbclass: Add a sanity check to the debugsrcdir removal code
(From OE-Core rev: 9f6b9d7d0402b883fc3ad3cdead40e838ce31a27)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-24 16:11:27 +00:00
Shane Wang 9531161d40 package.bbclass: set package size into pkgdata for hob2's use
Write the size of a package into its pkgdata for hob2 to get the size
and show on the UI for image making.

(From OE-Core rev: 9c446d007957dab36ee2c012f0a5b22494a7a84f)

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-24 00:39:09 +00:00
Richard Purdie 2fb9aace07 package.bbclass: Remove empty directories created as part of srcdebug handling
We can create directories like /usr/src/debug as part of the debug file
manipulations. If these are going to end up empty, remove them to avoid QA
warnings like:

WARNING: For recipe task-core-x11, the following files/directories were installed but not shipped in any package:
WARNING:   /usr
WARNING:   /usr/src
WARNING:   /usr/src/debug
WARNING: For recipe task-core-console, the following files/directories were installed but not shipped in any package:
WARNING:   /usr
WARNING:   /usr/src
WARNING:   /usr/src/debug

(From OE-Core rev: 4f4451f7c0f9762092eb3dbc995b4afa2572ceb6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-24 00:12:02 +00:00
Richard Purdie 12306d01a0 package.bbclass: Optimise the per file rpm handling
Currently a process was being forked off for each individual file
this class wanted to inspect with rpmdeps. This converts it to use
rpmdeps-oecore which allows batch processing of these dependencies.

For do_package for perl, this reduced the time by about 1 minute (33%).

(From OE-Core rev: 548037acd63bd4859f8de8d23a3d12f36ce9f97f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-10 14:38:45 +00:00
Koen Kooi 8d4d9a15c4 package bbclass: allow per package PRIVATE_LIBS
If a recipe packages multiple versions of shlib (e.g. powervr drivers) we only want the shlib code to pickup $PN, not $PN-foo subpackages.
This keeps backward compatibility with the global PRIVATE_LIBS usage if no per package PRIVATE_LIBS are set for a given package. In other words: this doesn't break the firefox recipe.

(From OE-Core rev: ce46dbddef40ae3eef7238ac07438b15bd09e156)

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-01 15:15:15 +00:00
Koen Kooi ae3184c96e classes: replace 'Poky' with 'OE-core'
(From OE-Core rev: 1fdcd32520a05465b0d54c062f28bac9cdf74a20)

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-01 15:07:42 +00:00
Paul Eggleton ee7fb2b86d classes/package: remove out-of-date notice referring to the OE bugtracker
OpenEmbedded doesn't officially use a bug tracker anymore, and a message
asking the user to fix the metadata could be applied to almost any error
that occurs, so just remove the whole message.

(From OE-Core rev: ee486e30432ffd3ef97ba16511a9a1a38bad3826)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-17 14:53:25 +00:00
Enrico Scholz 866ed43c12 package.bbclass: quote pathname given to objdump
Packaging will fail with executable files containing spaces in their
names. Patch quotes the parameter passed to 'objdump'.

(From OE-Core rev: 7f7db286ca0b70bd5cce643c3b84f77ad45cc786)

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-17 14:53:22 +00:00
Lianhao Lu 18c88fcec8 package.bbclass: per recipe PRSERV_HOST support
[YOCTO #1126]
Added per recipe PRSERV_HOST PRSERV_PORT support.

(From OE-Core rev: d5b8caac0e7fc4b05c76b4d3da0508e2a53f28cd)

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-11 10:37:43 +00:00
Lianhao Lu a05e3a57c6 meta/PRService: Added export/import fuctions.
[YOCTO #1556]
- Modified meta/class/package.bbclass and prserv.bbclass according to
the change in PR service by adding PACKAGE_ARCH into the query tuple.

- Added prexport.bbclass, primport.bbclass to export/import AUTOPR
  values from/to PRService.

- Move PR service related common code to lib/oe/prservice.py.

- Supported reading the AUTOPR values from the exported .inc file
instead of reading it from remote PR service.

- Created a new script bitbake-prserv-tool to export/import the AUTOPR
values from/to the PR service.

Typical usage scenario of the export/import is:
1. bitbake-prserv-tool export <file> to export the AUTOPR values from
the current PR service into an exported .inc file.

2. Others may use that exported .inc file(to be included in the
local.conf) to lockdown and reproduce the same AUTOPR when generating
package feeds.

3. Others may "bitbake-prserv-tool import <file>" to import the AUTOPR
values into their own PR service and the AUTOPR values will be
incremented from there.

(From OE-Core rev: 9979107d8eaf503efd921564385859b1e83dbb3c)

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-11 10:37:43 +00:00
Mark Hatle 77edb006bb package.bbclass: Adjust RPM call to use dynamic location for magic files
The magic file could be installed somewhere else if the system native prefix
settings are changed.  Adjust the packaging files to compensate for this.

(From OE-Core rev: 93c0e9915b5c9bf8b0877c76f89de721adfbfd66)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-24 10:05:44 +00:00
Elizabeth Flanagan 30301333f8 package.bbclass: Adding license collection
emite_package_data needs to have LICENSE, as pkgdata is as an
audit of licenses collected during do_populate_license.

(From OE-Core rev: 60f0b866b4b7c4aa337a2ff764455741a73665da)

Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-08 15:24:32 +00:00
Richard Purdie 0a434ac101 getVar/setVar cleanups
Complete the bb.data.getVar/setVar replacements with accesses
directly to the data store object.

(From OE-Core rev: 2864ff6a4b3c3f9b3bbb6d2597243cc5d3715939)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-27 10:25:34 +00:00
Richard Purdie 7a2458f451 package.bbclass: Ensure paths to rpmmarcos and rpmpopt are set
If rpm-native was built in an alternative location, it may not relocate correctly
unless the rpmpopt and macros paths are explicitly specified.

This fixes errors seen on the Yocto autobuilder where pkgconfig
"provides" entries could disappear leading to image dependency failures.

(From OE-Core rev: fb01bd81197057e62106aac966f9ebc4c5054f97)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-22 13:07:11 +00:00
Henning Heinold fc744a789d package.bbclass: fix path for relative links on elf files, when moved to debugdir
* relative links for elf files like ../foo.so ends up in the
  debugdir with ../.debug/foo.so, this causes infinite fileaccessloops
  fix it by adding an extra "../" to the link path

(From OE-Core rev: 27cf695f1cf259f8c79214e95a0c4bc2c0779b81)

Signed-off-by: Henning Heinold <heinold@inf.fu-berlin.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-21 16:48:52 +00:00
Richard Purdie f2d077255d package.bbclass: Ensure we tell rpmdeps where to find its magic file
Without this, if rpmddeps came from a sstate package which was relocated
it might not find its magic file and if that happens, requires/provides
in packages could get corrupted. This leads to failures at rootfs time
during builds with messages like:

libdbus-1.so.3 is needed by libdbus-glib-1-2-0.92-r1.armv5te

since the provides would be missing in the dbus package.

(From OE-Core rev: abe2a948905a997314c61a8fcd35e2b42a3f4408)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-17 12:31:01 +00:00
Richard Purdie c8dee9b92d Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:

sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`

(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10 11:51:19 +00:00
Richard Purdie 0182b2bca3 package.bbclass: Fix various problems
Before this change:

a) Ownership and permissions of files copied from packages to
   package-split could get lost during the copy process. This change
   ensures they are preserved.
b) Ownership and permissions of directories could also get lost.
   Most of the complexity in this patch is addressing this problem
   ensuring newly created directories match the source ones being
   copied.
c) There was no warning about directories being created but not
   shipped by any package.

This patch fixes all of the above issues.

(From OE-Core rev: 6021e309e69d823e1467648aee12a32182945569)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-01 17:43:57 +00:00
Mark Hatle 737f8bbb4f Update python dependencies to be simply to "python"
Previously python dependencies were of the format "python(abi) = ..."
This format is not yet supportable within OE, so revert to a form
we know we can handle.

Introduce a change to package.bbclass that ensures it will causes the
sstate-cache's "package" to invalidate.  Since pythondeps changed, the
output of rpmdeps changes, which causes the per-file dependency
information to change.... thus we need to invalidate the cache!

(From OE-Core rev: 30064a98dc9049db4a37f119d15fbb59aa3c8377)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-21 13:42:53 +01:00
Lianhao Lu 99dd3c0b2c image/package.bbclass: Revise multilib support for DEBIAN_NAME.
[YOCTO #1486]
1. image.bbclass: In multilib_sanity_check, duplicated files except
those matching to MULTILIBRE_ALLOW_REP are allowed if they're equal.

2. pacakge.bbclass: Allow DEBIAN_NOAUTONAMES variable to be
automatically mapped in multilib case.

(From OE-Core rev: 66f9045e17c39f5c64a0699b72ea460a0701717a)

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-16 18:07:26 +01:00
Tom Zanussi f5a1b3c8f7 package.bbclass: fix spurious 'installed but not shipped' warning
For packages that have files installed that aren't in a subdirectory,
the following build WARNING is emitted (this for initramfs-live-boot
as an example):

WARNING: For recipe initramfs-live-boot, the following files were
 installed but not shipped in any package:
WARNING:   init

The problem is that the filenames added to the 'seen' array are always
added with a path separator at the beginning of the filename, but when
the package dir is walked for comparison, any files at the top-level
will be missing the beginning path separator and the comparison will
fail despite the fact that the file was actually packaged.  This
because the remainder between the dirname and the dvar base name is
used in the path join and in the case of files at the top-level, the
remainder is the empty string, where it should be '/' for comparison
purposes.

(From OE-Core rev: cb19503139b9102f02ba3e5be63d5e85f280f2ef)

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-16 17:23:59 +01:00
Richard Purdie c7869b4d4c package.bbclass: Ensure task's variable dependencies are correctly caputred in the sstate checksum
[YOCTO #1388]

This change is needed to correctly add the dependencies for the do_package
task which bitbake is unable to automatically detect itself.

(From OE-Core rev: 0614b9aa62a46f81d334ca4230080cc707347f3c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-31 19:38:30 +01:00
Dongxiao Xu de36669053 package.bbclass: Fix recrdeptask of image type recipes
For image type of recipes, we need to define do_package_write as its
do_build recrdeptask, which ensures that all packaging types listed in
PACKAGE_CLASSES will be built out.

[YOCTO 1370]

(From OE-Core rev: b68cd33673fdc17711d7b9fde9cc23b0d8498c17)

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-29 13:48:00 +01:00
Lianhao Lu 57bd62ad5c package(_ipk).bbclass: opkg using ALL_MULTILIB_PACKAGE_ARCHS
[YOCTO #1345]
The new variable ALL_MULTILIB_PACKAGE_ARCHS contains all the values of
PACKAGE_ARCHS for each multilib variants. The opkg backend now uses this
new value insteald of the PACKAGE_ARCHS to update the opkg indexes and
to generate the opkg configuration files. This allows the normal
packages and multilib packages may be installed into the same rootfs.

(From OE-Core rev: b774bf44ef004276da12a83ebd69715c00b596ac)

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-17 15:14:56 +01:00
Chris Larson ce110eddfc package: allow setting a section for locale packages
(From OE-Core rev: 521cab0239352e3b4316183c20e63cc06f5ae92b)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-12 17:21:53 +01:00
Chris Larson 07de9dc55c package: include SECTION in the pkgdata
(From OE-Core rev: 47664bb8309f5d791d7aa040a38c7324cb4f14e6)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-12 17:21:53 +01:00
Yu Ke 350a8916c3 do_split_packages: revise for multilib case
in multilib case, the PACKAGE_DYNAMIC is overrided with multilib
prefix. Take multilib:lib64-perl as example. the "perl-module-*"
will become "lib64-perl-module-*"

the output_pattern in do_split_packages is designed to work with
PACKAGE_DYNAMIC, so it should be applied with the same logic, i.e.
overriding with multilib prefix. otherwise the do_split_package will
split incorrect files

this patch implements the mulitlib override logic for do_split_packages

We also need to rename the extra_depends to support multilib case
(from Dongxaio Xu).

(From OE-Core rev: a4bc86713892502aeefbbdb3053e8cf1e1fc0bdb)

Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Xu Dongxiao <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-27 16:18:50 +01:00
Richard Purdie c18aa8d065 multilib: Add support for compiling recipes against multiple ABIs
This patch adds the core multilib class which can be used along with a
parameter specifying the mutlilib to use in BBCLASSEXTEND.

The MLPREFIX variable is added and can be used in cases where its too
difficult to dynmaically work out where a mutltilib prefix is needed
to be added to a variable.

This includes:
  * SHLIBSDIR and PACKAGE_ARCH fixes from Lianhao Lu.
  * PACKAGE_DYNAMIC mapping from Yu Ke
  * PACKAGE_INSTALL mapping from Yu Ke
  * RPROVIDES mapping from Yu Ke
  * TARGET_VENDOR fix from Mark Hatle
  * Ignorning *-native-runtime dependnecies as well as *-native from Yu Ke
  * Map PKG and ALLOW_EMPTY from Dongxiao Xu
  * Ensure RCONFLICTS and PKG field dependencies are remapped (from Dongxiao Xu)
  * Ensure PN and MLPREFIX are set at the same time to ensure consistent BPN values (Yu Ke)

(From OE-Core rev: 5d9453049915db48ec4b5972e12287417ebb61a2)

Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Xu Dongxiao <dongxiao.xu@intel.com>
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-27 16:18:40 +01:00
Mark Hatle 30ddd02277 package.bbclass: fixup_perms - change symlink processing
We switch to using os.lchown in order to avoid following a symlink.

We also now check if an item is a symlink, if so we avoid the
os.chmod as a symlink inherits the mode of it's target.

(From OE-Core rev: c64d075b3d367e6c76aafa17782585d026b1f31e)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-27 15:45:48 +01:00
Richard Purdie e8e6f9df59 package.bbclass: Make unshipped packages message more readable
(From OE-Core rev: bc73fa1256d678c09c0d9b50e0153623861dcf32)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-05 13:36:56 +01:00
Mark Hatle 8781c843cf classes/package.bbclass: Add fixup_perms
Add a new function that is responsible for fixing directory and file
permissions, owners and groups during the packaging process.  This will fix
various issues where two packages may create the same directory and end up
with different permissions, owner and/or group.

The issue being resolved is that if two packages conflict in their ownership
of a directory, the first installed into the rootfs sets the permissions.
This leads to a least potentially non-deterministic filesystems, at worst
security defects.

The user can specify their own settings via the configuration files
specified in FILESYSTEM_PERMS_TABLES.  If this is not defined, it will
fall back to loading files/fs-perms.txt from BBPATH.  The format of this
file is documented within the file.

By default all of the system directories, specified in bitbake.conf, will
be fixed to be 0755, root, root.

The fs-perms.txt contains a few default entries to correct documentation,
locale, headers and debug sources.  It was discovered these are often
incorrect due to being directly copied from the build user environment.

The entries needed to match the base-files package have also been added.

Also tweak a couple of warnings to provide more diagnostic information.

(From OE-Core rev: 8c720efa053f81dc8d2bb604cdbdb25de9a6efab)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-30 22:54:04 +01:00
Richard Purdie 1f0e24236f package.bbclass: PACKAGELOCK is a shared lock file so inform sstate as such
(From OE-Core rev: 60f74e47160508c9150d880b1f627dc7e3f0d3ab)

Signed-off-by: Richard  Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-09 15:48:26 +01:00
Khem Raj c412674cf8 package.bbclass,prserv.bbclass: Compare USE_PR_SERV with "1" or "0"
Value of USE_PR_SERV is either "1" or "0" looking at
settings in bitbake.conf
USE_PR_SERV = "${@[1,0][(bb.data.getVar('PRSERV_HOST',d,1) is None) or (bb.data.getVar('PRSERV_PORT',d,1) is None)]}"
So we compare the strings

(From OE-Core rev: 5f6179324ac3956ad87123005bfcab4e8f30e67b)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-29 09:40:04 +01:00