filesystem: use_gap with gaps.after
This commit is contained in:
parent
76c708b951
commit
0f3b94349b
|
@ -223,11 +223,16 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
|
||||||
new_size = align_up(choice.target.new_size, part_align)
|
new_size = align_up(choice.target.new_size, part_align)
|
||||||
if new_size > partition.size:
|
if new_size > partition.size:
|
||||||
raise Exception(f'Aligned requested size {new_size} too large')
|
raise Exception(f'Aligned requested size {new_size} too large')
|
||||||
gap_offset = partition.offset + new_size
|
|
||||||
partition.size = new_size
|
partition.size = new_size
|
||||||
partition.resize = True
|
partition.resize = True
|
||||||
mode = 'use_gap'
|
mode = 'use_gap'
|
||||||
target = gaps.at_offset(disk, gap_offset)
|
# Calculating where that gap will be can be tricky due to alignment
|
||||||
|
# needs and the possibility that we may be splitting a logical
|
||||||
|
# partition, which needs an extra 1MiB spacer.
|
||||||
|
target = gaps.after(disk, partition.offset)
|
||||||
|
if target is None:
|
||||||
|
pgs = gaps.parts_and_gaps(disk)
|
||||||
|
raise Exception(f'gap not found after resize, pgs={pgs}')
|
||||||
else:
|
else:
|
||||||
raise Exception(f'Unknown guided target {choice.target}')
|
raise Exception(f'Unknown guided target {choice.target}')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue