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>
This commit is contained in:
parent
8535185235
commit
0510591058
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import uuid
|
||||||
|
|
||||||
from pykickstart.commands.partition import *
|
from pykickstart.commands.partition import *
|
||||||
from wic.utils.oe.misc 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.no_table = kwargs.get("no-table", False)
|
||||||
self.extra_space = kwargs.get("extra-space", "10M")
|
self.extra_space = kwargs.get("extra-space", "10M")
|
||||||
self.overhead_factor = kwargs.get("overhead-factor", 1.3)
|
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.use_uuid = kwargs.get("use-uuid", False)
|
||||||
self.source_file = ""
|
self.source_file = ""
|
||||||
self.size = 0
|
self.size = 0
|
||||||
|
@ -73,6 +76,16 @@ class Wic_PartData(Mic_PartData):
|
||||||
|
|
||||||
return retval
|
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):
|
def get_rootfs(self):
|
||||||
"""
|
"""
|
||||||
Acessor for rootfs dir
|
Acessor for rootfs dir
|
||||||
|
|
Loading…
Reference in New Issue