diff options
author | Hongxu Jia <hongxu.jia@windriver.com> | 2014-01-27 15:08:58 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-02-11 11:53:42 +0000 |
commit | 9d3c187b1a3327d45b1e4b50fdf10ab9895087d4 (patch) | |
tree | 5a634455c4feff4dddd62d352b0884e217b2af39 /meta/classes | |
parent | ed89fd28d743980b15312c00be632d914805df5b (diff) | |
download | poky-9d3c187b1a3327d45b1e4b50fdf10ab9895087d4.tar.gz |
populate_sdk_rpm.bbclass: remove old shell code
The old code no more needed since the job is done in python now.
(From OE-Core rev: 96bf2a93bb75fea23732014106039e14d72cd1c7)
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/populate_sdk_rpm.bbclass | 152 |
1 files changed, 0 insertions, 152 deletions
diff --git a/meta/classes/populate_sdk_rpm.bbclass b/meta/classes/populate_sdk_rpm.bbclass index 67cccafe4c..06605d366d 100644 --- a/meta/classes/populate_sdk_rpm.bbclass +++ b/meta/classes/populate_sdk_rpm.bbclass | |||
@@ -14,161 +14,9 @@ do_populate_sdk[depends] += "createrepo-native:do_populate_sysroot" | |||
14 | do_populate_sdk[recrdeptask] += "do_package_write_rpm" | 14 | do_populate_sdk[recrdeptask] += "do_package_write_rpm" |
15 | 15 | ||
16 | rpmlibdir = "/var/lib/rpm" | 16 | rpmlibdir = "/var/lib/rpm" |
17 | RPMOPTS="--dbpath ${rpmlibdir}" | ||
18 | RPM="rpm ${RPMOPTS}" | ||
19 | 17 | ||
20 | do_populate_sdk[lockfiles] += "${DEPLOY_DIR_RPM}/rpm.lock" | 18 | do_populate_sdk[lockfiles] += "${DEPLOY_DIR_RPM}/rpm.lock" |
21 | 19 | ||
22 | populate_sdk_post_rpm () { | ||
23 | |||
24 | local target_rootfs=$1 | ||
25 | |||
26 | # remove lock files | ||
27 | rm -f ${target_rootfs}/__db.* | ||
28 | |||
29 | # Remove all remaining resolver files | ||
30 | rm -rf ${target_rootfs}/install | ||
31 | rm -rf ${target_rootfs}/var/lib/smart | ||
32 | } | ||
33 | |||
34 | populate_sdk_rpm () { | ||
35 | |||
36 | package_update_index_rpm | ||
37 | |||
38 | ## install target ## | ||
39 | # This needs to work in the same way as rootfs_rpm.bbclass! | ||
40 | # | ||
41 | export INSTALL_ROOTFS_RPM="${SDK_OUTPUT}/${SDKTARGETSYSROOT}" | ||
42 | export INSTALL_PLATFORM_RPM="$(echo ${TARGET_ARCH} | tr - _)${TARGET_VENDOR}-${TARGET_OS}" | ||
43 | export INSTALL_PACKAGES_RPM="${TOOLCHAIN_TARGET_TASK}" | ||
44 | export INSTALL_PACKAGES_ATTEMPTONLY_RPM="$(echo '${TOOLCHAIN_TARGET_TASK_ATTEMPTONLY}' | sed 's/ *$//g')" | ||
45 | export INSTALL_PACKAGES_LINGUAS_RPM="" | ||
46 | # We don't need any of these runtime items for the SDK, so | ||
47 | # just make the system assume they exist. | ||
48 | export INSTALL_PROVIDENAME_RPM="/bin/sh /bin/bash /usr/bin/env /usr/bin/perl pkgconfig" | ||
49 | export INSTALL_TASK_RPM="populate_sdk-target" | ||
50 | export INSTALL_COMPLEMENTARY_RPM="" | ||
51 | export INTERCEPT_DIR=${WORKDIR}/intercept_scripts | ||
52 | export NATIVE_ROOT=${STAGING_DIR_NATIVE} | ||
53 | |||
54 | # Setup base system configuration | ||
55 | mkdir -p ${INSTALL_ROOTFS_RPM}/etc/rpm/ | ||
56 | |||
57 | # List must be prefered to least preferred order | ||
58 | default_extra_rpm="" | ||
59 | INSTALL_PLATFORM_EXTRA_RPM="" | ||
60 | for os in ${MULTILIB_OS_LIST} ; do | ||
61 | old_IFS="$IFS" | ||
62 | IFS=":" | ||
63 | set -- $os | ||
64 | IFS="$old_IFS" | ||
65 | mlib=$1 | ||
66 | mlib_os=$2 | ||
67 | for prefix in ${MULTILIB_PREFIX_LIST} ; do | ||
68 | old_IFS="$IFS" | ||
69 | IFS=":" | ||
70 | set -- $prefix | ||
71 | IFS="$old_IFS" | ||
72 | if [ "$mlib" != "$1" ]; then | ||
73 | continue | ||
74 | fi | ||
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 | ||
85 | done | ||
86 | done | ||
87 | if [ -n "$default_extra_rpm" ]; then | ||
88 | INSTALL_PLATFORM_EXTRA_RPM="$default_extra_rpm $INSTALL_PLATFORM_EXTRA_RPM" | ||
89 | fi | ||
90 | export INSTALL_PLATFORM_EXTRA_RPM | ||
91 | |||
92 | package_install_internal_rpm | ||
93 | ${POPULATE_SDK_POST_TARGET_COMMAND} | ||
94 | populate_sdk_post_rpm ${INSTALL_ROOTFS_RPM} | ||
95 | |||
96 | ## install nativesdk ## | ||
97 | echo "Installing NATIVESDK packages" | ||
98 | export INSTALL_ROOTFS_RPM="${SDK_OUTPUT}" | ||
99 | export INSTALL_PLATFORM_RPM="$(echo ${TARGET_ARCH} | tr - _)${SDK_VENDOR}-${SDK_OS}" | ||
100 | export INSTALL_PACKAGES_RPM="${TOOLCHAIN_HOST_TASK}" | ||
101 | export INSTALL_PACKAGES_ATTEMPTONLY_RPM="$(echo '${TOOLCHAIN_HOST_TASK_ATTEMPTONLY}' | sed 's/ *$//g')" | ||
102 | export INSTALL_PACKAGES_LINGUAS_RPM="" | ||
103 | export INSTALL_PROVIDENAME_RPM="/bin/sh /bin/bash /usr/bin/env /usr/bin/perl pkgconfig libGL.so()(64bit) libGL.so" | ||
104 | export INSTALL_TASK_RPM="populate_sdk_rpm-nativesdk" | ||
105 | export INSTALL_COMPLEMENTARY_RPM="" | ||
106 | |||
107 | # List must be prefered to least preferred order | ||
108 | INSTALL_PLATFORM_EXTRA_RPM="" | ||
109 | for each_arch in ${SDK_PACKAGE_ARCHS} ; do | ||
110 | platform="$(echo $each_arch | tr - _)-.*-${SDK_OS}" | ||
111 | INSTALL_PLATFORM_EXTRA_RPM="$platform $INSTALL_PLATFORM_EXTRA_RPM" | ||
112 | done | ||
113 | export INSTALL_PLATFORM_EXTRA_RPM | ||
114 | |||
115 | package_install_internal_rpm --sdk | ||
116 | ${POPULATE_SDK_POST_HOST_COMMAND} | ||
117 | populate_sdk_post_rpm ${INSTALL_ROOTFS_RPM} | ||
118 | |||
119 | # move host RPM library data | ||
120 | install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/rpm | ||
121 | mv ${SDK_OUTPUT}${rpmlibdir}/* ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/rpm/ | ||
122 | rm -Rf ${SDK_OUTPUT}/var | ||
123 | |||
124 | install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir} | ||
125 | mv ${SDK_OUTPUT}/etc/* ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir}/ | ||
126 | rm -rf ${SDK_OUTPUT}/etc | ||
127 | |||
128 | populate_sdk_log_check populate_sdk | ||
129 | } | ||
130 | |||
131 | python () { | ||
132 | # The following code should be kept in sync w/ the rootfs_rpm version. | ||
133 | |||
134 | # package_arch order is reversed. This ensures the -best- match is listed first! | ||
135 | package_archs = d.getVar("PACKAGE_ARCHS", True) or "" | ||
136 | package_archs = ":".join(package_archs.split()[::-1]) | ||
137 | package_os = d.getVar("TARGET_OS", True) or "" | ||
138 | ml_prefix_list = "%s:%s" % ('default', package_archs) | ||
139 | ml_os_list = "%s:%s" % ('default', package_os) | ||
140 | multilibs = d.getVar('MULTILIBS', True) or "" | ||
141 | for ext in multilibs.split(): | ||
142 | eext = ext.split(':') | ||
143 | if len(eext) > 1 and eext[0] == 'multilib': | ||
144 | localdata = bb.data.createCopy(d) | ||
145 | default_tune = localdata.getVar("DEFAULTTUNE_virtclass-multilib-" + eext[1], False) | ||
146 | if default_tune: | ||
147 | localdata.setVar("DEFAULTTUNE", default_tune) | ||
148 | bb.data.update_data(localdata) | ||
149 | package_archs = localdata.getVar("PACKAGE_ARCHS", True) or "" | ||
150 | package_archs = ":".join([i in "all noarch any".split() and i or eext[1]+"_"+i for i in package_archs.split()][::-1]) | ||
151 | package_os = localdata.getVar("TARGET_OS", True) or "" | ||
152 | ml_prefix_list += " %s:%s" % (eext[1], package_archs) | ||
153 | ml_os_list += " %s:%s" % (eext[1], package_os) | ||
154 | d.setVar('MULTILIB_PREFIX_LIST', ml_prefix_list) | ||
155 | d.setVar('MULTILIB_OS_LIST', ml_os_list) | ||
156 | } | ||
157 | |||
158 | RPM_QUERY_CMD = '${RPM} --root $INSTALL_ROOTFS_RPM -D "_dbpath ${rpmlibdir}"' | ||
159 | |||
160 | list_installed_packages() { | ||
161 | if [ "$1" = "arch" ]; then | ||
162 | ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH}\n]" | translate_smart_to_oe arch | ||
163 | elif [ "$1" = "file" ]; then | ||
164 | ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH} %{PACKAGEORIGIN}\n]" | translate_smart_to_oe file | ||
165 | elif [ "$1" = "ver" ]; then | ||
166 | ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH} %{VERSION}\n]" | translate_smart_to_oe arch | ||
167 | else | ||
168 | ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH}\n]" | translate_smart_to_oe | ||
169 | fi | ||
170 | } | ||
171 | |||
172 | rootfs_list_installed_depends() { | 20 | rootfs_list_installed_depends() { |
173 | rpmresolve -t $INSTALL_ROOTFS_RPM/${rpmlibdir} | 21 | rpmresolve -t $INSTALL_ROOTFS_RPM/${rpmlibdir} |
174 | } | 22 | } |