diff options
author | Paulo Neves <ptsneves@gmail.com> | 2018-02-25 17:49:25 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-03-04 11:35:40 +0000 |
commit | 5796b037d551e22c56ad4ed0e32a8e3939282cba (patch) | |
tree | 0f7d338358232bada5c596e513d5686418e261b4 /scripts/lib/wic/partition.py | |
parent | 8eb7e66246cf7c72dc68862f1c287029080a2e8a (diff) | |
download | poky-5796b037d551e22c56ad4ed0e32a8e3939282cba.tar.gz |
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.
(From OE-Core rev: 654d72d55194ec41bc1aacfcc6b2c8c9a305b042)
Signed-off-by: Paulo Neves <ptsneves@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/partition.py')
-rw-r--r-- | scripts/lib/wic/partition.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py index d4558621a9..2178321404 100644 --- a/scripts/lib/wic/partition.py +++ b/scripts/lib/wic/partition.py | |||
@@ -202,7 +202,7 @@ class Partition(): | |||
202 | (self.mountpoint, self.size, self.fixed_size)) | 202 | (self.mountpoint, self.size, self.fixed_size)) |
203 | 203 | ||
204 | def prepare_rootfs(self, cr_workdir, oe_builddir, rootfs_dir, | 204 | def prepare_rootfs(self, cr_workdir, oe_builddir, rootfs_dir, |
205 | native_sysroot): | 205 | native_sysroot, real_rootfs = True): |
206 | """ | 206 | """ |
207 | Prepare content for a rootfs partition i.e. create a partition | 207 | Prepare content for a rootfs partition i.e. create a partition |
208 | and fill it from a /rootfs dir. | 208 | and fill it from a /rootfs dir. |
@@ -226,7 +226,7 @@ class Partition(): | |||
226 | os.remove(rootfs) | 226 | os.remove(rootfs) |
227 | 227 | ||
228 | # Get rootfs size from bitbake variable if it's not set in .ks file | 228 | # Get rootfs size from bitbake variable if it's not set in .ks file |
229 | if not self.size: | 229 | if not self.size and real_rootfs: |
230 | # Bitbake variable ROOTFS_SIZE is calculated in | 230 | # Bitbake variable ROOTFS_SIZE is calculated in |
231 | # Image._get_rootfs_size method from meta/lib/oe/image.py | 231 | # Image._get_rootfs_size method from meta/lib/oe/image.py |
232 | # using IMAGE_ROOTFS_SIZE, IMAGE_ROOTFS_ALIGNMENT, | 232 | # using IMAGE_ROOTFS_SIZE, IMAGE_ROOTFS_ALIGNMENT, |