-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the first fitting gap for ESP, instead of the largest gap #1765
Changes from 3 commits
2abdfb5
f338cfe
7367a37
fc06fc0
778516a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -252,6 +252,14 @@ def largest_gap_size(device, in_extended=None): | |
return 0 | ||
|
||
|
||
def gap_with_size(device, size, *, in_extended=None): | ||
for pg in parts_and_gaps(device): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed the method name to 'first_gap_with_size'. For this use case, finding the smallest suitable gap might actually make more sense but well. Minor stuff I think. |
||
if isinstance(pg, Gap) and pg.size >= size and pg.is_usable: | ||
if in_extended is None or in_extended == pg.in_extended: | ||
return pg | ||
return None | ||
|
||
|
||
@functools.singledispatch | ||
def movable_trailing_partitions_and_gap_size(partition): | ||
"""For a given partition (or LVM logical volume), return the total, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the logic is redundant now