]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: Set type GUID and UUID for partition
authorEd Bartosh <ed.bartosh@linux.intel.com>
Fri, 5 Jun 2015 07:17:13 +0000 (10:17 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 11 Jun 2015 22:55:40 +0000 (23:55 +0100)
Set type GUID and UUID for partition using sgdisk utility.

Type GUID can be specified for partition in .wks with
--part-type option.

UUID is generated when --use-uuid option is specified for
partition.

[YOCTO #7716]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/lib/wic/utils/partitionedfs.py

index a6e2e4f233b7e5fd86409f6ea79857245e361929..1eb1f015d6fa9654cf228bb1b5a890ffee895481 100644 (file)
@@ -294,6 +294,21 @@ class Image(object):
             self.__create_partition(d['disk'].device, p['type'],
                                     parted_fs_type, p['start'], p['size'])
 
+            if p['part_type']:
+                msger.debug("partition %d: set type UID to %s" % \
+                            (p['num'], p['part_type']))
+                exec_native_cmd("sgdisk --typecode=%d:%s %s" % \
+                                         (p['num'], p['part_type'],
+                                          d['disk'].device), self.native_sysroot)
+
+            if p['uuid']:
+                msger.debug("partition %d: set UUID to %s" % \
+                            (p['num'], p['uuid']))
+                exec_native_cmd("sgdisk --partition-guid=%d:%s %s" % \
+                                         (p['num'], p['uuid'],
+                                          d['disk'].device),
+                                        self.native_sysroot)
+
             if p['boot']:
                 flag_name = "legacy_boot" if d['ptable_format'] == 'gpt' else "boot"
                 msger.debug("Set '%s' flag for partition '%s' on disk '%s'" % \