summaryrefslogtreecommitdiffstats
path: root/scripts
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:59:12 +0100
commit0510591058657ffe4f3e679838163fc22496c8ac (patch)
tree5097b1ef86921082d5a4408d67b9a3f1831ad0db /scripts
parent853518523538b274b83e1b7dba2f51a600aa3b02 (diff)
downloadpoky-0510591058657ffe4f3e679838163fc22496c8ac.tar.gz
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. (From OE-Core rev: 4bfe81a88653f4851ec24eef9e5ee51960cb101b) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-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 @@
26 26
27import os 27import os
28import tempfile 28import tempfile
29import uuid
29 30
30from pykickstart.commands.partition import * 31from pykickstart.commands.partition import *
31from wic.utils.oe.misc import * 32from wic.utils.oe.misc import *
@@ -51,6 +52,8 @@ class Wic_PartData(Mic_PartData):
51 self.no_table = kwargs.get("no-table", False) 52 self.no_table = kwargs.get("no-table", False)
52 self.extra_space = kwargs.get("extra-space", "10M") 53 self.extra_space = kwargs.get("extra-space", "10M")
53 self.overhead_factor = kwargs.get("overhead-factor", 1.3) 54 self.overhead_factor = kwargs.get("overhead-factor", 1.3)
55 self._use_uuid = False
56 self.uuid = None
54 self.use_uuid = kwargs.get("use-uuid", False) 57 self.use_uuid = kwargs.get("use-uuid", False)
55 self.source_file = "" 58 self.source_file = ""
56 self.size = 0 59 self.size = 0
@@ -73,6 +76,16 @@ class Wic_PartData(Mic_PartData):
73 76
74 return retval 77 return retval
75 78
79 @property
80 def use_uuid(self):
81 return self._use_uuid
82
83 @use_uuid.setter
84 def use_uuid(self, value):
85 self._use_uuid = value
86 if value and not self.uuid:
87 self.uuid = str(uuid.uuid4())
88
76 def get_rootfs(self): 89 def get_rootfs(self):
77 """ 90 """
78 Acessor for rootfs dir 91 Acessor for rootfs dir