diff options
| author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2015-06-05 10:17:09 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-06-11 23:59:12 +0100 |
| commit | 0510591058657ffe4f3e679838163fc22496c8ac (patch) | |
| tree | 5097b1ef86921082d5a4408d67b9a3f1831ad0db /scripts/lib | |
| parent | 853518523538b274b83e1b7dba2f51a600aa3b02 (diff) | |
| download | poky-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/lib')
| -rw-r--r-- | scripts/lib/wic/kickstart/custom_commands/partition.py | 13 |
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 | ||
| 27 | import os | 27 | import os |
| 28 | import tempfile | 28 | import tempfile |
| 29 | import uuid | ||
| 29 | 30 | ||
| 30 | from pykickstart.commands.partition import * | 31 | from pykickstart.commands.partition import * |
| 31 | from wic.utils.oe.misc import * | 32 | from 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 |
