summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/utils/partitionedfs.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/wic/utils/partitionedfs.py')
-rw-r--r--scripts/lib/wic/utils/partitionedfs.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py
index 46b5d345c7..cafb9338df 100644
--- a/scripts/lib/wic/utils/partitionedfs.py
+++ b/scripts/lib/wic/utils/partitionedfs.py
@@ -43,6 +43,7 @@ class Image():
43 def __init__(self, native_sysroot=None): 43 def __init__(self, native_sysroot=None):
44 self.disks = {} 44 self.disks = {}
45 self.partitions = [] 45 self.partitions = []
46 self.partimages = []
46 # Size of a sector used in calculations 47 # Size of a sector used in calculations
47 self.sector_size = SECTOR_SIZE 48 self.sector_size = SECTOR_SIZE
48 self._partitions_layed_out = False 49 self._partitions_layed_out = False
@@ -336,6 +337,10 @@ class Image():
336 disk['disk'].cleanup() 337 disk['disk'].cleanup()
337 except: 338 except:
338 pass 339 pass
340 # remove partition images
341 for image in self.partimages:
342 if os.path.isfile(image):
343 os.remove(image)
339 344
340 def assemble(self, image_file): 345 def assemble(self, image_file):
341 msger.debug("Installing partitions") 346 msger.debug("Installing partitions")
@@ -351,7 +356,9 @@ class Image():
351 (source, part['num'], part['start'], 356 (source, part['num'], part['start'],
352 part['start'] + part['size'] - 1, part['size'])) 357 part['start'] + part['size'] - 1, part['size']))
353 358
354 os.rename(source, image_file + '.p%d' % part['num']) 359 partimage = image_file + '.p%d' % part['num']
360 os.rename(source, partimage)
361 self.partimages.append(partimage)
355 362
356 def create(self): 363 def create(self):
357 for dev in self.disks: 364 for dev in self.disks: