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

Diff of /trunk/src/GLIStorageDevice.py

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

Revision 628 Revision 631
327 # Returns partition info in a format suitable for passing to install_profile.set_partition_tables() 327 # Returns partition info in a format suitable for passing to install_profile.set_partition_tables()
328 def get_install_profile_structure(self): 328 def get_install_profile_structure(self):
329 devdic = {} 329 devdic = {}
330 for part in self._partitions: 330 for part in self._partitions:
331 tmppart = self._partitions[part] 331 tmppart = self._partitions[part]
332 devdic[part] = { 'mb': tmppart.get_mb(), 'minor': float(part), 'origminor': tmppart.get_orig_minor(), 'start': tmppart.get_start(), 'end': tmppart.get_end(), 'type': tmppart.get_type(), 'mountpoint': tmppart.get_mountpoint(), 'mountopts': tmppart.get_mountopts(), 'format': tmppart.get_format() } 332 devdic[part] = { 'mb': tmppart.get_mb(), 'minor': float(part), 'origminor': tmppart.get_orig_minor(), 'type': tmppart.get_type(), 'mountpoint': tmppart.get_mountpoint(), 'mountopts': tmppart.get_mountopts(), 'format': tmppart.get_format(), 'mkfsopts': tmppart.get_mkfsopts() }
333 return devdic 333 return devdic
334 334
335 ## 335 ##
336 # Returns the minor of the extended partition, if any 336 # Returns the minor of the extended partition, if any
337 def get_extended_partition(self): 337 def get_extended_partition(self):
437 _mountopts = None 437 _mountopts = None
438 _format = None 438 _format = None
439 _resizeable = None 439 _resizeable = None
440 _min_mb_for_resize = 0 440 _min_mb_for_resize = 0
441 _mb = 0 441 _mb = 0
442 _mkfsopts = None
442 443
443 ## 444 ##
444 # Initialization function for the Partition class 445 # Initialization function for the Partition class
445 # @param device Parent GLIStorageDevice object 446 # @param device Parent GLIStorageDevice object
446 # @param minor Minor of partition 447 # @param minor Minor of partition
450 # @param type Parameter Type of partition (ext2, ext3, fat32, linux-swap, free, extended, etc.) 451 # @param type Parameter Type of partition (ext2, ext3, fat32, linux-swap, free, extended, etc.)
451 # @param mountpoint='' Mountpoint of partition 452 # @param mountpoint='' Mountpoint of partition
452 # @param mountopts='' Mount options of partition 453 # @param mountopts='' Mount options of partition
453 # @param format=True Format partition 454 # @param format=True Format partition
454 # @param existing=False This partition exists on disk 455 # @param existing=False This partition exists on disk
455 def __init__(self, device, minor, mb, start, end, type, mountpoint='', mountopts='', format=True, existing=False, origminor=0): 456 def __init__(self, device, minor, mb, start, end, type, mountpoint='', mountopts='', format=True, existing=False, origminor=0, mkfsopts=''):
456 self._device = device 457 self._device = device
457 self._minor = float(minor) 458 self._minor = float(minor)
458 self._start = int(start) 459 self._start = int(start)
459 self._end = int(end) 460 self._end = int(end)
460 self._type = type or "unknown" 461 self._type = type or "unknown"
461 self._mountpoint = mountpoint 462 self._mountpoint = mountpoint
462 self._mountopts = mountopts 463 self._mountopts = mountopts
463 self._format = format 464 self._format = format
464 self._mb = mb 465 self._mb = mb
465 self._orig_minor = origminor 466 self._orig_minor = origminor
467 self._mkfsopts = mkfsopts
466 if type != "free": 468 if type != "free":
467 if existing and not origminor: 469 if existing and not origminor:
468 self._orig_minor = self._minor 470 self._orig_minor = self._minor
469 self._minor = int(self._minor) 471 self._minor = int(self._minor)
470 self._orig_minor = int(self._orig_minor) 472 self._orig_minor = int(self._orig_minor)
539 def get_extended_parent(self): 541 def get_extended_parent(self):
540 if not self.is_logical(): 542 if not self.is_logical():
541 return None 543 return None
542 else: 544 else:
543 return self._device.get_partition_at(self._start, ignore_extended=0) 545 return self._device.get_partition_at(self._start, ignore_extended=0)
546
547 ##
548 # Sets the options passed to mkfs
549 # @param mkfsopts Options passed to mkfs
550 def set_mkfsopts(self, mkfsopts):
551 self._mkfsopts = mkfsopts
552
553 ##
554 # Returns the options passes to mkfs
555 def get_mkfsopts(self):
556 return self._mkfsopts
544 557
545 ## 558 ##
546 # Sets the start sector for the partition 559 # Sets the start sector for the partition
547 # @param start Start sector 560 # @param start Start sector
548 def set_start(self, start): 561 def set_start(self, start):

Legend:
Removed from v.628  
changed lines
  Added in v.631

  ViewVC Help
Powered by ViewVC 1.1.20