summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/package_rpm.bbclass31
-rw-r--r--meta/classes/populate_sdk_rpm.bbclass42
-rw-r--r--meta/classes/rootfs_rpm.bbclass37
3 files changed, 66 insertions, 44 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index dac89a79cd..7a1da33ead 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -248,8 +248,6 @@ translate_oe_to_smart() {
248package_install_internal_rpm () { 248package_install_internal_rpm () {
249 249
250 local target_rootfs="$INSTALL_ROOTFS_RPM" 250 local target_rootfs="$INSTALL_ROOTFS_RPM"
251 local platform="`echo $INSTALL_PLATFORM_RPM | sed 's#-#_#g'`"
252 local platform_extra="`echo $INSTALL_PLATFORM_EXTRA_RPM | sed 's#-#_#g'`"
253 local package_to_install="$INSTALL_PACKAGES_RPM" 251 local package_to_install="$INSTALL_PACKAGES_RPM"
254 local package_attemptonly="$INSTALL_PACKAGES_ATTEMPTONLY_RPM" 252 local package_attemptonly="$INSTALL_PACKAGES_ATTEMPTONLY_RPM"
255 local package_linguas="$INSTALL_PACKAGES_LINGUAS_RPM" 253 local package_linguas="$INSTALL_PACKAGES_LINGUAS_RPM"
@@ -273,29 +271,17 @@ package_install_internal_rpm () {
273 # Setup base system configuration 271 # Setup base system configuration
274 echo "Note: configuring RPM platform settings" 272 echo "Note: configuring RPM platform settings"
275 mkdir -p ${target_rootfs}/etc/rpm/ 273 mkdir -p ${target_rootfs}/etc/rpm/
276 if [ -n "${sdk_mode}" ]; then 274 echo "$INSTALL_PLATFORM_RPM" > ${target_rootfs}/etc/rpm/platform
277 platform_vendor="${SDK_VENDOR}"
278 platform_os="${SDK_OS}"
279 else
280 platform_vendor="${TARGET_VENDOR}"
281 platform_os="${TARGET_OS}"
282 fi
283
284 echo "${platform}${platform_vendor}-${platform_os}" > ${target_rootfs}/etc/rpm/platform
285 275
286 276 if [ ! -z "$INSTALL_PLATFORM_EXTRA_RPM" ]; then
287 if [ ! -z "$platform_extra" ]; then 277 for pt in $INSTALL_PLATFORM_EXTRA_RPM ; do
288 for pt in $platform_extra ; do
289 channel_priority=$(expr $channel_priority + 5) 278 channel_priority=$(expr $channel_priority + 5)
290 case $pt in 279 case $pt in
291 noarch | any | all) 280 noarch-* | any-* | all-*)
292 os="`echo ${platform_os} | sed "s,-.*,,"`.*" 281 pt=$(echo $pt | sed "s,-linux.*$,-linux\.*,")
293 ;;
294 *)
295 os="${platform_os}"
296 ;; 282 ;;
297 esac 283 esac
298 echo "$pt-.*-$os" >> ${target_rootfs}/etc/rpm/platform 284 echo "$pt" >> ${target_rootfs}/etc/rpm/platform
299 done 285 done
300 fi 286 fi
301 287
@@ -360,12 +346,13 @@ EOF
360 smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-extra-macros._tmppath=/install/tmp 346 smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-extra-macros._tmppath=/install/tmp
361 # Optional debugging 347 # Optional debugging
362 #smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-log-level=debug 348 #smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-log-level=debug
349 #smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-log-file=/tmp/smart-debug-logfile
363 350
364 # Delay this until later... 351 # Delay this until later...
365 #smart --data-dir=${target_rootfs}/var/lib/smart channel --add rpmsys type=rpm-sys -y 352 #smart --data-dir=${target_rootfs}/var/lib/smart channel --add rpmsys type=rpm-sys -y
366 353
367 platform_extra_fixed=`echo "$platform_extra" | tr - _` 354 for canonical_arch in $INSTALL_PLATFORM_EXTRA_RPM; do
368 for arch in $platform_extra_fixed ; do 355 arch=$(echo $canonical_arch | sed "s,\([^-]*\)-.*,\1,")
369 if [ -d ${DEPLOY_DIR_RPM}/$arch -a ! -e ${target_rootfs}/install/channel.$arch.stamp ] ; then 356 if [ -d ${DEPLOY_DIR_RPM}/$arch -a ! -e ${target_rootfs}/install/channel.$arch.stamp ] ; then
370 echo "Note: adding Smart channel $arch ($channel_priority)" 357 echo "Note: adding Smart channel $arch ($channel_priority)"
371 smart --data-dir=${target_rootfs}/var/lib/smart channel --add $arch type=rpm-md type=rpm-md baseurl=${DEPLOY_DIR_RPM}/$arch -y 358 smart --data-dir=${target_rootfs}/var/lib/smart channel --add $arch type=rpm-md type=rpm-md baseurl=${DEPLOY_DIR_RPM}/$arch -y
diff --git a/meta/classes/populate_sdk_rpm.bbclass b/meta/classes/populate_sdk_rpm.bbclass
index 0595aa7fca..2dfb80c592 100644
--- a/meta/classes/populate_sdk_rpm.bbclass
+++ b/meta/classes/populate_sdk_rpm.bbclass
@@ -39,7 +39,7 @@ populate_sdk_rpm () {
39 # This needs to work in the same way as rootfs_rpm.bbclass! 39 # This needs to work in the same way as rootfs_rpm.bbclass!
40 # 40 #
41 export INSTALL_ROOTFS_RPM="${SDK_OUTPUT}/${SDKTARGETSYSROOT}" 41 export INSTALL_ROOTFS_RPM="${SDK_OUTPUT}/${SDKTARGETSYSROOT}"
42 export INSTALL_PLATFORM_RPM="${TARGET_ARCH}" 42 export INSTALL_PLATFORM_RPM="$(echo ${TARGET_ARCH} | tr - _)${TARGET_VENDOR}-${TARGET_OS}"
43 export INSTALL_PACKAGES_RPM="${TOOLCHAIN_TARGET_TASK}" 43 export INSTALL_PACKAGES_RPM="${TOOLCHAIN_TARGET_TASK}"
44 export INSTALL_PACKAGES_ATTEMPTONLY_RPM="${TOOLCHAIN_TARGET_TASK_ATTEMPTONLY}" 44 export INSTALL_PACKAGES_ATTEMPTONLY_RPM="${TOOLCHAIN_TARGET_TASK_ATTEMPTONLY}"
45 export INSTALL_PACKAGES_LINGUAS_RPM="" 45 export INSTALL_PACKAGES_LINGUAS_RPM=""
@@ -57,20 +57,31 @@ populate_sdk_rpm () {
57 # List must be prefered to least preferred order 57 # List must be prefered to least preferred order
58 default_extra_rpm="" 58 default_extra_rpm=""
59 INSTALL_PLATFORM_EXTRA_RPM="" 59 INSTALL_PLATFORM_EXTRA_RPM=""
60 for i in ${MULTILIB_PREFIX_LIST} ; do 60 for os in ${MULTILIB_OS_LIST} ; do
61 old_IFS="$IFS" 61 old_IFS="$IFS"
62 IFS=":" 62 IFS=":"
63 set $i 63 set -- $os
64 IFS="$old_IFS" 64 IFS="$old_IFS"
65 mlib=$1 65 mlib=$1
66 shift #remove mlib 66 mlib_os=$2
67 while [ -n "$1" ]; do 67 for prefix in ${MULTILIB_PREFIX_LIST} ; do
68 if [ "$mlib" = "${BBEXTENDVARIANT}" ]; then 68 old_IFS="$IFS"
69 default_extra_rpm="$default_extra_rpm $1" 69 IFS=":"
70 else 70 set -- $prefix
71 INSTALL_PLATFORM_EXTRA_RPM="$INSTALL_PLATFORM_EXTRA_RPM $1" 71 IFS="$old_IFS"
72 if [ "$mlib" != "$1" ]; then
73 continue
72 fi 74 fi
73 shift 75 shift #remove mlib
76 while [ -n "$1" ]; do
77 platform="$(echo $1 | tr - _)-.*-$mlib_os"
78 if [ "$mlib" = "${BBEXTENDVARIANT}" ]; then
79 default_extra_rpm="$default_extra_rpm $platform"
80 else
81 INSTALL_PLATFORM_EXTRA_RPM="$INSTALL_PLATFORM_EXTRA_RPM $platform"
82 fi
83 shift
84 done
74 done 85 done
75 done 86 done
76 if [ -n "$default_extra_rpm" ]; then 87 if [ -n "$default_extra_rpm" ]; then
@@ -85,7 +96,7 @@ populate_sdk_rpm () {
85 ## install nativesdk ## 96 ## install nativesdk ##
86 echo "Installing NATIVESDK packages" 97 echo "Installing NATIVESDK packages"
87 export INSTALL_ROOTFS_RPM="${SDK_OUTPUT}" 98 export INSTALL_ROOTFS_RPM="${SDK_OUTPUT}"
88 export INSTALL_PLATFORM_RPM="${SDK_ARCH}" 99 export INSTALL_PLATFORM_RPM="$(echo ${TARGET_ARCH} | tr - _)${SDK_VENDOR}-${SDK_OS}"
89 export INSTALL_PACKAGES_RPM="${TOOLCHAIN_HOST_TASK}" 100 export INSTALL_PACKAGES_RPM="${TOOLCHAIN_HOST_TASK}"
90 export INSTALL_PACKAGES_ATTEMPTONLY_RPM="${TOOLCHAIN_TARGET_HOST_ATTEMPTONLY}" 101 export INSTALL_PACKAGES_ATTEMPTONLY_RPM="${TOOLCHAIN_TARGET_HOST_ATTEMPTONLY}"
91 export INSTALL_PACKAGES_LINGUAS_RPM="" 102 export INSTALL_PACKAGES_LINGUAS_RPM=""
@@ -96,7 +107,8 @@ populate_sdk_rpm () {
96 # List must be prefered to least preferred order 107 # List must be prefered to least preferred order
97 INSTALL_PLATFORM_EXTRA_RPM="" 108 INSTALL_PLATFORM_EXTRA_RPM=""
98 for each_arch in ${SDK_PACKAGE_ARCHS} ; do 109 for each_arch in ${SDK_PACKAGE_ARCHS} ; do
99 INSTALL_PLATFORM_EXTRA_RPM="$each_arch $INSTALL_PLATFORM_EXTRA_RPM" 110 platform="$(echo $each_arch | tr - _)-.*-${SDK_OS}"
111 INSTALL_PLATFORM_EXTRA_RPM="$platform $INSTALL_PLATFORM_EXTRA_RPM"
100 done 112 done
101 export INSTALL_PLATFORM_EXTRA_RPM 113 export INSTALL_PLATFORM_EXTRA_RPM
102 114
@@ -121,7 +133,9 @@ python () {
121 # package_arch order is reversed. This ensures the -best- match is listed first! 133 # package_arch order is reversed. This ensures the -best- match is listed first!
122 package_archs = d.getVar("PACKAGE_ARCHS", True) or "" 134 package_archs = d.getVar("PACKAGE_ARCHS", True) or ""
123 package_archs = ":".join(package_archs.split()[::-1]) 135 package_archs = ":".join(package_archs.split()[::-1])
136 package_os = d.getVar("TARGET_OS", True) or ""
124 ml_prefix_list = "%s:%s" % ('default', package_archs) 137 ml_prefix_list = "%s:%s" % ('default', package_archs)
138 ml_os_list = "%s:%s" % ('default', package_os)
125 multilibs = d.getVar('MULTILIBS', True) or "" 139 multilibs = d.getVar('MULTILIBS', True) or ""
126 for ext in multilibs.split(): 140 for ext in multilibs.split():
127 eext = ext.split(':') 141 eext = ext.split(':')
@@ -130,9 +144,13 @@ python () {
130 default_tune = localdata.getVar("DEFAULTTUNE_virtclass-multilib-" + eext[1], False) 144 default_tune = localdata.getVar("DEFAULTTUNE_virtclass-multilib-" + eext[1], False)
131 if default_tune: 145 if default_tune:
132 localdata.setVar("DEFAULTTUNE", default_tune) 146 localdata.setVar("DEFAULTTUNE", default_tune)
147 bb.data.update_data(localdata)
133 package_archs = localdata.getVar("PACKAGE_ARCHS", True) or "" 148 package_archs = localdata.getVar("PACKAGE_ARCHS", True) or ""
134 package_archs = ":".join([i in "all noarch any".split() and i or eext[1]+"_"+i for i in package_archs.split()][::-1]) 149 package_archs = ":".join([i in "all noarch any".split() and i or eext[1]+"_"+i for i in package_archs.split()][::-1])
150 package_os = localdata.getVar("TARGET_OS", True) or ""
135 ml_prefix_list += " %s:%s" % (eext[1], package_archs) 151 ml_prefix_list += " %s:%s" % (eext[1], package_archs)
152 ml_os_list += " %s:%s" % (eext[1], package_os)
136 d.setVar('MULTILIB_PREFIX_LIST', ml_prefix_list) 153 d.setVar('MULTILIB_PREFIX_LIST', ml_prefix_list)
154 d.setVar('MULTILIB_OS_LIST', ml_os_list)
137} 155}
138 156
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index 920380e559..9dc2bf997c 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -50,7 +50,7 @@ fakeroot rootfs_rpm_do_rootfs () {
50 # install packages 50 # install packages
51 # This needs to work in the same way as populate_sdk_rpm.bbclass! 51 # This needs to work in the same way as populate_sdk_rpm.bbclass!
52 export INSTALL_ROOTFS_RPM="${IMAGE_ROOTFS}" 52 export INSTALL_ROOTFS_RPM="${IMAGE_ROOTFS}"
53 export INSTALL_PLATFORM_RPM="${TARGET_ARCH}" 53 export INSTALL_PLATFORM_RPM="$(echo ${TARGET_ARCH} | tr - _)${TARGET_VENDOR}-${TARGET_OS}"
54 export INSTALL_PACKAGES_RPM="${PACKAGE_INSTALL}" 54 export INSTALL_PACKAGES_RPM="${PACKAGE_INSTALL}"
55 export INSTALL_PACKAGES_ATTEMPTONLY_RPM="${PACKAGE_INSTALL_ATTEMPTONLY}" 55 export INSTALL_PACKAGES_ATTEMPTONLY_RPM="${PACKAGE_INSTALL_ATTEMPTONLY}"
56 export INSTALL_PACKAGES_LINGUAS_RPM="${LINGUAS_INSTALL}" 56 export INSTALL_PACKAGES_LINGUAS_RPM="${LINGUAS_INSTALL}"
@@ -64,20 +64,31 @@ fakeroot rootfs_rpm_do_rootfs () {
64 # List must be prefered to least preferred order 64 # List must be prefered to least preferred order
65 default_extra_rpm="" 65 default_extra_rpm=""
66 INSTALL_PLATFORM_EXTRA_RPM="" 66 INSTALL_PLATFORM_EXTRA_RPM=""
67 for i in ${MULTILIB_PREFIX_LIST} ; do 67 for os in ${MULTILIB_OS_LIST} ; do
68 old_IFS="$IFS" 68 old_IFS="$IFS"
69 IFS=":" 69 IFS=":"
70 set $i 70 set -- $os
71 IFS="$old_IFS" 71 IFS="$old_IFS"
72 mlib=$1 72 mlib=$1
73 shift #remove mlib 73 mlib_os=$2
74 while [ -n "$1" ]; do 74 for prefix in ${MULTILIB_PREFIX_LIST} ; do
75 if [ "$mlib" = "${BBEXTENDVARIANT}" ]; then 75 old_IFS="$IFS"
76 default_extra_rpm="$default_extra_rpm $1" 76 IFS=":"
77 else 77 set -- $prefix
78 INSTALL_PLATFORM_EXTRA_RPM="$INSTALL_PLATFORM_EXTRA_RPM $1" 78 IFS="$old_IFS"
79 if [ "$mlib" != "$1" ]; then
80 continue
79 fi 81 fi
80 shift 82 shift #remove mlib
83 while [ -n "$1" ]; do
84 platform="$(echo $1 | tr - _)-.*-$mlib_os"
85 if [ "$mlib" = "${BBEXTENDVARIANT}" ]; then
86 default_extra_rpm="$default_extra_rpm $platform"
87 else
88 INSTALL_PLATFORM_EXTRA_RPM="$INSTALL_PLATFORM_EXTRA_RPM $platform"
89 fi
90 shift
91 done
81 done 92 done
82 done 93 done
83 if [ -n "$default_extra_rpm" ]; then 94 if [ -n "$default_extra_rpm" ]; then
@@ -210,7 +221,9 @@ python () {
210 # package_arch order is reversed. This ensures the -best- match is listed first! 221 # package_arch order is reversed. This ensures the -best- match is listed first!
211 package_archs = d.getVar("PACKAGE_ARCHS", True) or "" 222 package_archs = d.getVar("PACKAGE_ARCHS", True) or ""
212 package_archs = ":".join(package_archs.split()[::-1]) 223 package_archs = ":".join(package_archs.split()[::-1])
224 package_os = d.getVar("TARGET_OS", True) or ""
213 ml_prefix_list = "%s:%s" % ('default', package_archs) 225 ml_prefix_list = "%s:%s" % ('default', package_archs)
226 ml_os_list = "%s:%s" % ('default', package_os)
214 multilibs = d.getVar('MULTILIBS', True) or "" 227 multilibs = d.getVar('MULTILIBS', True) or ""
215 for ext in multilibs.split(): 228 for ext in multilibs.split():
216 eext = ext.split(':') 229 eext = ext.split(':')
@@ -219,8 +232,12 @@ python () {
219 default_tune = localdata.getVar("DEFAULTTUNE_virtclass-multilib-" + eext[1], False) 232 default_tune = localdata.getVar("DEFAULTTUNE_virtclass-multilib-" + eext[1], False)
220 if default_tune: 233 if default_tune:
221 localdata.setVar("DEFAULTTUNE", default_tune) 234 localdata.setVar("DEFAULTTUNE", default_tune)
235 bb.data.update_data(localdata)
222 package_archs = localdata.getVar("PACKAGE_ARCHS", True) or "" 236 package_archs = localdata.getVar("PACKAGE_ARCHS", True) or ""
223 package_archs = ":".join([i in "all noarch any".split() and i or eext[1]+"_"+i for i in package_archs.split()][::-1]) 237 package_archs = ":".join([i in "all noarch any".split() and i or eext[1]+"_"+i for i in package_archs.split()][::-1])
238 package_os = localdata.getVar("TARGET_OS", True) or ""
224 ml_prefix_list += " %s:%s" % (eext[1], package_archs) 239 ml_prefix_list += " %s:%s" % (eext[1], package_archs)
240 ml_os_list += " %s:%s" % (eext[1], package_os)
225 d.setVar('MULTILIB_PREFIX_LIST', ml_prefix_list) 241 d.setVar('MULTILIB_PREFIX_LIST', ml_prefix_list)
242 d.setVar('MULTILIB_OS_LIST', ml_os_list)
226} 243}