diff options
author | Richard Purdie <richard@openedhand.com> | 2008-10-02 15:22:10 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2008-10-02 15:22:10 +0000 |
commit | 096b0cd29275043aafb820026a49e525089e15cf (patch) | |
tree | 3a5d866abf8e29512f239ba533fc021fce9502f1 /meta | |
parent | 66d13479c4e75b4e7e04ff639384c2574441112c (diff) | |
download | openembedded-core-096b0cd29275043aafb820026a49e525089e15cf.tar.gz openembedded-core-096b0cd29275043aafb820026a49e525089e15cf.tar.bz2 openembedded-core-096b0cd29275043aafb820026a49e525089e15cf.zip |
packaged-staging.bbclass: Add rpm package coverage
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5382 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/packaged-staging.bbclass | 14 | ||||
-rw-r--r-- | meta/classes/rootfs_rpm.bbclass | 36 |
2 files changed, 36 insertions, 14 deletions
diff --git a/meta/classes/packaged-staging.bbclass b/meta/classes/packaged-staging.bbclass index 4c468b8c77..a7dd1f80c1 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 533efb09b8..2d5f51af04 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 |