diff options
author | Tom Zanussi <tom.zanussi@linux.intel.com> | 2014-08-08 13:28:54 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-08-11 10:52:18 +0100 |
commit | b4232041534a79236eb8d8ab5c0024a0ef4da649 (patch) | |
tree | 68fb94ec1945fa3f03cbbd1e78ad9a2568973f79 /scripts | |
parent | 1b103bf4a7c7527d4fc57bad1bbd1d5a5bbddb4a (diff) | |
download | openembedded-core-b4232041534a79236eb8d8ab5c0024a0ef4da649.tar.gz openembedded-core-b4232041534a79236eb8d8ab5c0024a0ef4da649.tar.bz2 openembedded-core-b4232041534a79236eb8d8ab5c0024a0ef4da649.zip |
wic: Update/rename install-related code
The wic code inherited a basic image-creation flow based on installing
packages, but wic doesn't actually install anything, so rename parts
of the code dealing with installing to something more appropriate.
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/mic/imager/direct.py | 50 | ||||
-rw-r--r-- | scripts/lib/mic/plugins/imager/direct_plugin.py | 2 | ||||
-rw-r--r-- | scripts/lib/mic/utils/partitionedfs.py | 16 |
3 files changed, 34 insertions, 34 deletions
diff --git a/scripts/lib/mic/imager/direct.py b/scripts/lib/mic/imager/direct.py index 91f64d52cf..8d7b6ee804 100644 --- a/scripts/lib/mic/imager/direct.py +++ b/scripts/lib/mic/imager/direct.py @@ -62,7 +62,7 @@ class DirectImageCreator(BaseImageCreator): """ BaseImageCreator.__init__(self, creatoropts) - self.__instimage = None + self.__image = None self.__disks = {} self.__disk_format = "direct" self._disk_names = [] @@ -226,7 +226,7 @@ class DirectImageCreator(BaseImageCreator): """ parts = self._get_parts() - self.__instimage = PartitionedMount() + self.__image = PartitionedMount() for p in parts: # as a convenience, set source to the boot partition source @@ -250,39 +250,39 @@ class DirectImageCreator(BaseImageCreator): self._restore_fstab(fstab) - self.__instimage.add_partition(int(p.size), - p.disk, - p.mountpoint, - p.source_file, - p.fstype, - p.label, - fsopts = p.fsopts, - boot = p.active, - align = p.align, - part_type = p.part_type) + self.__image.add_partition(int(p.size), + p.disk, + p.mountpoint, + p.source_file, + p.fstype, + p.label, + fsopts = p.fsopts, + boot = p.active, + align = p.align, + part_type = p.part_type) - self.__instimage.layout_partitions(self._ptable_format) + self.__image.layout_partitions(self._ptable_format) self.__imgdir = self.workdir - for disk_name, disk in self.__instimage.disks.items(): + for disk_name, disk in self.__image.disks.items(): full_path = self._full_path(self.__imgdir, disk_name, "direct") msger.debug("Adding disk %s as %s with size %s bytes" \ % (disk_name, full_path, disk['min_size'])) disk_obj = fs_related.DiskImage(full_path, disk['min_size']) self.__disks[disk_name] = disk_obj - self.__instimage.add_disk(disk_name, disk_obj) + self.__image.add_disk(disk_name, disk_obj) - self.__instimage.create() + self.__image.create() - def install(self): + def assemble(self): """ - Install fs images into partitions + Assemble partitions into disk image(s) """ - for disk_name, disk in self.__instimage.disks.items(): + for disk_name, disk in self.__image.disks.items(): full_path = self._full_path(self.__imgdir, disk_name, "direct") - msger.debug("Installing disk %s as %s with size %s bytes" \ + msger.debug("Assembling disk %s as %s with size %s bytes" \ % (disk_name, full_path, disk['min_size'])) - self.__instimage.install(full_path) + self.__image.assemble(full_path) def configure(self): """ @@ -294,7 +294,7 @@ class DirectImageCreator(BaseImageCreator): source_plugin = self.get_default_source_plugin() if source_plugin: self._source_methods = pluginmgr.get_source_plugin_methods(source_plugin, disk_methods) - for disk_name, disk in self.__instimage.disks.items(): + for disk_name, disk in self.__image.disks.items(): self._source_methods["do_install_disk"](disk, disk_name, self, self.workdir, self.oe_builddir, @@ -310,7 +310,7 @@ class DirectImageCreator(BaseImageCreator): parts = self._get_parts() - for disk_name, disk in self.__instimage.disks.items(): + for disk_name, disk in self.__image.disks.items(): full_path = self._full_path(self.__imgdir, disk_name, "direct") msg += ' %s\n\n' % full_path @@ -355,9 +355,9 @@ class DirectImageCreator(BaseImageCreator): return (rootdev, root_part_uuid) def _cleanup(self): - if not self.__instimage is None: + if not self.__image is None: try: - self.__instimage.cleanup() + self.__image.cleanup() except MountError, err: msger.warning("%s" % err) diff --git a/scripts/lib/mic/plugins/imager/direct_plugin.py b/scripts/lib/mic/plugins/imager/direct_plugin.py index da18b65f54..2cbd5d11fc 100644 --- a/scripts/lib/mic/plugins/imager/direct_plugin.py +++ b/scripts/lib/mic/plugins/imager/direct_plugin.py @@ -92,7 +92,7 @@ class DirectPlugin(ImagerPlugin): try: creator.create() - creator.install() + creator.assemble() creator.configure() creator.print_outimage_info() diff --git a/scripts/lib/mic/utils/partitionedfs.py b/scripts/lib/mic/utils/partitionedfs.py index 43a38a9b14..2f950a69d4 100644 --- a/scripts/lib/mic/utils/partitionedfs.py +++ b/scripts/lib/mic/utils/partitionedfs.py @@ -309,11 +309,11 @@ class PartitionedMount: except: pass - def __install_partition(self, num, source_file, start, size): + def __write_partition(self, num, source_file, start, size): """ Install source_file contents into a partition. """ - if not source_file: # nothing to install + if not source_file: # nothing to write return # Start is included in the size so need to substract one from the end. @@ -325,7 +325,7 @@ class PartitionedMount: exec_cmd(dd_cmd) - def install(self, image_file): + def assemble(self, image_file): msger.debug("Installing partitions") self.image_file = image_file @@ -337,12 +337,12 @@ class PartitionedMount: # of the first _logical_ partition. This is why the extended # partition should start one sector before the first logical # partition. - self.__install_partition(p['num'], p['source_file'], - p['start'] - 1, - d['offset'] - p['start']) + self.__write_partition(p['num'], p['source_file'], + p['start'] - 1, + d['offset'] - p['start']) - self.__install_partition(p['num'], p['source_file'], - p['start'], p['size']) + self.__write_partition(p['num'], p['source_file'], + p['start'], p['size']) def create(self): for dev in self.disks.keys(): |