]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: fix generation of partition UUID
authorEd Bartosh <ed.bartosh@linux.intel.com>
Sun, 26 Mar 2017 15:28:04 +0000 (18:28 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 26 Mar 2017 23:07:36 +0000 (00:07 +0100)
Partition UUID for msdos partitioning is based on a 4 bytes long
system identifier. Wic uses random number to generate system
identifier. For the numbers starting with 0 partition uuid is
shorter, which makes wic images non-bootable as kernel expects
8 charactest in PARTUUID parameter.

Padded system identifier with '0' when generating partition UUID
to make it always 8 characters long. This should fix the boot
issue.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/wic/plugins/imager/direct.py

index 7d38ab34fb339077153b183acf8ad5cee08560e4..67fd183670c956211b0db3cd56a137464cbc4356 100644 (file)
@@ -323,7 +323,7 @@ class PartitionedImage():
                 if self.ptable_format == 'gpt':
                     part.uuid = str(uuid.uuid4())
                 else: # msdos partition table
-                    part.uuid = '%0x-%02d' % (self.identifier, part.realnum)
+                    part.uuid = '%08x-%02d' % (self.identifier, part.realnum)
 
     def prepare(self, imager):
         """Prepare an image. Call prepare method of all image partitions."""