Commit Graph

353 Commits

Author SHA1 Message Date
Enrico Scholz 448d0be779 wic: accept '-' in bitbake variables
'-' is valid and common in bitbake variables (e.g. 'FOO_pn-bar'). Accept
it and other characters when reading the .env file.

Also, allow variables to be empty.

(From OE-Core rev: e688ac8e92d2bc451d8b2d437596f630bedccd2c)

(From OE-Core rev: 2a69250abf61e51f633033ddb672e8f459191899)

(From OE-Core rev: aa367a3583f6e1fb0e55f7ec46ddad13291f1c6f)

Signed-off-by: Enrico Scholz <enrico.scholz@ensc.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-05 22:39:46 +00:00
Kristian Amlie e3e78df1b2 wic: Fix typo in help screen.
This was overlooked when f6a064d969 was merged.

(From OE-Core rev: 29a209822488ab687abdb1ceffdd9c7af5b3db68)

Signed-off-by: Kristian Amlie <kristian.amlie@mender.io>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-29 11:17:22 +01:00
Ed Bartosh 8838dd2dbd oe-selftest: test wic sparse_copy API
Added new parameter 'api' to sparse_copy function to specify
underlying filemap API to use. By default sparse_copy will
try both available APIs.

Added test case for sparse_copy to wic test suite.

(From OE-Core rev: 88701cef6ba399e82f96ed1b0eef9a44ed8c1687)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-12 15:09:57 +01:00
Robert Yang 7792688ac2 qemux86-directdisk.wks: vda -> sda
Previously, runqemu grep root=/dev/sd or root=/dev/hd on the image, and
would use vda if no grep result, now we have set QB_DRIVE_TYPE to
"/dev/sd" by default, and the device will be /dev/sda, so use sda to
replace vda in the test case.

