diff options
author | Jeremy Katz <katzj@redhat.com> | 2001-07-30 18:46:10 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2001-07-30 18:46:10 +0000 |
commit | da80c44de2b7ad7400974164677af5e7e64a8019 (patch) | |
tree | 5b331211175bdb5d1cf153b4a2e64187a0a306b8 /autopart.py | |
parent | 84aebabf23549af8857287951487e666c9606d91 (diff) | |
download | anaconda-da80c44de2b7ad7400974164677af5e7e64a8019.tar.gz anaconda-da80c44de2b7ad7400974164677af5e7e64a8019.tar.xz anaconda-da80c44de2b7ad7400974164677af5e7e64a8019.zip |
fix up the case where /boot wouldn't go to the second drive if there was
no space for it to go on the first requested drive (like if you left the
existing partitions on the first drive)
Diffstat (limited to 'autopart.py')
-rw-r--r-- | autopart.py | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/autopart.py b/autopart.py index 09fc00737..0c9543ccd 100644 --- a/autopart.py +++ b/autopart.py @@ -198,7 +198,7 @@ def fitConstrained(diskset, requests, primOnly=0, newParts = None): # get the list of the "best" drives to try to use... # if currentdrive is set, use that, else use the drive list, or use # all the drives -def getDriveList(request, diskset, bootrequest = 0): +def getDriveList(request, diskset): if request.currentDrive: drives = request.currentDrive elif request.drive: @@ -210,9 +210,6 @@ def getDriveList(request, diskset, bootrequest = 0): drives = [ drives ] drives.sort() - # XXX boot drive being first drive works now, but perhaps not always =\ - if bootrequest: - drives = [ drives[0] ] return drives @@ -231,13 +228,15 @@ def fitSized(diskset, requests, primOnly = 0, newParts = None): if primOnly and not request.primary: continue if request == bootreq: - drives = getDriveList(request, diskset, 1) + drives = getDriveList(request, diskset) + numDrives = 0 # allocate bootable requests first else: drives = getDriveList(request, diskset) - if not todo.has_key(len(drives)): - todo[len(drives)] = [ request ] + numDrives = len(drives) + if not todo.has_key(numDrives): + todo[numDrives] = [ request ] else: - todo[len(drives)].append(request) + todo[numDrives].append(request) number = todo.keys() number.sort() @@ -252,9 +251,14 @@ def fitSized(diskset, requests, primOnly = 0, newParts = None): isBoot = 0 largestPart = (0, None) - drives = getDriveList(request, diskset, isBoot) + drives = getDriveList(request, diskset) # print "Trying drives to find best free space out of", free for drive in drives: + # this request is bootable and we've found a large enough + # partition already, so we don't need to keep trying other + # drives. this keeps us on the first possible drive + if isBoot and largestPart[1]: + break # print "Trying drive", drive disk = diskset.disks[drive] |