diff options
Diffstat (limited to 'meta')
-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 0000000000..e1abbad17b --- /dev/null +++ b/meta/classes/populate_sdk_rpm.bbclass | |||
@@ -0,0 +1,80 @@ | |||
1 | do_populate_sdk[depends] += "rpm-native:do_populate_sysroot" | ||
2 | do_populate_sdk[recrdeptask] += "do_package_write_rpm" | ||
3 | |||
4 | rpmlibdir = "/var/lib/rpm" | ||
5 | RPMOPTS="--dbpath ${rpmlibdir} --define='_openall_before_chroot 1'" | ||
6 | RPM="rpm ${RPMOPTS}" | ||
7 | |||
8 | |||
9 | populate_sdk_post_rpm () { | ||
10 | |||
11 | local target_rootfs=$1 | ||
12 | |||
13 | # remove lock files | ||
14 | rm -f ${target_rootfs}/__db.* | ||
15 | |||
16 | # Move manifests into the directory with the logs | ||
17 | mv ${target_rootfs}/install/*.manifest ${T}/ | ||
18 | |||
19 | # Remove all remaining resolver files | ||
20 | rm -rf ${target_rootfs}/install | ||
21 | } | ||
22 | |||
23 | fakeroot populate_sdk_rpm () { | ||
24 | |||
25 | package_update_index_rpm | ||
26 | package_generate_rpm_conf | ||
27 | |||
28 | export INSTALL_PACKAGES_ATTEMPTONLY_RPM="" | ||
29 | export INSTALL_PACKAGES_LINGUAS_RPM="" | ||
30 | export INSTALL_PROVIDENAME_RPM="/bin/sh" | ||
31 | export INSTALL_TASK_RPM="populate_sdk" | ||
32 | |||
33 | |||
34 | #install target | ||
35 | export INSTALL_ROOTFS_RPM="${SDK_OUTPUT}/${SDKTARGETSYSROOT}" | ||
36 | export INSTALL_PLATFORM_RPM="${TARGET_ARCH}" | ||
37 | export INSTALL_PLATFORM_EXTRA_RPM="${PACKAGE_ARCHS}" | ||
38 | export INSTALL_CONFBASE_RPM="${RPMCONF_TARGET_BASE}" | ||
39 | export INSTALL_PACKAGES_NORMAL_RPM="${TOOLCHAIN_TARGET_TASK}" | ||
40 | |||
41 | package_install_internal_rpm | ||
42 | populate_sdk_post_rpm ${INSTALL_ROOTFS_RPM} | ||
43 | |||
44 | #install host | ||
45 | export INSTALL_ROOTFS_RPM="${SDK_OUTPUT}" | ||
46 | export INSTALL_PLATFORM_RPM="${SDK_ARCH}" | ||
47 | export INSTALL_CONFBASE_RPM="${RPMCONF_HOST_BASE}" | ||
48 | export INSTALL_PACKAGES_NORMAL_RPM="${TOOLCHAIN_HOST_TASK}" | ||
49 | INSTALL_PLATFORM_EXTRA_RPM="" | ||
50 | for arch in ${PACKAGE_ARCHS}; do | ||
51 | sdkarch=`echo $arch | sed -e 's/${HOST_ARCH}/${SDK_ARCH}/'` | ||
52 | extension="-nativesdk" | ||
53 | if [ "$sdkarch" = "all" -o "$sdkarch" = "any" -o "$sdkarch" = "noarch" ]; then | ||
54 | extension="" | ||
55 | fi | ||
56 | if [ -e ${DEPLOY_DIR_RPM}/$sdkarch$extension ]; then | ||
57 | INSTALL_PLATFORM_EXTRA_RPM="$INSTALL_PLATFORM_EXTRA_RPM $sdkarch" | ||
58 | fi | ||
59 | done | ||
60 | export INSTALL_PLATFORM_EXTRA_RPM | ||
61 | |||
62 | package_install_internal_rpm | ||
63 | populate_sdk_post_rpm ${INSTALL_ROOTFS_RPM} | ||
64 | |||
65 | # move host RPM library data | ||
66 | install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/rpm | ||
67 | mv ${SDK_OUTPUT}${rpmlibdir}/* ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/rpm/ | ||
68 | rm -Rf ${SDK_OUTPUT}/var | ||
69 | |||
70 | install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir} | ||
71 | mv ${SDK_OUTPUT}/etc/* ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir}/ | ||
72 | rm -rf ${SDK_OUTPUT}/etc | ||
73 | |||
74 | populate_sdk_log_check populate_sdk | ||
75 | |||
76 | # Workaround so the parser knows we need the resolve_package function! | ||
77 | if false ; then | ||
78 | resolve_package_rpm foo ${RPMCONF_TARGET_BASE}.conf || true | ||
79 | fi | ||
80 | } | ||