(From OE-Core rev: 3f1f42984021d87ac43aaa16f38b706c2c965e02)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-12 15:09:57 +01:00
Chen Qi 9cacf8488c wic: improve error message
When using `wic create mkefidisk -e core-image-minimal', the following
error message appeared.

  Please bake it with 'bitbake parted-native' and try again.

However, following this command doesn't do any help. The same problem
still appeared.

The problem is that when we 'bitbake parted-native', it doesn't have
anything to do with core-image-minimal. And the required tool 'parted'
is not under core-image-minimal's recipe-sysroot-native directory.

Improve the error message so that following it could get things done.

(From OE-Core rev: f0425c0a0f1c98f65bf61fd9aa7e023ed41a35fa)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-05 23:22:13 +01:00
Ed Bartosh b5bc885ba7 Revert "filemap: remove FilemapSeek class"
FIEMAP API is not supported by tmpfs file system, but
SEEK_HOLE/SEEK_DATA is supported.

Returned back FilemapSeek class that implements support
of SEEK_HOLE/SEEK_DATA API to make sparse_copy API working
on tmpfs again.

This reverts commit 6b80c13f7a.

(From OE-Core rev: e75bd6a7dd5c1b4bad039c35cf4a2ffc2f77c60a)

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>
2017-04-05 23:22:13 +01:00
Daniel Schultz 28997864e2 wic: partition: Update fsck parameters
These parameters are copied from the ext image class.

-D will let fsck perform further directory optimizations
-v might be helpful for debugging purpose

(From OE-Core rev: be93e378506a85772503005294503cfc348a552c)

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-01 08:14:58 +01:00
Ed Bartosh 67ec097bc3 wic: remove prepare_empty_partition_squashfs
There is not much sense in creation of empty squashfs
partition. It's also not possible to create empty squashfs
partition of specified size.

Even more, prepare_empty_partition_squashfs method is
absolutely broken. It raises exception when called and
even its signature differs from the rest of of similar
methods. It means that nobody uses it and it's safe
to remove it.

Removed prepare_empty_partition_squashfs method and
testing of empty squashfs partition.

(From OE-Core rev: 9152960f250cb4df1e559d747fb09005675a0d75)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-01 08:14:58 +01:00
Ed Bartosh d62a97ec54 wic: fix list of supported fstypes in help content
Added vfat and msdos to the list of supported fstypes in
'wic help kickstart' output.

[YOCTO #11137]

(From OE-Core rev: ab7f2a77e124d8859002619e7ba3117e8a165df7)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-01 08:14:58 +01:00
Ed Bartosh 1586663fb3 wic: set correct system id for msdos partitions
Explicitly set system id 0x6(FAT16) for msdos partitions.

Removed old code that attempts to achieve the same result
using 'parted ... lba off'.

(From OE-Core rev: 230452faf151e277bfb2b49526923f8097755b35)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-01 08:14:58 +01:00
Ed Bartosh e5959eb480 wic: set FAT 16 for msdos partitions
Used '-F 16' parameter for mkdosfs to create FAT16 partitions for
'msdos' partition type.

[YOCTO #11137]

(From OE-Core rev: b6243a03ced9a719a5801afcee014b03313cc43c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-01 08:14:58 +01:00
Ed Bartosh 88e1d55de2 wic: support 'msdos' fstype
Added prepare_empty_partition_msdos and prepare_rootfs_msdos
methods to support 'msdos' filesystem type.

Created aliases prepare_empty_partition_vfat and prepare_rootfs_vfat
to continue supporting creation of vfat patitiions.

(From OE-Core rev: f06c507078da72f616f45effe5005cc01615a17c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-01 08:14:57 +01:00
Ed Bartosh b4d15e0713 wic: don't silently skip unknown fstypes
Fixed wic code that loops through hard-coded list of known fstypes
to find prepare_rootfs_<fstype> or prepare_empty_partition_<fstype>
methods and silently skipping unknown fstypes.

(From OE-Core rev: ebb8fb5f81f473156c9aa4bf1965e538492a851b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-01 08:14:57 +01:00
Ed Bartosh 54cd064c66 wic: allow only supported fstypes
Restricted possible values of --fstype to the list of
supported types. This should catch incorrect values
when .wks file is being parsed.

Removed checks for empty fstype and mentioning of
unsupported fstype 'ontrackdm6aux3'.

(From OE-Core rev: 21af89a6d44ccea6aef975ffd2483a8fad1231de)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-01 08:14:57 +01:00
Ed Bartosh ad1bce56c4 wic: remove unused code from runner module
Removed unused APIs 'outs' and 'quiet'.
Removed 'catch' parameter from runner.runtool API as wic
uses only one value of it. Removed the code that handles
unused values of 'catch' parameter.

[YOCTO #10618]

(From OE-Core rev: 1e45a4f72b16c7ab64f46907d2d2ee9cd749dc23)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-01 08:14:57 +01:00
Ed Bartosh d39a158855 wic: remove runner.show API
Replaced runner.show call to exec_cmd call in bootimg-pcbios
plugin. Removed runner.show API as it's not used anywhere else.

[YOCTO #10618]

(From OE-Core rev: 9749336c37249af99c92478c3e4dc8821cb9a816)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-01 08:14:57 +01:00
Ed Bartosh 2122dd7718 wic: use wic-tools STAGING_DATADIR as bootimg_dir
If bootloader artifacts are not found in default bootimg_dir
use wic-tools sysroot for the same purpose. This should
prevent wic from failing if bootloader artifacts can't be
found in image native sysroot.

(From OE-Core rev: 9674bbd0585fc25ccd362f233b83d07ff8f6ff53)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-01 08:14:57 +01:00
Ed Bartosh 3a53361084 wic: remove fsimage plugin
Removed fsimage plugin and prepare_rootfs_from_fs_image API as
they duplicate functionality of rawcopy plugin. Fsimage plugin makes
wic to remove the image artifact from deployment directory, which
can cause problems too.

[YOCTO #10618]

(From OE-Core rev: 9a470752f5698f791f8f78e28d163a0b9c695186)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-01 08:14:57 +01:00
Ed Bartosh 6b80c13f7a filemap: remove FilemapSeek class
FIEMAP API was added to Linux kernel 2.6.28 back in 2008
SEEK_HOLE and SEEK_DATA API was added much letter.
As FIEMAP is used by filemap module as a default API it's
safe to remove FileMpSeek class as it's never used.

[YOCTO #10618]

(From OE-Core rev: 44e9406ea6e3263d2fb95e9d534a21f74f318480)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-01 08:14:57 +01:00
Ed Bartosh 871363251a wic: fix generation of partition UUID
Partition UUID for msdos partitioning is based on a 4 bytes long
system identifier. Wic uses random number to generate system
identifier. For the numbers starting with 0 partition uuid is
shorter, which makes wic images non-bootable as kernel expects
8 charactest in PARTUUID parameter.

Padded system identifier with '0' when generating partition UUID
to make it always 8 characters long. This should fix the boot
issue.

(From OE-Core rev: bdaba95af2b2c9174311374436f184d2a927f6f1)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-27 11:08:34 +01:00
Ed Bartosh cc970c23a7 wic: use kernel_dir to find systemd-efi bootloader
Fixed test failure caused by using bootimg_dir path
instead of kernel_dir to find systemd-efi bootloader:
FAIL: test_systemd_bootdisk (oeqa.selftest.wic.Wic)
...
FileNotFoundError: [Errno 2] No such file or directory:
'tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot/usr/share'

(From OE-Core rev: 552bd782d9ffe275b8fc7d7cb0b9aaceb51888c3)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-24 23:43:33 +00:00
Ed Bartosh fa10b24950 wic: improve getting syslinux path
Used wic-tools STAGING_DATADIR if syslinux can't be found
in default bootimg_dir.

(From OE-Core rev: 79a935cfc86ffce6f4b4f328b90337de36ba6dbb)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-23 13:19:49 +00:00
Ed Bartosh 5c04e37140 wic: remove empty plugin methods
Removed do_install_disk and do_configure_partition methods from
bootimage-partition, fsimage and rawcopy plugins as they're empy
and not used.

[YOCTO #10618]

(From OE-Core rev: d58c8ef2836418056f776a9586e0bb0d33afb788)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-23 13:19:49 +00:00
Ed Bartosh b78c564cca wic: fix bug in sparse_copy
sparse_copy creates output file that is smaller than input
file when input file ends with unmapped blocks.

Used truncate(<input file size>) when output file is created
to ensure the size of output file will always be equal to
the size of input file.

(From OE-Core rev: 567186f995302a095a771baede4ff5034d1d1862)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-23 13:19:49 +00:00
Ed Bartosh 627952a234 wic: use kernel_dir instead of bootimg_dir
bootimg_dir is usually set to the value of STAGING_DATADIR and
kernel_dir - to the value of DEPLOY_DIR_IMAGE, so usage of
kernel_dir is more logical in bootimg-efi, bootimg-partition and
rawcopy plugins.

Replaced usage of bootimg_dir to kernel_dir in 3 above mentioned
plugins that use DEPLOY_DIR_IMAGE as a default artifact location.

(From OE-Core rev: 48a5d67d7cafdeac821e6f35bea380521ef017d5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-23 13:19:49 +00:00
Ed Bartosh ce627abf86 wic: don't set creator.bootimg_dir in plugins
Changing bootimg_dir in plugins is a dangerous hack as this
value comes from wic command line and can be used by multiple
plugins.

(From OE-Core rev: 2457ea5338f7309316b474562b4723e8cb09286d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-23 13:19:49 +00:00
Ed Bartosh d38d526991 wic: remove rootfs_pcbios_ext plugin
Removed broken unused plugin.

(From OE-Core rev: 6d162118a2567ccbcdbc2a9ca14a8c358fa1a055)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-23 13:19:49 +00:00
Daniel Schultz 898de507d3 wic: partition.py: Add fsck to avoid corrupt EXT file systems
This patch avoids the creation of a corrupt EXT file system.

Since there are no checks if a EXT file system was successfully created,
this should add to prevent possible system failures.

(From OE-Core rev: 95ac3d0637cad7e12f246b8bd64ab64348df0483)

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:21 +00:00
Kristian Amlie 76d182c757 wic/partionedfs: Avoid reserving space for non-existing ext. partition
We don't need the gap that the extended partition occupies if we
already know that we have less than five partitions. Saves up to one
full alignment of space.

(From OE-Core rev: 485315dc170e29962a8848db38db73abafd0586e)

Signed-off-by: Kristian Amlie <kristian.amlie@mender.io>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:20 +00:00
Kristian Amlie 0cfcdf2e95 wic/direct.py: Avoid exception if using multiple rawcopy/no-table entries.
If we are both having a bootloader and a U-Boot environment file, we
can end up with two entries using "--source rawcopy" and "--no-table",
and since they reuse the same file [1], their cleanup handlers will
try to delete the same file twice. So make sure we only do it once.

[1] Although they reuse the same file, the resulting output is
correct, so it appears the file is accessed in properly sequential
order.

(From OE-Core rev: f1a3eac376c4600cdb128d870ad9b7e9d51ed9c0)

Signed-off-by: Kristian Amlie <kristian.amlie@mender.io>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-11 16:09:14 +00:00
Daniel Schultz 8dddce21c4 wic: filemap: Fixed spared_copy skip
This patches removes the empty space in front of the copied file which
was skipped. Without this reduction it's not possible to place a
partition with rawcopy and skip parameter on a desired alignment.

(From OE-Core rev: 5c024d71f9413b81ee1707dbc41f0721f8f27bdb)

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-10 14:50:10 +00:00
Daniel Schultz 52de84763d wic: plugins: rawcopy: Fixed wrong variable type
Without the int() function this variable will be a string. This will led
to a error in Filemap on line 545 due wrong types.

> [...]
>   File
> ".../poky/scripts/lib/wic/filemap.py", line 545, in sparse_copy
>     if start < skip < end:
> TypeError: unorderable types: int() < str()

(From OE-Core rev: 46b5814bcdc0e7e3cb293e877e2aa949baf5fef8)

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-10 14:50:10 +00:00
Ed Bartosh 13c54959dd wic: add more targets to directdisk syslinux config
Added 3 new targets to directdisk-bootloader-config.cfg to
match hddimg syslinux config.

This is a preparation for dropping hddimg in favor of wic.

[YOCTO #11044]

(From OE-Core rev: 95bf0af5293a7f5868abd85f4fc15f5c542bfd09)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:18 +00:00
Ed Bartosh bf3e8c4500 wic: bootimg-pcbios: add support for syslinux vesamenu
Installed vesamenu.c32 and its dependencies to support
vesamenu ui in syslinux config.

(From OE-Core rev: 6d7e57ca7e77f3164e4d24470bb1e3ee91a07a89)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:18 +00:00
Ed Bartosh aad85050d7 wic: raise WicError instead of calling logger.error
Replaced forgotten calls of logger.error with raising
WicError exception. Otherwise errors will be ignored.

(From OE-Core rev: 7a5156092699593903a4bedb4cb23cc6e42ea62e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:18 +00:00
Ed Bartosh e3c64a90d7 wic: exec_native_cmd: fix undefined variable error
Defined variable 'out' to fix this exception:
UnboundLocalError: local variable 'out' referenced before assignment

(From OE-Core rev: d994340ec32ec04226ec185a8998775602c8b8bf)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:18 +00:00
Ed Bartosh 97b07710c3 wic: exec_native_cmd: improve debug message
Added search paths to the debug message to make it
easier to see where the native command is searched.

[YOCTO #11017]

(From OE-Core rev: 3e78aa91aa07510a75ec2eecdd2dd00b1c583c26)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:18 +00:00
Ed Bartosh 6d5dd6e560 wic: use 2 sysroots to find native executable
Currently there is no way to specify a dependency on native
tools for wic without modifying wic-tools recipe. Obvious
way to make it more flexible is to use image sysroot and
wic-tools together to find an executable.

Modified run_native_cmd to use image and wic-tools sysroots
to find native executable.

[YOCTO #11017]

(From OE-Core rev: 06f976cb7c593ab14ee221365d9afbaf9de94a91)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:17 +00:00
Ed Bartosh c4b96817e5 wic: pluginbase: use global dictionary
Made PluginMeta to populate global PLUGINS dictionary that
is accessed by PluginMgr. This should make the code more
understandable as PluginMgr don't need to get data directly
from PlugnMeta attribute.

(From OE-Core rev: 68df14eb43103537279824c5f627cc5914b5282c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:17 +00:00
Ed Bartosh 0c0ed61992 wic: move PluginMgr class to pluginbase
As PluginMgr class contains only one method it's
better to move it to pluginbase to have all plugin
related APIs in one module.

(From OE-Core rev: 244585b369ecc0019002ca51bf7f8fd506234462)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:17 +00:00
Ed Bartosh 93b3eb37ff wic: plugin: cache results in get_plugins
Store results of PluginMgr.get_plugins to avoid
loading plugins more than once.

This should speed up finding plugins.

(From OE-Core rev: 95ba37b394d01a6ed81f32ffa03813a070d682dc)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:17 +00:00
Ed Bartosh b9839fd664 wic: remove PluginMgr.get_plugin_methods
Call methods directly instead of getting them with
get_plugin_methods and then calling.

(From OE-Core rev: efcd07fe17bf55441059b00a5becc3952e0a4075)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:17 +00:00
Ed Bartosh 59b72c0b26 wic: throw exception if required API is not implemented
Throw WicError if do_create method of imager plugin is
not implemented.

(From OE-Core rev: 87031c933047a37ddc26be3d04ea17b6e60ea10a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:17 +00:00
Ed Bartosh 455ce228df wic: pluginbase: use python 3 metaclass syntax
Used more readable syntax to specify metaclass for
the base plugin classes.

(From OE-Core rev: 808451f154867caef73e00af04f56f051b7d5f6b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:17 +00:00
Ed Bartosh d088d22a38 wic: reimplement PluginMgr.get_plugins
Removed all private methods and complicated logic.
Put all code to get plugins into get_plugins method.

(From OE-Core rev: 9b8c69cdc8500ce065dbe607ba07ee95c1016659)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:17 +00:00
Ed Bartosh d8cf70bf0f wic: reimplement PluginMgr.get_plugin_methods
Simplified the implementation of get_plugin_methods:
- get rid of looping over the dicrtionary, used access by key instead
- get rid of filling a dictionary that passed as a parameter

(From OE-Core rev: 875d4eede61b548d64f426c2ef077cc17e50cd45)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:17 +00:00
Ed Bartosh 27e172c3b6 wic: remove PluginMgr.get_source_plugins
Used get_plugins('source') instead of get_source_plugins to
unify and simplify API to get plugins.

(From OE-Core rev: aaab003e472416124d7342fc8c4a17c252b83f4d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:17 +00:00
Ed Bartosh ec7b604b1e wic: use PluginMgr directly
Instead of making a singleton object of PluginMgr class
it's simpler to use PluginMgr class directly as any class
is a singleton.

(From OE-Core rev: cbe7dbd31f2292416d8e801e142679c69d9a44bc)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:17 +00:00
Ed Bartosh f8a4bd9950 wic: move WicError to lib/wic/__init__.py
Removed unused exceptions from error.py
Moved definition of WicError to lib/wic/__init__.py

(From OE-Core rev: 15442d072bb6d93bd9b941726f93262503053da5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:17 +00:00
Ed Bartosh af17aa91b3 wic: raise WicError instead of ImageError and CreatorError
There is no need to raise special exceptions. Raising
WicError should be enough.

(From OE-Core rev: b952076cc9f458c3d5eb03e12dc3ec316a44804c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:17 +00:00