]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
rpm: ensure rpm2cpio call rpm relocation code
authorZhixiong Chi <Zhixiong.Chi@windriver.com>
Mon, 5 Sep 2016 04:08:13 +0000 (12:08 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 6 Sep 2016 09:23:59 +0000 (10:23 +0100)
We need to call rpmcliInit to ensure the rpm relocation code is called.
when we allow rpm2cpio to be relocatable, The adjusted path used to find
the macro files was being built into the binary and this path was valid
for the machine it was built on and some of our other build machines,
but invalid on some others, and was not being properly overridden at
runtime.

when we export the wrsdk and source the sdk, then execute rpm2cpio xxx.rpm|cpio -t.
we will get the following error :
"rpm-5.4.14/rpmdb/dbconfig.c:493:
db3New: Assertion `dbOpts != ((void *)0) && *dbOpts != '\0'' failed.

Signed-off-by: Zhixiong Chi <Zhixiong.Chi@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/rpm/rpm/rpm-ensure-rpm2cpio-call-rpm-relocation-code.patch [new file with mode: 0644]
meta/recipes-devtools/rpm/rpm_5.4.16.bb

diff --git a/meta/recipes-devtools/rpm/rpm/rpm-ensure-rpm2cpio-call-rpm-relocation-code.patch b/meta/recipes-devtools/rpm/rpm/rpm-ensure-rpm2cpio-call-rpm-relocation-code.patch
new file mode 100644 (file)
index 0000000..63af100
--- /dev/null
@@ -0,0 +1,25 @@
+We need to call rpmcliInit to ensure the rpm relocation code is called
+and it correctly honours the relocation environmental variables.
+
+when we export the wrsdk and source the sdk, then execute rpm2cpio xxx.rpm|cpio -t.
+we will get the following error :
+"rpm-5.4.14/rpmdb/dbconfig.c:493:
+db3New: Assertion `dbOpts != ((void *)0) && *dbOpts != '\0'' failed.
+
+Upstream-Status: Pending
+
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
+Index: rpm-5.4.15/tools/rpm2cpio.c
+===================================================================
+--- rpm-5.4.15.orig/tools/rpm2cpio.c   2012-04-27 01:46:51.000000000 +0800
++++ rpm-5.4.15/tools/rpm2cpio.c        2016-09-05 11:07:30.419903338 +0800
+@@ -87,6 +87,8 @@
+ #endif
+       (void) rpmtsSetVSFlags(ts, vsflags);
++      rpmcliInit(argc, argv, NULL);
++
+       /*@-mustmod@*/      /* LCL: segfault */
+       rc = rpmReadPackageFile(ts, fdi, "rpm2cpio", &h);
+       /*@=mustmod@*/
index 84adef661ac68c2a42e3612fce84ee12d5ed32d8..55acd25b1ceeca29f4b7920201cdf6617c957786 100644 (file)
@@ -118,6 +118,7 @@ SRC_URI += " \
           file://0001-Disable-__sync_add_and_fetch_8-on-nios2.patch \
           file://gcc6-stdlib.patch \
           file://0001-system.h-query.c-support-nosignature.patch \
+          file://rpm-ensure-rpm2cpio-call-rpm-relocation-code.patch \
 "
 
 # OE specific changes