From 096b0cd29275043aafb820026a49e525089e15cf Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 2 Oct 2008 15:22:10 +0000 Subject: packaged-staging.bbclass: Add rpm package coverage git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5382 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- meta/classes/packaged-staging.bbclass | 14 ++++++++++++++ meta/classes/rootfs_rpm.bbclass | 36 +++++++++++++++++++++-------------- 2 files changed, 36 insertions(+), 14 deletions(-) (limited to 'meta') diff --git a/meta/classes/packaged-staging.bbclass b/meta/classes/packaged-staging.bbclass index 4c468b8c7..a7dd1f80c 100644 --- a/meta/classes/packaged-staging.bbclass +++ b/meta/classes/packaged-staging.bbclass @@ -361,6 +361,8 @@ python do_package_stage () { ipkpath = bb.data.getVar('DEPLOY_DIR_IPK', d, True).replace(tmpdir, stagepath) if bb.data.inherits_class('package_deb', d): debpath = bb.data.getVar('DEPLOY_DIR_DEB', d, True).replace(tmpdir, stagepath) + if bb.data.inherits_class('package_rpm', d): + rpmpath = bb.data.getVar('DEPLOY_DIR_RPM', d, True).replace(tmpdir, stagepath) for pkg in packages: pkgname = bb.data.getVar('PKG_%s' % pkg, d, 1) @@ -393,6 +395,18 @@ python do_package_stage () { bb.mkdirhier(destpath) bb.copyfile(srcfile, destpath + srcname) + if bb.data.inherits_class('package_rpm', d): + version = bb.data.getVar('PV', d, 1) + version = version.replace('-', '+') + bb.data.setVar('RPMPV', version, d) + srcname = bb.data.expand(pkgname + "-${RPMPV}-" + pr + ".${TARGET_ARCH}.rpm", d) + srcfile = bb.data.expand("${DEPLOY_DIR_RPM}/" + arch + "/" + srcname, d) + if os.path.exists(srcfile): + destpath = rpmpath + "/" + arch + "/" + bb.mkdirhier(destpath) + bb.copyfile(srcfile, destpath + srcname) + + # # Handle stamps/ files # diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass index 533efb09b..2d5f51af0 100644 --- a/meta/classes/rootfs_rpm.bbclass +++ b/meta/classes/rootfs_rpm.bbclass @@ -17,18 +17,9 @@ AWKPOSTINSTSCRIPT = "${STAGING_BINDIR_NATIVE}/extract-postinst.awk" fakeroot rootfs_rpm_do_rootfs () { set -x - # Update the repository index - createrepo ${DEPLOY_DIR_RPM} - mkdir -p ${IMAGE_ROOTFS}/etc/rpm/ #echo "arm" > ${IMAGE_ROOTFS}/etc/rpm/platform - # Copy the packages into the target image - # Ugly ugly ugly but rpm is braindead and can't see outside the chroot - # when installing :( - mkdir -p ${IMAGE_ROOTFS}${DEPLOY_DIR_RPM} - cp -r ${DEPLOY_DIR_RPM}/* ${IMAGE_ROOTFS}${DEPLOY_DIR_RPM}/ - # Generate an apprpriate yum.conf rm -rf ${YUMCONF} cat > ${YUMCONF} << EOF @@ -43,12 +34,29 @@ tolerant=1 arch=arm basearch=arm -[poky-feed] -name = Poky RPM Feed -baseurl=file://${DEPLOY_DIR_RPM} -gpgcheck=0 - EOF + + #priority=1 + for arch in ${PACKAGE_ARCHS}; do + if [ ! -d ${DEPLOY_DIR_RPM}/$arch ]; then + continue; + fi + createrepo ${DEPLOY_DIR_RPM}/$arch + + echo "[poky-feed-$arch]" >> ${YUMCONF} + echo "name = Poky RPM $arch Feed" >> ${YUMCONF} + echo "baseurl=file://${DEPLOY_DIR_RPM}/$arch" >> ${YUMCONF} + echo "gpgcheck=0" >> ${YUMCONF} + echo "" >> ${YUMCONF} + #priority=$(expr $priority + 5) + done + + # Copy the packages into the target image + # Ugly ugly ugly but rpm is braindead and can't see outside the chroot + # when installing :( + mkdir -p ${IMAGE_ROOTFS}${DEPLOY_DIR_RPM} + cp -r ${DEPLOY_DIR_RPM}/* ${IMAGE_ROOTFS}${DEPLOY_DIR_RPM}/ + #mkdir -p ${IMAGE_ROOTFS}/var/lib/rpm #rpm --root ${IMAGE_ROOTFS} --initdb #rpm --root ${IMAGE_ROOTFS} --dbpath ${IMAGE_ROOTFS}/var/lib/rpm -ihv --nodeps --ignoreos -- cgit v1.2.3