summaryrefslogtreecommitdiffstats
path: root/meta/classes/package_rpm.bbclass
AgeCommit message (Collapse)Author
2022-08-12classes: Update classes to match new bitbake class scope functionalityRichard Purdie
Move classes to classes-global or classes-recipe as appropriate to take advantage of new bitbake functionality to check class scope/usage. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12classes: Add SPDX license identifiersRichard Purdie
As stated in our top level license files, the license is MIT unless otherwise stated. Add SPDX identifers accordingly. Replace older license statementa with the standardised syntax. Also drop "All Rights Reserved" expression as it isn't used now, doesn't mean anything and is confusing. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12classes: Add copyright statements to files without oneRichard Purdie
Where there isn't a copyright statement, add one to make it explicit. Also drop editor config lines where they were present. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-01-04package_deb/ipk/rpm: Add more minimal do_build dependencies backRichard Purdie
The dependencies for do_build became a little too minimal after the removal of recrdeptask since "bitbake go" would not package go-runtime despite it being in DEPENDS and the resulting package having a dependency on it. A reasonable compromise is probably rdeptask instead of recrdeptask which is a lot lower overhead but makes the build target more useful and importantly, lets world builds do what you'd expect them to. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-16reproducible: Merge code into base.bbclassRichard Purdie
Reproducibility is here to stay and needs to be part of our default workflow. Move the remaining code to base.bbclass so it is always a first class citizen and it is clear people need to be mindful of it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-11package_rpm: use zstd instead of xzAlexander Kanavin
zstd has similar time and space performance in compression but is vastly faster in decompression, which benefits rootfs creation (especially when installing very large packages) and on-target package installation. Also, ensure ZSTD_THREADS doesn't change sstate checksums. The detailed explanation is in the commit making similar change for XZ_THREADS. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2021-09-23reproducible_build/package_XXX: Ensure SDE task is in dependency chainRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-09-23package_ipk/deb/rpm: Drop recursive do_build task dependenciesRichard Purdie
This is a controversial change which removes the recursive dependencies from the do_build target of packaging tasks of recipes. Currently this means when you "bitbake <image>" or "bitbake <recipe>", the packaging tasks run for all packaging backends enabled for all recipes in the dependency chain. The same therefore then applies to images. We don't actually need that, it is a convinience thing. Removing it massively simplifies the task graph and causes much fewer tasks to execute in many common scenarios. It also means less sstate is fetched for example when building an image. This means when building a recipe all package formats would be built but when building an image, only the format used by the image would be generated. This should be an improvement in most cases but some CI systems may need to be explict about what they're building. 'bitbake XXX --runall build' would give the previous behaviour. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-22package_rpm/update-alternatives: fix package's providesChen Qi
Currently we have: $ rpm -qp --provides tmp/deploy/rpm/core2_64/bash-5.1.8-r0.core2_64.rpm bash = 5.1.8-r0 This is incorrect as bash provides /bin/bash and /bin/sh. This is caused by incomplete conversion of new override syntax, which breaks the per-file parsing of package_rpm. With this patch, we have: $ rpm -qp --provides tmp/deploy/rpm/core2_64/bash-5.1.8-r0.core2_64.rpm /bin/bash /bin/sh bash = 5.1.8-r0 Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-30Convert to new override syntaxRichard Purdie
This is the result of automated script conversion: scripts/contrib/convert-overrides.py <oe-core directory> converting the metadata to use ":" as the override character instead of "_". Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-27package_rpm: pass XZ_THREADS to rpmRoss Burton
By default RPM uses the number of cores as the number of threads to use, which can result in quite antisocial memory usage. As we control the macros for compression anyway, we can pass XZ_THREADS to limit the number of threads if needed. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-26package/package_rpm: Disable font_provides configuration for reproducibiltyRichard Purdie
The host may or may not have fc-cache which is used for find provides information by rpmdeps. This lead to non-deterministic build output. Disable the font provides code so we have deterministic builds, we have nothing using/relying on it at this point. Need to disable this in both the rpmdeps code and in package_rpm itself although the latter shouldn't be being used. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-19package_rpm: Enable use_source_date_epoch_as_buildtime in package_rpm classJan-Simon Möller
Adding --define 'use_source_date_epoch_as_buildtime 1' to rpmbuild ensure that the rpm header does have a consistent BUILDTIME tag. This allows the rpms to be built reproducibly. Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-16classes: Drop now unneeded umask flagsRichard Purdie
Now that 022 is the default in BB_DEFAULT_UMASK in bitbake.conf, we don't need any of these task flags, clean up. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-29package_rpm: Clean up unset runtime package variable handlingRichard Purdie
If the R* runtime package variables are unset it could cause trackbacks. There were some fallbacks already, clean this up to handle consistently. The code was expecting strings but setting defaults of empty lists which silently were converted to strings by the "or" statements which was a nightmare to understand or alter. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-22nativesdk-sdk-provides-dummy: Add /bin/shRichard Purdie
By doing this we can revert b18c32ab6bc9c4f1953e9f79aa39bc92d1c4e30d which was a pretty ugly hack anyway and now means the different providers are all being handled consistently. Anyone with SDK recipes will need to ensure nativesdk-sdk-provides-dummy is included in those builds (or an equivalent). This is a good thing to do anyway. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-25package_rpm.bbclass: add PACKAGE_ADD_METADATA_RPM to sstate variablesMichael Ho
Refactor the addition of vardeps for this package class to use RPMEXTRAVARS and pass the items through gen_packagevar so package name specific overrides are accounted for. This matches the style used in package_ipk.bbclass. Since do_package_write_rpm does not have any "extra vars" that affect the rpm packaging yet, this commit has to add the variable. This refactoring is needed to add PACKAGE_ADD_METADATA_RPM to RPMEXTRAVARS so it affects the sstate hash of do_package_write_rpm. Signed-off-by: Michael Ho <Michael.Ho@bmw.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-25package_rpm.bbclass: respect package overrides for the main packageMichael Ho
Apply ${PN} to OVERRIDES when determining the base package spec variables. Without this, there is a mismatch in behaviour where overrides for the base package have no effect while overrides for subpackages do. The subpackages should not be affected by this override as they apply their own package overrides and will by default fetch the base variables and apply them in the spec file. This makes the behaviour for package overrides match the implementation in package_deb.bbclass and package_ipk.bbclass. Signed-off-by: Michael Ho <Michael.Ho@bmw.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-19package_rpm.bbclass: Remove a misleading bb.note()Peter Kjellerstedt
It should have been removed in 3db9d865 (classes/package_rpm.bbclass: Enhance diagnostic messages) when it was split in two new notes. Also change the casing of two other notes to align them with the other notes. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-06-28package_rpm.bbclass: python2 -> python3Robert Yang
Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-06archiver/package_rpm: Fix the worst src.rpm generation raceRichard Purdie
The package_rpm code is writing outside the task's sstate directory into the sstate of do_deploy_archives. This is "out of spec" since if the task is installed from sstate, the files are not restored. This means the files may appear/disappear, things are not deterministic and there are races. Extend the do_package_write_rpm code to handle writing the src.rpm into place to avoid these issues. There are other problems but this avoids races around this file. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-05package_rpm/archiver: Apply bandaid to src.rpm creationRichard Purdie
| error: create archive failed on file /media/build1/poky/build/tmp/work/all-poky-linux/xcursor-transparent-theme/0.1.1+gitAUTOINC+23c8af5ba4-r0/deploy-sources/allarch-poky-linux/xcursor-transparent-theme-0.1.1+gitAUTOINC+23c8af5ba4-r0/xcursor-transparent-theme-0.1.1+git0+23c8af5ba4-r0.src.rpm: cpio: read failed - No such file or directory | Building target platforms: noarch-poky-linux | Building for target noarch-poky-linux This is caused by: $ cat log.task_order do_cleansstate (24289): log.do_cleansstate.24289 do_deploy_archives_setscene (24395): log.do_deploy_archives_setscene.24395 do_fetch (24407): log.do_fetch.24407 [..] do_package_write_rpm (25448): log.do_package_write_rpm.25448 do_package_qa (25451): log.do_package_qa.25451 So do_deploy_archives can run from sstate, created a .src.rpm in WORKDIR/deploy-sources, then it was removed when rpm was running. This leads to a broken Source line in the spec file as the original file was found by the os.listdir(). This fix is just a bandaid over much more fundamental problems sadly. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-30package_rpm: set _builddir to B not SRichard Purdie
Recipes which use a shared workdir (e.g. gcc-runtine and libgcc) can race over temporary files causing interesting build failures. Using B instead of S avoids this problem. [YOCTO #12605] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-12package.bbclass: run pre/post installation/removal scriptlets using sh -eAlexander Kanavin
This allows catching errors in the scriptlets which would otherwise go unnoticed, e.g. this sequence: ==== bogus_command proper_command ==== would work just fine without any visible warnings or errors. This was previously done only for rpm packages; this patch replaces the rpm-specific tweak with one that works for all package types. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-29package_rpm.bbclass: run pre/post installation scriptlets using sh -eAlexander Kanavin
This allows catching errors in the scriptlets which would otherwise go unnoticed, e.g. this sequence: ==== bogus_command proper_command ==== would work just fine. Note that this patch needs all of the preceding patches, as otherwise running failing scriptlets with -e would defer them to first boot, instead of properly reporting failure and aborting the package installation. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-29package_rpm.bbclass: improve reproducibility of RPM packagesJuro Bystricky
The RPM packages contain BUILDHOST based on the current build host. This breaks reproducibility if the same package is build on two different hosts. To improve reproducible builds, we always set BUILDHOST as "reproducible". Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-01-29package_rpm.bbclass: Fix matching of architecture independent packagesOtavio Salvador
OE-Core changes the architecture independent RPM packages to use "noarch" instead of "all". This change has been included in the commit below: ,---- | commit 341810aff923ace6b1cc1e15e19383c4f8773b51 | Author: Alexander Kanavin <alexander.kanavin@linux.intel.com> | Date: Mon Jan 9 16:37:28 2017 +0200 | | package_rpm.bbclass: make architecture-independent .rpm packages | "noarch" instead of "all" | | Too many places in dnf/rpm4 stack make that assumption; let's not | fight against it. | | Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> `---- This is causing problems with machines that has "all" inside the machine name. Reported-by: Alexandru Palalau <ioan-alexandru.palalau@nxp.com> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-01-26package_rpm: correctly handle LICENSE_${PN}Ross Burton
RPM spec files don't distinguish between spec-level license and the primary package license, so always output the License for every package (defaulting to the recipe-wide license) and use LICENSE_${PN} if set for the primary package. As the primary use of package_rpm is to generate built packages, this fixes the license fields in the generated packages. [ YOCTO #12057 ] (From OE-Core rev: 8c333e592fa7a3a887c792ac14e5cde2141b5d35) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-05package_rpm.bbclass: clamp timestampsJuro Bystricky
Improve binary reproducibility of RPM packages. Ensure timestamps in RPM packages are not later than the value of SOURCE_DATE_EPOCH. If SOURCE_DATE_EPOCH is not set, timestamps are not clamped. Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-16package_rpm.bbclass: Filter out unwanted file deps for nativesdk packagesPeter Kjellerstedt
Filter out any file dependencies on absolute paths and any dependencies on Perl modules for nativesdk packages. It is assumed that they will be provided by the native host if needed, and they mess up the dependency handling if they are present. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-25package_rpm.bbclass: disable generation of .build-id linksAlexander Kanavin
As we're not using them and they're getting in the way of reproducibility. [YOCTO #11718] 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>
2017-06-12package_rpm.bbclass: use multithreaded xz compressionAlexander Kanavin
RPM's default is single-threaded gz; the change greatly helps with both buildtimes (when there is a small number of large-sized packages) and disk space taken by resulting rpms. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-05-16rpm: allow arch-dependent binaries in noarch packagesNg Wei Tee
This is needed for packages like linux-firmware which have a legitimate reason for it. Oe-core has a separate package_qa test for this situation, so any accidental inclusions of such binaries will still be caught. [YOCTO #11329] Signed-off-by: Ng Wei Tee <wei.tee.ng@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-04-20package_rpm.bbclass: Dosen't filter Conflicts if found in ProvidesAníbal Limón
This filter was add to make compilence with debian packaging but in package_deb.bbclass is allowed to have the same values in Conflicts and Provides. With this filtering errors in recipe meta-data are hidden and could end on install two packages that conflicts [2]. Reviewing the RPM spec from Fedora doesn't have anything that denies to use the both Conflicts and Provides with the same value [3], also in debian manual section 7.6.2 of [4] this behaviour is allowed to force the removal of the conflicted package and RPM is compilence with this behaviour after remove the filtering this is seen [5]. [1] http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=4b611b66743a5ec220aef34d796af63029bb5fd9 [2] https://bugzilla.yoctoproject.org/show_bug.cgi?id=9349#c9 [3] https://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch-advanced-packaging.html [4] https://www.debian.org/doc/debian-policy/ch-relationships.html [5] https://bugzilla.yoctoproject.org/show_bug.cgi?id=9349#c12 Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-03-13package_rpm.bbclass: do not strip multilib prefixes from package names, do ↵Alexander Kanavin
not add multilib prefix to package arch This is done for reasons I cannot establish, and greatly complicates the code that installs packages into rootfs. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
2017-03-13package_rpm.bbclass: do not set the OS dynamically when building rpmsAlexander Kanavin
Packages need to contain just one value for the os field, otherwise rpm will refuse to install them if they don't match what is in /etc/rpm/platform. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
2017-03-13package_rpm.bbclass: add a /bin/sh Provides for nativesdk- packagesAlexander Kanavin
nativesdk-* rpm packages all require /bin/sh because postinst scriptlets are run with it. We can either teach rpm4 and dnf to ignore that dependency (a lot of non-upstreamable work), or add auto-satisfy the dependency in each package. I've chosen to do the latter. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
2017-03-13package_rpm.bbclass: instruct rpm to not remove the buildroot directoryAlexander Kanavin
This is the ${W}/package directory which may be reused in subsequent builds. Also clean up various default directories rpm 4 creates. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
2017-03-13package_rpm.bbclass: no need to specify the magic file locationAlexander Kanavin
It's handled by the rpm wrapper command, created in rpm recipe. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
2017-03-13package_rpm.bbclass: replace createrepo reference with createrepo_cAlexander Kanavin
Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
2017-03-13package_rpm.bbclass: correctly map RRECOMMENDS and RSUGGESTS to rpm tagsAlexander Kanavin
Previously they were swapped, not sure why. Their meaning, as far as rpm world goes, is different: - Recommends is a soft dependency and will be installed by default; there is an option not to do that. - Suggests is a suggestion to be picked up and presented to end user by package management tools; it has no special meaning otherwise. OE packages use RRECOMMENDS, which should be mapped to Recommends rpm tag, so that the packages will be picked up as dependencies. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
2017-03-13package_rpm.bbclass: make architecture-independent .rpm packages "noarch" ↵Alexander Kanavin
instead of "all" Too many places in dnf/rpm4 stack make that assumption; let's not fight against it. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
2017-02-15classes: Drop now unneeded update_data callsRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22package_rpm: Clean up pointless exception handlingRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19classes/package*: Add support for PACKAGE_WRITE_DEPSRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-09classes/package_rpm: handle square brackets in filenamesPaul Eggleton
When constructing a spec file we list files and directory paths in the %files section. If ] or [ characters are in a file or directory name, rpm treats them as wildcards which will mean it won't properly match the filename. Instead, transform these into an ? wildcard so they don't cause a problem. (This fixes packaging the npm package "file-set" and anything that happens to depend upon it, since it includes tests with files that contain unusual characters including ] and [). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-16meta: remove True option to getVarFlag callsJoshua Lock
getVarFlag() now defaults to expanding by default, thus remove the True option from getVarFlag() calls with a regex search and replace. Search made with the following regex: getVarFlag ?\(( ?[^,()]*, ?[^,()]*), True\) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-16meta: remove True option to getVar callsJoshua Lock
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\) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-10-03package_rpm.bbclass: Use bb.fatal() instead of raising FuncFailedUlf Magnusson
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. Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02classes/lib: Convert to use python3 octal syntaxRichard Purdie
The syntax for octal values changed in python3, adapt to it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>