summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/utils
Commit message (Collapse)AuthorAgeFilesLines
* wic: accept '-' in bitbake variablesEnrico Scholz2017-11-051-1/+1
| | | | | | | | | | | | | | | | | | | '-' 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>
* 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>
* 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-011-24/+0
| | | | | | | | | | | | 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: raise WicError instead of calling logger.errorEd Bartosh2017-03-041-1/+1
| | | | | | | | | | 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: move WicError to lib/wic/__init__.pyEd Bartosh2017-03-042-2/+2
| | | | | | | | | | 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>
* wic: raise WicError in core modulesEd Bartosh2017-03-042-6/+6
| | | | | | | | | Replaced sys.exit with raising WicError in the core wic modules. (From OE-Core rev: 1b11437fb25ece5b3eede52344b071e875fa738f) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: move errors moduleEd Bartosh2017-03-041-29/+0
| | | | | | | | | Moved from lib/wic/utils/ to lib/wic as this is a core module. (From OE-Core rev: 808c70b81de5c3cfc3dcb01f08213e2ea33b7252) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: use wic logger in core modulesEd Bartosh2017-03-042-18/+26
| | | | | | | | | Replaced msger with wic logger in the core wic modules. (From OE-Core rev: cdd6675951b74075c9b9159f7465a88f83775bac) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: remove utils/oe/__init__.pyEd Bartosh2017-02-151-22/+0
| | | | | | | | | | This file and utils/oe folder are not needed anymore as all modules were removed or moved out of this directory. (From OE-Core rev: e3b73b1c07620cde423cc7db7e2f7d8b1ad25e25) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: move PartitionedImage class to direct.pyEd Bartosh2017-02-151-301/+0
| | | | | | | | | | | As PartitionedImage is only used in direct.py it makes sense to move it there. It's easier to maintain (and refactor) it this way. (From OE-Core rev: 2550622371f5c50857e5d58eabab01a1823c6fc3) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: move disk operations to PartitionImage classEd Bartosh2017-02-151-119/+75
| | | | | | | | | | | | | | | | | | | | | | | | Disk operations were spread over DirectPlugin, DiskImage and Image code making the code hard to understand. Renamed Image class to PartitionedImage. Removed DiskImage class. Moved disk operations to PartitionedImage. There was an implicit support for multiple disks: if different devices were specified in .wks file (e.g. --ondisk sda and --ondisk sdb), wic would theoretically generate multiple images. This is quite confusing option and the code supporting it was broken for a long time. The same effect (multiple output images) can be achieved in obvious and clear way - by using multiple .wks files. This functionality was removed. PartitionedImage works only with one image. This makes the code less complex and easier to maintain. (From OE-Core rev: 4dc9dbfc7fbc16d349a019e8973d50905cd28244) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: make sure layout_partitions is called onceEd Bartosh2017-02-151-12/+0
| | | | | | | | | | | Removed artificial _partitions_layed_out attribute and unneeded call of layout_partitions method. (From OE-Core rev: 702772edc839c220140ac0572bb14b4e44c81c1c) 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 the same partition object in direct and partitionedfsEd Bartosh2017-02-151-88/+70
| | | | | | | | | | | | | | Partition attributes were copied to the dictionary in partitionedfs code, which makes the code hard to follow. Used partition object passed from direct.py module as is in partitionedfs. (From OE-Core rev: 97db24d34847a641868f9ee83aae56f9dd5e0a8a) 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: partitionedfs: rename __create_partition and __add_diskEd Bartosh2017-02-151-8/+8
| | | | | | | | | | | | | | | Renamed private methods with leading double underscores: __create_partition -> _create_partition __add_disk -> _add_disk There is no point to have those names mangled, one underscore is enough. (From OE-Core rev: 26f3218070d34ccd4e81fa3b8e1a15c03583d070) 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: partitionedfs: get rid of __add_partitionEd Bartosh2017-02-151-10/+4
| | | | | | | | | | | | 3 lines long private method __add_partition is called only from add_partition method. Merged them together to increase readability. (From OE-Core rev: b7fb20fffada61211dda6d41f99407618428f23c) 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: partitionedfs: merged __format_disks and createEd Bartosh2017-02-151-10/+5
| | | | | | | | | | | | Private method __format_disks is called only from create method making the code less readable. Merged the code into one method. (From OE-Core rev: b76b1bd404487df38fd99bc0d0e6a59acb10c9d3) 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: remove syslinux.pyEd Bartosh2017-02-021-58/+0
| | | | | | | | | | This module contains singe function serial_console_form_kargs, which is used only by rootfs_pcbios_ext plugin. Moved it there and removed syslinux module to make it easy to find and mainain plugin code. [YOCTO #10619] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: code cleanupEd Bartosh2017-02-022-10/+6
| | | | | | | | | | | Fixed indentation, unused imports, trailing lines etc. [YOCTO #10619] (From OE-Core rev: 5fa7768bfb4b6d464c6a812822b0665f52e7bea4) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: move oe/misc.py one level upEd Bartosh2017-02-022-1/+1
| | | | | | | | | | | | Flattened directory structure: moved wic/utils/oe/misc.py -> wic/utils/misc.py [YOCTO #10619] (From OE-Core rev: 392532a2748ff2e6412eeb79163662b5168611ce) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: move 2 APIs to wic.engineEd Bartosh2017-02-021-56/+0
| | | | | | | | | | | | Moved find_canned and get_custom_config APIs to engine module. Removed empty wic.utils.misc module. [YOCTO #10619] (From OE-Core rev: 10e9afac46575d3f557b7cb505daa31ce9ce85fa) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wci: misc: removed build_name APIEd Bartosh2017-02-021-39/+0
| | | | | | | | | | | This API is not used in wic code. [YOCTO #10619] (From OE-Core rev: 9d14cb8bb8cf9559b7ff0efa03427624c18e2506) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: partition: simlify calling plugin methodsEd Bartosh2017-02-021-23/+0
| | | | | | | | | | | | | Replaced parse_sourceparams function with list comprehension. Used local variables instead of attributes. Moved global variable to the local scope. [YOCTO #10619] (From OE-Core rev: 4adbac84046ff744f1452b5ff4d017d17d2d45e2) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: partitionedfs: set partition name for gpt partitionsJukka Laitinen2017-01-311-0/+7
| | | | | | | | | | | Set proper gpt partition name for the partitions in case given in the configuration (From OE-Core rev: bc6e6a34f35bd081d828160bab8ee12e770c7e1e) Signed-off-by: Jukka Laitinen <jukka.laitinen@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: misc.py: add parameter 'cache' to get_bitbake_varsEd Bartosh2017-01-231-7/+12
| | | | | | | | | | | | This parameter will be used to allow or prevent variable caching. For example, we don't want to cache value of RECIPE_SYSROOT_NATIVE wic-tools variable as we may decide to rebuild wic-tools. (From OE-Core rev: e4269fdb4c3ef06b97df063f8586f74986215c83) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: fixed recipe nameEd Bartosh2017-01-231-1/+1
| | | | | | | | | | | Renamed grub-efi-native -> grub-efi in NATIVE_RECIPES dictionary as '-native' suffix is added to the recipe name in the code. (From OE-Core rev: cd0e7b20de2de67793d0454f4e5cf6bb6f4a16f7) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: partitionedfs: account for non-table partitions when checking if ↵Maciej Borzecki2017-01-191-1/+2
| | | | | | | | | | | | | | logical parititon is needed Commit 8c1c43b7901a9fcd8b279eb4250b08157ad345b7 `wic: Create a logical partition only when it is really mandatory` did not account for partitions that are not present in partition table. (From OE-Core rev: 57b05e924bba7b2fff07a34690474c0fa3046865) Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: _exec_cmd: produce error if exit code is not 0Ed Bartosh2017-01-161-10/+4
| | | | | | | | | | | | | | | | | | Current code doesn't always show error output of the external command and even ignores non-zero exit code. Moved checking of exit code value to the lowest level possible: to _exec_cmd. This should make wic to always check exit code of the external command and issue an error if it's not 0. [YOCTO #10816] (From OE-Core rev: 7f68001579c08509332d633b27b5c2ea9386b6c9) 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/isoimage-isohybrid: remove do_stage_partition()Ioan-Adrian Ratiu2017-01-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | The purpouse of this function was to check dependencies for building a hybrid iso and build them using bitbake if not found. Calling bitbake in this context means this wic plugin itself cannot be instrumented inside bitbake recipes which is undesirable, the benefits of this are clear: there is no need to maintain outside scripts to generate an iso using wic and the isohybrid building logic can be further abstracted away into an isohybrid.bbclass in the future which can be easily inherited or something similar. So remove the function and add all dependencies to NATIVE_RECIPES so that wic can print useful errors when they're not built. To automate building the isohybrid image dependencies, add the following somewhere in your image build inheritence hierarcy (or maybe create a bbclass in the future to do these sort of things automatically): DEPENDS += "syslinux syslinux-native cdrtools-native e2fsprogs-native \ parted-native dosfstools-native mtools-native grub-efi-native" (From OE-Core rev: ba4346069ab87f1cf942d1928f911eca6a9d65cd) Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: fix parsing of 'bitbake -e' outputEd Bartosh2017-01-161-8/+6
| | | | | | | | | | | | | | Current parsing code can wrongly interpret arbitrary lines that are of 'key=value' format as legitimate bitbake variables. Implemented more strict parsing of key=value pairs using regular expressions. (From OE-Core rev: f0ec387ad40fb9c098ac8d761993bc2bacc76e65) 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 --fixed-size wks optionMaciej Borzecki2016-12-221-1/+1
| | | | | | | | | | | | | | | | | Added new option --fixed-size to wks. The option can be used to indicate the exact size of a partition. The option cannot be added together with --size, in which case an error will be raised. Other options that influence automatic partition size (--extra-space, --overhead-factor), if specifiec along with --fixed-size, will raise an error. If it partition data is larger than the amount of space specified with --fixed-size option wic will raise an error. (From OE-Core rev: fdd217ba874bd480e0180830fe2e6bd54dde19d9) Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Create a logical partition only when it is really mandatoryAlessio Igor Bogani2016-12-131-3/+4
| | | | | | | | | | | Don't worth bother with logical partition on MBR partition type (aka msdos) if disk image generated by wic should have 4 partitions. (From OE-Core rev: 36a558fbdc96094626e7de1a3510691e30885368) Signed-off-by: Alessio Igor Bogani <alessio.bogani@elettra.eu> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: fix function comment typosMaciej Borzecki2016-11-151-2/+2
| | | | | | | | | | | Fix typos in documentation of Image.add_partition() and Image.__format_disks(). (From OE-Core rev: f5bf7bf253224912c66bab89f48ff63a73e0d698) Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: rewrite MBR disk identifierEd Bartosh2016-10-071-2/+10
| | | | | | | | | | | | | | | Disk identifier created by parted doesn't match the one we generated and used in bootloader config. We need to rewrite it to make our image bootable. Modified involved API and data structures to access previously generated disk identifiers after MBR is initialized. Written disk identifiers to MBR. (From OE-Core rev: 221d3bdd6e0ab8a4d25e2c96bd976cbec4e76681) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: set PARTUUID only for gpt partition tableEd Bartosh2016-10-071-1/+1
| | | | | | | | | | | | | sgdisk fails to set PARTUUID for msdos partitions as it's only supported for GPT partitions. Checked partition table format to run sgdisk --partition-guid only for GPT partitions. (From OE-Core rev: 0c1804821917d6d3a062ca19b63667d030138f21) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: remove partition imagesEd Bartosh2016-09-241-1/+8
| | | | | | | | | | | Preserving images for every partition doubles disk space consumed by an image build. As those images are not used, so it's better to remove them after assembling final image. (From OE-Core rev: 51171b4aa10f2218c5e27d785ca7bf4f3949a4b4) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: add bmaptool to the list of utilitiesEd Bartosh2016-05-191-1/+2
| | | | | | | | | | | | | Added bmaptool -> bmap-tools pair to the dictionary executable -> recipe as bmaptool is going to be used by wic to generate .bmap file. [YOCTO #9413] (From OE-Core rev: 4684ac5f4d823a6afedc57aad0aa417bb17ba950) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: decode output of subprocess.communicateEd Bartosh2016-05-141-2/+2
| | | | | | | | | | | | | | stdeout and stderr content returned by communicate API has different types in Python 3(bytes) and Python 2(string). Decoding it to 'utf-8' makes it unicode on both pythons. Decoded stdout and stderr output to utf-8 to make the code working under both Python 2 and Python 3. (From OE-Core rev: 5b556f58a171e3d45107bb56a1f780e5c1abba37) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: use // operator instead of /Ed Bartosh2016-05-141-3/+3
| | | | | | | | | | | | | | | Division operator works differently in Python 3. It results in float unlike in Python 2, where it results in int. Explicitly used "floor division" operator instead of 'division' operator. This should make the code to result in integer under both pythons. [YOCTO #9412] (From OE-Core rev: 997ff239bd753a7957cc14c6829b2f093d9bcef6) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: use find_executable in favor of bb.utils.whichEd Bartosh2016-05-141-8/+2
| | | | | | | | | | | | | | As bitbake is not ported to Python 3 yet it's better to avoid using its APIs as much as possible to be able to test wic under Python 3 at least partially. Used distutils.spawn.find_executable API in favor of bb.utils.which to get path of the command to run. (From OE-Core rev: 9658956bf8a5da779e06f71941de9b3e89415cdc) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: use new syntax of 'except' statementEd Bartosh2016-05-141-1/+1
| | | | | | | | | | | | | | New syntax 'except Exception as err' is supported by Python >= 2.7. Old syntax 'except Exception, err' is not supported by Python 3. Used new syntax to be able to run wic on Python 3. [YOCTO #9412] (From OE-Core rev: 15e88714d6b0a93f72e8a19b083fcc1f2006e128) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: don't inherit classes from objectEd Bartosh2016-05-141-1/+1
| | | | | | | | | | | | | | All classes in Python3 are new style classes and don't need to be inherited from object. Wic code works fine without this inheritance even with Python2, so it's harmless to remove it. [YOCTO #9412] (From OE-Core rev: a146b03ee7d0aa5bc1722da5977a5952782b69bf) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: don't use dict.keys and dict.has_keyEd Bartosh2016-05-141-3/+3
| | | | | | | | | | | | | Replaced calls of dict.keys and dict.has_key methods with the 'key in dict' statement. 'key in dict' is more pythonic, faster and readable. dict.has_key doesn't exist in Python 3. [YOCTO #9412] (From OE-Core rev: 003df7dfb932c551953fbf1bd769b3c31bd16fb4) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: replace print statements with print functionEd Bartosh2016-05-141-4/+4
| | | | | | | | | | | | | Print statements have been replaced with print function in Python 3. Replaced them in wic code to be able to run it under both Python 2 and Python 3. [YOCTO #9412] (From OE-Core rev: ee6979a19c77931c3cf6368e695e370d46192fef) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: use sparse_copy to copy partitionsEd Bartosh2016-05-061-4/+2
| | | | | | | | | | | | | | Copied partition images into final partitioned image using sparse_copy API. This method preserves sparseness of the final image. It also makes wic much faster, as unmapped blocks of the partition images are not copied. [YOCTO #9099] (From OE-Core rev: 7f21427aca5df81d8881027fd98f71b821cf31d7) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: moved DiskImage to direct.pyEd Bartosh2016-05-061-39/+0
| | | | | | | | | | | | | Moved DiskImage class from utils/fs_related.py to imager/direct.py as it's only used there. Removed fs_related module as it doesn't contain anything except of DiskImage. (From OE-Core rev: b3cc471790784c28f9362fcd6fc6a81c4316754c) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: get rid of fs_related.makedirsEd Bartosh2016-05-061-14/+0
| | | | | | | | | | Removed fs_related.makedirs as is not used anywhere. The name is easy to confuse with os.makedirs. (From OE-Core rev: 796b114863ef20fbc89da45dbe6780abe1256f5e) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>