Fix on-target RPM platform mismatch
cover Fix on-target RPM platform mismatch
This fixes the Yocto bug #1352. When trying to install an arm package on the target, the platform no longer matched properly. The platform was being set to arm*-oe-linux-gnu, instead of the proper arm*-oe-linux-gnueabi.
The following changes since commit 87456db10d6e615e5f49453befedaa5957dfe292:
package_rpm.bbclass: Update the platform config and --target (2011-08-11 10:42:02 -0500)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib mhatle/fix_1352
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=mhatle/fix_1352
Mark Hatle (2):
rpm: Fix the canonical arch --target processing and cleanup package_rpm.bbclass: Update the platform config and --target
meta/classes/package_rpm.bbclass | 14 ++- .../recipes-devtools/rpm/rpm/export-rpmbag-h.patch | 45 ------- meta/recipes-devtools/rpm/rpm/hdraddorappend.patch | 22 ---- meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch | 134 ++++++++++++++++++++ meta/recipes-devtools/rpm/rpm/rpm-no-loop.patch | 38 ------ meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch | 16 +++ meta/recipes-devtools/rpm/rpm/rpm-nrescan.patch | 17 --- meta/recipes-devtools/rpm/rpm_5.4.0.bb | 8 +- 8 files changed, 164 insertions(+), 130 deletions(-) delete mode 100644 meta/recipes-devtools/rpm/rpm/export-rpmbag-h.patch delete mode 100644 meta/recipes-devtools/rpm/rpm/hdraddorappend.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch delete mode 100644 meta/recipes-devtools/rpm/rpm/rpm-no-loop.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch delete mode 100644 meta/recipes-devtools/rpm/rpm/rpm-nrescan.patch
Signature · 1 line
1.7.3.4
PATCH 1/2 rpm: Fix the canonical arch --target processing and cleanup
[YOCTO #1352]
Fix the canonical arch --target processor to work with the way OE handles the GNU canonical arch.
Also cleanup a number of files that are no longer used, and refactor the no-loop patch into the "no-loopmsg" patch.
--- .../recipes-devtools/rpm/rpm/export-rpmbag-h.patch | 45 ------- meta/recipes-devtools/rpm/rpm/hdraddorappend.patch | 22 ---- meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch | 134 ++++++++++++++++++++ meta/recipes-devtools/rpm/rpm/rpm-no-loop.patch | 38 ------ meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch | 16 +++ meta/recipes-devtools/rpm/rpm/rpm-nrescan.patch | 17 --- meta/recipes-devtools/rpm/rpm_5.4.0.bb | 8 +- 7 files changed, 153 insertions(+), 127 deletions(-) delete mode 100644 meta/recipes-devtools/rpm/rpm/export-rpmbag-h.patch delete mode 100644 meta/recipes-devtools/rpm/rpm/hdraddorappend.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch delete mode 100644 meta/recipes-devtools/rpm/rpm/rpm-no-loop.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch delete mode 100644 meta/recipes-devtools/rpm/rpm/rpm-nrescan.patch
meta/recipes-devtools/rpm/rpm/export-rpmbag-h.patch deleted +0 -45
@@ -1,45 +0,0 @@ -rpmbag.h (added in 5.1.10) is used by rpmts.h, thus should be -exported. Change Makefile.in as well since currently autoreconf -is not performed for rpm. - -8/26/2010 - created by Qing He <[email protected]> - -diff --git a/rpmio/Makefile.am b/rpmio/Makefile.am -index ce9e4f7..0d825b6 100644 ---- a/rpmio/Makefile.am -+++ b/rpmio/Makefile.am -@@ -59,12 +59,12 @@ pkginc_HEADERS = \ - argv.h envvar.h fts.h mire.h rpmbc.h rpmcb.h rpmdav.h rpmgc.h \ - rpmhash.h rpmio.h rpmiotypes.h rpmio-stub.h rpmku.h rpmlog.h \ - rpmmacro.h rpmmg.h rpmnss.h rpmpgp.h rpmsq.h rpmssl.h rpmsw.h \ -- rpmurl.h rpmxar.h ugid.h rpmuuid.h rpmzlog.h yarn.h -+ rpmurl.h rpmxar.h ugid.h rpmuuid.h rpmzlog.h yarn.h rpmbag.h - noinst_HEADERS = \ - ar.h cpio.h crc.h fnmatch.h glob.h iosm.h \ - md2.h md4.h poptIO.h rmd128.h rmd160.h rmd256.h rmd320.h sha224.h \ - salsa10.h salsa20.h tar.h tiger.h \ -- rpmbag.h rpmbf.h rpmbz.h rpmhook.h rpmio_internal.h rpmlua.h -+ rpmbf.h rpmbz.h rpmhook.h rpmio_internal.h rpmlua.h - - usrlibdir = $(libdir) - usrlib_LTLIBRARIES = librpmio.la -diff --git a/rpmio/Makefile.in b/rpmio/Makefile.in -index ef76570..0b212bd 100644 ---- a/rpmio/Makefile.in -+++ b/rpmio/Makefile.in -@@ -638,13 +638,13 @@ pkginc_HEADERS = \ - argv.h envvar.h fts.h mire.h rpmbc.h rpmcb.h rpmdav.h rpmgc.h \ - rpmhash.h rpmio.h rpmiotypes.h rpmio-stub.h rpmku.h rpmlog.h \ - rpmmacro.h rpmmg.h rpmnss.h rpmpgp.h rpmsq.h rpmssl.h rpmsw.h \ -- rpmurl.h rpmxar.h ugid.h rpmuuid.h rpmzlog.h yarn.h -+ rpmurl.h rpmxar.h ugid.h rpmuuid.h rpmzlog.h yarn.h rpmbag.h - - noinst_HEADERS = \ - ar.h cpio.h crc.h fnmatch.h glob.h iosm.h \ - md2.h md4.h poptIO.h rmd128.h rmd160.h rmd256.h rmd320.h sha224.h \ - salsa10.h salsa20.h tar.h tiger.h \ -- rpmbag.h rpmbf.h rpmbz.h rpmhook.h rpmio_internal.h rpmlua.h -+ rpmbf.h rpmbz.h rpmhook.h rpmio_internal.h rpmlua.h - - usrlibdir = $(libdir) - usrlib_LTLIBRARIES = librpmio.la
meta/recipes-devtools/rpm/rpm/hdraddorappend.patch deleted +0 -22
@@ -1,22 +0,0 @@ -diff --git a/lib/rpm4compat.h b/lib/rpm4compat.h -index b957f8e..b1954d5 100644 ---- a/lib/rpm4compat.h -+++ b/lib/rpm4compat.h -@@ -211,6 +211,17 @@ static inline int headerAddEntry(Header h, int_32 tag, int_32 type, const void * - return headerPut(h, he, 0); - } - -+static inline int headerAddOrAppendEntry(Header h, int_32 tag, int_32 type, const void * p, int_32 c) { -+ HE_t he = (HE_s*)memset(alloca(sizeof(*he)), 0, sizeof(*he)); -+ -+ he->tag = (rpmTag)tag; -+ he->t = (rpmTagType)type; -+ he->p.str = (const char*)p; -+ he->c = (rpmTagCount)c; -+ he->append = 1; -+ return headerPut(h, he, 0); -+} -+ - static inline int headerRemoveEntry(Header h, int_32 tag) { - HE_t he = (HE_s*)memset(alloca(sizeof(*he)), 0, sizeof(*he)); -
meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch new file +134 -0
134 lines not on this page · raw message
meta/recipes-devtools/rpm/rpm/rpm-no-loop.patch deleted +0 -38
@@ -1,38 +0,0 @@ -The LOOP: ... messages appear to be errors, but in reality they are -simply debug messages that indicate there is one or more dependency -loop within the system. - -Due to Poky packages owning all of the directories they use, a large -number of depedency loops may be present. So disabling this message -seems to make the most sense. - -Signed-off-by: [email protected] - -diff -ur rpm-5.1.10.orig/lib/depends.c rpm-5.1.10/lib/depends.c ---- rpm-5.1.10.orig/lib/depends.c 2010-09-29 12:23:48.307048065 -0500 -+++ rpm-5.1.10/lib/depends.c 2010-09-29 12:33:23.306022259 -0500 -@@ -2044,9 +2044,11 @@ - * Attempt to unravel a dependency loop by eliminating Requires's. - */ - if (zap) { -+#if 0 - rpmlog(msglvl, - _("removing %s \"%s\" from tsort relations.\n"), - (rpmteNEVRA(p) ? rpmteNEVRA(p) : "???"), dp); -+#endif - rpmteTSI(p)->tsi_count--; - if (tsi_prev) tsi_prev->tsi_next = tsi->tsi_next; - tsi->tsi_next = NULL; -@@ -2676,10 +2678,12 @@ - /* Unchain predecessor loop. */ - rpmteTSI(p)->tsi_chain = NULL; - -+#if 0 - if (!printed) { - rpmlog(msglvl, _("LOOP:\n")); - printed = 1; - } -+#endif - - /* Find (and destroy if co-requisite) "q <- p" relation. */ - dp = zapRelation(q, p, 1, &nzaps, msglvl);
meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch new file +16 -0
@@ -0,0 +1,16 @@ +lib/order.c: Make the dependency loop messages into debug msgs + +Signed-off-by: Mark Hatle <[email protected]> + +diff -urN rpm-5.4.0.orig/lib/order.c rpm-5.4.0/lib/order.c +--- rpm-5.4.0.orig/lib/order.c 2010-12-13 17:36:39.000000000 -0600 ++++ rpm-5.4.0/lib/order.c 2011-08-10 11:11:43.194686332 -0500 +@@ -2170,7 +2170,7 @@ + const char * dp; + rpmlogLvl msglvl = (anaconda || (rpmtsDFlags(ts) & RPMDEPS_FLAG_DEPLOOPS)) + ? RPMLOG_WARNING : RPMLOG_ERR; +-#if defined(RPM_VENDOR_MANDRIVA) /* loop-detection-optional-loglevel */ ++#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_POKY) /* loop-detection-optional-loglevel */ + // Report loops as debug-level message by default (7 = RPMLOG_DEBUG), overridable + msglvl = rpmExpandNumeric("%{?_loop_detection_loglevel}%{?!_loop_detection_loglevel:7}"); + #endif
meta/recipes-devtools/rpm/rpm/rpm-nrescan.patch deleted +0 -17
@@ -1,17 +0,0 @@ -We need to increase the number of dependency rescans as we have a large -number of self-referencing dependencies within Poky. 100 seem reasonable. - -Signed-off-by: Mark Hatle <[email protected]> - -diff -ur rpm-5.1.10.orig/lib/depends.c rpm-5.1.10/lib/depends.c ---- rpm-5.1.10.orig/lib/depends.c 2010-08-20 17:12:43.000000000 -0500 -+++ rpm-5.1.10/lib/depends.c 2010-09-02 13:37:21.966116309 -0500 -@@ -2310,7 +2310,7 @@ - int numOrderList; - int npeer = 128; /* XXX more than deep enough for now. */ - int * peer = memset(alloca(npeer*sizeof(*peer)), 0, (npeer*sizeof(*peer))); -- int nrescans = 10; -+ int nrescans = 100; - int _printed = 0; - char deptypechar; - size_t tsbytes;
meta/recipes-devtools/rpm/rpm_5.4.0.bb +3 -5
@@ -45,7 +45,7 @@ LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1" DEPENDS = "bzip2 zlib db openssl elfutils expat libpcre attr acl popt ${extrarpmdeps}" extrarpmdeps = "python perl" extrarpmdeps_virtclass-native = "" -PR = "r19" +PR = "r20" # rpm2cpio is a shell script, which is part of the rpm src.rpm. It is needed # in order to extract the distribution SRPM into a format we can extract...
@@ -61,14 +61,12 @@ SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.0-0.20101229.src.rpm;ex file://rpm-tools-mtree-LDFLAGS.patch \ file://fprint-pointer-fix.patch \ file://rpm-fileclass.patch \ + file://rpm-canonarch.patch \ + file://rpm-no-loopmsg.patch \ " -# file://hdraddorappend.patch \ -# file://export-rpmbag-h.patch \ -# file://rpm-nrescan.patch \ # file://rpm-autoconf.patch \ # file://remove-compiled-tests.patch;apply=no \ -# file://rpm-no-loop.patch \ # " SRC_URI[md5sum] = "19c1a7f68d7765eeb7615c9c4e54e380"
Signature · 1 line
1.7.3.4
PATCH 2/2 package_rpm.bbclass: Update the platform config and --target
In reply to Mark HatleWhen constructing the /etc/rpm/platform file, we need to ensure that the any, all, and noarch platforms will allow any "linux" variant to be installable, not just matching variants.. i.e.
arm-oe-linux-gnueabi should be able to install noarch-oe-linux
Also ensure that we pass the full canonical arch via the --target= parameter. This allows us to define the proper platform settings for all packages.
--- meta/classes/package_rpm.bbclass | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-)
meta/classes/package_rpm.bbclass +11 -3
@@ -177,7 +177,15 @@ package_install_internal_rpm () { echo "${platform}${TARGET_VENDOR}-${TARGET_OS}" > ${target_rootfs}/etc/rpm/platform if [ ! -z "$platform_extra" ]; then for pt in $platform_extra ; do - echo "$pt-.*-${TARGET_OS}" >> ${target_rootfs}/etc/rpm/platform + case $pt in + noarch | any | all) + os="`echo ${TARGET_OS} | sed "s,-.*,,"`.*" + ;; + *) + os="${TARGET_OS}" + ;; + esac + echo "$pt-.*-$os" >> ${target_rootfs}/etc/rpm/platform done fi
@@ -821,12 +829,12 @@ python do_package_rpm () { targetsys = bb.data.getVar('TARGET_SYS', d, True) targetvendor = bb.data.getVar('TARGET_VENDOR', d, True) pkgwritedir = bb.data.expand('${PKGWRITEDIRRPM}/${PACKAGE_ARCH}', d) - pkgarch = bb.data.expand('${PACKAGE_ARCH}', d) + pkgarch = bb.data.expand('${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}', d) bb.mkdirhier(pkgwritedir) os.chmod(pkgwritedir, 0755) cmd = rpmbuild - cmd = cmd + " --nodeps --short-circuit --target " + pkgarch + targetvendor + "-linux-gnu --buildroot " + pkgd + cmd = cmd + " --nodeps --short-circuit --target " + pkgarch + " --buildroot " + pkgd cmd = cmd + " --define '_topdir " + workdir + "' --define '_rpmdir " + pkgwritedir + "'" cmd = cmd + " --define '_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm'" cmd = cmd + " --define '_use_internal_dependency_generator 0'"
Signature · 1 line
1.7.3.4
Saul Wold
AppliedQuoted 25 lines · Mark Hatle
This fixes the Yocto bug #1352. When trying to install an arm package on the target, the platform no longer matched properly. The platform was being set to arm*-oe-linux-gnu, instead of the proper arm*-oe-linux-gnueabi.
The following changes since commit
87456db10d6e615e5f49453befedaa5957dfe292:package_rpm.bbclass: Update the platform config and --target (2011-08-11 10:42:02 -0500)are available in the git repository at:
git://git.pokylinux.org/poky-contrib mhatle/fix_1352 http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=mhatle/fix_1352Mark Hatle (2):
rpm: Fix the canonical arch --target processing and cleanup package_rpm.bbclass: Update the platform config and --targetmeta/classes/package_rpm.bbclass | 14 ++- .../recipes-devtools/rpm/rpm/export-rpmbag-h.patch | 45 ------- meta/recipes-devtools/rpm/rpm/hdraddorappend.patch | 22 ---- meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch | 134 ++++++++++++++++++++ meta/recipes-devtools/rpm/rpm/rpm-no-loop.patch | 38 ------ meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch | 16 +++ meta/recipes-devtools/rpm/rpm/rpm-nrescan.patch | 17 --- meta/recipes-devtools/rpm/rpm_5.4.0.bb | 8 +- 8 files changed, 164 insertions(+), 130 deletions(-)
Quoted 7 lines
delete mode 100644
meta/recipes-devtools/rpm/rpm/export-rpmbag-h.patchdelete mode 100644meta/recipes-devtools/rpm/rpm/hdraddorappend.patchcreate mode 100644meta/recipes-devtools/rpm/rpm/rpm-canonarch.patchdelete mode 100644meta/recipes-devtools/rpm/rpm/rpm-no-loop.patchcreate mode 100644meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patchdelete mode 100644meta/recipes-devtools/rpm/rpm/rpm-nrescan.patch
Merged into OE-Core
Thanks
Sau!