Patchwork [v3,06/13] package_rpm.bbclass: Fix the way the RPM platform file is generated

login
register
mail settings
Submitter Paul Eggleton
Date Dec. 12, 2012, 6:31 p.m.
Message ID <12fac0f79c482879c42dc433dd3311edc8ef3f9f.1355337025.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/40839/
State Accepted
Commit 8f6e33231439c9c2c1584b2790f62f833439e3c1
Headers show

Comments

Paul Eggleton - Dec. 12, 2012, 6:31 p.m.
From: Mark Hatle <mark.hatle@windriver.com>

When generating an SDK, we need to use either the SDK or TARGET version
of the OS.  They are not interchangable!

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/classes/package_rpm.bbclass |   16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

Patch

diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 4f60daf..fdca2c3 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -262,16 +262,26 @@  package_install_internal_rpm () {
 	if [ "${INSTALL_COMPLEMENTARY_RPM}" != "1" ] ; then
 		# Setup base system configuration
 		mkdir -p ${target_rootfs}/etc/rpm/
-		echo "${platform}${TARGET_VENDOR}-${TARGET_OS}" > ${target_rootfs}/etc/rpm/platform
+		if [ -n "${sdk_mode}" ]; then
+			platform_vendor="${SDK_VENDOR}"
+			platform_os="${SDK_OS}"
+		else
+			platform_vendor="${TARGET_VENDOR}"
+			platform_os="${TARGET_OS}"
+		fi
+
+		echo "${platform}${platform_vendor}-${platform_os}" > ${target_rootfs}/etc/rpm/platform
+
+
 		if [ ! -z "$platform_extra" ]; then
 			for pt in $platform_extra ; do
 				channel_priority=$(expr $channel_priority + 5)
 				case $pt in
 					noarch | any | all)
-						os="`echo ${TARGET_OS} | sed "s,-.*,,"`.*"
+						os="`echo ${platform_os} | sed "s,-.*,,"`.*"
 						;;
 					*)
-						os="${TARGET_OS}"
+						os="${platform_os}"
 						;;
 				esac
 				echo "$pt-.*-$os" >> ${target_rootfs}/etc/rpm/platform