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:53:12 +0100 |
commit | d02c91fe4db69fa780d7d1924105446208a66819 (patch) | |
tree | 41265108e778de4eb099534a1d544fd525360fe8 /scripts | |
parent | 467bf7e68f537b9475241e4cd3450100d0146ab2 (diff) | |
download | poky-d02c91fe4db69fa780d7d1924105446208a66819.tar.gz |
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.
(From OE-Core rev: b4232041534a79236eb8d8ab5c0024a0ef4da649)
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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): | |||
62 | """ | 62 | """ |
63 | BaseImageCreator.__init__(self, creatoropts) | 63 | BaseImageCreator.__init__(self, creatoropts) |
64 | 64 | ||
65 | self.__instimage = None | 65 | self.__image = None |
66 | self.__disks = {} | 66 | self.__disks = {} |
67 | self.__disk_format = "direct" | 67 | self.__disk_format = "direct" |
68 | self._disk_names = [] | 68 | self._disk_names = [] |
@@ -226,7 +226,7 @@ class DirectImageCreator(BaseImageCreator): | |||
226 | """ | 226 | """ |
227 | parts = self._get_parts() | 227 | parts = self._get_parts() |
228 | 228 | ||
229 | self.__instimage = PartitionedMount() | 229 | self.__image = PartitionedMount() |
230 | 230 | ||
231 | for p in parts: | 231 | for p in parts: |
232 | # as a convenience, set source to the boot partition source | 232 | # as a convenience, set source to the boot partition source |
@@ -250,39 +250,39 @@ class DirectImageCreator(BaseImageCreator): | |||
250 | 250 | ||
251 | self._restore_fstab(fstab) | 251 | self._restore_fstab(fstab) |
252 | 252 | ||
253 | self.__instimage.add_partition(int(p.size), | 253 | self.__image.add_partition(int(p.size), |
254 | p.disk, | 254 | p.disk, |
255 | p.mountpoint, | 255 | p.mountpoint, |
256 | p.source_file, | 256 | p.source_file, |
257 | p.fstype, | 257 | p.fstype, |
258 | p.label, | 258 | p.label, |
259 | fsopts = p.fsopts, | 259 | fsopts = p.fsopts, |
260 | boot = p.active, | 260 | boot = p.active, |
261 | align = p.align, | 261 | align = p.align, |
262 | part_type = p.part_type) | 262 | part_type = p.part_type) |
263 | 263 | ||
264 | self.__instimage.layout_partitions(self._ptable_format) | 264 | self.__image.layout_partitions(self._ptable_format) |
265 | 265 | ||
266 | self.__imgdir = self.workdir | 266 | self.__imgdir = self.workdir |
267 | for disk_name, disk in self.__instimage.disks.items(): | 267 | for disk_name, disk in self.__image.disks.items(): |
268 | full_path = self._full_path(self.__imgdir, disk_name, "direct") | 268 | full_path = self._full_path(self.__imgdir, disk_name, "direct") |
269 | msger.debug("Adding disk %s as %s with size %s bytes" \ | 269 | msger.debug("Adding disk %s as %s with size %s bytes" \ |
270 | % (disk_name, full_path, disk['min_size'])) | 270 | % (disk_name, full_path, disk['min_size'])) |
271 | disk_obj = fs_related.DiskImage(full_path, disk['min_size']) | 271 | disk_obj = fs_related.DiskImage(full_path, disk['min_size']) |
272 | self.__disks[disk_name] = disk_obj | 272 | self.__disks[disk_name] = disk_obj |
273 | self.__instimage.add_disk(disk_name, disk_obj) | 273 | self.__image.add_disk(disk_name, disk_obj) |
274 | 274 | ||
275 | self.__instimage.create() | 275 | self.__image.create() |
276 | 276 | ||
277 | def install(self): | 277 | def assemble(self): |
278 | """ | 278 | """ |
279 | Install fs images into partitions | 279 | Assemble partitions into disk image(s) |
280 | """ | 280 | """ |
281 | for disk_name, disk in self.__instimage.disks.items(): | 281 | for disk_name, disk in self.__image.disks.items(): |
282 | full_path = self._full_path(self.__imgdir, disk_name, "direct") | 282 | full_path = self._full_path(self.__imgdir, disk_name, "direct") |
283 | msger.debug("Installing disk %s as %s with size %s bytes" \ | 283 | msger.debug("Assembling disk %s as %s with size %s bytes" \ |
284 | % (disk_name, full_path, disk['min_size'])) | 284 | % (disk_name, full_path, disk['min_size'])) |
285 | self.__instimage.install(full_path) | 285 | self.__image.assemble(full_path) |
286 | 286 | ||
287 | def configure(self): | 287 | def configure(self): |
288 | """ | 288 | """ |
@@ -294,7 +294,7 @@ class DirectImageCreator(BaseImageCreator): | |||
294 | source_plugin = self.get_default_source_plugin() | 294 | source_plugin = self.get_default_source_plugin() |
295 | if source_plugin: | 295 | if source_plugin: |
296 | self._source_methods = pluginmgr.get_source_plugin_methods(source_plugin, disk_methods) | 296 | self._source_methods = pluginmgr.get_source_plugin_methods(source_plugin, disk_methods) |
297 | for disk_name, disk in self.__instimage.disks.items(): | 297 | for disk_name, disk in self.__image.disks.items(): |
298 | self._source_methods["do_install_disk"](disk, disk_name, self, | 298 | self._source_methods["do_install_disk"](disk, disk_name, self, |
299 | self.workdir, | 299 | self.workdir, |
300 | self.oe_builddir, | 300 | self.oe_builddir, |
@@ -310,7 +310,7 @@ class DirectImageCreator(BaseImageCreator): | |||
310 | 310 | ||
311 | parts = self._get_parts() | 311 | parts = self._get_parts() |
312 | 312 | ||
313 | for disk_name, disk in self.__instimage.disks.items(): | 313 | for disk_name, disk in self.__image.disks.items(): |
314 | full_path = self._full_path(self.__imgdir, disk_name, "direct") | 314 | full_path = self._full_path(self.__imgdir, disk_name, "direct") |
315 | msg += ' %s\n\n' % full_path | 315 | msg += ' %s\n\n' % full_path |
316 | 316 | ||
@@ -355,9 +355,9 @@ class DirectImageCreator(BaseImageCreator): | |||
355 | return (rootdev, root_part_uuid) | 355 | return (rootdev, root_part_uuid) |
356 | 356 | ||
357 | def _cleanup(self): | 357 | def _cleanup(self): |
358 | if not self.__instimage is None: | 358 | if not self.__image is None: |
359 | try: | 359 | try: |
360 | self.__instimage.cleanup() | 360 | self.__image.cleanup() |
361 | except MountError, err: | 361 | except MountError, err: |
362 | msger.warning("%s" % err) | 362 | msger.warning("%s" % err) |
363 | 363 | ||
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): | |||
92 | 92 | ||
93 | try: | 93 | try: |
94 | creator.create() | 94 | creator.create() |
95 | creator.install() | 95 | creator.assemble() |
96 | creator.configure() | 96 | creator.configure() |
97 | creator.print_outimage_info() | 97 | creator.print_outimage_info() |
98 | 98 | ||
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: | |||
309 | except: | 309 | except: |
310 | pass | 310 | pass |
311 | 311 | ||
312 | def __install_partition(self, num, source_file, start, size): | 312 | def __write_partition(self, num, source_file, start, size): |
313 | """ | 313 | """ |
314 | Install source_file contents into a partition. | 314 | Install source_file contents into a partition. |
315 | """ | 315 | """ |
316 | if not source_file: # nothing to install | 316 | if not source_file: # nothing to write |
317 | return | 317 | return |
318 | 318 | ||
319 | # Start is included in the size so need to substract one from the end. | 319 | # Start is included in the size so need to substract one from the end. |
@@ -325,7 +325,7 @@ class PartitionedMount: | |||
325 | exec_cmd(dd_cmd) | 325 | exec_cmd(dd_cmd) |
326 | 326 | ||
327 | 327 | ||
328 | def install(self, image_file): | 328 | def assemble(self, image_file): |
329 | msger.debug("Installing partitions") | 329 | msger.debug("Installing partitions") |
330 | 330 | ||
331 | self.image_file = image_file | 331 | self.image_file = image_file |
@@ -337,12 +337,12 @@ class PartitionedMount: | |||
337 | # of the first _logical_ partition. This is why the extended | 337 | # of the first _logical_ partition. This is why the extended |
338 | # partition should start one sector before the first logical | 338 | # partition should start one sector before the first logical |
339 | # partition. | 339 | # partition. |
340 | self.__install_partition(p['num'], p['source_file'], | 340 | self.__write_partition(p['num'], p['source_file'], |
341 | p['start'] - 1, | 341 | p['start'] - 1, |
342 | d['offset'] - p['start']) | 342 | d['offset'] - p['start']) |
343 | 343 | ||
344 | self.__install_partition(p['num'], p['source_file'], | 344 | self.__write_partition(p['num'], p['source_file'], |
345 | p['start'], p['size']) | 345 | p['start'], p['size']) |
346 | 346 | ||
347 | def create(self): | 347 | def create(self): |
348 | for dev in self.disks.keys(): | 348 | for dev in self.disks.keys(): |