summaryrefslogtreecommitdiffstats
path: root/autopart.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-04-24 15:46:31 +0000
committerJeremy Katz <katzj@redhat.com>2003-04-24 15:46:31 +0000
commit0a562126d84c59a113231ae7ab38984f92d62153 (patch)
tree5e87b9094f4ebdc328979e3a0640dee5f1fc40cb /autopart.py
parentdd200d781bd9012f562399c2ee69c23fe60d86b9 (diff)
downloadanaconda-0a562126d84c59a113231ae7ab38984f92d62153.tar.gz
anaconda-0a562126d84c59a113231ae7ab38984f92d62153.tar.xz
anaconda-0a562126d84c59a113231ae7ab38984f92d62153.zip
another taroon merge. tagged before as before-taroon-merge, after as
after-taroon-merge this one adds s390 fixes, basic i/p series platform support, support for multiple kernels and one second stage, cmdline kickstart mode (nice for s390), some warning cleanups.
Diffstat (limited to 'autopart.py')
-rw-r--r--autopart.py54
1 files changed, 45 insertions, 9 deletions
diff --git a/autopart.py b/autopart.py
index e3a7e8182..1cafef1a4 100644
--- a/autopart.py
+++ b/autopart.py
@@ -35,6 +35,7 @@ BOOT_ABOVE_1024 = -1
BOOTEFI_NOT_VFAT = -2
BOOTALPHA_NOT_BSD = -3
BOOTALPHA_NO_RESERVED_SPACE = -4
+BOOTPSERIES_NOT_PREP = -5
DEBUG_LVM_GROW = 0
@@ -59,6 +60,12 @@ def bootRequestCheck(requests, diskset):
return BOOT_ABOVE_1024
elif iutil.getArch() == "alpha":
return bootAlphaCheckRequirements(part, diskset)
+ elif (iutil.getPPCMachine() == "pSeries" or
+ iutil.getPPCMachine() == "iSeries"):
+ # FIXME: does this also have to be at the beginning of the disk
+## if part.native_type != 0x41:
+## return BOOTPSERIES_NOT_PREP
+ log("FIXME: unable to check suitability of boot partition on pseries right now")
return PARTITION_SUCCESS
@@ -985,6 +992,8 @@ def doPartitioning(diskset, requests, doRefresh = 1):
raise PartitioningWarning, _("Boot partition %s doesn't belong to a disk with enough free space at its beginning for the bootloader to live on. Make sure that there's at least 5MB of free space at the beginning of the disk that contains /boot") %(requests.getBootableRequest().mountpoint)
elif ret == BOOTEFI_NOT_VFAT:
raise PartitioningError, _("Boot partition %s isn't a VFAT partition. EFI won't be able to boot from this partition.") %(requests.getBootableRequest().mountpoint,)
+ elif ret == BOOTPSERIES_NOT_PREP:
+ raise PartitioningError, _("Boot partition %s isn't a PPC PReP boot partition. OpenFirmware won't be able to boot from this partition.") %(requests.getBootableRequest().mountpoint,)
elif ret != PARTITION_SUCCESS:
# more specific message?
raise PartitioningWarning, _("Boot partition %s may not meet booting constraints for your architecture. Creation of a boot disk is highly encouraged.") %(requests.getBootableRequest().mountpoint)
@@ -1093,7 +1102,25 @@ def doClearPartAction(partitions, diskset):
break
if request:
partitions.autoPartitionRequests.remove(request)
-
+ # hey, what do you know, pseries is weird too. *grumble*
+ elif (((iutil.getPPCMachine() == "pSeries") or
+ (iutil.getPPCMachine() == "iSeries"))
+ and (linuxOnly == 1)
+ and (not partitions.isKickstart) and
+ part.is_flag_available(parted.PARTITION_BOOT) and
+ (part.native_type == 0x41) and
+ part.get_flag(parted.PARTITION_BOOT)):
+ req = partitions.getRequestByDeviceName(partedUtils.get_partition_name(part))
+ req.mountpoint = None
+ req.format = 0
+ request = None
+ for req in partitions.autoPartitionRequests:
+ if req.fstype == fsset.fileSystemTypeGet("PPC PReP Boot"):
+ request = req
+ break
+ if request:
+ partitions.autoPartitionRequests.remove(request)
+
part = disk.next_partition(part)
# set the diskset up
@@ -1381,6 +1408,9 @@ def getAutopartitionBoot():
"""Return the proper shorthand for the boot dir (arch dependent)."""
if iutil.getArch() == "ia64":
return ("/boot/efi", "vfat", 100, None, 0, 1)
+ elif (iutil.getPPCMachine() == "pSeries" or
+ iutil.getPPCMachine() == "iSeries"):
+ return(None, "PPC PReP Boot", 8, None, 0, 1)
else:
return ("/boot", None, 100, None, 0, 1)
@@ -1402,15 +1432,21 @@ def queryAutoPartitionOK(intf, diskset, partitions):
drives = diskset.disks.keys()
drives.sort()
- i = 0
+ width = 44
+ str = ""
+ maxlen = 0
for drive in drives:
- drvstr = drvstr + "%-10s" % ("/dev/"+drive)
-# i = i + 1
-# if i > 3:
-# drvstr = drvstr + "\n "
-# i = 0
-
- drvstr = drvstr +"\n"
+ if (len(drive) > maxlen):
+ maxlen = len(drive)
+ maxlen = maxlen + 8 # 5 for /dev/, 3 for spaces
+ for drive in drives:
+ if (len(str) + maxlen <= width):
+ str = str + "%-*s" % (maxlen, "/dev/"+drive)
+ else:
+ drvstr = drvstr + str + "\n"
+ str = ""
+ str = "%-*s" % (maxlen, "/dev/"+drive)
+ drvstr = drvstr + str + "\n"
rc = intf.messageWindow(_("Warning"), _(msg) % drvstr, type="yesno", default="no", custom_icon ="warning")