diff options
author | Ovidiu Panait <ovidiu.panait@windriver.com> | 2018-05-25 10:48:29 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-07-02 11:41:25 +0100 |
commit | de85243b220b4623ad6358881be6f7060f5c3588 (patch) | |
tree | 46ac0d8ec9d4307bcc70c7cd4de5975dfec64bbd /meta/recipes-devtools/rpm | |
parent | 67f4c5d1b6e1e6cc0cf3ceec48108f75440708a4 (diff) | |
download | poky-de85243b220b4623ad6358881be6f7060f5c3588.tar.gz |
nativesdk-rpm: Add wrappers for nativesdk support
When installing the SDK to a non-default path, running "rpm --showrc" from the
sdk will produce the following error:
error: Unable to open /opt/windriver/wrlinux-small/10.17.41/sysroots/x86_64-wrlinuxsdk-linux/usr/lib/rpm/rpmrc for reading: No such file or directory.
Fix this by adding wrappers that dynamically export the RPM_CONFIGDIR,
RPM_ETCCONFIGDIR and MAGIC environment variables, pointing to the proper
sdk locations.
(From OE-Core rev: 760103cdaed3e820888d8984ec0b76cfc831d534)
(From OE-Core rev: bca05415510ebd847da0035536e32ab5fca1c3e2)
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/rpm')
-rw-r--r-- | meta/recipes-devtools/rpm/rpm_4.14.1.bb | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/meta/recipes-devtools/rpm/rpm_4.14.1.bb b/meta/recipes-devtools/rpm/rpm_4.14.1.bb index 6012922adb..1a03a0fce0 100644 --- a/meta/recipes-devtools/rpm/rpm_4.14.1.bb +++ b/meta/recipes-devtools/rpm/rpm_4.14.1.bb | |||
@@ -69,6 +69,7 @@ EXTRA_OECONF_append_libc-musl = " --disable-nls" | |||
69 | # Disable dbus for native, so that rpm doesn't attempt to inhibit shutdown via session dbus even when plugins support is enabled. | 69 | # Disable dbus for native, so that rpm doesn't attempt to inhibit shutdown via session dbus even when plugins support is enabled. |
70 | # Also disable plugins by default for native. | 70 | # Also disable plugins by default for native. |
71 | EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --localstatedir=/var --without-dbus --disable-plugins" | 71 | EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --localstatedir=/var --without-dbus --disable-plugins" |
72 | EXTRA_OECONF_append_class-nativesdk = " --sysconfdir=/etc --localstatedir=/var --without-dbus --disable-plugins" | ||
72 | 73 | ||
73 | BBCLASSEXTEND = "native nativesdk" | 74 | BBCLASSEXTEND = "native nativesdk" |
74 | 75 | ||
@@ -77,21 +78,22 @@ PACKAGECONFIG[imaevm] = "--with-imaevm,,ima-evm-utils" | |||
77 | 78 | ||
78 | # Direct rpm-native to read configuration from our sysroot, not the one it was compiled in | 79 | # Direct rpm-native to read configuration from our sysroot, not the one it was compiled in |
79 | # libmagic also has sysroot path contamination, so override it | 80 | # libmagic also has sysroot path contamination, so override it |
81 | |||
82 | WRAPPER_TOOLS = " \ | ||
83 | ${bindir}/rpm \ | ||
84 | ${bindir}/rpm2archive \ | ||
85 | ${bindir}/rpm2cpio \ | ||
86 | ${bindir}/rpmbuild \ | ||
87 | ${bindir}/rpmdb \ | ||
88 | ${bindir}/rpmgraph \ | ||
89 | ${bindir}/rpmkeys \ | ||
90 | ${bindir}/rpmsign \ | ||
91 | ${bindir}/rpmspec \ | ||
92 | ${libdir}/rpm/rpmdeps \ | ||
93 | " | ||
94 | |||
80 | do_install_append_class-native() { | 95 | do_install_append_class-native() { |
81 | tools="\ | 96 | for tool in ${WRAPPER_TOOLS}; do |
82 | ${bindir}/rpm \ | ||
83 | ${bindir}/rpm2archive \ | ||
84 | ${bindir}/rpm2cpio \ | ||
85 | ${bindir}/rpmbuild \ | ||
86 | ${bindir}/rpmdb \ | ||
87 | ${bindir}/rpmgraph \ | ||
88 | ${bindir}/rpmkeys \ | ||
89 | ${bindir}/rpmsign \ | ||
90 | ${bindir}/rpmspec \ | ||
91 | ${libdir}/rpm/rpmdeps \ | ||
92 | " | ||
93 | |||
94 | for tool in $tools; do | ||
95 | create_wrapper ${D}$tool \ | 97 | create_wrapper ${D}$tool \ |
96 | RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \ | 98 | RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \ |
97 | RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \ | 99 | RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \ |
@@ -100,6 +102,18 @@ do_install_append_class-native() { | |||
100 | done | 102 | done |
101 | } | 103 | } |
102 | 104 | ||
105 | do_install_append_class-nativesdk() { | ||
106 | for tool in ${WRAPPER_TOOLS}; do | ||
107 | create_wrapper ${D}$tool \ | ||
108 | RPM_CONFIGDIR='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \ | ||
109 | RPM_ETCCONFIGDIR='$'{RPM_ETCCONFIGDIR-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/..} \ | ||
110 | MAGIC='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/misc/magic.mgc \ | ||
111 | RPM_NO_CHROOT_FOR_SCRIPTS=1 | ||
112 | done | ||
113 | |||
114 | rm -rf ${D}/var | ||
115 | } | ||
116 | |||
103 | # Rpm's make install creates var/tmp which clashes with base-files packaging | 117 | # Rpm's make install creates var/tmp which clashes with base-files packaging |
104 | do_install_append_class-target() { | 118 | do_install_append_class-target() { |
105 | rm -rf ${D}/var | 119 | rm -rf ${D}/var |