image.bbclass: remove tmp/rootfs after image creation unless you set a variable
authorChris Larson <clarson@mvista.com>
Thu, 11 Jun 2009 00:20:23 +0000 (17:20 -0700)
committerChris Larson <clarson@mvista.com>
Wed, 17 Jun 2009 17:41:11 +0000 (10:41 -0700)
Set IMAGE_KEEPROOTFS to something other than the empty string to keep
tmp/rootfs around after image creation, otherwise it will be removed, as it's
not a fully functional filesystem, and causes much confusion among users as a
result.

Signed-off-by: Chris Larson <clarson@mvista.com>
Acked-by: Tom Rini <trini@embeddedalley.com>
Acked-by: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
classes/image.bbclass

index f0cc3b3..0d798fa 100644 (file)
@@ -17,6 +17,9 @@ IMAGE_INITSCRIPTS ?= "initscripts"
 #
 IMAGE_LOGIN_MANAGER ?= "tinylogin"
 
+IMAGE_KEEPROOTFS ?= ""
+IMAGE_KEEPROOTFS[doc] = "Set to non-empty to keep ${IMAGE_ROOTFS} around after image creation."
+
 IMAGE_BOOT ?= "${IMAGE_INITSCRIPTS} \
 ${IMAGE_DEV_MANAGER} \
 ${IMAGE_INIT_MANAGER} \
@@ -133,6 +136,7 @@ fakeroot do_rootfs () {
        ${IMAGE_POSTPROCESS_COMMAND}
        
        ${MACHINE_POSTPROCESS_COMMAND}
+       ${@['rm -rf ${IMAGE_ROOTFS}', ''][bool(d.getVar("IMAGE_KEEPROOTFS", 1))]}
 }
 
 do_deploy_to[nostamp] = "1"