diff options
Diffstat (limited to 'poky/meta/recipes-devtools/rpm')
3 files changed, 82 insertions, 9 deletions
diff --git a/poky/meta/recipes-devtools/rpm/files/0001-Bump-up-the-limit-of-signature-header-to-64MB.patch b/poky/meta/recipes-devtools/rpm/files/0001-Bump-up-the-limit-of-signature-header-to-64MB.patch new file mode 100644 index 000000000..0a19c12a7 --- /dev/null +++ b/poky/meta/recipes-devtools/rpm/files/0001-Bump-up-the-limit-of-signature-header-to-64MB.patch @@ -0,0 +1,62 @@ +From e8bf0eba7143abb6e69db82ee747a0c6790dd00a Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Wed, 3 Jun 2020 10:25:24 +0800 +Subject: [PATCH] Bump up the limit of signature header to 64MB + +Since commits [Place file signatures into the signature header where they +belong][1] applied, run `rpm -Kv **.rpm' failed if signature header +is larger than 64KB. Here are steps: + +1) A unsigned rpm package, the size is 227560 bytes +$ ls -al xz-src-5.2.5-r0.corei7_64.rpm +-rw-------. 1 mockbuild 1000 227560 Jun 3 09:59 + +2) Sign the rpm package +$ rpmsign --addsign ... xz-src-5.2.5-r0.corei7_64.rpm + +3) The size of signed rpm is 312208 bytes +$ ls -al xz-src-5.2.5-r0.corei7_64.rpm +-rw-------. 1 mockbuild 1000 312208 Jun 3 09:48 + +4) Run `rpm -Kv' failed with signature hdr data out of range +$ rpm -Kv xz-src-5.2.5-r0.corei7_64.rpm +xz-src-5.2.5-r0.corei7_64.rpm: +error: xz-src-5.2.5-r0.corei7_64.rpm: signature hdr data: BAD, no. of +bytes(88864) out of range + +From 1) and 3), the size of signed rpm package increased +312208 - 227560 = 84648, so the check of dl_max (64KB,65536) +is not enough. + +As [1] said: + + This also means the signature header can be MUCH bigger than ever + before,so bump up the limit (to 64MB, arbitrary something for now) + +So [1] missed to multiply by 1024. + +[1] https://github.com/rpm-software-management/rpm/commit/f558e886050c4e98f6cdde391df679a411b3f62c + +Upstream-Status: Backport [https://github.com/rpm-software-management/rpm/commit/486579912381ede82172dc6d0ff3941a6d0536b5] + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + lib/header.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/header.c b/lib/header.c +index 9ec7ed0..cbf6890 100644 +--- a/lib/header.c ++++ b/lib/header.c +@@ -1906,7 +1906,7 @@ rpmRC hdrblobRead(FD_t fd, int magic, int exact_size, rpmTagVal regionTag, hdrbl + + if (regionTag == RPMTAG_HEADERSIGNATURES) { + il_max = 32; +- dl_max = 64 * 1024; ++ dl_max = 64 * 1024 * 1024; + } + + memset(block, 0, sizeof(block)); +-- +2.25.4 + diff --git a/poky/meta/recipes-devtools/rpm/files/environment.d-rpm.sh b/poky/meta/recipes-devtools/rpm/files/environment.d-rpm.sh new file mode 100644 index 000000000..9b669a18d --- /dev/null +++ b/poky/meta/recipes-devtools/rpm/files/environment.d-rpm.sh @@ -0,0 +1 @@ +export RPM_CONFIGDIR="$OECORE_NATIVE_SYSROOT/usr/lib/rpm" diff --git a/poky/meta/recipes-devtools/rpm/rpm_4.15.1.bb b/poky/meta/recipes-devtools/rpm/rpm_4.15.1.bb index 8add14246..a1c520555 100644 --- a/poky/meta/recipes-devtools/rpm/rpm_4.15.1.bb +++ b/poky/meta/recipes-devtools/rpm/rpm_4.15.1.bb @@ -25,6 +25,7 @@ LICENSE = "GPL-2.0" LIC_FILES_CHKSUM = "file://COPYING;md5=c0bf017c0fd1920e6158a333acabfd4a" SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.15.x \ + file://environment.d-rpm.sh \ file://0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch \ file://0001-Do-not-read-config-files-from-HOME.patch \ file://0001-When-cross-installing-execute-package-scriptlets-wit.patch \ @@ -40,6 +41,7 @@ SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.15.x \ file://0001-rpmplugins.c-call-dlerror-prior-to-dlsym.patch \ file://0001-rpmfc.c-do-not-run-file-classification-in-parallel.patch \ file://0001-lib-transaction.c-fix-file-conflicts-for-MIPS64-N32.patch \ + file://0001-Bump-up-the-limit-of-signature-header-to-64MB.patch \ " PE = "1" @@ -47,7 +49,7 @@ SRCREV = "ab2179452c5be276a6b96c591afded485c7e58c3" S = "${WORKDIR}/git" -DEPENDS = "openssl libarchive db file popt xz bzip2 dbus elfutils python3" +DEPENDS = "openssl db file popt xz bzip2 elfutils python3" DEPENDS_append_class-native = " file-replacement-native bzip2-replacement-native" inherit autotools gettext pkgconfig python3native @@ -60,18 +62,22 @@ EXTRA_OECONF_append = " --without-lua --enable-python --with-crypto=openssl" EXTRA_OECONF_append_libc-musl = " --disable-nls --disable-openmp" # --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs -# # --localstatedir prevents rpm from writing its database to native sysroot when building images -# -# Disable dbus for native, so that rpm doesn't attempt to inhibit shutdown via session dbus even when plugins support is enabled. -# Also disable plugins by default for native. +# Forcibly disable plugins for native/nativesdk, as the inhibit and prioreset +# plugins both behave badly inside builds. EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --localstatedir=/var --disable-plugins" -EXTRA_OECONF_append_class-nativesdk = " --sysconfdir=/etc --localstatedir=/var --disable-plugins" +EXTRA_OECONF_append_class-nativesdk = " --sysconfdir=/etc --disable-plugins" BBCLASSEXTEND = "native nativesdk" -PACKAGECONFIG ??= "" +PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'inhibit', '', d)}" +# The inhibit plugin serves no purpose outside of the target +PACKAGECONFIG_remove_class-native = "inhibit" +PACKAGECONFIG_remove_class-nativesdk = "inhibit" + PACKAGECONFIG[imaevm] = "--with-imaevm,,ima-evm-utils" +PACKAGECONFIG[inhibit] = "--enable-inhibit-plugin,--disable-inhibit-plugin,dbus" +PACKAGECONFIG[rpm2archive] = "--with-archive,--without-archive,libarchive" ASNEEDED = "" @@ -93,7 +99,7 @@ WRAPPER_TOOLS = " \ do_install_append_class-native() { for tool in ${WRAPPER_TOOLS}; do - create_wrapper ${D}$tool \ + test -x ${D}$tool && create_wrapper ${D}$tool \ RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \ RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \ MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \ @@ -103,7 +109,7 @@ do_install_append_class-native() { do_install_append_class-nativesdk() { for tool in ${WRAPPER_TOOLS}; do - create_wrapper ${D}$tool \ + test -x ${D}$tool && create_wrapper ${D}$tool \ RPM_CONFIGDIR='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir'), d.getVar('bindir'))}/rpm \ RPM_ETCCONFIGDIR='$'{RPM_ETCCONFIGDIR-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir'), d.getVar('bindir'))}/..} \ MAGIC='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir'), d.getVar('bindir'))}/misc/magic.mgc \ @@ -111,6 +117,9 @@ do_install_append_class-nativesdk() { done rm -rf ${D}/var + + mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d + install -m 644 ${WORKDIR}/environment.d-rpm.sh ${D}${SDKPATHNATIVE}/environment-setup.d/rpm.sh } # Rpm's make install creates var/tmp which clashes with base-files packaging @@ -128,6 +137,7 @@ do_install_append () { FILES_${PN} += "${libdir}/rpm-plugins/*.so \ " +FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/rpm.sh" FILES_${PN}-dev += "${libdir}/rpm-plugins/*.la \ " |