diff options
Diffstat (limited to 'classes/rootfs_ipk.bbclass')
| -rw-r--r-- | classes/rootfs_ipk.bbclass | 107 |
1 files changed, 74 insertions, 33 deletions
diff --git a/classes/rootfs_ipk.bbclass b/classes/rootfs_ipk.bbclass index 03ba5f86b7..16dd511fcb 100644 --- a/classes/rootfs_ipk.bbclass +++ b/classes/rootfs_ipk.bbclass @@ -5,62 +5,98 @@ # See image.bbclass for a usage of this. # -DEPENDS_prepend="ipkg-native ipkg-utils-native fakeroot-native " -DEPENDS_append=" ${EXTRA_IMAGEDEPENDS}" -RDEPENDS += "ipkg ipkg-collateral" +do_rootfs[depends] += "opkg-native:do_populate_staging" -IPKG_ARGS = "-f ${T}/ipkg.conf -o ${IMAGE_ROOTFS}" +IPKG_ARGS = "-f ${IPKGCONF_TARGET} -o ${IMAGE_ROOTFS} ${@base_conditional("PACKAGE_INSTALL_NO_DEPS", "1", "-nodeps", "", d)}" -PACKAGE_INSTALL += "ipkg ipkg-collateral" +PACKAGE_INSTALL_NO_DEPS ?= "0" + +# What support to provide for online management of packages at run time? +# full -> traditional system, opkg is installed with all metadata +# add -> opkg is installed with basic conf files but no status database; can add new packages at runtime but not modify existing ones +# none -> opkg not installed at all, no metadata or config files provided +ONLINE_PACKAGE_MANAGEMENT ?= "full" + +# Which packages to not install on the basis of a recommendation +BAD_RECOMMENDATIONS ?= "" + +IPKG_VARIANT ?= "opkg" + +RDEPENDS_append = " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "${IPKG_VARIANT} opkg-collateral", d)}" +PACKAGE_INSTALL_append = " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "${IPKG_VARIANT} opkg-collateral", d)}" fakeroot rootfs_ipk_do_rootfs () { set -x - - mkdir -p ${IMAGE_ROOTFS}/dev - if [ -z "${DEPLOY_KEEP_PACKAGES}" ]; then - touch ${DEPLOY_DIR_IPK}/Packages - ipkg-make-index -r ${DEPLOY_DIR_IPK}/Packages -p ${DEPLOY_DIR_IPK}/Packages -l ${DEPLOY_DIR_IPK}/Packages.filelist -m ${DEPLOY_DIR_IPK} - fi + package_generate_ipkg_conf + mkdir -p ${T} - echo "src oe file:${DEPLOY_DIR_IPK}" > ${T}/ipkg.conf - ipkgarchs="${PACKAGE_ARCHS}" - priority=1 - for arch in $ipkgarchs; do - echo "arch $arch $priority" >> ${T}/ipkg.conf - priority=$(expr $priority + 5) + mkdir -p ${IMAGE_ROOTFS}${libdir}/opkg/ + + STATUS=${IMAGE_ROOTFS}${libdir}/opkg/status + # prime the status file with bits that we don't want + for i in ${BAD_RECOMMENDATIONS}; do + echo "Package: $i" >> $STATUS + echo "Architecture: ${TARGET_ARCH}" >> $STATUS + echo "Status: deinstall ok not-installed" >> $STATUS + echo >> $STATUS done - ipkg-cl ${IPKG_ARGS} update - if [ ! -z "${LINGUAS_INSTALL}" ]; then - ipkg-cl ${IPKG_ARGS} install glibc-localedata-i18n - for i in ${LINGUAS_INSTALL}; do - ipkg-cl ${IPKG_ARGS} install $i - done + + 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 "${LINGUAS_INSTALL}" ]; then + opkg-cl ${IPKG_ARGS} install glibc-localedata-i18n + for i in ${LINGUAS_INSTALL}; do + opkg-cl ${IPKG_ARGS} install $i + done + fi fi if [ ! -z "${PACKAGE_INSTALL}" ]; then - ipkg-cl ${IPKG_ARGS} install ${PACKAGE_INSTALL} + opkg-cl ${IPKG_ARGS} install ${PACKAGE_INSTALL} fi export D=${IMAGE_ROOTFS} export OFFLINE_ROOT=${IMAGE_ROOTFS} export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS} - mkdir -p ${IMAGE_ROOTFS}/etc/ipkg/ - grep "^arch" ${T}/ipkg.conf >${IMAGE_ROOTFS}/etc/ipkg/arch.conf + export OPKG_OFFLINE_ROOT=${IPKG_OFFLINE_ROOT} + + if [ "${ONLINE_PACKAGE_MANAGEMENT}" != "none" ]; then + mkdir -p ${IMAGE_ROOTFS}${sysconfdir}/opkg/ + grep "^arch" ${IPKGCONF_TARGET} >${IMAGE_ROOTFS}${sysconfdir}/opkg/arch.conf + fi - for i in ${IMAGE_ROOTFS}${libdir}/ipkg/info/*.preinst; do + for i in ${IMAGE_ROOTFS}${libdir}/opkg/info/*.preinst; do if [ -f $i ] && ! sh $i; then - ipkg-cl ${IPKG_ARGS} flag unpacked `basename $i .preinst` + opkg-cl ${IPKG_ARGS} flag unpacked `basename $i .preinst` fi done - for i in ${IMAGE_ROOTFS}${libdir}/ipkg/info/*.postinst; do + for i in ${IMAGE_ROOTFS}${libdir}/opkg/info/*.postinst; do if [ -f $i ] && ! sh $i configure; then - ipkg-cl ${IPKG_ARGS} flag unpacked `basename $i .postinst` + opkg-cl ${IPKG_ARGS} flag unpacked `basename $i .postinst` fi done install -d ${IMAGE_ROOTFS}/${sysconfdir} echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version + if [ "${ONLINE_PACKAGE_MANAGEMENT}" != "none" ]; then + if [ "${ONLINE_PACKAGE_MANAGEMENT}" == "add" ]; then + rm -f ${IMAGE_ROOTFS}${libdir}/opkg/status + rm -f ${IMAGE_ROOTFS}${libdir}/opkg/*/* + else + rm -f ${IMAGE_ROOTFS}${libdir}/opkg/lists/* + fi + + # Keep these lines until package manager selection is implemented + ln -s opkg ${IMAGE_ROOTFS}${sysconfdir}/ipkg + ln -s opkg ${IMAGE_ROOTFS}${libdir}/ipkg + else + rm -rf ${IMAGE_ROOTFS}${libdir}/opkg + rm -rf ${IMAGE_ROOTFS}/usr/lib/opkg + fi + ${ROOTFS_POSTPROCESS_COMMAND} log_check rootfs @@ -71,12 +107,13 @@ rootfs_ipk_log_check() { lf_path="$2" lf_txt="`cat $lf_path`" - for keyword_die in "Cannot find package" "exit 1" ERR Fail + for keyword_die in "Cannot find package" "Cannot satisfy the following dependencies" \ + "exit 1" ERR Fail do - if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") >/dev/null 2>&1 + if (echo "$lf_txt" | grep -v log_check | grep -w "$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" + printf "log_check: Matched keyword: [$keyword_die]\n" echo "$lf_txt" | grep -v log_check | grep -i "$keyword_die" -C1 echo "" do_exit=1 @@ -85,3 +122,7 @@ rootfs_ipk_log_check() { test "$do_exit" = 1 && exit 1 true } + +remove_packaging_data_files() { + rm -rf ${IMAGE_ROOTFS}${libdir}/opkg/ +} |
