summaryrefslogtreecommitdiffstats
path: root/meta/classes-global/package_rpm.bbclass
Commit message (Collapse)AuthorAgeFilesLines
* package_rpm: remove support for DIRFILESAlexander Kanavin2024-04-231-22/+9
| | | | | | | | | | | | | | This was added here: https://git.yoctoproject.org/poky/commit/?id=2f42ef8d8fb1febf28252b98884cebabc931f720 It's undocumented, untested, rpm-specific, and currently broken, and to begin with looks like a workaround for Tizen/smack security label conflicts elsewhere. (From OE-Core rev: ea8af19bb909c7e3633d82bec9d925c8f42ec860) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_rpm: add RPMBUILD_EXTRA_PARAMS variableMartin Jansa2024-02-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * e.g. for DISTROs which define extra user-defined fields with PACKAGE_ADD_METADATA/PACKAGE_ADD_METADATA_RPM as undefined fields in packagedata are fatal error for rpmbuild: "error: line 9: Unknown tag: Author: Unspecified" as shown in: http://errors.yoctoproject.org/Errors/Details/751706/ with "Author" field added with: PACKAGE_CLASSES = "package_rpm" PACKAGE_ADD_AUTHOR_METADATA = "test-author" PACKAGE_ADD_METADATA = "Author: ${PACKAGE_ADD_AUTHOR_METADATA}" to fix rpm build you can use: RPMBUILD_EXTRA_PARAMS = " --define '_Author Author'" keep in mind that this doesn't cause this Author field to be added in .rpm, it just avoids the BUILDSPEC failure. and for ipk build: OPKG_MAKE_INDEX_EXTRA_PARAMS = "-f" alternatively you can avoid additional packagedata fields ending in the package manager (if you use them only with buildhistory or packagedata) with: PACKAGE_ADD_METADATA_RPM = "" PACKAGE_ADD_METADATA_IPK = "" PACKAGE_ADD_METADATA_DEP = "" (From OE-Core rev: 31030e7a19a27ad424b997fad36ee4f633ce0d63) Signed-off-by: Martin Jansa <martin.jansa@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/package_rpm: streamline the logic in one of the condition blocksAlexander Kanavin2024-02-081-4/+2
| | | | | | | | (From OE-Core rev: e6a8ca554509c0edf9fd36ced88165dc3caf0e87) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/package_rpm: additionally escape \ and " in filenamesAlexander Kanavin2024-02-081-1/+1
| | | | | | | | | | | As specified in: https://github.com/rpm-software-management/rpm/blob/rpm-4.19.x/docs/manual/spec.md#shell-globbing (From OE-Core rev: 78d22c80c3f3a9f82c9f0d3dd1c591d395e02918) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/package_rpm: correctly escape percent charactersAlexander Kanavin2024-02-021-8/+8
| | | | | | | | | | | | | | | | | | This many characters doesn't work with rpm 4.19 packaging (as shown by nodejs recipes), and per documentation a single escape is enough: https://github.com/rpm-software-management/rpm/blob/rpm-4.19.x/docs/manual/spec.md#shell-globbing It also should be done in a function, and just before writing out the corrected filename to .spec, not earlier where the path may still be needed for file operations (such as gettings file attributes). (From OE-Core rev: 6d9fe2623c37e405a80acf71633f7291ecdde533) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/package_rpm: set bogus locations for passwd/group filesAlexander Kanavin2024-01-271-0/+2
| | | | | | | | | | | | | | | | | Since https://github.com/rpm-software-management/rpm/commit/f3eaeeb7341085e1850e914350cf1f33d538320d rpm does its own parsing of /etc/passwd and /etc/group instead of relying on getpwnam() and friends. This has an unfortunate effect of leaking build host uid/gid values for users and groups into the cpio header inside rpm file (where previously those were always zero). Installation of rpm packages relies on rpm header to set files ownership, and that is a different structure that is build from .spec information, so we can avoid host contamination by setting the paths to something bogus. (From OE-Core rev: ac8ea64bb39a5e56599e078c7e6cd056a2aa4144) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/package_rpm: use weak user/group dependenciesAlexander Kanavin2024-01-271-0/+1
| | | | | | | | | | | | | | | rpm 4.19 automatically generates provides and depends for user and groups: https://github.com/rpm-software-management/rpm/blob/rpm-4.19.x/docs/manual/users_and_groups.md#dependencies This mechanism relies on sysusers.d for the 'provides' part, and thus is systemd-only at best. So we need to disable it for now, otherwise image generation fails with unresolved dependencies. (From OE-Core rev: 10064e364f015ad3c0c8d63511cd9a7da5e22c69) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/package_rpm: write file permissions and ownership explicitly into .specAlexander Kanavin2024-01-271-6/+28
| | | | | | | | | | | | | | | | | | | | | | Per https://github.com/rpm-software-management/rpm/commit/77d3529c31ca090a40b8d3959a0bcdd721a556d6 rpm 4.19.1+ will not consider actual filesystem permissions and ownership, and will quietly default to root if not expictly set otherwise in .spec file. There's also additional diagnostics (printing what is in passwd/group) when user/group name lookup against the sysroot fails. That is never supposed to happen, and yet there was one report that it did: https://autobuilder.yoctoproject.org/typhoon/#/builders/44/builds/8493/steps/23/logs/stdio Investigating that issue led to the first three commits in this patchset: sysroot user management postinsts: run with /bin/sh -e to report errors when they happen classes/multilib: expand PACKAGE_WRITE_DEPS in addition to DEPENDS classes/staging: capture output of sysroot postinsts into logs (From OE-Core rev: a9db9a56617459e8f6f6dd466f2e18a7eed5c1e3) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package/package_write: Improve packagedata code locationRichard Purdie2023-11-081-0/+4
| | | | | | | | | | Move the do_packagedata dependencies into the package_write codeblocks themselves. Also drop the dependency for the tar package backend which was dropped. (From OE-Core rev: 372a7f2e3c5c03da044e576e1501e86f8938f5e6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_rpm: Allow compression mode overrideNiko Mauno2023-10-261-2/+4
| | | | | | | | | | | | | | | | | | | | | | | Commit 4a4d5f78a6962dda5f63e9891825c80a8a87bf66 ("package_rpm: use zstd instead of xz") changed the rpm package compressor from 'xz' to 'zstd' which results in decompression failure with BusyBox-provided 'rpm2cpio' applet and 'rpm' applet when given the '-i' (Install package) option: rpm2cpio: no gzip/bzip2/xz magic Introduce a variable which makes it possible to use a different compression mode, making it possible to override the default value for example like RPMBUILD_COMPMODE = "${@'w6T%d.xzdio' % int(d.getVar('XZ_THREADS'))}" to enable rpm decompression without including the full rpm package in the resulting root filesystem. (From OE-Core rev: a40d9258148e28cbee2168c93179cd4c1232fb62) Signed-off-by: Niko Mauno <niko.mauno@vaisala.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_rpm: Remove unused definitionsNiko Mauno2023-10-261-4/+0
| | | | | | | | | | Some local variables defined in do_package_rpm() are not referenced, so remove such dead code lines. (From OE-Core rev: 5d387bc9001726937ffa7d3cfc333cfa31b681fb) Signed-off-by: Niko Mauno <niko.mauno@vaisala.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_rpm: Minor cosmetic and style fixesNiko Mauno2023-10-261-3/+3
| | | | | | | | | | Add the missing conventional space characters around bitbake variable assignment operators. Also fix a typo on a comment line. (From OE-Core rev: 3dea51ce6c91dc2b12a5520dede51ec6357e87d5) Signed-off-by: Niko Mauno <niko.mauno@vaisala.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_rpm: Fix some pycodestyle issuesNiko Mauno2023-10-261-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | Fix following subset of observations reported by version 2.10.0 of pycodestyle utility: meta/classes-global/package_rpm.bbclass:65:46: E231 missing whitespace after ',' meta/classes-global/package_rpm.bbclass:66:46: E231 missing whitespace after ',' meta/classes-global/package_rpm.bbclass:107:19: E231 missing whitespace after ',' meta/classes-global/package_rpm.bbclass:109:69: E202 whitespace before ')' meta/classes-global/package_rpm.bbclass:122:103: W291 trailing whitespace meta/classes-global/package_rpm.bbclass:194:74: W291 trailing whitespace meta/classes-global/package_rpm.bbclass:448:16: E713 test for membership should be 'not in' meta/classes-global/package_rpm.bbclass:450:16: E713 test for membership should be 'not in' meta/classes-global/package_rpm.bbclass:520:1: W293 blank line contains whitespace meta/classes-global/package_rpm.bbclass:521:15: E231 missing whitespace after ',' meta/classes-global/package_rpm.bbclass:542:12: E713 test for membership should be 'not in' meta/classes-global/package_rpm.bbclass:544:12: E713 test for membership should be 'not in' meta/classes-global/package_rpm.bbclass:647:67: W291 trailing whitespace (From OE-Core rev: 7920599c05c066767025063b277df73c6560753d) Signed-off-by: Niko Mauno <niko.mauno@vaisala.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package: Move mapping_rename_hook to packagedata function libraryRichard Purdie2023-01-051-1/+1
| | | | | | | | | This function is used by the packaging tasks/classes and makes much more sense in the packagedata function library. (From OE-Core rev: 7a512a8803101310772d83836e6b78ebaf8121de) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package: Move pkgdata handling functions to oe.packagedataRichard Purdie2023-01-051-2/+2
| | | | | | | | | To avoid reparsing the bbclass code all the time, move the functions to the packagedata python function library code which is more efficient. (From OE-Core rev: f520a3039540b1183b1b2bdaaf8b9195995c0187) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package: Move get_conffiles/files_from_filevars functions to libRichard Purdie2023-01-051-1/+1
| | | | | | | | | To avoid reparsing the bbclass code all the time, move the functions to the python function library code which is more efficient. (From OE-Core rev: 424e65627c018b3119050f515b0c7cfb43be5573) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_rpm: Fix Linux 6.1.0 perf 1.0 version mistranslationMarek Vasut2022-12-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | With Linux 6.1.0 and perf 1.0-r9, a build which includes perf-dev fails due to perf-dev depending on perf 6.6.1.0-r9 . This is because translate_vers() operates on perf-dev and mangles its version. The following scenario occurs: ver=6.1.0-r9 pv=1.0 pkgv=6.1.0 reppv=6.1.0 With Linux 6.1.0, a corner case is hit where pv is a substring of ver, which yields this corrupted version 6.6.1.0-r9 . Example in python3: >>> "6.1.0-r9".replace("1.0", "6.1.0") '6.6.1.0-r9' >>> "6.0.13-r9".replace("1.0", "6.0.13") '6.0.13-r9' The fix is to only replace pv with reppv in case pv is at the beginning of ver , instead of replacing all occurences. (From OE-Core rev: bf2096a43d56c2d633a4b6e3db9e4390da4be6e2) Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_rpm: Do not replace square brackets in %filesPavel Zhukov2022-08-211-6/+0
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit f95adb749619e70920c6cc6cd01c6d02cd348fd8. At some point RPM stopped treating "[]?" characters in quoted text as a glob This causes rpmbuild error [1] in oe-core if package contains filenames with such characters [Yocto #13746]. Reverting commit which replaces "[]" with "?" fixes the issue. It should be safe now becuase rpm tries to use filename directly if not found by glob [2]. [1] | error: File not found: /mnt/builds/yocto/build/build/tmp/work/core2-64-poky-linux/testrpm/0.0.1-r0/package/42 All-Time Classics (E) ?v1.1?.cht | File not found: /mnt/builds/yocto/build/build/tmp/work/core2-64-poky-linux/testrpm/0.0.1-r0/package/42 All-Time Classics (E) ?v1.1?.cht | [2] https://github.com/rpm-software-management/rpm/commit/c16c70cbd6b31cd93541d5c22d23ba98d212ad3d (From OE-Core rev: 9916212b4810280108107d94cd2c0cd3e07ae6ed) Signed-off-by: Pavel Zhukov <pavel.zhukov@huawei.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes: Update classes to match new bitbake class scope functionalityRichard Purdie2022-08-121-0/+761
Move classes to classes-global or classes-recipe as appropriate to take advantage of new bitbake functionality to check class scope/usage. (From OE-Core rev: f5c128008365e141082c129417eb72d2751e8045) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>