diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2017-01-10 19:46:08 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-16 18:05:13 +0000 |
commit | c1bb8c9b141c42473fc4895276677340bd898bef (patch) | |
tree | 5646a65dda455b15be79664491bf0d2d4f1ee07a /scripts | |
parent | c52432498bdb9c32b2c448575de11f7478408c60 (diff) | |
download | poky-c1bb8c9b141c42473fc4895276677340bd898bef.tar.gz |
direct.py: fix getting image name
part.rootfs_dir was used as an image name in the code.
However, when multi-rootfs feature is used this attribute
points to the name of the rootfs, e.g. if --rootfs command line
is rootfs1=core-image-minimal partf.rootfs_dir is 'rootfs1'.
The code also fails when image name is not provided in wic
commandline. For example, when wic is called with
--rootfs-dir=<path> part.rootfs_dir will contain path and
wic will crash trying to call bitbake -e <path> to get
value of ROOTFS_SIZE variable.
Fixed the code by getting image name properly and checking
if it's not a path.
[YOCTO #10815]
(From OE-Core rev: 2e05d9709f1308fc95d3406b8a409ea982c5b474)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/wic/imager/direct.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py index 11ec15e33f..52828c10cd 100644 --- a/scripts/lib/wic/imager/direct.py +++ b/scripts/lib/wic/imager/direct.py | |||
@@ -270,8 +270,8 @@ class DirectImageCreator(BaseImageCreator): | |||
270 | # get rootfs size from bitbake variable if it's not set in .ks file | 270 | # get rootfs size from bitbake variable if it's not set in .ks file |
271 | if not part.size: | 271 | if not part.size: |
272 | # and if rootfs name is specified for the partition | 272 | # and if rootfs name is specified for the partition |
273 | image_name = part.rootfs_dir | 273 | image_name = self.rootfs_dir.get(part.rootfs_dir) |
274 | if image_name: | 274 | if image_name and os.path.sep not in image_name: |
275 | # Bitbake variable ROOTFS_SIZE is calculated in | 275 | # Bitbake variable ROOTFS_SIZE is calculated in |
276 | # Image._get_rootfs_size method from meta/lib/oe/image.py | 276 | # Image._get_rootfs_size method from meta/lib/oe/image.py |
277 | # using IMAGE_ROOTFS_SIZE, IMAGE_ROOTFS_ALIGNMENT, | 277 | # using IMAGE_ROOTFS_SIZE, IMAGE_ROOTFS_ALIGNMENT, |