summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/wic/plugins/imager/direct.py24
1 files changed, 11 insertions, 13 deletions
diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index 64a3368526..9c4109e6b8 100644
--- a/scripts/lib/wic/plugins/imager/direct.py
+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -182,12 +182,8 @@ class DirectPlugin(ImagerPlugin):
182 rsize_bb = get_bitbake_var('ROOTFS_SIZE', image_name) 182 rsize_bb = get_bitbake_var('ROOTFS_SIZE', image_name)
183 if rsize_bb: 183 if rsize_bb:
184 part.size = int(round(float(rsize_bb))) 184 part.size = int(round(float(rsize_bb)))
185 # need to create the filesystems in order to get their
186 # sizes before we can add them and do the layout.
187 part.prepare(self, self.workdir, self.oe_builddir, self.rootfs_dir,
188 self.bootimg_dir, self.kernel_dir, self.native_sysroot)
189 185
190 self._image.add_partition(part) 186 self._image.prepare(self)
191 187
192 if fstab_path: 188 if fstab_path:
193 shutil.move(fstab_path + ".orig", fstab_path) 189 shutil.move(fstab_path + ".orig", fstab_path)
@@ -329,15 +325,17 @@ class PartitionedImage():
329 else: # msdos partition table 325 else: # msdos partition table
330 part.uuid = '%0x-%02d' % (self.identifier, part.realnum) 326 part.uuid = '%0x-%02d' % (self.identifier, part.realnum)
331 327
332 def add_partition(self, part): 328 def prepare(self, imager):
333 """ 329 """Prepare an image. Call prepare method of all image partitions."""
334 Add the next partition. Partitions have to be added in the 330 for part in self.partitions:
335 first-to-last order. 331 # need to create the filesystems in order to get their
336 """ 332 # sizes before we can add them and do the layout.
337 part.ks_pnum = len(self.partitions) 333 part.prepare(imager, imager.workdir, imager.oe_builddir,
334 imager.rootfs_dir, imager.bootimg_dir,
335 imager.kernel_dir, imager.native_sysroot)
338 336
339 # Converting kB to sectors for parted 337 # Converting kB to sectors for parted
340 part.size_sec = part.disk_size * 1024 // self.sector_size 338 part.size_sec = part.disk_size * 1024 // self.sector_size
341 339
342 def layout_partitions(self): 340 def layout_partitions(self):
343 """ Layout the partitions, meaning calculate the position of every 341 """ Layout the partitions, meaning calculate the position of every