From patchwork Mon Feb 4 09:34:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3/5] populate_sdk:support incremental deb image generation Date: Mon, 04 Feb 2013 09:34:14 -0000 From: Hongxu Jia X-Patchwork-Id: 43969 Message-Id: To: 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 --- 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_ 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