]> code.ossystems Code Review - openembedded-core.git/commitdiff
image.py: set bitbake variable ROOTFS_SIZE
authorEd Bartosh <ed.bartosh@linux.intel.com>
Wed, 19 Aug 2015 20:21:58 +0000 (23:21 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 30 Aug 2015 11:34:36 +0000 (12:34 +0100)
This variable is going to be used by wic to set partition
size. Setting it in image.py makes it possible for wic to
use it without calculating it again.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/lib/oe/image.py

index 699c30fa2bd9e8781a0ae03febbdd8bf5d8d7e68..d9121fc907eb38082f671496379e4c1285312c84 100644 (file)
@@ -262,14 +262,16 @@ class Image(ImageDepGraph):
     def _write_script(self, type, cmds):
         tempdir = self.d.getVar('T', True)
         script_name = os.path.join(tempdir, "create_image." + type)
+        rootfs_size = self._get_rootfs_size()
 
         self.d.setVar('img_creation_func', '\n'.join(cmds))
         self.d.setVarFlag('img_creation_func', 'func', 1)
         self.d.setVarFlag('img_creation_func', 'fakeroot', 1)
+        self.d.setVar('ROOTFS_SIZE', str(rootfs_size))
 
         with open(script_name, "w+") as script:
             script.write("%s" % bb.build.shell_trap_code())
-            script.write("export ROOTFS_SIZE=%d\n" % self._get_rootfs_size())
+            script.write("export ROOTFS_SIZE=%d\n" % rootfs_size)
             bb.data.emit_func('img_creation_func', script, self.d)
             script.write("img_creation_func\n")