/[smeserver]/cdrom.image/sme8/updates/installclasses/smeinstallclass.py
ViewVC logotype

Diff of /cdrom.image/sme8/updates/installclasses/smeinstallclass.py

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

Revision 1.2 by slords, Sun Jun 7 02:30:05 2009 UTC Revision 1.4 by slords, Wed Jun 10 14:22:18 2009 UTC
# Line 67  class InstallClass(BaseInstallClass): Line 67  class InstallClass(BaseInstallClass):
67      description = N_("This option performs a new install of "      description = N_("This option performs a new install of "
68                       "SME Server.  All attached hard drives "                       "SME Server.  All attached hard drives "
69                       "will be repartitioned and formated.")                       "will be repartitioned and formated.")
70    
71      sortPriority = 1      sortPriority = 1
72      doPartition = False      doPartition = False
73    
# Line 131  class InstallClass(BaseInstallClass): Line 132  class InstallClass(BaseInstallClass):
132      def setDefaultPartitioning(self, partitions, clear = CLEARPART_TYPE_LINUX, doClear = 1):      def setDefaultPartitioning(self, partitions, clear = CLEARPART_TYPE_LINUX, doClear = 1):
133          diskset = partedUtils.DiskSet()          diskset = partedUtils.DiskSet()
134    
135          alldrives = diskset.driveList()          if flags.cmdline.has_key("exclude"):
136                alldrives = filter(lambda x:not x in flags.cmdline["exclude"].split(","), diskset.driveList())
137            else:
138                alldrives = diskset.driveList()
139    
140          if flags.cmdline.has_key("drives"):          if flags.cmdline.has_key("drives"):
141              drives = filter(lambda x:isys.mediaPresent(x) and              if flags.cmdline["drives"] == "all":
142                                       x in flags.cmdline["drives"].split(","), alldrives)                  drives = filter(lambda x:isys.mediaPresent(x), alldrives)
143                else:
144                    drives = filter(lambda x:isys.mediaPresent(x) and
145                                             x in flags.cmdline["drives"].split(","), alldrives)
146          else:          else:
147              drives = filter(lambda x:not self.driveIsRemovable(x) and              drives = filter(lambda x:not self.driveIsRemovable(x) and
148                                       isys.mediaPresent(x) and                                       isys.mediaPresent(x) and
149                                       not isys.driveUsesModule(x, ["usb-storage", "ub", "sbp2"]), alldrives)                                       not isys.driveUsesModule(x, ["usb-storage", "ub", "sbp2"]), alldrives)
150    
151          if flags.cmdline.has_key("spares"):          if flags.cmdline.has_key("spares"):
152              spares = max(0,min(int(flags.cmdline["spares"]),len(drives)-2))              if flags.cmdline["spares"] == "none":
153                    spares = 0
154                else:
155                    try:
156                        spares = max(0,min(int(flags.cmdline["spares"]),len(drives)-2))
157                    except:
158                        spares = (len(drives)+4)/7
159          else:          else:
160              spares = (len(drives)+4)/7              spares = (len(drives)+4)/7
161    
# Line 170  class InstallClass(BaseInstallClass): Line 184  class InstallClass(BaseInstallClass):
184                  level = 1                  level = 1
185    
186          if len(drives) >= 1:          if len(drives) >= 1:
187                excluded = filter(lambda x:x not in drives, diskset.driveList())
188              log.info("Using the following drives: %s" % drives)              log.info("Using the following drives: %s" % drives)
189                log.info("Excluding the following drives: %s" % excluded)
190              if level >= 1:              if level >= 1:
191                  log.info("Installing using RAID%s" % level)                  log.info("Installing using RAID%s" % level)
192                  log.info("Using %s spare drives" % spares)                  log.info("Using %s spare drives" % spares)
# Line 257  class InstallClass(BaseInstallClass): Line 273  class InstallClass(BaseInstallClass):
273    
274                  if not flags.cmdline.has_key("multipart"):                  if not flags.cmdline.has_key("multipart"):
275                      partitions.autoPartitionRequests.append(partRequests.LogicalVolumeRequestSpec(fileSystemTypeGet("ext3"),                      partitions.autoPartitionRequests.append(partRequests.LogicalVolumeRequestSpec(fileSystemTypeGet("ext3"),
276                          mountpoint="/", size=1300, volgroup=201, lvname="root", grow=1, format=1))                              mountpoint="/", size=1300, volgroup=201, lvname="root", grow=1, format=1))
277    
278                      partitions.autoPartitionRequests.append(partRequests.LogicalVolumeRequestSpec(fileSystemTypeGet("swap"),                      partitions.autoPartitionRequests.append(partRequests.LogicalVolumeRequestSpec(fileSystemTypeGet("swap"),
279                              size=swapMin, maxSizeMB=swapMax, volgroup=201, lvname="swap", grow=1, format=1))                              size=swapMin, maxSizeMB=swapMax, volgroup=201, lvname="swap", grow=1, format=1))


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed