summaryrefslogtreecommitdiffstats
path: root/autopart.py
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2008-03-14 16:15:06 -0400
committerPeter Jones <pjones@pjones2.localdomain>2008-03-14 16:15:06 -0400
commita3050d8c2ddd3860d15c60015442ab250c648fd6 (patch)
tree9a0ed1271db1de84983518eaf3a2dfbdf37087d1 /autopart.py
parent02e92de3f4d8a49be7d9984e3b39c1e1348aad9e (diff)
downloadanaconda-a3050d8c2ddd3860d15c60015442ab250c648fd6.tar.gz
anaconda-a3050d8c2ddd3860d15c60015442ab250c648fd6.tar.xz
anaconda-a3050d8c2ddd3860d15c60015442ab250c648fd6.zip
Create and check /boot/efi correctly, and use preexisting one if available.
Diffstat (limited to 'autopart.py')
-rw-r--r--autopart.py53
1 files changed, 33 insertions, 20 deletions
diff --git a/autopart.py b/autopart.py
index 43b3c36d2..983cf10c7 100644
--- a/autopart.py
+++ b/autopart.py
@@ -44,7 +44,7 @@ log = logging.getLogger("anaconda")
PARTITION_FAIL = -1
PARTITION_SUCCESS = 0
-BOOT_ABOVE_1024 = -1
+BOOT_NOT_EXT2 = -1
BOOTEFI_NOT_VFAT = -2
BOOTALPHA_NOT_BSD = -3
BOOTALPHA_NO_RESERVED_SPACE = -4
@@ -74,8 +74,12 @@ def bootRequestCheck(req, diskset):
return PARTITION_SUCCESS
if iutil.isEfi():
- if not part.fs_type.name in ("FAT", "fat16", "fat32"):
- return BOOTEFI_NOT_VFAT
+ if req.mountpoint == "/boot":
+ if not part.fs_type.name.startswith("ext"):
+ return BOOT_NOT_EXT2
+ elif req.mountpoint == "/boot/efi":
+ if not part.fs_type.name in ("FAT", "fat16", "fat32"):
+ return BOOTEFI_NOT_VFAT
elif rhpl.getArch() == "alpha":
return bootAlphaCheckRequirements(part)
elif (iutil.getPPCMachine() == "pSeries" or
@@ -321,6 +325,8 @@ def fitSized(diskset, requests, primOnly = 0, newParts = None):
numDrives = -1
if request.fstype == fsset.fileSystemTypeGet("Apple Bootstrap"):
numDrives = -1
+ if request.fstype == fsset.fileSystemTypeGet("efi"):
+ numDrives = -1
else:
drives = getDriveList(request, diskset)
numDrives = len(drives)
@@ -1057,6 +1063,8 @@ def doPartitioning(diskset, requests, doRefresh = 1):
raise PartitioningError, _("Boot partition %s isn't a VFAT partition. EFI won't be able to boot from this partition.") %(req.mountpoint,)
elif ret == BOOTIPSERIES_TOO_HIGH:
raise PartitioningError, _("The boot partition must entirely be in the first 4GB of the disk. OpenFirmware won't be able to boot this installation.")
+ elif req == BOOT_NOT_EXT2:
+ raise PartitioningError, _("Boot partition %s is not a Linux filesystem, such as ext3. The system won't be able to boot from this partition.") %(req.mountpoint,)
elif ret != PARTITION_SUCCESS:
# more specific message?
raise PartitioningWarning, _("Boot partition %s may not meet booting constraints for your architecture.") %(req.mountpoint,)
@@ -1159,21 +1167,19 @@ def doClearPartAction(anaconda, partitions, diskset):
# bootable flag set, do not delete it and make it our
# /boot/efi as it could contain system utils.
# doesn't apply on kickstart installs or if no boot flag
- if (iutil.isEfi() and linuxOnly == 1 and (not anaconda.isKickstart)
- and part.is_flag_available(parted.PARTITION_BOOT)):
- if part.fs_type and part.fs_type.name in ("FAT", "fat16", "fat32"):
- if part.get_flag(parted.PARTITION_BOOT):
- req = partitions.getRequestByDeviceName(partedUtils.get_partition_name(part))
- req.mountpoint = "/boot/efi"
- req.format = 0
-
- request = None
- for req in partitions.autoPartitionRequests:
- if req.mountpoint == "/boot/efi":
- request = req
- break
- if request:
- partitions.autoPartitionRequests.remove(request)
+ if iutil.isEfi() and linuxOnly == 1 and (not anaconda.isKickstart):
+ if partedUtils.isEfiSystemPartition(part):
+ req = partitions.getRequestByDeviceName(partedUtils.get_partition_name(part))
+ req.mountpoint = "/boot/efi"
+ req.format = 0
+
+ request = None
+ for req in partitions.autoPartitionRequests:
+ if req.mountpoint == "/boot/efi":
+ request = req
+ 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"))
@@ -1666,10 +1672,17 @@ def autoCreateLVMPartitionRequests(autoreq):
return requests
-def getAutopartitionBoot():
+def getAutopartitionBoot(partitions):
"""Return the proper shorthand for the boot dir (arch dependent)."""
if iutil.isEfi():
- return [ ("/boot/efi", "vfat", 200, None, 0, 1, 0) ]
+ ret = [ ["/boot/efi", "efi", 50, 200, 1, 1, 0] ]
+ for req in partitions.requests:
+ if req.fstype == fsset.fileSystemTypeGet("efi") \
+ and not req.mountpoint:
+ req.mountpoint = "/boot/efi"
+ ret = []
+ ret.append(("/boot", None, 200, None, 0, 1, 0))
+ return ret
elif (iutil.getPPCMachine() == "pSeries"):
return [ (None, "PPC PReP Boot", 4, None, 0, 1, 0),
("/boot", None, 200, None, 0, 1, 0) ]