diff options
author | Lianhao Lu <lianhao.lu@intel.com> | 2011-01-30 15:52:27 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-02-01 23:59:38 +0000 |
commit | 8b6626abbf8b190a9e6811b9e73d7c41f6f3c907 (patch) | |
tree | efbcd88481d208ace5fc2dd0207e9e14d9f1cfc6 | |
parent | 382075a9c2a5877d198a217161558da6ad2d5f89 (diff) | |
download | ast2050-yocto-poky-8b6626abbf8b190a9e6811b9e73d7c41f6f3c907.zip ast2050-yocto-poky-8b6626abbf8b190a9e6811b9e73d7c41f6f3c907.tar.gz |
populate_sdk_rpm.bbclass: Added rpm support for populate_sdk task.
This is preparation commit to support using rpm in populate_sdk task.
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
-rw-r--r-- | meta/classes/populate_sdk_rpm.bbclass | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/meta/classes/populate_sdk_rpm.bbclass b/meta/classes/populate_sdk_rpm.bbclass new file mode 100644 index 0000000..e1abbad --- /dev/null +++ b/meta/classes/populate_sdk_rpm.bbclass @@ -0,0 +1,80 @@ +do_populate_sdk[depends] += "rpm-native:do_populate_sysroot" +do_populate_sdk[recrdeptask] += "do_package_write_rpm" + +rpmlibdir = "/var/lib/rpm" +RPMOPTS="--dbpath ${rpmlibdir} --define='_openall_before_chroot 1'" +RPM="rpm ${RPMOPTS}" + + +populate_sdk_post_rpm () { + + local target_rootfs=$1 + + # remove lock files + rm -f ${target_rootfs}/__db.* + + # Move manifests into the directory with the logs + mv ${target_rootfs}/install/*.manifest ${T}/ + + # Remove all remaining resolver files + rm -rf ${target_rootfs}/install +} + +fakeroot populate_sdk_rpm () { + + package_update_index_rpm + package_generate_rpm_conf + + export INSTALL_PACKAGES_ATTEMPTONLY_RPM="" + export INSTALL_PACKAGES_LINGUAS_RPM="" + export INSTALL_PROVIDENAME_RPM="/bin/sh" + export INSTALL_TASK_RPM="populate_sdk" + + + #install target + export INSTALL_ROOTFS_RPM="${SDK_OUTPUT}/${SDKTARGETSYSROOT}" + export INSTALL_PLATFORM_RPM="${TARGET_ARCH}" + export INSTALL_PLATFORM_EXTRA_RPM="${PACKAGE_ARCHS}" + export INSTALL_CONFBASE_RPM="${RPMCONF_TARGET_BASE}" + export INSTALL_PACKAGES_NORMAL_RPM="${TOOLCHAIN_TARGET_TASK}" + + package_install_internal_rpm + populate_sdk_post_rpm ${INSTALL_ROOTFS_RPM} + + #install host + export INSTALL_ROOTFS_RPM="${SDK_OUTPUT}" + export INSTALL_PLATFORM_RPM="${SDK_ARCH}" + export INSTALL_CONFBASE_RPM="${RPMCONF_HOST_BASE}" + export INSTALL_PACKAGES_NORMAL_RPM="${TOOLCHAIN_HOST_TASK}" + INSTALL_PLATFORM_EXTRA_RPM="" + for arch in ${PACKAGE_ARCHS}; do + sdkarch=`echo $arch | sed -e 's/${HOST_ARCH}/${SDK_ARCH}/'` + extension="-nativesdk" + if [ "$sdkarch" = "all" -o "$sdkarch" = "any" -o "$sdkarch" = "noarch" ]; then + extension="" + fi + if [ -e ${DEPLOY_DIR_RPM}/$sdkarch$extension ]; then + INSTALL_PLATFORM_EXTRA_RPM="$INSTALL_PLATFORM_EXTRA_RPM $sdkarch" + fi + done + export INSTALL_PLATFORM_EXTRA_RPM + + package_install_internal_rpm + 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 + + # Workaround so the parser knows we need the resolve_package function! + if false ; then + resolve_package_rpm foo ${RPMCONF_TARGET_BASE}.conf || true + fi +} |