package_install_internal_rpm () {
local target_rootfs="$INSTALL_ROOTFS_RPM"
- local platform="`echo $INSTALL_PLATFORM_RPM | sed 's#-#_#g'`"
- local platform_extra="`echo $INSTALL_PLATFORM_EXTRA_RPM | sed 's#-#_#g'`"
local package_to_install="$INSTALL_PACKAGES_RPM"
local package_attemptonly="$INSTALL_PACKAGES_ATTEMPTONLY_RPM"
local package_linguas="$INSTALL_PACKAGES_LINGUAS_RPM"
# Setup base system configuration
echo "Note: configuring RPM platform settings"
mkdir -p ${target_rootfs}/etc/rpm/
- 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
+ echo "$INSTALL_PLATFORM_RPM" > ${target_rootfs}/etc/rpm/platform
-
- if [ ! -z "$platform_extra" ]; then
- for pt in $platform_extra ; do
+ if [ ! -z "$INSTALL_PLATFORM_EXTRA_RPM" ]; then
+ for pt in $INSTALL_PLATFORM_EXTRA_RPM ; do
channel_priority=$(expr $channel_priority + 5)
case $pt in
- noarch | any | all)
- os="`echo ${platform_os} | sed "s,-.*,,"`.*"
- ;;
- *)
- os="${platform_os}"
+ noarch-* | any-* | all-*)
+ pt=$(echo $pt | sed "s,-linux.*$,-linux\.*,")
;;
esac
- echo "$pt-.*-$os" >> ${target_rootfs}/etc/rpm/platform
+ echo "$pt" >> ${target_rootfs}/etc/rpm/platform
done
fi
smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-extra-macros._tmppath=/install/tmp
# Optional debugging
#smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-log-level=debug
+ #smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-log-file=/tmp/smart-debug-logfile
# Delay this until later...
#smart --data-dir=${target_rootfs}/var/lib/smart channel --add rpmsys type=rpm-sys -y
- platform_extra_fixed=`echo "$platform_extra" | tr - _`
- for arch in $platform_extra_fixed ; do
+ for canonical_arch in $INSTALL_PLATFORM_EXTRA_RPM; do
+ arch=$(echo $canonical_arch | sed "s,\([^-]*\)-.*,\1,")
if [ -d ${DEPLOY_DIR_RPM}/$arch -a ! -e ${target_rootfs}/install/channel.$arch.stamp ] ; then
echo "Note: adding Smart channel $arch ($channel_priority)"
smart --data-dir=${target_rootfs}/var/lib/smart channel --add $arch type=rpm-md type=rpm-md baseurl=${DEPLOY_DIR_RPM}/$arch -y
# This needs to work in the same way as rootfs_rpm.bbclass!
#
export INSTALL_ROOTFS_RPM="${SDK_OUTPUT}/${SDKTARGETSYSROOT}"
- export INSTALL_PLATFORM_RPM="${TARGET_ARCH}"
+ export INSTALL_PLATFORM_RPM="$(echo ${TARGET_ARCH} | tr - _)${TARGET_VENDOR}-${TARGET_OS}"
export INSTALL_PACKAGES_RPM="${TOOLCHAIN_TARGET_TASK}"
export INSTALL_PACKAGES_ATTEMPTONLY_RPM="${TOOLCHAIN_TARGET_TASK_ATTEMPTONLY}"
export INSTALL_PACKAGES_LINGUAS_RPM=""
# List must be prefered to least preferred order
default_extra_rpm=""
INSTALL_PLATFORM_EXTRA_RPM=""
- for i in ${MULTILIB_PREFIX_LIST} ; do
+ for os in ${MULTILIB_OS_LIST} ; do
old_IFS="$IFS"
IFS=":"
- set $i
+ set -- $os
IFS="$old_IFS"
mlib=$1
- shift #remove mlib
- while [ -n "$1" ]; do
- if [ "$mlib" = "${BBEXTENDVARIANT}" ]; then
- default_extra_rpm="$default_extra_rpm $1"
- else
- INSTALL_PLATFORM_EXTRA_RPM="$INSTALL_PLATFORM_EXTRA_RPM $1"
+ mlib_os=$2
+ for prefix in ${MULTILIB_PREFIX_LIST} ; do
+ old_IFS="$IFS"
+ IFS=":"
+ set -- $prefix
+ IFS="$old_IFS"
+ if [ "$mlib" != "$1" ]; then
+ continue
fi
- shift
+ shift #remove mlib
+ while [ -n "$1" ]; do
+ platform="$(echo $1 | tr - _)-.*-$mlib_os"
+ if [ "$mlib" = "${BBEXTENDVARIANT}" ]; then
+ default_extra_rpm="$default_extra_rpm $platform"
+ else
+ INSTALL_PLATFORM_EXTRA_RPM="$INSTALL_PLATFORM_EXTRA_RPM $platform"
+ fi
+ shift
+ done
done
done
if [ -n "$default_extra_rpm" ]; then
## install nativesdk ##
echo "Installing NATIVESDK packages"
export INSTALL_ROOTFS_RPM="${SDK_OUTPUT}"
- export INSTALL_PLATFORM_RPM="${SDK_ARCH}"
+ export INSTALL_PLATFORM_RPM="$(echo ${TARGET_ARCH} | tr - _)${SDK_VENDOR}-${SDK_OS}"
export INSTALL_PACKAGES_RPM="${TOOLCHAIN_HOST_TASK}"
export INSTALL_PACKAGES_ATTEMPTONLY_RPM="${TOOLCHAIN_TARGET_HOST_ATTEMPTONLY}"
export INSTALL_PACKAGES_LINGUAS_RPM=""
# List must be prefered to least preferred order
INSTALL_PLATFORM_EXTRA_RPM=""
for each_arch in ${SDK_PACKAGE_ARCHS} ; do
- INSTALL_PLATFORM_EXTRA_RPM="$each_arch $INSTALL_PLATFORM_EXTRA_RPM"
+ platform="$(echo $each_arch | tr - _)-.*-${SDK_OS}"
+ INSTALL_PLATFORM_EXTRA_RPM="$platform $INSTALL_PLATFORM_EXTRA_RPM"
done
export INSTALL_PLATFORM_EXTRA_RPM
# package_arch order is reversed. This ensures the -best- match is listed first!
package_archs = d.getVar("PACKAGE_ARCHS", True) or ""
package_archs = ":".join(package_archs.split()[::-1])
+ package_os = d.getVar("TARGET_OS", True) or ""
ml_prefix_list = "%s:%s" % ('default', package_archs)
+ ml_os_list = "%s:%s" % ('default', package_os)
multilibs = d.getVar('MULTILIBS', True) or ""
for ext in multilibs.split():
eext = ext.split(':')
default_tune = localdata.getVar("DEFAULTTUNE_virtclass-multilib-" + eext[1], False)
if default_tune:
localdata.setVar("DEFAULTTUNE", default_tune)
+ bb.data.update_data(localdata)
package_archs = localdata.getVar("PACKAGE_ARCHS", True) or ""
package_archs = ":".join([i in "all noarch any".split() and i or eext[1]+"_"+i for i in package_archs.split()][::-1])
+ package_os = localdata.getVar("TARGET_OS", True) or ""
ml_prefix_list += " %s:%s" % (eext[1], package_archs)
+ ml_os_list += " %s:%s" % (eext[1], package_os)
d.setVar('MULTILIB_PREFIX_LIST', ml_prefix_list)
+ d.setVar('MULTILIB_OS_LIST', ml_os_list)
}
# install packages
# This needs to work in the same way as populate_sdk_rpm.bbclass!
export INSTALL_ROOTFS_RPM="${IMAGE_ROOTFS}"
- export INSTALL_PLATFORM_RPM="${TARGET_ARCH}"
+ export INSTALL_PLATFORM_RPM="$(echo ${TARGET_ARCH} | tr - _)${TARGET_VENDOR}-${TARGET_OS}"
export INSTALL_PACKAGES_RPM="${PACKAGE_INSTALL}"
export INSTALL_PACKAGES_ATTEMPTONLY_RPM="${PACKAGE_INSTALL_ATTEMPTONLY}"
export INSTALL_PACKAGES_LINGUAS_RPM="${LINGUAS_INSTALL}"
# List must be prefered to least preferred order
default_extra_rpm=""
INSTALL_PLATFORM_EXTRA_RPM=""
- for i in ${MULTILIB_PREFIX_LIST} ; do
+ for os in ${MULTILIB_OS_LIST} ; do
old_IFS="$IFS"
IFS=":"
- set $i
+ set -- $os
IFS="$old_IFS"
mlib=$1
- shift #remove mlib
- while [ -n "$1" ]; do
- if [ "$mlib" = "${BBEXTENDVARIANT}" ]; then
- default_extra_rpm="$default_extra_rpm $1"
- else
- INSTALL_PLATFORM_EXTRA_RPM="$INSTALL_PLATFORM_EXTRA_RPM $1"
+ mlib_os=$2
+ for prefix in ${MULTILIB_PREFIX_LIST} ; do
+ old_IFS="$IFS"
+ IFS=":"
+ set -- $prefix
+ IFS="$old_IFS"
+ if [ "$mlib" != "$1" ]; then
+ continue
fi
- shift
+ shift #remove mlib
+ while [ -n "$1" ]; do
+ platform="$(echo $1 | tr - _)-.*-$mlib_os"
+ if [ "$mlib" = "${BBEXTENDVARIANT}" ]; then
+ default_extra_rpm="$default_extra_rpm $platform"
+ else
+ INSTALL_PLATFORM_EXTRA_RPM="$INSTALL_PLATFORM_EXTRA_RPM $platform"
+ fi
+ shift
+ done
done
done
if [ -n "$default_extra_rpm" ]; then
# package_arch order is reversed. This ensures the -best- match is listed first!
package_archs = d.getVar("PACKAGE_ARCHS", True) or ""
package_archs = ":".join(package_archs.split()[::-1])
+ package_os = d.getVar("TARGET_OS", True) or ""
ml_prefix_list = "%s:%s" % ('default', package_archs)
+ ml_os_list = "%s:%s" % ('default', package_os)
multilibs = d.getVar('MULTILIBS', True) or ""
for ext in multilibs.split():
eext = ext.split(':')
default_tune = localdata.getVar("DEFAULTTUNE_virtclass-multilib-" + eext[1], False)
if default_tune:
localdata.setVar("DEFAULTTUNE", default_tune)
+ bb.data.update_data(localdata)
package_archs = localdata.getVar("PACKAGE_ARCHS", True) or ""
package_archs = ":".join([i in "all noarch any".split() and i or eext[1]+"_"+i for i in package_archs.split()][::-1])
+ package_os = localdata.getVar("TARGET_OS", True) or ""
ml_prefix_list += " %s:%s" % (eext[1], package_archs)
+ ml_os_list += " %s:%s" % (eext[1], package_os)
d.setVar('MULTILIB_PREFIX_LIST', ml_prefix_list)
+ d.setVar('MULTILIB_OS_LIST', ml_os_list)
}