summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorLianhao Lu <lianhao.lu@intel.com>2011-07-05 13:18:06 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-07-27 16:25:35 +0100
commit28543c5780ab8f3d504a827bf37f3dc2fc1c5f12 (patch)
tree413b00c9efaa1e61202686fa8811f25b14c8ac7b /meta/classes
parentaf1cd61210619b97b362c40b875ff0aa81ff4546 (diff)
downloadpoky-28543c5780ab8f3d504a827bf37f3dc2fc1c5f12.tar.gz
package(rootfs)_ipk.bbclass: support multilib in opkg backend.
Support install multiple multilib in opkg backend. The installation is done in 3 phases. Phase 1: install normal packages to IMAGE_ROOTFS. Phase 2: install multilib packages under MULTILIB_TEMP_ROOTFS. Packages belongs to the same multilib arch would be installed to a unique directory. Phase 3: check file confliction between IMAGE_ROOTFS and MULTILIB_TEMP_ROOTFS, install multilib packages to IMAGE_ROOTFS only if the sanity check passed. (From OE-Core rev: 9d81c2166be7ed388e5616e01ca2b4059e524c8e) Signed-off-by: Lianhao Lu <lianhao.lu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/package_ipk.bbclass51
-rw-r--r--meta/classes/rootfs_ipk.bbclass2
2 files changed, 53 insertions, 0 deletions
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index 0c0f00d579..b7afa835ed 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -61,6 +61,28 @@ python package_ipk_install () {
61 raise bb.build.FuncFailed 61 raise bb.build.FuncFailed
62} 62}
63 63
64package_tryout_install_multilib_ipk() {
65 #try install multilib
66 multilib_tryout_dirs=""
67 for arch in ${MULTILIB_ARCHS}; do
68 local target_rootfs="${MULTILIB_TEMP_ROOTFS}/${arch}"
69 local ipkg_args="-f ${INSTALL_CONF_IPK} -o ${target_rootfs} --force_overwrite"
70 local selected_pkg=""
71 #strip the "ml" from package_arch
72 local pkgarch_prefix="${arch:2}-"
73 for pkg in "${INSTALL_PACKAGES_MULTILIB_IPK}"; do
74 if [ ${pkg:0:${#pkgarch_prefix}} == ${pkgarch_prefix} ]; then
75 selected_pkg="${selected_pkg} ${pkg}"
76 fi
77 done
78 if [ ! -z "${selected_pkg}" ]; then
79 mkdir -p ${target_rootfs}/${opkglibdir}
80 opkg-cl ${ipkg_args} update
81 opkg-cl ${ipkg_args} install ${selected_pkg}
82 multilib_tryout_dirs="${multilib_tryout_dirs} ${target_rootfs}"
83 fi
84 done
85}
64# 86#
65# install a bunch of packages using opkg 87# install a bunch of packages using opkg
66# the following shell variables needs to be set before calling this func: 88# the following shell variables needs to be set before calling this func:
@@ -78,6 +100,7 @@ package_install_internal_ipk() {
78 local package_to_install="${INSTALL_PACKAGES_NORMAL_IPK}" 100 local package_to_install="${INSTALL_PACKAGES_NORMAL_IPK}"
79 local package_attemptonly="${INSTALL_PACKAGES_ATTEMPTONLY_IPK}" 101 local package_attemptonly="${INSTALL_PACKAGES_ATTEMPTONLY_IPK}"
80 local package_lingusa="${INSTALL_PACKAGES_LINGUAS_IPK}" 102 local package_lingusa="${INSTALL_PACKAGES_LINGUAS_IPK}"
103 local package_multilib="${INSTALL_PACKAGES_MULTILIB_IPK}"
81 local task="${INSTALL_TASK_IPK}" 104 local task="${INSTALL_TASK_IPK}"
82 105
83 mkdir -p ${target_rootfs}${localstatedir}/lib/opkg/ 106 mkdir -p ${target_rootfs}${localstatedir}/lib/opkg/
@@ -102,6 +125,14 @@ package_install_internal_ipk() {
102 if [ ! -z "${package_attemptonly}" ]; then 125 if [ ! -z "${package_attemptonly}" ]; then
103 opkg-cl ${ipkg_args} install ${package_attemptonly} > "${WORKDIR}/temp/log.do_${task}_attemptonly.${PID}" || true 126 opkg-cl ${ipkg_args} install ${package_attemptonly} > "${WORKDIR}/temp/log.do_${task}_attemptonly.${PID}" || true
104 fi 127 fi
128
129 package_tryout_install_multilib_ipk
130 #sanity check
131 multilib_sanity_check ${target_rootfs} ${multilib_tryout_dirs}|| exit 1
132
133 if [ ! -z "${package_multilib}" ]; then
134 opkg-cl ${ipkg_args} install ${package_multilib}
135 fi
105} 136}
106 137
107ipk_log_check() { 138ipk_log_check() {
@@ -142,6 +173,11 @@ package_update_index_ipk () {
142 packagedirs="$packagedirs ${DEPLOY_DIR_IPK}/$arch ${DEPLOY_DIR_IPK}/$sdkarch-nativesdk" 173 packagedirs="$packagedirs ${DEPLOY_DIR_IPK}/$arch ${DEPLOY_DIR_IPK}/$sdkarch-nativesdk"
143 done 174 done
144 175
176 multilib_archs="${MULTILIB_ARCHS}"
177 for arch in $multilib_archs; do
178 packagedirs="$packagedirs ${DEPLOY_DIR_IPK}/$arch"
179 done
180
145 for pkgdir in $packagedirs; do 181 for pkgdir in $packagedirs; do
146 if [ -e $pkgdir/ ]; then 182 if [ -e $pkgdir/ ]; then
147 touch $pkgdir/Packages 183 touch $pkgdir/Packages
@@ -173,6 +209,13 @@ package_generate_ipkg_conf () {
173 echo "src oe-$sdkarch$extension file:${DEPLOY_DIR_IPK}/$sdkarch$extension" >> ${IPKGCONF_SDK} 209 echo "src oe-$sdkarch$extension file:${DEPLOY_DIR_IPK}/$sdkarch$extension" >> ${IPKGCONF_SDK}
174 fi 210 fi
175 done 211 done
212
213 multilib_archs="${MULTILIB_ARCHS}"
214 for arch in $multilib_archs; do
215 if [ -e ${DEPLOY_DIR_IPK}/$arch/Packages ] ; then
216 echo "src oe-$arch file:${DEPLOY_DIR_IPK}/$arch" >> ${IPKGCONF_TARGET}
217 fi
218 done
176} 219}
177 220
178package_generate_archlist () { 221package_generate_archlist () {
@@ -188,6 +231,14 @@ package_generate_archlist () {
188 echo "arch $sdkarch$extension $priority" >> ${IPKGCONF_SDK} 231 echo "arch $sdkarch$extension $priority" >> ${IPKGCONF_SDK}
189 priority=$(expr $priority + 5) 232 priority=$(expr $priority + 5)
190 done 233 done
234
235 multilib_archs="${MULTILIB_ARCHS}"
236 for arch in $multilib_archs; do
237 echo "arch $arch $priority" >> ${IPKGCONF_TARGET}
238 priority=$(expr $priority + 5)
239 done
240
241
191} 242}
192 243
193python do_package_ipk () { 244python do_package_ipk () {
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index 4fcacc67ec..695bee0296 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -22,6 +22,7 @@ opkglibdir = "${localstatedir}/lib/opkg"
22 22
23# Which packages to not install on the basis of a recommendation 23# Which packages to not install on the basis of a recommendation
24BAD_RECOMMENDATIONS ?= "" 24BAD_RECOMMENDATIONS ?= ""
25MULTILIBRE_ALLOW_REP = "${opkglibdir}"
25 26
26fakeroot rootfs_ipk_do_rootfs () { 27fakeroot rootfs_ipk_do_rootfs () {
27 set -x 28 set -x
@@ -58,6 +59,7 @@ fakeroot rootfs_ipk_do_rootfs () {
58 export INSTALL_ROOTFS_IPK="${IMAGE_ROOTFS}" 59 export INSTALL_ROOTFS_IPK="${IMAGE_ROOTFS}"
59 export INSTALL_CONF_IPK="${IPKGCONF_TARGET}" 60 export INSTALL_CONF_IPK="${IPKGCONF_TARGET}"
60 export INSTALL_PACKAGES_NORMAL_IPK="${PACKAGE_INSTALL}" 61 export INSTALL_PACKAGES_NORMAL_IPK="${PACKAGE_INSTALL}"
62 export INSTALL_PACKAGES_MULTILIB_IPK="${MULTILIB_PACKAGE_INSTALL}"
61 63
62 package_install_internal_ipk 64 package_install_internal_ipk
63 65