diff --git a/image_creator/bundle_volume.py b/image_creator/bundle_volume.py index ff6ed3e2960a417af1a031800eb4130cd3bfc121..189e10793c954c04b2a74d579c9e5a99d93dc253 100644 --- a/image_creator/bundle_volume.py +++ b/image_creator/bundle_volume.py @@ -222,9 +222,13 @@ class BundleVolume(object): # Align to 2048 part_end = ((part_end + 2047) // 2048) * 2048 + # Make sure the partition starts where the old partition started. + constraint = parted.Constraint(device=image_disk.device) + constraint.startRange = parted.Geometry(device=image_disk.device, + start=last.start, length=1) + image_disk.setPartitionGeometry( - image_disk.getPartitionBySector(last.start), - parted.Constraint(device=image_disk.device), + image_disk.getPartitionBySector(last.start), constraint, start=last.start, end=part_end) image_disk.commitToDevice()