2012-11-29 15:43:16 +00:00
|
|
|
# Smart is python based, so be sure python-native is available to us.
|
|
|
|
EXTRANATIVEPATH += "python-native"
|
|
|
|
|
2011-01-30 07:52:27 +00:00
|
|
|
do_populate_sdk[depends] += "rpm-native:do_populate_sysroot"
|
2012-07-30 23:10:56 +00:00
|
|
|
do_populate_sdk[depends] += "rpmresolve-native:do_populate_sysroot"
|
2012-11-29 15:43:16 +00:00
|
|
|
do_populate_sdk[depends] += "python-smartpm-native:do_populate_sysroot"
|
|
|
|
|
|
|
|
# Needed for update-alternatives
|
|
|
|
do_populate_sdk[depends] += "opkg-native:do_populate_sysroot"
|
|
|
|
|
|
|
|
# Creating the repo info in do_rootfs
|
2012-08-04 04:58:21 +00:00
|
|
|
do_populate_sdk[depends] += "createrepo-native:do_populate_sysroot"
|
2012-11-29 15:43:16 +00:00
|
|
|
|
2011-01-30 07:52:27 +00:00
|
|
|
do_populate_sdk[recrdeptask] += "do_package_write_rpm"
|
|
|
|
|
|
|
|
rpmlibdir = "/var/lib/rpm"
|
2012-11-29 15:43:16 +00:00
|
|
|
RPMOPTS="--dbpath ${rpmlibdir}"
|
2011-01-30 07:52:27 +00:00
|
|
|
RPM="rpm ${RPMOPTS}"
|
|
|
|
|
2011-02-28 19:40:37 +00:00
|
|
|
do_populate_sdk[lockfiles] += "${DEPLOY_DIR_RPM}/rpm.lock"
|
2011-01-30 07:52:27 +00:00
|
|
|
|
|
|
|
populate_sdk_post_rpm () {
|
|
|
|
|
|
|
|
local target_rootfs=$1
|
|
|
|
|
|
|
|
# remove lock files
|
|
|
|
rm -f ${target_rootfs}/__db.*
|
|
|
|
|
|
|
|
# Remove all remaining resolver files
|
|
|
|
rm -rf ${target_rootfs}/install
|
2012-11-29 15:43:16 +00:00
|
|
|
rm -rf ${target_rootfs}/var/lib/smart
|
2011-01-30 07:52:27 +00:00
|
|
|
}
|
|
|
|
|
2011-11-10 18:02:56 +00:00
|
|
|
populate_sdk_rpm () {
|
2011-01-30 07:52:27 +00:00
|
|
|
|
|
|
|
package_update_index_rpm
|
|
|
|
|
2011-08-01 17:34:51 +00:00
|
|
|
## install target ##
|
|
|
|
# This needs to work in the same way as rootfs_rpm.bbclass!
|
|
|
|
#
|
2011-01-30 07:52:27 +00:00
|
|
|
export INSTALL_ROOTFS_RPM="${SDK_OUTPUT}/${SDKTARGETSYSROOT}"
|
2013-02-21 23:18:29 +00:00
|
|
|
export INSTALL_PLATFORM_RPM="$(echo ${TARGET_ARCH} | tr - _)${TARGET_VENDOR}-${TARGET_OS}"
|
2011-11-10 18:03:30 +00:00
|
|
|
export INSTALL_PACKAGES_RPM="${TOOLCHAIN_TARGET_TASK}"
|
2013-09-12 06:47:09 +00:00
|
|
|
export INSTALL_PACKAGES_ATTEMPTONLY_RPM="$(echo '${TOOLCHAIN_TARGET_TASK_ATTEMPTONLY}' | sed 's/ *$//g')"
|
2011-08-01 17:34:51 +00:00
|
|
|
export INSTALL_PACKAGES_LINGUAS_RPM=""
|
2013-01-18 23:13:37 +00:00
|
|
|
# We don't need any of these runtime items for the SDK, so
|
|
|
|
# just make the system assume they exist.
|
|
|
|
export INSTALL_PROVIDENAME_RPM="/bin/sh /bin/bash /usr/bin/env /usr/bin/perl pkgconfig"
|
2011-08-01 17:34:51 +00:00
|
|
|
export INSTALL_TASK_RPM="populate_sdk-target"
|
Rework installation of dev, dbg, doc, and locale packages
Use a similar mechanism that was previously used to install locales at
rootfs generation time to install other "complementary" packages (e.g.
*-dev packages) - i.e. install all of the explicitly requested packages
and their dependencies, then get a list of the packages that were
installed, and use that list to install the complementary packages. This
has been implemented by using a list of globs which should make it
easier to extend in future.
The previous locale package installation code assumed that the locale
packages did not have any dependencies that were not already installed;
now that we are installing non-locale packages this is no longer
correct. In practice only the rpm backend actually made use of this
assumption, so it needed to be changed to call into the existing package
backend code to do the complementary package installation rather than
calling rpm directly.
This fixes the doc-pkgs IMAGE_FEATURES feature to work correctly, and
also ensures that all dev/dbg packages get installed for
dev-pkgs/dbg-pkgs respectively even if the dependency chains between
those packages was not ensuring that already.
The code has also been adapted to work correctly with the new
SDK-from-image functionality. To that end, an SDKIMAGE_FEATURES variable
has been added to allow specifying what extra image features should go
into the SDK (extra, because by virtue of installing all of the packages
in the image into the target part of the SDK, we already include all of
IMAGE_FEATURES) with a default value of "dev-pkgs dbg-pkgs".
Fixes [YOCTO #2614].
(From OE-Core rev: 72d1048a8381fa4a8c4c0d082047536727b4be47)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-09 13:15:08 +00:00
|
|
|
export INSTALL_COMPLEMENTARY_RPM=""
|
2012-12-10 14:30:03 +00:00
|
|
|
export INTERCEPT_DIR=${WORKDIR}/intercept_scripts
|
|
|
|
export NATIVE_ROOT=${STAGING_DIR_NATIVE}
|
2011-08-01 17:34:51 +00:00
|
|
|
|
|
|
|
# Setup base system configuration
|
|
|
|
mkdir -p ${INSTALL_ROOTFS_RPM}/etc/rpm/
|
2011-01-30 07:52:27 +00:00
|
|
|
|
2011-02-25 23:31:50 +00:00
|
|
|
# List must be prefered to least preferred order
|
2013-02-20 19:31:11 +00:00
|
|
|
default_extra_rpm=""
|
2011-08-01 17:11:22 +00:00
|
|
|
INSTALL_PLATFORM_EXTRA_RPM=""
|
2013-02-21 23:18:29 +00:00
|
|
|
for os in ${MULTILIB_OS_LIST} ; do
|
2012-11-30 22:11:37 +00:00
|
|
|
old_IFS="$IFS"
|
|
|
|
IFS=":"
|
2013-02-21 23:18:29 +00:00
|
|
|
set -- $os
|
2012-11-30 22:11:37 +00:00
|
|
|
IFS="$old_IFS"
|
2013-02-20 19:31:11 +00:00
|
|
|
mlib=$1
|
2013-02-21 23:18:29 +00:00
|
|
|
mlib_os=$2
|
|
|
|
for prefix in ${MULTILIB_PREFIX_LIST} ; do
|
|
|
|
old_IFS="$IFS"
|
|
|
|
IFS=":"
|
|
|
|
set -- $prefix
|
|
|
|
IFS="$old_IFS"
|
|
|
|
if [ "$mlib" != "$1" ]; then
|
|
|
|
continue
|
2013-02-20 19:31:11 +00:00
|
|
|
fi
|
2013-02-21 23:18:29 +00:00
|
|
|
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
|
2012-11-30 22:11:37 +00:00
|
|
|
done
|
2011-02-25 23:31:50 +00:00
|
|
|
done
|
2013-02-20 19:31:11 +00:00
|
|
|
if [ -n "$default_extra_rpm" ]; then
|
|
|
|
INSTALL_PLATFORM_EXTRA_RPM="$default_extra_rpm $INSTALL_PLATFORM_EXTRA_RPM"
|
|
|
|
fi
|
2011-08-01 17:11:22 +00:00
|
|
|
export INSTALL_PLATFORM_EXTRA_RPM
|
2011-02-25 23:31:50 +00:00
|
|
|
|
2011-01-30 07:52:27 +00:00
|
|
|
package_install_internal_rpm
|
Rework installation of dev, dbg, doc, and locale packages
Use a similar mechanism that was previously used to install locales at
rootfs generation time to install other "complementary" packages (e.g.
*-dev packages) - i.e. install all of the explicitly requested packages
and their dependencies, then get a list of the packages that were
installed, and use that list to install the complementary packages. This
has been implemented by using a list of globs which should make it
easier to extend in future.
The previous locale package installation code assumed that the locale
packages did not have any dependencies that were not already installed;
now that we are installing non-locale packages this is no longer
correct. In practice only the rpm backend actually made use of this
assumption, so it needed to be changed to call into the existing package
backend code to do the complementary package installation rather than
calling rpm directly.
This fixes the doc-pkgs IMAGE_FEATURES feature to work correctly, and
also ensures that all dev/dbg packages get installed for
dev-pkgs/dbg-pkgs respectively even if the dependency chains between
those packages was not ensuring that already.
The code has also been adapted to work correctly with the new
SDK-from-image functionality. To that end, an SDKIMAGE_FEATURES variable
has been added to allow specifying what extra image features should go
into the SDK (extra, because by virtue of installing all of the packages
in the image into the target part of the SDK, we already include all of
IMAGE_FEATURES) with a default value of "dev-pkgs dbg-pkgs".
Fixes [YOCTO #2614].
(From OE-Core rev: 72d1048a8381fa4a8c4c0d082047536727b4be47)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-09 13:15:08 +00:00
|
|
|
${POPULATE_SDK_POST_TARGET_COMMAND}
|
2011-01-30 07:52:27 +00:00
|
|
|
populate_sdk_post_rpm ${INSTALL_ROOTFS_RPM}
|
|
|
|
|
2011-08-01 17:34:51 +00:00
|
|
|
## install nativesdk ##
|
|
|
|
echo "Installing NATIVESDK packages"
|
2011-01-30 07:52:27 +00:00
|
|
|
export INSTALL_ROOTFS_RPM="${SDK_OUTPUT}"
|
2013-02-21 23:18:29 +00:00
|
|
|
export INSTALL_PLATFORM_RPM="$(echo ${TARGET_ARCH} | tr - _)${SDK_VENDOR}-${SDK_OS}"
|
2011-11-10 18:03:30 +00:00
|
|
|
export INSTALL_PACKAGES_RPM="${TOOLCHAIN_HOST_TASK}"
|
2013-09-12 06:47:09 +00:00
|
|
|
export INSTALL_PACKAGES_ATTEMPTONLY_RPM="$(echo '${TOOLCHAIN_HOST_TASK_ATTEMPTONLY}' | sed 's/ *$//g')"
|
2011-08-01 17:34:51 +00:00
|
|
|
export INSTALL_PACKAGES_LINGUAS_RPM=""
|
2011-09-22 19:51:21 +00:00
|
|
|
export INSTALL_PROVIDENAME_RPM="/bin/sh /bin/bash /usr/bin/env /usr/bin/perl pkgconfig libGL.so()(64bit) libGL.so"
|
2011-08-01 17:34:51 +00:00
|
|
|
export INSTALL_TASK_RPM="populate_sdk_rpm-nativesdk"
|
Rework installation of dev, dbg, doc, and locale packages
Use a similar mechanism that was previously used to install locales at
rootfs generation time to install other "complementary" packages (e.g.
*-dev packages) - i.e. install all of the explicitly requested packages
and their dependencies, then get a list of the packages that were
installed, and use that list to install the complementary packages. This
has been implemented by using a list of globs which should make it
easier to extend in future.
The previous locale package installation code assumed that the locale
packages did not have any dependencies that were not already installed;
now that we are installing non-locale packages this is no longer
correct. In practice only the rpm backend actually made use of this
assumption, so it needed to be changed to call into the existing package
backend code to do the complementary package installation rather than
calling rpm directly.
This fixes the doc-pkgs IMAGE_FEATURES feature to work correctly, and
also ensures that all dev/dbg packages get installed for
dev-pkgs/dbg-pkgs respectively even if the dependency chains between
those packages was not ensuring that already.
The code has also been adapted to work correctly with the new
SDK-from-image functionality. To that end, an SDKIMAGE_FEATURES variable
has been added to allow specifying what extra image features should go
into the SDK (extra, because by virtue of installing all of the packages
in the image into the target part of the SDK, we already include all of
IMAGE_FEATURES) with a default value of "dev-pkgs dbg-pkgs".
Fixes [YOCTO #2614].
(From OE-Core rev: 72d1048a8381fa4a8c4c0d082047536727b4be47)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-09 13:15:08 +00:00
|
|
|
export INSTALL_COMPLEMENTARY_RPM=""
|
2011-08-01 17:11:22 +00:00
|
|
|
|
|
|
|
# List must be prefered to least preferred order
|
|
|
|
INSTALL_PLATFORM_EXTRA_RPM=""
|
|
|
|
for each_arch in ${SDK_PACKAGE_ARCHS} ; do
|
2013-02-21 23:18:29 +00:00
|
|
|
platform="$(echo $each_arch | tr - _)-.*-${SDK_OS}"
|
|
|
|
INSTALL_PLATFORM_EXTRA_RPM="$platform $INSTALL_PLATFORM_EXTRA_RPM"
|
2011-01-30 07:52:27 +00:00
|
|
|
done
|
2011-02-25 23:31:50 +00:00
|
|
|
export INSTALL_PLATFORM_EXTRA_RPM
|
2011-01-30 07:52:27 +00:00
|
|
|
|
2012-11-30 22:11:37 +00:00
|
|
|
package_install_internal_rpm --sdk
|
2013-03-22 19:53:52 +00:00
|
|
|
${POPULATE_SDK_POST_HOST_COMMAND}
|
2011-01-30 07:52:27 +00:00
|
|
|
populate_sdk_post_rpm ${INSTALL_ROOTFS_RPM}
|
|
|
|
|
|
|
|
# move host RPM library data
|
|
|
|
install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/rpm
|
|
|
|
mv ${SDK_OUTPUT}${rpmlibdir}/* ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/rpm/
|
|
|
|
rm -Rf ${SDK_OUTPUT}/var
|
|
|
|
|
|
|
|
install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir}
|
|
|
|
mv ${SDK_OUTPUT}/etc/* ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir}/
|
|
|
|
rm -rf ${SDK_OUTPUT}/etc
|
|
|
|
|
|
|
|
populate_sdk_log_check populate_sdk
|
|
|
|
}
|
2011-08-01 17:34:51 +00:00
|
|
|
|
|
|
|
python () {
|
2012-07-06 19:13:59 +00:00
|
|
|
# The following code should be kept in sync w/ the rootfs_rpm version.
|
2012-11-30 22:11:37 +00:00
|
|
|
|
|
|
|
# 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])
|
2013-02-21 23:18:29 +00:00
|
|
|
package_os = d.getVar("TARGET_OS", True) or ""
|
2012-11-30 22:11:37 +00:00
|
|
|
ml_prefix_list = "%s:%s" % ('default', package_archs)
|
2013-02-21 23:18:29 +00:00
|
|
|
ml_os_list = "%s:%s" % ('default', package_os)
|
2011-08-01 17:34:51 +00:00
|
|
|
multilibs = d.getVar('MULTILIBS', True) or ""
|
|
|
|
for ext in multilibs.split():
|
|
|
|
eext = ext.split(':')
|
|
|
|
if len(eext) > 1 and eext[0] == 'multilib':
|
|
|
|
localdata = bb.data.createCopy(d)
|
2012-07-06 19:13:59 +00:00
|
|
|
default_tune = localdata.getVar("DEFAULTTUNE_virtclass-multilib-" + eext[1], False)
|
|
|
|
if default_tune:
|
|
|
|
localdata.setVar("DEFAULTTUNE", default_tune)
|
2013-02-21 23:18:29 +00:00
|
|
|
bb.data.update_data(localdata)
|
2012-07-06 19:13:59 +00:00
|
|
|
package_archs = localdata.getVar("PACKAGE_ARCHS", True) or ""
|
2012-11-30 22:11:37 +00:00
|
|
|
package_archs = ":".join([i in "all noarch any".split() and i or eext[1]+"_"+i for i in package_archs.split()][::-1])
|
2013-02-21 23:18:29 +00:00
|
|
|
package_os = localdata.getVar("TARGET_OS", True) or ""
|
2012-11-30 22:11:37 +00:00
|
|
|
ml_prefix_list += " %s:%s" % (eext[1], package_archs)
|
2013-02-21 23:18:29 +00:00
|
|
|
ml_os_list += " %s:%s" % (eext[1], package_os)
|
2012-07-06 19:13:59 +00:00
|
|
|
d.setVar('MULTILIB_PREFIX_LIST', ml_prefix_list)
|
2013-02-21 23:18:29 +00:00
|
|
|
d.setVar('MULTILIB_OS_LIST', ml_os_list)
|
2011-08-01 17:34:51 +00:00
|
|
|
}
|
|
|
|
|
2013-03-23 17:36:53 +00:00
|
|
|
RPM_QUERY_CMD = '${RPM} --root $INSTALL_ROOTFS_RPM -D "_dbpath ${rpmlibdir}"'
|
|
|
|
|
|
|
|
list_installed_packages() {
|
|
|
|
if [ "$1" = "arch" ]; then
|
|
|
|
${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH}\n]" | translate_smart_to_oe arch
|
|
|
|
elif [ "$1" = "file" ]; then
|
2013-08-15 17:04:35 +00:00
|
|
|
${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH} %{PACKAGEORIGIN}\n]" | translate_smart_to_oe file
|
2013-11-26 12:09:52 +00:00
|
|
|
elif [ "$1" = "ver" ]; then
|
|
|
|
${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH} %{VERSION}\n]" | translate_smart_to_oe arch
|
2013-03-23 17:36:53 +00:00
|
|
|
else
|
|
|
|
${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH}\n]" | translate_smart_to_oe
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
rootfs_list_installed_depends() {
|
|
|
|
rpmresolve -t $INSTALL_ROOTFS_RPM/${rpmlibdir}
|
|
|
|
}
|