/[gli]/trunk/src/GLIStorageDevice.py
Gentoo

Diff of /trunk/src/GLIStorageDevice.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1038 Revision 1040
223 # @param mkfsopts='' Additional mkfs options 223 # @param mkfsopts='' Additional mkfs options
224 def add_partition(self, free_minor, mb, start, end, type, mountpoint='', mountopts='',mkfsopts=''): 224 def add_partition(self, free_minor, mb, start, end, type, mountpoint='', mountopts='',mkfsopts=''):
225 if free_minor == -1: 225 if free_minor == -1:
226 tmpparts = self._partitions.keys() 226 tmpparts = self._partitions.keys()
227 tmpparts.sort() 227 tmpparts.sort()
228 tmpminor = 0
229 if len(tmpparts):
228 tmpminor = tmpparts[-1] 230 tmpminor = tmpparts[-1]
229 if archinfo[self._arch]['extended'] and tmpminor >= 5: 231 if archinfo[self._arch]['extended'] and tmpminor >= 5:
230 free_minor = new_minor + FREE_MINOR_FRAC_LOG 232 free_minor = tmpminor + FREE_MINOR_FRAC_LOG
231 else: 233 else:
232 free_minor = new_minor + FREE_MINOR_FRAC_PRI 234 free_minor = tmpminor + FREE_MINOR_FRAC_PRI
233 self._partitions[free_minor] = Partition(self, free_minor, mb, 0, 0, "free") 235 self._partitions[free_minor] = Partition(self, free_minor, mb, 0, 0, "free")
234 new_minor = int(free_minor) + 1 236 new_minor = int(free_minor) + 1
235 if self._partitions.has_key(new_minor): 237 if self._partitions.has_key(new_minor):
236 parts = self._partitions.keys() 238 parts = self._partitions.keys()
237 parts.sort() 239 parts.sort()
262 del self._partitions[free_minor] 264 del self._partitions[free_minor]
263 self._partitions[new_minor] = Partition(self, new_minor, mb, start, end, type, mountpoint=mountpoint, mountopts=mountopts,mkfsopts=mkfsopts) 265 self._partitions[new_minor] = Partition(self, new_minor, mb, start, end, type, mountpoint=mountpoint, mountopts=mountopts,mkfsopts=mkfsopts)
264 if type == "extended": 266 if type == "extended":
265 self._partitions[4 + FREE_MINOR_FRAC_LOG] = Partition(self, (4 + FREE_MINOR_FRAC_LOG), mb, 0, 0, "free") 267 self._partitions[4 + FREE_MINOR_FRAC_LOG] = Partition(self, (4 + FREE_MINOR_FRAC_LOG), mb, 0, 0, "free")
266 self.tidy_partitions() 268 self.tidy_partitions()
269 return new_minor
267 270
268 ## 271 ##
269 # Removes partition from partition info 272 # Removes partition from partition info
270 # @param minor Minor of partition to remove 273 # @param minor Minor of partition to remove
271 def remove_partition(self, minor): 274 def remove_partition(self, minor):

Legend:
Removed from v.1038  
changed lines
  Added in v.1040

  ViewVC Help
Powered by ViewVC 1.1.20