# this is the prototypical class for workstation, server, and kickstart
# installs
#
# The interface to InstallClass is *public* -- ISVs/OEMs can customize the
# install by creating a new derived type of this class.
# putting these here is a bit of a hack, but we can't switch between
# newtfsedit and gnomefsedit right now, so we have to put up with this
FSEDIT_CLEAR_LINUX = (1 << 1)
FSEDIT_CLEAR_ALL = (1 << 2)
FSEDIT_USE_EXISTING = (1 << 3)
# ummm, HACK
def finishPartitioning(self, ddruid):
if not self.partitions: return
attempt = []
swapCount = 0
for (mntpoint, size, maxsize, grow) in self.partitions:
type = 0x83
if (mntpoint == "swap"):
mntpoint = "Swap%04d-auto" % swapCount
swapCount = swapCount + 1
type = 0x82
attempt.append((mntpoint, size, type, grow, -1))
try:
ddruid.attempt (attempt, "Junk Argument", self.clearParts)
return 1
except:
# life's a female dog <shrug> -- we should log something though
# <double-shrug>
self.skipPartitioning = 0
self.clearPartText = None
pass
return 0
# look in mouse.py for a list of valid mouse names -- use the LONG names
def setMouseType(self, name, device = None, emulateThreeButtons = 0):
self.mouse = (name, device, emulateThreeButtons)
def setLiloInformation(self, location, linear = 1, appendLine = None):
# this throws an exception if there is a problem
["mbr", "partition", "none"].index(location)
self.lilo = (location, linear, appendLine)
def setClearParts(self, clear, warningText = None):
self.clearParts = clear
# XXX hack for install help text in GUI mode
if clear == FSEDIT_CLEAR_LINUX:
self.clearType = "wkst"
if clear == FSEDIT_CLEAR_ALL:
self.clearType = "svr"
self.clearPartText = warningText
def removeFromSkipList(self, type):
if type == "partition":
self.skipPartitioning = 0
self.removeFromSkipList("format")
else:
if self.skipSteps.has_key(type):
del self.skipSteps[type]
def addToSkipList(self, type):
# this throws an exception if there is a problem
[ "lilo", "mouse", "network", "authentication", "complete", "complete",
"package-selection", "bootdisk", "partition", "format", "timezone",
"accounts", "dependencies", "language", "keyboard", "xconfig",
"welcome", "installtype", "mouse", "confirm-install" ].index(type)
if type == "partition":
self.skipPartitioning = 1
else:
self.skipSteps[type] = 1
self.partitions.append(('/boot', 16, 16, 0))
self.partitions.append(('/', 500, 500, 1))
self.partitions.append(('swap', 64, 64, 0))
self.setClearParts(FSEDIT_CLEAR_LINUX,
warningText = _("You are about to erase any preexisting Linux "
"installations on your system."))
self.partitions.append(('/boot', 16, 16, 0))
self.partitions.append(('/', 256, 256, 0))
self.partitions.append(('/usr', 512, 512, 1))
self.partitions.append(('/var', 256, 256, 0))
self.partitions.append(('/home', 512, 512, 1))
self.partitions.append(('swap', 64, 64, 1))
self.setClearParts(FSEDIT_CLEAR_ALL,
warningText = _("You are about to erase ALL DATA on your hard " + \
"drive to make room for your Linux installation."))