From 4d1f5ee6d1ae1eb7f60d58c4e960dde879ae0e7f Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Fri, 8 Aug 2014 10:09:12 -0500 Subject: wic: Update/rename/delete mount-related code The wic code inherited a basic image-creation flow based on mounting loop devices, but wic doesn't actually mount anything, so rename parts of the code dealing with mounting to something more appropriate, and remove related unused code. (From OE-Core rev: 94e15c18c011b0d7d71276cd4566be2417c2c6be) Signed-off-by: Tom Zanussi Signed-off-by: Richard Purdie --- scripts/lib/mic/utils/partitionedfs.py | 37 ++-------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) (limited to 'scripts/lib/mic/utils/partitionedfs.py') diff --git a/scripts/lib/mic/utils/partitionedfs.py b/scripts/lib/mic/utils/partitionedfs.py index 50536b4fce..43a38a9b14 100644 --- a/scripts/lib/mic/utils/partitionedfs.py +++ b/scripts/lib/mic/utils/partitionedfs.py @@ -33,11 +33,9 @@ MBR_OVERHEAD = 1 SECTOR_SIZE = 512 class PartitionedMount: - def __init__(self, mountdir): + def __init__(self): self.disks = {} self.partitions = [] - self.mountOrder = [] - self.unmountOrder = [] self.parted = find_binary_path("parted") # Size of a sector used in calculations self.sector_size = SECTOR_SIZE @@ -102,7 +100,6 @@ class PartitionedMount: 'label': label, # Partition label 'disk_name': disk_name, # physical disk name holding partition 'device': None, # kpartx device node for partition - 'mount': None, # Mount object 'num': None, # Partition number 'boot': boot, # Bootable flag 'align': align, # Partition alignment @@ -303,17 +300,6 @@ class PartitionedMount: self.__run_parted(["-s", d['disk'].device, "set", "%d" % p['num'], "lba", "off"]) - def __calculate_mountorder(self): - msger.debug("Calculating mount order") - for p in self.partitions: - if p['mountpoint']: - self.mountOrder.append(p['mountpoint']) - self.unmountOrder.append(p['mountpoint']) - - self.mountOrder.sort() - self.unmountOrder.sort() - self.unmountOrder.reverse() - def cleanup(self): if self.disks: for dev in self.disks.keys(): @@ -323,23 +309,6 @@ class PartitionedMount: except: pass - def unmount(self): - for mp in self.unmountOrder: - if mp == 'swap': - continue - p = None - for p1 in self.partitions: - if p1['mountpoint'] == mp: - p = p1 - break - - if p['mount'] != None: - try: - p['mount'].cleanup() - except: - pass - p['mount'] = None - def __install_partition(self, num, source_file, start, size): """ Install source_file contents into a partition. @@ -375,13 +344,11 @@ class PartitionedMount: self.__install_partition(p['num'], p['source_file'], p['start'], p['size']) - def mount(self): + def create(self): for dev in self.disks.keys(): d = self.disks[dev] d['disk'].create() self.__format_disks() - self.__calculate_mountorder() - return -- cgit v1.2.3-54-g00ecf