111 |
dispatch.skipStep("partition", skip = 1) |
dispatch.skipStep("partition", skip = 1) |
112 |
|
|
113 |
def setDefaultPartitioning(self, partitions, clear = CLEARPART_TYPE_LINUX, doClear = 1): |
def setDefaultPartitioning(self, partitions, clear = CLEARPART_TYPE_LINUX, doClear = 1): |
114 |
|
uniqueID = 100 |
115 |
|
raid1 = [] |
116 |
|
raid2 = [] |
117 |
|
(swapMin, swapMax) = iutil.swapSuggestion() |
118 |
|
|
119 |
diskset = partedUtils.DiskSet() |
diskset = partedUtils.DiskSet() |
120 |
drives = diskset.driveList() |
drives = diskset.driveList() |
|
if len(drives) > 0: |
|
|
uniqueID = 100 |
|
|
raid1 = [] |
|
|
raid2 = [] |
|
|
(swapMin, swapMax) = iutil.swapSuggestion() |
|
121 |
|
|
122 |
for drive in drives: |
for drive in drives: |
123 |
|
if not isys.driveIsRemovable(drive): |
124 |
filesystem = fileSystemTypeGet("software RAID") |
filesystem = fileSystemTypeGet("software RAID") |
125 |
request = partRequests.PartitionSpec(filesystem, drive=[drive], size=100, primary=1, format=1) |
request = partRequests.PartitionSpec(filesystem, drive=[drive], size=100, primary=1, format=1) |
126 |
request.uniqueID = uniqueID |
request.uniqueID = uniqueID |
136 |
|
|
137 |
uniqueID = uniqueID + 1 |
uniqueID = uniqueID + 1 |
138 |
|
|
139 |
|
if len(raid2) > 0: |
140 |
filesystem = fileSystemTypeGet("ext3") |
filesystem = fileSystemTypeGet("ext3") |
141 |
request = partRequests.RaidRequestSpec(filesystem, mountpoint="/boot", raidminor=1, |
request = partRequests.RaidRequestSpec(filesystem, mountpoint="/boot", raidminor=1, |
142 |
raidmembers=raid1, raidlevel="RAID1", format=1, raidspares=0) |
raidmembers=raid1, raidlevel="RAID1", format=1, raidspares=0) |
143 |
partitions.autoPartitionRequests.append(request) |
partitions.autoPartitionRequests.append(request) |
144 |
|
|
145 |
if len(drives) > 5: |
if len(raid2) > 5: |
146 |
raidLevel = "RAID6" |
raidLevel = "RAID6" |
147 |
elif len(drives) > 2: |
elif len(raid2) > 2: |
148 |
raidLevel = "RAID5" |
raidLevel = "RAID5" |
149 |
else: |
else: |
150 |
raidLevel = "RAID1" |
raidLevel = "RAID1" |