diff options
Diffstat (limited to 'scripts/lib/wic/plugins')
-rw-r--r-- | scripts/lib/wic/plugins/imager/direct.py | 17 | ||||
-rw-r--r-- | scripts/lib/wic/plugins/source/bootimg-efi.py | 3 | ||||
-rw-r--r-- | scripts/lib/wic/plugins/source/bootimg-pcbios.py | 3 |
3 files changed, 19 insertions, 4 deletions
diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py index da1c061063..71c0b1c82b 100644 --- a/scripts/lib/wic/plugins/imager/direct.py +++ b/scripts/lib/wic/plugins/imager/direct.py | |||
@@ -141,7 +141,15 @@ class DirectPlugin(ImagerPlugin): | |||
141 | continue | 141 | continue |
142 | 142 | ||
143 | if part.use_uuid: | 143 | if part.use_uuid: |
144 | device_name = "PARTUUID=%s" % part.uuid | 144 | if part.fsuuid: |
145 | # FAT UUID is different from others | ||
146 | if len(part.fsuuid) == 10: | ||
147 | device_name = "UUID=%s-%s" % \ | ||
148 | (part.fsuuid[2:6], part.fsuuid[6:]) | ||
149 | else: | ||
150 | device_name = "UUID=%s" % part.fsuuid | ||
151 | else: | ||
152 | device_name = "PARTUUID=%s" % part.uuid | ||
145 | else: | 153 | else: |
146 | # mmc device partitions are named mmcblk0p1, mmcblk0p2.. | 154 | # mmc device partitions are named mmcblk0p1, mmcblk0p2.. |
147 | prefix = 'p' if part.disk.startswith('mmcblk') else '' | 155 | prefix = 'p' if part.disk.startswith('mmcblk') else '' |
@@ -334,13 +342,18 @@ class PartitionedImage(): | |||
334 | continue | 342 | continue |
335 | part.realnum = realnum | 343 | part.realnum = realnum |
336 | 344 | ||
337 | # generate parition UUIDs | 345 | # generate parition and filesystem UUIDs |
338 | for part in self.partitions: | 346 | for part in self.partitions: |
339 | if not part.uuid and part.use_uuid: | 347 | if not part.uuid and part.use_uuid: |
340 | if self.ptable_format == 'gpt': | 348 | if self.ptable_format == 'gpt': |
341 | part.uuid = str(uuid.uuid4()) | 349 | part.uuid = str(uuid.uuid4()) |
342 | else: # msdos partition table | 350 | else: # msdos partition table |
343 | part.uuid = '%08x-%02d' % (self.identifier, part.realnum) | 351 | part.uuid = '%08x-%02d' % (self.identifier, part.realnum) |
352 | if not part.fsuuid: | ||
353 | if part.fstype == 'vfat' or part.fstype == 'msdos': | ||
354 | part.fsuuid = '0x' + str(uuid.uuid4())[:8].upper() | ||
355 | else: | ||
356 | part.fsuuid = str(uuid.uuid4()) | ||
344 | 357 | ||
345 | def prepare(self, imager): | 358 | def prepare(self, imager): |
346 | """Prepare an image. Call prepare method of all image partitions.""" | 359 | """Prepare an image. Call prepare method of all image partitions.""" |
diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py index 4c4f36a32f..beb74d7a71 100644 --- a/scripts/lib/wic/plugins/source/bootimg-efi.py +++ b/scripts/lib/wic/plugins/source/bootimg-efi.py | |||
@@ -240,7 +240,8 @@ class BootimgEFIPlugin(SourcePlugin): | |||
240 | # dosfs image, created by mkdosfs | 240 | # dosfs image, created by mkdosfs |
241 | bootimg = "%s/boot.img" % cr_workdir | 241 | bootimg = "%s/boot.img" % cr_workdir |
242 | 242 | ||
243 | dosfs_cmd = "mkdosfs -n efi -C %s %d" % (bootimg, blocks) | 243 | dosfs_cmd = "mkdosfs -n efi -i %s -C %s %d" % \ |
244 | (part.fsuuid, bootimg, blocks) | ||
244 | exec_native_cmd(dosfs_cmd, native_sysroot) | 245 | exec_native_cmd(dosfs_cmd, native_sysroot) |
245 | 246 | ||
246 | mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (bootimg, hdddir) | 247 | mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (bootimg, hdddir) |
diff --git a/scripts/lib/wic/plugins/source/bootimg-pcbios.py b/scripts/lib/wic/plugins/source/bootimg-pcbios.py index 56da468fb5..d599112dd7 100644 --- a/scripts/lib/wic/plugins/source/bootimg-pcbios.py +++ b/scripts/lib/wic/plugins/source/bootimg-pcbios.py | |||
@@ -186,7 +186,8 @@ class BootimgPcbiosPlugin(SourcePlugin): | |||
186 | # dosfs image, created by mkdosfs | 186 | # dosfs image, created by mkdosfs |
187 | bootimg = "%s/boot%s.img" % (cr_workdir, part.lineno) | 187 | bootimg = "%s/boot%s.img" % (cr_workdir, part.lineno) |
188 | 188 | ||
189 | dosfs_cmd = "mkdosfs -n boot -S 512 -C %s %d" % (bootimg, blocks) | 189 | dosfs_cmd = "mkdosfs -n boot -i %s -S 512 -C %s %d" % \ |
190 | (part.fsuuid, bootimg, blocks) | ||
190 | exec_native_cmd(dosfs_cmd, native_sysroot) | 191 | exec_native_cmd(dosfs_cmd, native_sysroot) |
191 | 192 | ||
192 | mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (bootimg, hdddir) | 193 | mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (bootimg, hdddir) |