When use the incremental image generation, and the type of previous image
has no change, don't remove the rootfs

Signed-off-by: Hongxu Jia <[email protected]>
---
 meta/classes/populate_sdk_base.bbclass |   13 ++++++++++---
 meta/classes/populate_sdk_deb.bbclass  |    2 +-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/meta/classes/populate_sdk_base.bbclass 
b/meta/classes/populate_sdk_base.bbclass
index c587af8..783682f 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -65,8 +65,15 @@ fakeroot python do_populate_sdk() {
 }
 
 fakeroot populate_sdk_image() {
-       rm -rf ${SDK_OUTPUT}
-       mkdir -p ${SDK_OUTPUT}
+
+       # When use the incremental image generation, and the type of previous 
image
+       # has no change, don't remove the rootfs
+       if [ "${INC_DEB_IMAGE_GEN}" = "1" -a -d ${T}/dpkg ]; then
+               echo "NOTE: Start incremental generation"
+       else
+               rm -rf ${SDK_OUTPUT}
+               mkdir -p ${SDK_OUTPUT}
+       fi
 
        # populate_sdk_<image> is required to construct two images:
        #  SDK_ARCH-nativesdk - contains the cross compiler and associated 
tooling
@@ -90,7 +97,7 @@ fakeroot populate_sdk_image() {
        rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/*.la
 
        # Link the ld.so.cache file into the hosts filesystem
-       ln -s /etc/ld.so.cache ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.cache
+       ln -snf /etc/ld.so.cache ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.cache
 }
 
 fakeroot create_sdk_files() {
diff --git a/meta/classes/populate_sdk_deb.bbclass 
b/meta/classes/populate_sdk_deb.bbclass
index e1705e7b..687f63d 100644
--- a/meta/classes/populate_sdk_deb.bbclass
+++ b/meta/classes/populate_sdk_deb.bbclass
@@ -60,7 +60,7 @@ populate_sdk_deb () {
 
        #move remainings
        install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}/var/lib/dpkg
-       mv ${SDK_OUTPUT}/var/lib/dpkg/* 
${SDK_OUTPUT}/${SDKPATHNATIVE}/var/lib/dpkg
+       cp -rf ${SDK_OUTPUT}/var/lib/dpkg/* 
${SDK_OUTPUT}/${SDKPATHNATIVE}/var/lib/dpkg
        rm -rf ${SDK_OUTPUT}/var
 
        populate_sdk_log_check populate_sdk
-- 
1.7.10.4


_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Reply via email to