Bug 3534

Summary: incremental RPM generation does not work
Product: [Runtime] Package Management Issues Reporter: Stoicescu Cornel <corneliux.stoicescu>
Component: RPMAssignee: Robert Yang <liezhi.yang>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: Medium CC: sgw
Version: 1.3   
Target Milestone: 1.4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Attachments:
Description Flags
log.do_rootfs none

Description Stoicescu Cornel 2012-12-04 16:49:35 UTC
Created attachment 970 [details]
log.do_rootfs

1. Download poky source and prepare the build environment
2. Run "bitbake core-image-sato" to build an image
3. Add the following line to conf/local.conf:
INC_IMAGE_GEN = "1"
4. Make the following changes to meta/classes/image.bbclass:


# 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}
+               rm -rfv ${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


4. Run "bitbake core-image-sato" to build an image and check the log.do_rootfs. 

Result: Notice rootfs is always deleted.
Comment 1 Stoicescu Cornel 2012-12-04 16:50:00 UTC
Tested in master:

Build Configuration:
BB_VERSION        = "1.17.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-12.04"
TARGET_SYS        = "x86_64-poky-linux"
MACHINE           = "qemux86-64"
DISTRO            = "poky"
DISTRO_VERSION    = "1.3+snapshot-20121204"
TUNE_FEATURES     = "m64"
TARGET_FPU        = ""
meta
meta-yocto
meta-yocto-bsp    = "(nobranch):247b6a3754c2c50318e2a73d79981ba0e9cb560b"
Comment 2 Darren Hart 2012-12-04 17:13:16 UTC
Mark, can you have a look?
Comment 3 Mark Hatle 2012-12-04 17:16:07 UTC
It appears the option you configured is wrong.  It should be "INC_RPM_IMAGE_GEN" not "INC_IMAGE_GEN".

I have used this code recently and verified it is working properly.  (The removal code, not the actual incremental update code.)
Comment 4 Stoicescu Cornel 2012-12-05 09:41:53 UTC
I see the problem here. The test case had the wrong variable name. I will test this again. Thank you for the input!
Comment 5 Stoicescu Cornel 2012-12-06 09:06:39 UTC
After using INC_RPM_IMAGE_GEN = "1" the incremental rpm generation seems to be working fine, only processing the changed/added/removed packages. 

Marking this as invalid because of wrong configuration on my side.