diff options
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/wic/utils/partitionedfs.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py index 36ef4063d1..791f488cd6 100644 --- a/scripts/lib/wic/utils/partitionedfs.py +++ b/scripts/lib/wic/utils/partitionedfs.py | |||
@@ -164,16 +164,19 @@ class Image: | |||
164 | 164 | ||
165 | # Calc how much the alignment is off. | 165 | # Calc how much the alignment is off. |
166 | align_sectors = d['offset'] % (p['align'] * 1024 / self.sector_size) | 166 | align_sectors = d['offset'] % (p['align'] * 1024 / self.sector_size) |
167 | # We need to move forward to the next alignment point | ||
168 | align_sectors = (p['align'] * 1024 / self.sector_size) - align_sectors | ||
169 | 167 | ||
170 | msger.debug("Realignment for %s%s with %s sectors, original" | 168 | if align_sectors: |
171 | " offset %s, target alignment is %sK." % | 169 | # If partition is not aligned as required, we need |
172 | (p['disk_name'], d['numpart'], align_sectors, | 170 | # to move forward to the next alignment point |
173 | d['offset'], p['align'])) | 171 | align_sectors = (p['align'] * 1024 / self.sector_size) - align_sectors |
174 | 172 | ||
175 | # increase the offset so we actually start the partition on right alignment | 173 | msger.debug("Realignment for %s%s with %s sectors, original" |
176 | d['offset'] += align_sectors | 174 | " offset %s, target alignment is %sK." % |
175 | (p['disk_name'], d['numpart'], align_sectors, | ||
176 | d['offset'], p['align'])) | ||
177 | |||
178 | # increase the offset so we actually start the partition on right alignment | ||
179 | d['offset'] += align_sectors | ||
177 | 180 | ||
178 | p['start'] = d['offset'] | 181 | p['start'] = d['offset'] |
179 | d['offset'] += p['size'] | 182 | d['offset'] += p['size'] |