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

Diff of /trunk/src/GLIStorageDevice.py

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

Revision 924 Revision 925
121 free_minor = 0 121 free_minor = 0
122 recommended_parts = [ { 'type': "ext2", 'size': 100, 'mountpoint': "/boot" }, 122 recommended_parts = [ { 'type': "ext2", 'size': 100, 'mountpoint': "/boot" },
123 { 'type': "linux-swap", 'size': 512, 'mountpoint': "" }, 123 { 'type': "linux-swap", 'size': 512, 'mountpoint': "" },
124 { 'type': "ext3", 'size': "*", 'mountpoint': "/" } ] 124 { 'type': "ext3", 'size': "*", 'mountpoint': "/" } ]
125 to_create = [] 125 to_create = []
126 physical_memory = int(GLIUtility.spawn(r"free -m | egrep '^Mem:' | sed -e 's/^Mem: \+//' -e 's/ \+.\+$//'", return_output=True)[1].strip())
126 parts = self.get_ordered_partition_list() 127 parts = self.get_ordered_partition_list()
127 for part in parts: 128 for part in parts:
128 if self._partitions[part].get_type() == "free" and self._partitions[part].get_mb() >= 4096: 129 if self._partitions[part].get_type() == "free" and self._partitions[part].get_mb() >= 4096:
129 free_minor = part 130 free_minor = part
130 break 131 break
136 if self.get_extended_partition(): 137 if self.get_extended_partition():
137 raise GLIException("RecommendedPartitionLayoutError", "notice", "do_recommended", "This code is not yet robust enough to handle automatic partitioning with your current layout.") 138 raise GLIException("RecommendedPartitionLayoutError", "notice", "do_recommended", "This code is not yet robust enough to handle automatic partitioning with your current layout.")
138 to_create.append({ 'type': "extended", 'size': remaining_free, 'mountpoint': "", 'free_minor': free_minor }) 139 to_create.append({ 'type': "extended", 'size': remaining_free, 'mountpoint': "", 'free_minor': free_minor })
139 free_minor = 4 + FREE_MINOR_FRAC_LOG 140 free_minor = 4 + FREE_MINOR_FRAC_LOG
140 newpart['free_minor'] = free_minor 141 newpart['free_minor'] = free_minor
142 if newpart['type'] == "linux-swap" and physyical_memory and physical_memory < 1024:
143 newpart['size'] = physical_memory * 2
141 to_create.append(newpart) 144 to_create.append(newpart)
142 free_minor = free_minor + 1 145 free_minor = free_minor + 1
143 if not newpart['size'] == "*": 146 if not newpart['size'] == "*":
144 remaining_free = remaining_free - newpart['size'] 147 remaining_free = remaining_free - newpart['size']
145 for newpart in to_create: 148 for newpart in to_create:

Legend:
Removed from v.924  
changed lines
  Added in v.925

  ViewVC Help
Powered by ViewVC 1.1.20