diff options
Diffstat (limited to 'scripts/lib/wic/plugins/imager/direct.py')
| -rw-r--r-- | scripts/lib/wic/plugins/imager/direct.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py index 9c4109e6b8..c517904ed1 100644 --- a/scripts/lib/wic/plugins/imager/direct.py +++ b/scripts/lib/wic/plugins/imager/direct.py | |||
| @@ -74,19 +74,6 @@ class DirectPlugin(ImagerPlugin): | |||
| 74 | self.ptable_format = self.ks.bootloader.ptable | 74 | self.ptable_format = self.ks.bootloader.ptable |
| 75 | self.parts = self.ks.partitions | 75 | self.parts = self.ks.partitions |
| 76 | 76 | ||
| 77 | # calculate the real partition number, accounting for partitions not | ||
| 78 | # in the partition table and logical partitions | ||
| 79 | realnum = 0 | ||
| 80 | for part in self.parts: | ||
| 81 | if part.no_table: | ||
| 82 | part.realnum = 0 | ||
| 83 | else: | ||
| 84 | realnum += 1 | ||
| 85 | if self.ptable_format == 'msdos' and realnum > 3: | ||
| 86 | part.realnum = realnum + 1 | ||
| 87 | continue | ||
| 88 | part.realnum = realnum | ||
| 89 | |||
| 90 | # as a convenience, set source to the boot partition source | 77 | # as a convenience, set source to the boot partition source |
| 91 | # instead of forcing it to be set via bootloader --source | 78 | # instead of forcing it to be set via bootloader --source |
| 92 | for part in self.parts: | 79 | for part in self.parts: |
| @@ -317,6 +304,19 @@ class PartitionedImage(): | |||
| 317 | self.sector_size = SECTOR_SIZE | 304 | self.sector_size = SECTOR_SIZE |
| 318 | self.native_sysroot = native_sysroot | 305 | self.native_sysroot = native_sysroot |
| 319 | 306 | ||
| 307 | # calculate the real partition number, accounting for partitions not | ||
| 308 | # in the partition table and logical partitions | ||
| 309 | realnum = 0 | ||
| 310 | for part in self.partitions: | ||
| 311 | if part.no_table: | ||
| 312 | part.realnum = 0 | ||
| 313 | else: | ||
| 314 | realnum += 1 | ||
| 315 | if self.ptable_format == 'msdos' and realnum > 3: | ||
| 316 | part.realnum = realnum + 1 | ||
| 317 | continue | ||
| 318 | part.realnum = realnum | ||
| 319 | |||
| 320 | # generate parition UUIDs | 320 | # generate parition UUIDs |
| 321 | for part in self.partitions: | 321 | for part in self.partitions: |
| 322 | if not part.uuid and part.use_uuid: | 322 | if not part.uuid and part.use_uuid: |
