summaryrefslogtreecommitdiffstats
path: root/installclasses
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2001-06-25 21:47:43 +0000
committerMike Fulbright <msf@redhat.com>2001-06-25 21:47:43 +0000
commit38cace3bab4387bddaaaaa0afd810f19c63795eb (patch)
tree6bf564a71dc08b0a34f22c0cefedf0fca62913a5 /installclasses
parenta93ec8dcafbe97ef7a97241148fe97bc462ce828 (diff)
downloadanaconda-38cace3bab4387bddaaaaa0afd810f19c63795eb.tar.gz
anaconda-38cace3bab4387bddaaaaa0afd810f19c63795eb.tar.xz
anaconda-38cace3bab4387bddaaaaa0afd810f19c63795eb.zip
added all previous autopartitioning cases for installclasses
Diffstat (limited to 'installclasses')
-rw-r--r--installclasses/custom.py26
-rw-r--r--installclasses/server.py18
-rw-r--r--installclasses/workstation.py26
3 files changed, 46 insertions, 24 deletions
diff --git a/installclasses/custom.py b/installclasses/custom.py
index bd79c2c5d..3dc8b41a2 100644
--- a/installclasses/custom.py
+++ b/installclasses/custom.py
@@ -2,13 +2,35 @@ from installclass import BaseInstallClass
from translate import N_
import os
import iutil
+from autopart import CLEARPART_TYPE_LINUX
+from autopart import CLEARPART_TYPE_ALL
+from autopart import CLEARPART_TYPE_NONE
+from partitioning import autoCreatePartitionRequests
# custom installs are easy :-)
class InstallClass(BaseInstallClass):
-
name = N_("Custom System")
pixmap = "custom.png"
-
+
sortPriority = 10000
+ def setInstallData(self, id):
+ BaseInstallClass.setInstallData(self, id)
+ self.setHostname(id, "localhost.localdomain")
+
+ autorequests = [ ("/", None, 700, None, 1, 1),
+ ("/boot", None, 50, None, 0, 1) ]
+
+ (minswap, maxswap) = iutil.swapSuggestion()
+ autorequests.append((None, "swap", minswap, maxswap, 1, 1))
+ id.autoClearPartType = CLEARPART_TYPE_LINUX
+ id.autoClearPartDrives = []
+ id.autoPartitionRequests = autoCreatePartitionRequests(autorequests)
+
+ def __init__(self, expert):
+ BaseInstallClass.__init__(self, expert)
+ if expert:
+ self.skipLilo = 1
+ else:
+ self.skipLilo = 0
diff --git a/installclasses/server.py b/installclasses/server.py
index 2d79019f5..48cd3201d 100644
--- a/installclasses/server.py
+++ b/installclasses/server.py
@@ -2,6 +2,10 @@ from installclass import BaseInstallClass
from translate import *
import os
import iutil
+from partitioning import autoCreatePartitionRequests
+from autopart import CLEARPART_TYPE_LINUX
+from autopart import CLEARPART_TYPE_ALL
+from autopart import CLEARPART_TYPE_NONE
class InstallClass(BaseInstallClass):
@@ -34,6 +38,19 @@ class InstallClass(BaseInstallClass):
BaseInstallClass.setInstallData(self, id)
self.setHostname(id, "localhost.localdomain")
+ autorequests = [ ("/", None,256, None, 1, 1),
+ ("/boot", None, 50, None, 0, 1),
+ ("/usr", None, 512, None, 0, 1),
+ ("/var", None, 256, None, 0, 1),
+ ("/home", None, 512, None, 1, 1) ]
+
+ (minswap, maxswap) = iutil.swapSuggestion()
+ autorequests.append((None, "swap", minswap, maxswap, 1, 1))
+
+ id.autoClearPartType = CLEARPART_TYPE_ALL
+ id.autoClearPartDrives = []
+ id.autoPartitionRequests = autoCreatePartitionRequests(autorequests)
+
def __init__(self, expert):
BaseInstallClass.__init__(self, expert)
@@ -41,4 +58,3 @@ class InstallClass(BaseInstallClass):
self.skipLilo = 1
else:
self.skipLilo = 0
-
diff --git a/installclasses/workstation.py b/installclasses/workstation.py
index 79930eac4..5945a46d9 100644
--- a/installclasses/workstation.py
+++ b/installclasses/workstation.py
@@ -31,30 +31,14 @@ class InstallClass(BaseInstallClass):
BaseInstallClass.setInstallData(self, id)
self.setHostname(id, "localhost.localdomain")
- rootrequest = PartitionSpec(fileSystemTypeGetDefault(),
- mountpoint = "/",
- size = 800,
- grow = 1,
- requesttype = REQUEST_NEW,
- format = 1)
-
- bootrequest = PartitionSpec(fileSystemTypeGetDefault(),
- mountpoint = "/boot",
- size = 100,
- grow = 0,
- requesttype = REQUEST_NEW,
- format = 1)
-
- swaprequest = PartitionSpec(fileSystemTypeGet("swap"),
- size = 128,
- grow = 0,
- requesttype = REQUEST_NEW,
- format = 1)
+ autorequests = [ ("/", None, 1100, None, 1, 1),
+ ("/boot", None, 50, None, 0, 1) ]
+ (minswap, maxswap) = iutil.swapSuggestion()
+ autorequests.append((None, "swap", minswap, maxswap, 1, 1))
id.autoClearPartType = CLEARPART_TYPE_LINUX
id.autoClearPartDrives = []
- id.autoPartitionRequests = [rootrequest, bootrequest, swaprequest]
-
+ id.autoPartitionRequests = autoCreatePartitionRequests(autorequests)
def __init__(self, expert):
BaseInstallClass.__init__(self, expert)