1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 00:59:48 +00:00

Factor ipkg index and conf file creation into package_ipk.bbclass

git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2637 311d38ba-8fff-0310-9ca6-ca027cbcb966
This commit is contained in:
Richard Purdie
2007-09-01 22:17:06 +00:00
parent a7c63ec482
commit c6938aad87
6 changed files with 88 additions and 52 deletions
+4
View File
@@ -0,0 +1,4 @@
PACKAGES = ""
do_build[recrdeptask] = "do_build"
+44
View File
@@ -4,6 +4,9 @@ BOOTSTRAP_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link"
DISTRO_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link"
IMAGE_PKGTYPE ?= "ipk"
IPKGCONF_TARGET = "${STAGING_ETCDIR_NATIVE}/ipkg.conf"
IPKGCONF_SDK = "${STAGING_ETCDIR_NATIVE}/ipkg-sdk.conf"
python package_ipk_fn () {
from bb import data
bb.data.setVar('PKGFN', bb.data.getVar('PKG',d), d)
@@ -60,6 +63,47 @@ python package_ipk_install () {
raise bb.build.FuncFailed
}
#
# Update the Packages index files in ${DEPLOY_DIR_IPK}
#
package_update_index_ipk () {
set -x
ipkgarchs="${PACKAGE_ARCHS}"
if [ ! -z "${DEPLOY_KEEP_PACKAGES}" ]; then
return
fi
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}
for arch in $ipkgarchs; do
if [ -e ${DEPLOY_DIR_IPK}/$arch/ ] ; then
touch ${DEPLOY_DIR_IPK}/$arch/Packages
ipkg-make-index -r ${DEPLOY_DIR_IPK}/$arch/Packages -p ${DEPLOY_DIR_IPK}/$arch/Packages -l ${DEPLOY_DIR_IPK}/$arch/Packages.filelist -m ${DEPLOY_DIR_IPK}/$arch/
fi
done
}
#
# Generate an ipkg conf file ${IPKGCONF_TARGET} suitable for use against
# the target system and an ipkg conf file ${IPKGCONF_SDK} suitable for
# use against the host system in sdk builds
#
package_generate_ipkg_conf () {
mkdir -p ${STAGING_ETCDIR_NATIVE}/
echo "src oe file:${DEPLOY_DIR_IPK}" > ${IPKGCONF_TARGET}
echo "src oe file:${DEPLOY_DIR_IPK}" > ${IPKGCONF_SDK}
ipkgarchs="${PACKAGE_ARCHS}"
priority=1
for arch in $ipkgarchs; do
echo "arch $arch $priority" >> ${IPKGCONF_TARGET}
echo "arch ${BUILD_ARCH}-$arch-sdk $priority" >> ${IPKGCONF_SDK}
priority=$(expr $priority + 5)
done
}
python do_package_ipk () {
import sys, re, fcntl, copy
+5 -30
View File
@@ -8,41 +8,16 @@
do_rootfs[depends] += "ipkg-native:do_populate_staging ipkg-utils-native:do_populate_staging"
do_rootfs[recrdeptask] += "do_package_write_ipk"
IPKG_ARGS = "-f ${T}/ipkg.conf -o ${IMAGE_ROOTFS}"
rootfs_ipk_do_indexes () {
set -x
ipkgarchs="${PACKAGE_ARCHS}"
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
for arch in $ipkgarchs; do
if [ -z "${DEPLOY_KEEP_PACKAGES}" ]; then
if [ -e ${DEPLOY_DIR_IPK}/$arch/ ] ; then
touch ${DEPLOY_DIR_IPK}/$arch/Packages
ipkg-make-index -r ${DEPLOY_DIR_IPK}/$arch/Packages -p ${DEPLOY_DIR_IPK}/$arch/Packages -l ${DEPLOY_DIR_IPK}/$arch/Packages.filelist -m ${DEPLOY_DIR_IPK}/$arch/
fi
fi
done
}
IPKG_ARGS = "-f ${IPKGCONF_TARGET} -o ${IMAGE_ROOTFS}"
fakeroot rootfs_ipk_do_rootfs () {
set -x
rootfs_ipk_do_indexes
package_update_index_ipk
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)
done
ipkg-cl ${IPKG_ARGS} update
if [ ! -z "${LINGUAS_INSTALL}" ]; then
ipkg-cl ${IPKG_ARGS} install glibc-localedata-i18n
@@ -58,7 +33,7 @@ fakeroot rootfs_ipk_do_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
grep "^arch" ${IPKGCONF_TARGET} >${IMAGE_ROOTFS}/etc/ipkg/arch.conf
for i in ${IMAGE_ROOTFS}${libdir}/ipkg/info/*.preinst; do
if [ -f $i ] && ! sh $i; then
+27
View File
@@ -0,0 +1,27 @@
# Task packages are only used to pull in other packages
# via their dependencies. They are empty.
ALLOW_EMPTY = "1"
# By default, only the task package itself is in PACKAGES.
# -dbg and -dev flavours are handled by the anonfunc below.
# This means that task recipes used to build multiple task
# packages have to modify PACKAGES after inheriting task.bbclass.
PACKAGES = "${PN}"
# By default, task packages do not depend on a certain architecture.
# Only if dependencies are modified by MACHINE_FEATURES, packages
# need to be set to MACHINE_ARCH after inheriting task.bbclass
PACKAGE_ARCH = "all"
# This automatically adds -dbg and -dev flavours of all PACKAGES
# to the list. Their dependencies (RRECOMMENDS) are handled as usual
# by package_depchains in a following step.
python () {
packages = bb.data.getVar('PACKAGES', d, 1).split()
genpackages = []
for pkg in packages:
for postfix in ['-dbg', '-dev']:
genpackages.append(pkg+postfix)
bb.data.setVar('PACKAGES', ' '.join(packages+genpackages), d)
}