aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/plugins
AgeCommit message (Collapse)Author
2017-03-22wic: improve getting syslinux pathEd Bartosh
Used wic-tools STAGING_DATADIR if syslinux can't be found in default bootimg_dir. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22wic: remove empty plugin methodsEd Bartosh
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] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22wic: use kernel_dir instead of bootimg_dirEd Bartosh
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. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22wic: don't set creator.bootimg_dir in pluginsEd Bartosh
Changing bootimg_dir in plugins is a dangerous hack as this value comes from wic command line and can be used by multiple plugins. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22wic: remove rootfs_pcbios_ext pluginEd Bartosh
Removed broken unused plugin. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-21wic/partionedfs: Avoid reserving space for non-existing ext. partitionKristian Amlie
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. Signed-off-by: Kristian Amlie <kristian.amlie@mender.io> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-03-11wic/direct.py: Avoid exception if using multiple rawcopy/no-table entries.Kristian Amlie
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. Signed-off-by: Kristian Amlie <kristian.amlie@mender.io> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-03-10wic: plugins: rawcopy: Fixed wrong variable typeDaniel Schultz
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() Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-03-04wic: bootimg-pcbios: add support for syslinux vesamenuEd Bartosh
Installed vesamenu.c32 and its dependencies to support vesamenu ui in syslinux config. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-03-04wic: raise WicError instead of calling logger.errorEd Bartosh
Replaced forgotten calls of logger.error with raising WicError exception. Otherwise errors will be ignored. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-03-04wic: move PluginMgr class to pluginbaseEd Bartosh
As PluginMgr class contains only one method it's better to move it to pluginbase to have all plugin related APIs in one module. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-03-04wic: remove PluginMgr.get_plugin_methodsEd Bartosh
Call methods directly instead of getting them with get_plugin_methods and then calling. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-03-04wic: reimplement PluginMgr.get_plugin_methodsEd Bartosh
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 Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-03-04wic: use PluginMgr directlyEd Bartosh
Instead of making a singleton object of PluginMgr class it's simpler to use PluginMgr class directly as any class is a singleton. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-03-04wic: move WicError to lib/wic/__init__.pyEd Bartosh
Removed unused exceptions from error.py Moved definition of WicError to lib/wic/__init__.py Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-03-04wic: raise WicError instead of ImageError and CreatorErrorEd Bartosh
There is no need to raise special exceptions. Raising WicError should be enough. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-03-04wic: raise WicError in wic pluginsEd Bartosh
Replaced sys.exit with raising WicError in wic plugins. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-03-04wic: move errors moduleEd Bartosh
Moved from lib/wic/utils/ to lib/wic as this is a core module. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-03-04wic: use wic logger in wic source pluginsEd Bartosh
Replaced msger with wic logger in wic source plugins. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-03-04wic: use wic logger in imager direct pluginEd Bartosh
Replaced msger with wic logger in the direct plugin. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-15wic: direct: move creation of PartitionedImage to __init__Ed Bartosh
Moved creation of PartitionedImage object from DirectPlugin.create method to init. It makes the code a bit more readable and logical. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-15wic: direct: move generation of part.realnum to PartitionedImageEd Bartosh
Moved the code that generates real partition numbers from DirectPlugin to PartitionedImage. The idea is to have all code that works with partitions in PartitionedImage class. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-15wic: direct: add PartitionedImage.prepare methodEd Bartosh
Moved code that calls prepare method of Partition objects from DirectPlugin to PartitionedImage.prepare. The idea is to have all code that works with partitions in PartitionedImage class. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-15wic: direct: set bootloader.source in the __init__Ed Bartosh
Moved setting of bootloader source from do_create method to __init__ as it doesn't have anything to do with image creation. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-15wic: direct: move UUID generation to PartitionedImageEd Bartosh
Moved code that generates partition UUIDs from DirectPlugin to PartitionedImage class as it's more logical to have it there. This allows the code to be reused by other imager plugins. Got rid of having yet another list of partitions in PartitionedImage. Reused the list passed from DirectPlugin. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-15wic: direct: add 'realnum' attribute to partitionEd Bartosh
Replaced call of _get_part_num method with an attribute. This eliminates the need to call the method and loop over partitions every time we need to know realnum for partition. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-15wic: direct: remove useless codeEd Bartosh
Removed catching CreatorError and raising it again. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-15wic: direct: don't catch ImagerErrorEd Bartosh
Don't transform ImagerError exception into warning. Let wic to catch it on the upper level. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-15wic: direct: remove set_bootimg_dir setterEd Bartosh
Removed java-like setter set_bootimg_dir. It's more pythonic to access public attributes directly. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-15wic: move PartitionedImage class to direct.pyEd Bartosh
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. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-15wic: move disk operations to PartitionImage classEd Bartosh
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. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-15wic: Add --exclude-path option to rootfs source plugin.Kristian Amlie
It will omit the given path from the resulting partition, and if the given path ends in a slash, it will only delete the content, and keep the directory. Since mkfs only accepts whole directories as input, we need to copy the rootfs directory to the workdir so that we can selectively delete files from it. Since we want to use the copyhardlinktree() function, we need to put the generic oe lib in the module search path. Signed-off-by: Kristian Amlie <kristian.amlie@mender.io> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-02-15wic: remove unused argument scripts_pathEd Bartosh
There is no need to pass scripts_path from main wic module down the stack as it's not used there. Removed scripts_path argument from DirectPlugin class and wic_create function. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-02-15wic: direct: remove unused importEd Bartosh
Removed unused import of wic.errors module. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-02-15wic: direct: remove unused plugin attributesEd Bartosh
Removed unused _disks, _disk_format and _disk_names attributes from DirectPlugin class. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-02-15wic: use the same partition object in direct and partitionedfsEd Bartosh
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. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-02-15wic: direct: get rid of _get_parts getterEd Bartosh
Replaced _get_parts getter with direct attribute access to self.parts Removed code that implicitly created partition if there are no partitions mentioned in .wks file Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-02-05wic: fix call of serial_console_form_kargsEd Bartosh
As syslinux module has been recently removed and serial_consloe_form_kargs became local API in rootfs_pcbios_ext plugin it should be called without syslinux. prefix. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-02-05wic: isoimage-isohybrid: use wic-tools to get syslinux pathEd Bartosh
wic-tools recipe specific sysroot contains syslinux as wic-tools depends on it. Used wic-tools target to get syslinux path should guarantee that syslinux is installed there and can be used. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-02-05wic: flatten imager class hierarchyEd Bartosh
wic code is hard to follow due to deep and twiggy class inheritance tree. Flatten imager tree: wic -> wic_create -> Creator -> DirectPlugin -> DirectImageCreator to wic -> wic_create -> DirectPlugin by removing Creator class and creator module merging DirectImageCreator into DirectPlugin Changed APIs to use the same parameters names. Passed parsed command line options as an object down the stack. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-02-02wic: direct: fix creation of work directoryEd Bartosh
It was a typo in current code: mktemp was used instead of mkdtemp to create work directory. This is fixed by using mkdtemp. Create work directory as a subdirectory of output directory to make sure both are on the same partition to make moving of result image faster. This also fixes possible disk space issues as mkdtemp uses TMPDIR, TEMP or TMP environment variables to get default value of its 'dir' parameter. Those variables are usually pointing to /tmp, which is not the best location to create huge images. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-02-02wic: remove syslinux.pyEd Bartosh
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]
2017-02-02wic: code cleanupEd Bartosh
Fixed indentation, unused imports, trailing lines etc. [YOCTO #10619] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-02wic: move oe/misc.py one level upEd Bartosh
Flattened directory structure: moved wic/utils/oe/misc.py -> wic/utils/misc.py [YOCTO #10619] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-02wic: move 2 APIs to wic.engineEd Bartosh
Moved find_canned and get_custom_config APIs to engine module. Removed empty wic.utils.misc module. [YOCTO #10619] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-02wic: renamd direct_plugin.py -> direct.pyEd Bartosh
As this files is located in plugins/imager subdirectory it's obvious that it's an imager plugin. Renamed to direct.py to be consistent with plugin naming scheme. [YOCTO #10619] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-02wic: simplified code of direct_pluginEd Bartosh
Removed unused methods. Got rid of get_default_source_plugin and _full_name methods. [YOCTO #10619] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-02wic: pylinted direct_pluginEd Bartosh
Fixed wrong continued indentation, unused import and trailing new line pyling warnings. [YOCTO #10619] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-02wic: improve naming in direct_plugin classesEd Bartosh
Synchronized attribure names in DirectImageCreator and DirectPlugin for better readability. Simplified code, removed unneeded global variable disk_methods. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-02wic: get rid of __rootfs_dir_to_dict methodEd Bartosh
Replaced class method __rootfs_dir_to_dict with a list comprehension. [YOCTO #10619] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>