summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bootloader.py17
-rw-r--r--dispatch.py3
-rw-r--r--installclass.py15
-rw-r--r--iw/partition_gui.py10
-rw-r--r--kickstart.py26
-rw-r--r--textw/partition_text.py8
6 files changed, 34 insertions, 45 deletions
diff --git a/bootloader.py b/bootloader.py
index b3de4adf7..6b455e1d1 100644
--- a/bootloader.py
+++ b/bootloader.py
@@ -365,6 +365,7 @@ class x86BootloaderInfo:
self.useGrubVal = 1 # use lilo otherwise
self.device = None
self.useLinear = 1 # only used for kickstart compatibility
+ self.setDefaultDevice = 0 # XXX hack, used by kickstart
def availableBootDevices(diskSet, fsset):
devs = []
@@ -388,7 +389,17 @@ def availableBootDevices(diskSet, fsset):
return devs
-def partitioningComplete(dispatch, bl, fsset, diskSet):
+# XXX move me somewhere else and split the bootloader and fsset parts
+# into different functions
+def partitioningComplete(dispatch, bl, fsset, diskSet, partitions):
+ fsset.reset()
+ for request in partitions.requests:
+ # XXX improve sanity checking
+ if not request.fstype or (request.fstype.isMountable() and not request.mountpoint):
+ continue
+ entry = request.toEntry()
+ fsset.add (entry)
+
choices = fsset.bootloaderChoices(diskSet)
if not choices:
dispatch.skipStep("instbootloader")
@@ -397,6 +408,10 @@ def partitioningComplete(dispatch, bl, fsset, diskSet):
bl.images.setup(diskSet, fsset)
+ if bl.setDefaultDevice and choices:
+ bl.setDevice(choices[0][0])
+
+
def writeBootloader(intf, instRoot, fsset, bl, langs, comps):
justConfigFile = not flags.setupFilesystems
diff --git a/dispatch.py b/dispatch.py
index f1b6a904a..ae21e27f0 100644
--- a/dispatch.py
+++ b/dispatch.py
@@ -58,7 +58,8 @@ installSteps = [
( "fdisk", ("id.useFdisk", "id.diskset", "id.partrequests")),
( "partition", ("id.fsset", "id.diskset", "id.partrequests", "intf")),
( "partitiondone", partitioningComplete, ("dispatch", "id.bootloader",
- "id.fsset", "id.diskset" ) ),
+ "id.fsset", "id.diskset",
+ "id.partrequests") ),
( "bootloader", ("dispatch", "id.bootloader", "id.fsset", "id.diskset") ),
( "network", ("id.network",) ),
( "firewall", ("id.network", "id.firewall") ),
diff --git a/installclass.py b/installclass.py
index 3bc0eefcd..542a89460 100644
--- a/installclass.py
+++ b/installclass.py
@@ -9,6 +9,7 @@ import string
from xf86config import XF86Config
from translate import _
from instdata import InstallData
+from autopart import *
class BaseInstallClass:
# default to not being hidden
@@ -44,18 +45,16 @@ class BaseInstallClass:
id.bootloader.args.set(appendLine)
id.bootloader.useGrubVal = 0
- def setClearParts(self, clear, warningText = None):
- self.clearParts = clear
+ def setClearParts(self, id, clear, drives = None, warningText = None):
+ id.autoClearPartType = clear
+ id.autoClearPartDrives = drives
# XXX hack for install help text in GUI mode
- if clear == FSEDIT_CLEAR_LINUX:
+ if clear == CLEARPART_TYPE_LINUX:
self.clearType = "wkst"
- if clear == FSEDIT_CLEAR_ALL:
- self.clearType = "svr"
+ if clear == CLEARPART_TYPE_ALL:
+ self.clearType = "svr"
self.clearPartText = warningText
- def getClearParts(self):
- return self.clearParts
-
def getFstab(self):
return self.fstab
diff --git a/iw/partition_gui.py b/iw/partition_gui.py
index bb28057ff..a0b02675f 100644
--- a/iw/partition_gui.py
+++ b/iw/partition_gui.py
@@ -440,16 +440,6 @@ class PartitionWindow(InstallWindow):
def getNext(self):
self.diskStripeGraph.shutDown()
self.clearTree()
- self.fsset.reset()
- for request in self.partitions.requests:
- # XXX improve sanity checking
- if not request.fstype or (request.fstype.isMountable() and not request.mountpoint):
- continue
- entry = request.toEntry()
- self.fsset.add (entry)
-
-# print self.fsset.fstab()
-# print self.fsset.raidtab()
del self.parent
return None
diff --git a/kickstart.py b/kickstart.py
index 442758e8e..084fa130b 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -544,21 +544,8 @@ class KickstartBase(BaseInstallClass):
self.packageList = packages
self.excludedList = excludedPackages
- # XXX actual partitioning processing should happen after %pre
- doPartitioning(id.diskset, id.partrequests)
- for request in id.partrequests.requests:
- # XXX improve sanity checking
- if not request.fstype or (request.fstype.isMountable() and not request.mountpoint):
- continue
- entry = request.toEntry()
- id.fsset.add (entry)
-
- # XXX bootloader stuff shouldn't be done here either
- choices = id.fsset.bootloaderChoices(id.diskset)
- if not choices:
- raise RuntimeError, "Unable to find device to install bootloader to"
- device = choices[0][0]
- id.bootloader.setDevice(device)
+ # XXX this is just not really a good way to do this...
+ id.bootloader.setDefaultDevice = 1
# test to see if they specified to clear partitions and also
# tried to --onpart on a logical partition
@@ -588,8 +575,8 @@ class KickstartBase(BaseInstallClass):
# XXX invalid clearpart arguments
return
- # XXX need to include list of drive to restrict clear to!
- doClearPartAction(id, type, None)
+ # XXX want to have --drive hda,hdb
+ self.setClearParts(id, type, None)
def defineRaid(self, args):
(args, extra) = isys.getopt(args, '', [ 'level=', 'device=' ] )
@@ -684,9 +671,12 @@ class KickstartBase(BaseInstallClass):
if not format:
request.format = 0
- id.partrequests.addRequest(request)
+ id.autoPartitionRequests.append(request)
self.skipSteps.append("partition")
+ self.skipSteps.append("partitionmethod")
+ self.skipSteps.append("partitionmethodsetup")
+ self.skipSteps.append("fdisk")
self.skipSteps.append("autopartition")
def setSteps(self, dispatch):
diff --git a/textw/partition_text.py b/textw/partition_text.py
index 5adb8fffe..5e18ccc0c 100644
--- a/textw/partition_text.py
+++ b/textw/partition_text.py
@@ -803,13 +803,7 @@ class PartitionWindow:
self.intf.messageWindow(_("No Root Partition"),
_("Must have a / partition to install on."))
continue
- self.fsset.reset()
- for request in self.partitions.requests:
- # XXX improve sanity checking
- if not request.fstype or (request.fstype.isMountable() and not request.mountpoint):
- continue
- entry = request.toEntry()
- self.fsset.add (entry)
+
screen.popHelpLine()
screen.popWindow()
return INSTALL_OK