diff options
author | Tom Zanussi <tom.zanussi@linux.intel.com> | 2014-08-08 10:09:12 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-08-11 10:52:18 +0100 |
commit | 94e15c18c011b0d7d71276cd4566be2417c2c6be (patch) | |
tree | 29c05167f89065cc02c677425a573a8140665ee4 /scripts/lib/mic/utils | |
parent | fb2a162d8756ab69c9c29a0715b033f18620341d (diff) | |
download | openembedded-core-94e15c18c011b0d7d71276cd4566be2417c2c6be.tar.gz openembedded-core-94e15c18c011b0d7d71276cd4566be2417c2c6be.tar.bz2 openembedded-core-94e15c18c011b0d7d71276cd4566be2417c2c6be.zip |
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.
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Diffstat (limited to 'scripts/lib/mic/utils')
-rw-r--r-- | scripts/lib/mic/utils/partitionedfs.py | 37 |
1 files changed, 2 insertions, 35 deletions
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 |