summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic
Commit message (Collapse)AuthorAgeFilesLines
...
* wic: add help and usage content for 'wic ls'Ed Bartosh2017-06-141-0/+65
| | | | | | | | | | | | Added wic_ls_help and wic_ls_usage variables to help.py. These variables contain help content that will be used in 'wic ls help' and 'wic ls --help' output. (From OE-Core rev: 5152f993777550e5e8a420db4d1f3c4370cd1d33) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg-pcbios: make boot image file uniqueEd Bartosh2017-06-141-1/+1
| | | | | | | | | | | | | | Plugin code uses boot.img file name for an image file. If there are two partitions that use bootimg-pcbios wic breaks with an error "file already exists: boot.img" Made image file name unique by adding wks like number to it to fix the issue. (From OE-Core rev: eec6e946cce36cba304851fa4a1c1d7bfd7b0bed) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* filemap: add parameter 'length' to sparse_copyEd Bartosh2017-06-141-3/+12
| | | | | | | | | | | Added parameter 'length' to specify amount of data to write into destination file. This is useful when only part of source file should be written into destination file. (From OE-Core rev: cc44e2eb3b5027a3531e6349937a23d73313b3c6) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* filemap: fix skip logicEd Bartosh2017-06-141-4/+7
| | | | | | | | | | | | | Fixed bug in processing 'skip' parameter: don't read input file if end of bmap block is less than skip Simplified logic of positioning to the start of data inside a partially skipped bmap block. (From OE-Core rev: c19f78a0713c8ac9d28b78f86c6d7b96157788f0) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Remove obsolete reference to msger logger.Kristian Amlie2017-06-061-2/+5
| | | | | | | | | | This was overlooked when msger was removed in 28014087b8091. (From OE-Core rev: b561292c4e7b5578172066f82b6518b5bda53f42) 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>
* isoimage-isohybrid: don't use TRANSLATED_TARGET_ARCHEd Bartosh2017-06-031-4/+2
| | | | | | | | | | | | | | | | | | | | | | isoimage-isohybrid plugin fails with this error when trying to find initrd image: initrd = glob.glob('%s/%s*%s.%s' % (initrd_dir, image_name, target_arch, image_type))[0] IndexError: list index out of range as it uses TRANSLATED_TARGET_ARCH value as part of the image. This approach stopped to work due to changes in oe core code. initrd file name is made using MACHINE variable. wic can't get value of this variable as it's not included into bitbake -e output. Used basename of deploy dir as MACHINE value to fix the breakage. (From OE-Core rev: cfbb3cc1279ea88ca3e2867f8a409c5120aa1f05) (From OE-Core rev: e26fa1c34c33ffdc678f8073dade0126aff08b40) 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>
* wic: Add missing text to usage and help stringsAndreas J. Reichel2017-05-231-1/+1
| | | | | | | | | | | | | | Add missing parameters -c to and remove non-existent parameter -i from usage string for 'wic create'. (From OE-Core rev: da937e0e2478152968d5fd5eec7dd8cc2b922afb) Signed-off-by: Andreas Reichel <andreas.reichel.ext@siemens.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Daniel Wagner <daniel.wagner@siemens.com> 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>
* wic: Use argparse instead of optparseAndreas J. Reichel2017-05-232-12/+22
| | | | | | | | | | | | | | | | | | | * optparse is deprecated and will not be developed further (see: https://docs.python.org/2/library/optparse.html) * argparse supports subcommands, which simplifies definition of arguments and options * reimplement help mechanism through sub-subcommands [YOCTO #9636] (From OE-Core rev: 4fe9635c72a6ee1becc47d832ab54724176ee811) Signed-off-by: Andreas Reichel <andreas.reichel.ext@siemens.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Daniel Wagner <daniel.wagner@siemens.com> 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>
* wic: Fix typo in help screen.Kristian Amlie2017-04-291-1/+1
| | | | | | | | | | This was overlooked when f6a064d969f4149b 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>
* oe-selftest: test wic sparse_copy APIEd Bartosh2017-04-121-2/+4
| | | | | | | | | | | | | 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>
* qemux86-directdisk.wks: vda -> sdaRobert Yang2017-04-121-1/+1
| | | | | | | | | | | | 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>
* wic: improve error messageChen Qi2017-04-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* Revert "filemap: remove FilemapSeek class"Ed Bartosh2017-04-051-49/+260
| | | | | | | | | | | | | | | | | 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 6b80c13f7a82a312a3b981de5a56c66466ba1fac. (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>
* wic: partition: Update fsck parametersDaniel Schultz2017-04-011-1/+1
| | | | | | | | | | | | | 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>
* wic: remove prepare_empty_partition_squashfsEd Bartosh2017-04-011-29/+4
| | | | | | | | | | | | | | | | | | | | 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>
* wic: fix list of supported fstypes in help contentEd Bartosh2017-04-011-0/+2
| | | | | | | | | | | | 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>
* wic: set correct system id for msdos partitionsEd Bartosh2017-04-011-11/+2
| | | | | | | | | | | | 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>
* wic: set FAT 16 for msdos partitionsEd Bartosh2017-04-011-2/+12
| | | | | | | | | | | | 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>
* wic: support 'msdos' fstypeEd Bartosh2017-04-011-5/+9
| | | | | | | | | | | | | 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>
* wic: don't silently skip unknown fstypesEd Bartosh2017-04-011-19/+13
| | | | | | | | | | | 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>
* wic: allow only supported fstypesEd Bartosh2017-04-013-9/+5
| | | | | | | | | | | | | | 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>
* wic: remove unused code from runner moduleEd Bartosh2017-04-012-51/+13
| | | | | | | | | | | | | | 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>
* wic: remove runner.show APIEd Bartosh2017-04-012-28/+2
| | | | | | | | | | | | 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>
* wic: use wic-tools STAGING_DATADIR as bootimg_dirEd Bartosh2017-04-011-22/+20
| | | | | | | | | | | | 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>
* wic: remove fsimage pluginEd Bartosh2017-04-012-69/+0
| | | | | | | | | | | | | | 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>
* filemap: remove FilemapSeek classEd Bartosh2017-04-011-260/+49
| | | | | | | | | | | | | | 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>
* wic: fix generation of partition UUIDEd Bartosh2017-03-271-1/+1
| | | | | | | | | | | | | | | | | 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>
* wic: use kernel_dir to find systemd-efi bootloaderEd Bartosh2017-03-241-1/+1
| | | | | | | | | | | | | | 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>
* wic: improve getting syslinux pathEd Bartosh2017-03-231-24/+27
| | | | | | | | | | 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>
* wic: remove empty plugin methodsEd Bartosh2017-03-233-58/+0
| | | | | | | | | | | | | 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>
* wic: fix bug in sparse_copyEd Bartosh2017-03-231-0/+1
| | | | | | | | | | | | | | 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>
* wic: use kernel_dir instead of bootimg_dirEd Bartosh2017-03-233-18/+18
| | | | | | | | | | | | | | | 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>
* wic: don't set creator.bootimg_dir in pluginsEd Bartosh2017-03-232-4/+0
| | | | | | | | | | | 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>
* wic: remove rootfs_pcbios_ext pluginEd Bartosh2017-03-231-213/+0
| | | | | | | | | 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>
* wic: partition.py: Add fsck to avoid corrupt EXT file systemsDaniel Schultz2017-03-221-0/+3
| | | | | | | | | | | | | 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>
* wic/partionedfs: Avoid reserving space for non-existing ext. partitionKristian Amlie2017-03-221-2/+6
| | | | | | | | | | | | 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>
* wic/direct.py: Avoid exception if using multiple rawcopy/no-table entries.Kristian Amlie2017-03-111-1/+1
| | | | | | | | | | | | | | | | | 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>
* wic: filemap: Fixed spared_copy skipDaniel Schultz2017-03-101-3/+3
| | | | | | | | | | | | 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>
* wic: plugins: rawcopy: Fixed wrong variable typeDaniel Schultz2017-03-101-1/+1
| | | | | | | | | | | | | | | | | 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>
* wic: add more targets to directdisk syslinux configEd Bartosh2017-03-041-6/+22
| | | | | | | | | | | | | | 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>
* wic: bootimg-pcbios: add support for syslinux vesamenuEd Bartosh2017-03-041-7/+13
| | | | | | | | | | 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>
* wic: raise WicError instead of calling logger.errorEd Bartosh2017-03-042-3/+3
| | | | | | | | | | 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>
* wic: exec_native_cmd: fix undefined variable errorEd Bartosh2017-03-041-0/+1
| | | | | | | | | | 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>
* wic: exec_native_cmd: improve debug messageEd Bartosh2017-03-041-1/+1
| | | | | | | | | | | | 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>
* wic: use 2 sysroots to find native executableEd Bartosh2017-03-041-2/+6
| | | | | | | | | | | | | | | | | 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>
* wic: pluginbase: use global dictionaryEd Bartosh2017-03-041-17/+15
| | | | | | | | | | | | 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>
* wic: move PluginMgr class to pluginbaseEd Bartosh2017-03-046-74/+48
| | | | | | | | | | | 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>
* wic: plugin: cache results in get_pluginsEd Bartosh2017-03-041-10/+12
| | | | | | | | | | | | 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>
* wic: remove PluginMgr.get_plugin_methodsEd Bartosh2017-03-044-41/+13
| | | | | | | | | | 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>
* wic: throw exception if required API is not implementedEd Bartosh2017-03-041-0/+6
| | | | | | | | | | 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>