summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/kickstart/custom_commands/partition.py
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-06-05 10:17:09 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-11 23:55:39 +0100
commit4bfe81a88653f4851ec24eef9e5ee51960cb101b (patch)
treee746b3990cb5e8cd51ee1ae0dff888b2961ffbd0 /scripts/lib/wic/kickstart/custom_commands/partition.py
parentb2b6ff9dcf8c8b1c01ddf13894b8318becf4a8d0 (diff)
downloadopenembedded-core-4bfe81a88653f4851ec24eef9e5ee51960cb101b.tar.gz
openembedded-core-4bfe81a88653f4851ec24eef9e5ee51960cb101b.tar.bz2
openembedded-core-4bfe81a88653f4851ec24eef9e5ee51960cb101b.zip
wic: Generate random uuid for partition
'uuid' attribute of partition object is set to generated uuid when --use-uuid option is used for partition in .wks file. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts/lib/wic/kickstart/custom_commands/partition.py')
-rw-r--r--scripts/lib/wic/kickstart/custom_commands/partition.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py
index 7d04738faa..f3c5545789 100644
--- a/scripts/lib/wic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/wic/kickstart/custom_commands/partition.py
@@ -26,6 +26,7 @@
import os
import tempfile
+import uuid
from pykickstart.commands.partition import *
from wic.utils.oe.misc import *
@@ -51,6 +52,8 @@ class Wic_PartData(Mic_PartData):
self.no_table = kwargs.get("no-table", False)
self.extra_space = kwargs.get("extra-space", "10M")
self.overhead_factor = kwargs.get("overhead-factor", 1.3)
+ self._use_uuid = False
+ self.uuid = None
self.use_uuid = kwargs.get("use-uuid", False)
self.source_file = ""
self.size = 0
@@ -73,6 +76,16 @@ class Wic_PartData(Mic_PartData):
return retval
+ @property
+ def use_uuid(self):
+ return self._use_uuid
+
+ @use_uuid.setter
+ def use_uuid(self, value):
+ self._use_uuid = value
+ if value and not self.uuid:
+ self.uuid = str(uuid.uuid4())
+
def get_rootfs(self):
"""
Acessor for rootfs dir