summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2012-11-13 20:56:37 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-12-07 15:58:17 +0000
commit95f2a5b635d2d5ad41b02356c0b507b2fcae89f9 (patch)
tree99733db64044c338d643c8b17e3fbc964ac56b9a
parent75997b4565bcbefd3e6c30f279650e126dd96919 (diff)
downloadpoky-95f2a5b635d2d5ad41b02356c0b507b2fcae89f9.tar.gz
poky-95f2a5b635d2d5ad41b02356c0b507b2fcae89f9.tar.bz2
poky-95f2a5b635d2d5ad41b02356c0b507b2fcae89f9.zip
rootfs_rpm.bbclass: save rpmlib rather than remove it
The rpmlib was removed when images that add "remove_packaging_data_files" to ROOTFS_POSTPROCESS_COMMAND, which would make the increment rpm image generation doesn't work in the second build, since list_installed_packages would get incorrect value in the second build, move the rpmlib to ${T} rather than remove it, and move it back when INC_RPM_IMAGE_GEN =1. [YOCTO #2690] (From OE-Core rev: c30e79510c06701f10f659eedaa0fe785538ac17) (From OE-Core rev: 15e13ea1fc8a0c29b4ca68c31c83ca013c89c36e) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/image.bbclass6
-rw-r--r--meta/classes/rootfs_rpm.bbclass6
2 files changed, 11 insertions, 1 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 9557433e8e..90a6a9da74 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -143,6 +143,12 @@ fakeroot do_rootfs () {
# When use the rpm incremental image generation, don't remove the rootfs
if [ "${INC_RPM_IMAGE_GEN}" != "1" -o "${IMAGE_PKGTYPE}" != "rpm" ]; then
rm -rf ${IMAGE_ROOTFS}
+ elif [ -d ${T}/saved_rpmlib/var/lib/rpm ]; then
+ # Move the rpmlib back
+ if [ ! -d ${IMAGE_ROOTFS}/var/lib/rpm ]; then
+ mkdir -p ${IMAGE_ROOTFS}/var/lib/
+ mv ${T}/saved_rpmlib/var/lib/rpm ${IMAGE_ROOTFS}/var/lib/
+ fi
fi
rm -rf ${MULTILIB_TEMP_ROOTFS}
mkdir -p ${IMAGE_ROOTFS}
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index 9039b21a07..fbc46c056a 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -154,7 +154,11 @@ EOF
}
remove_packaging_data_files() {
- rm -rf ${IMAGE_ROOTFS}${rpmlibdir}
+ # Save the rpmlib for increment rpm image generation
+ t="${T}/saved_rpmlib/var/lib"
+ rm -fr $t
+ mkdir -p $t
+ mv ${IMAGE_ROOTFS}${rpmlibdir} $t
rm -rf ${IMAGE_ROOTFS}${opkglibdir}
}