]> code.ossystems Code Review - openembedded-core.git/commitdiff
rootfs_rpm.bbclass: save rpmlib rather than remove it
authorRobert Yang <liezhi.yang@windriver.com>
Tue, 13 Nov 2012 12:56:37 +0000 (20:56 +0800)
committerScott Garman <scott.a.garman@intel.com>
Fri, 30 Nov 2012 02:35:33 +0000 (18:35 -0800)
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)

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>
meta/classes/image.bbclass
meta/classes/rootfs_rpm.bbclass

index 9557433e8e02e789a98ccefe44873cb6a0a82cc8..90a6a9da7440925527814e897a50482f921c44f1 100644 (file)
@@ -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}
index 9039b21a07da0210c94073c4dae93fb9ddd2cbf0..fbc46c056a51e138121bb4023aea96682a5ba3ad 100644 (file)
@@ -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}
 }