[oe-commits] [openembedded-core] 19/56: wic: partition plugin wrongly assumes it is rootfs

git at git.openembedded.org git at git.openembedded.org
Sat Mar 3 09:13:44 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 6009e1062217ff8b925550e530a8560e85d64b17
Author: Paulo Neves <ptsneves at gmail.com>
AuthorDate: Sun Feb 25 17:49:25 2018 +0100

    wic: partition plugin wrongly assumes it is rootfs
    
    The partition plugin is used as the base for other plugins.
    One of the methods the plugins use, is the prepare_rootfs
    method.
    
    The prepare_rootfs method wrongly assumes that the value
    ROOTFS_SIZE from bitbake datastore is relevant to every
    invocation of prepare_rootfs, which it clearly is not, for
    example in the bootimg-partition case.
    
    This commit adds an optional argument to prepare_rootfs
    where a caller can tell prepare_rootfs if it is an actual
    rootfs and whether related rootfs information retrieved from
    bitbake is valid. The default behavior of this optional
    argument is to assume that the invocation is an actual
    rootfs, to maintain compatibility with previous
    implementations.
    
    Signed-off-by: Paulo Neves <ptsneves at gmail.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 scripts/lib/wic/partition.py                        | 4 ++--
 scripts/lib/wic/plugins/source/bootimg-partition.py | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index d455862..2178321 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -202,7 +202,7 @@ class Partition():
                            (self.mountpoint, self.size, self.fixed_size))
 
     def prepare_rootfs(self, cr_workdir, oe_builddir, rootfs_dir,
-                       native_sysroot):
+                       native_sysroot, real_rootfs = True):
         """
         Prepare content for a rootfs partition i.e. create a partition
         and fill it from a /rootfs dir.
@@ -226,7 +226,7 @@ class Partition():
             os.remove(rootfs)
 
         # Get rootfs size from bitbake variable if it's not set in .ks file
-        if not self.size:
+        if not self.size and real_rootfs:
             # Bitbake variable ROOTFS_SIZE is calculated in
             # Image._get_rootfs_size method from meta/lib/oe/image.py
             # using IMAGE_ROOTFS_SIZE, IMAGE_ROOTFS_ALIGNMENT,
diff --git a/scripts/lib/wic/plugins/source/bootimg-partition.py b/scripts/lib/wic/plugins/source/bootimg-partition.py
index 67e5498..b239fc0 100644
--- a/scripts/lib/wic/plugins/source/bootimg-partition.py
+++ b/scripts/lib/wic/plugins/source/bootimg-partition.py
@@ -129,4 +129,4 @@ class BootimgPartitionPlugin(SourcePlugin):
 
         logger.debug('Prepare boot partition using rootfs in %s', hdddir)
         part.prepare_rootfs(cr_workdir, oe_builddir, hdddir,
-                            native_sysroot)
+                            native_sysroot, False)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list