summaryrefslogtreecommitdiff
path: root/meta/classes/package_ipk.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/package_ipk.bbclass')
-rw-r--r--meta/classes/package_ipk.bbclass70
1 files changed, 64 insertions, 6 deletions
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index 5ddd6c66ea..3c2472bc10 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -62,6 +62,69 @@ python package_ipk_install () {
}
#
+# install a bunch of packages using opkg
+# the following shell variables needs to be set before calling this func:
+# INSTALL_ROOTFS_IPK - install root dir
+# INSTALL_CONF_IPK - configuration file
+# INSTALL_PACKAGES_NORMAL_IPK - packages to be installed
+# INSTALL_PACKAGES_ATTEMPTONLY_IPK - packages attemped to be installed only
+# INSTALL_PACKAGES_LINGUAS_IPK - additional packages for uclibc
+# INSTALL_TASK_IPK - task name
+
+package_install_internal_ipk() {
+
+ local target_rootfs="${INSTALL_ROOTFS_IPK}"
+ local conffile="${INSTALL_CONF_IPK}"
+ local package_to_install="${INSTALL_PACKAGES_NORMAL_IPK}"
+ local package_attemptonly="${INSTALL_PACKAGES_ATTEMPTONLY_IPK}"
+ local package_lingusa="${INSTALL_PACKAGES_LINGUAS_IPK}"
+ local task="${INSTALL_TASK_IPK}"
+
+ mkdir -p ${target_rootfs}${localstatedir}/lib/opkg/
+
+ local ipkg_args="-f ${conffile} -o ${target_rootfs} --force-overwrite"
+
+ opkg-cl ${ipkg_args} update
+
+ # Uclibc builds don't provide this stuff...
+ if [ x${TARGET_OS} = "xlinux" ] || [ x${TARGET_OS} = "xlinux-gnueabi" ] ; then
+ if [ ! -z "${package_lingusa}" ]; then
+ for i in ${package_lingusa}; do
+ opkg-cl ${ipkg_args} install $i
+ done
+ fi
+ fi
+
+ if [ ! -z "${package_to_install}" ]; then
+ opkg-cl ${ipkg_args} install ${package_to_install}
+ fi
+
+ if [ ! -z "${package_attemptonly}" ]; then
+ opkg-cl ${ipkg_args} install ${package_attemptonly} > "${WORKDIR}/temp/log.do_${task}_attemptonly.${PID}" || true
+ fi
+}
+
+ipk_log_check() {
+ target="$1"
+ lf_path="$2"
+
+ lf_txt="`cat $lf_path`"
+ for keyword_die in "exit 1" "Collected errors" ERR Fail
+ do
+ if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") >/dev/null 2>&1
+ then
+ echo "log_check: There were error messages in the logfile"
+ echo -e "log_check: Matched keyword: [$keyword_die]\n"
+ echo "$lf_txt" | grep -v log_check | grep -C 5 -i "$keyword_die"
+ echo ""
+ do_exit=1
+ fi
+ done
+ test "$do_exit" = 1 && exit 1
+ true
+}
+
+#
# Update the Packages index files in ${DEPLOY_DIR_IPK}
#
package_update_index_ipk () {
@@ -133,17 +196,12 @@ python do_package_ipk () {
workdir = bb.data.getVar('WORKDIR', d, True)
outdir = bb.data.getVar('PKGWRITEDIRIPK', d, True)
- dvar = bb.data.getVar('D', d, True)
tmpdir = bb.data.getVar('TMPDIR', d, True)
pkgdest = bb.data.getVar('PKGDEST', d, True)
- if not workdir or not outdir or not dvar or not tmpdir:
+ if not workdir or not outdir or not tmpdir:
bb.error("Variables incorrectly set, unable to package")
return
- if not os.path.exists(dvar):
- bb.debug(1, "Nothing installed, nothing to do")
- return
-
packages = bb.data.getVar('PACKAGES', d, True)
if not packages or packages == '':
bb.debug(1, "No packages; nothing to do")