1 From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2 Date: Tue, 8 Mar 2016 16:29:39 +0100
3 Subject: [PATCH] Add <esp> partition flag.
5 Parted flag <esp> (see [1]) will mark EFI system partition, allowing us
6 to properly format and mount it during do_partitioning deployment phase.
8 [1] https://www.gnu.org/software/parted/manual/html_node/set.html
10 fuel_agent/drivers/nailgun.py | 2 +-
11 fuel_agent/utils/partition.py | 4 ++--
12 2 files changed, 3 insertions(+), 3 deletions(-)
14 diff --git a/fuel_agent/drivers/nailgun.py b/fuel_agent/drivers/nailgun.py
15 index 3807ca7..bc532b4 100644
16 --- a/fuel_agent/drivers/nailgun.py
17 +++ b/fuel_agent/drivers/nailgun.py
18 @@ -324,7 +324,7 @@ class Nailgun(BaseDataDriver):
19 # uefi partition (for future use)
20 LOG.debug('Adding UEFI partition on disk %s: size=200' %
22 - parted.add_partition(size=200)
23 + parted.add_partition(size=200, flags=['esp'])
25 LOG.debug('Looping over all volumes on disk %s' % disk['name'])
26 for volume in disk['volumes']:
27 diff --git a/fuel_agent/utils/partition.py b/fuel_agent/utils/partition.py
28 index acdd0b3..86349d2 100644
29 --- a/fuel_agent/utils/partition.py
30 +++ b/fuel_agent/utils/partition.py
31 @@ -93,7 +93,7 @@ def set_partition_flag(dev, num, flag, state='on'):
32 :param dev: A device file, e.g. /dev/sda.
33 :param num: Partition number
34 :param flag: Flag name. Must be one of 'bios_grub', 'legacy_boot',
35 - 'boot', 'raid', 'lvm'
36 + 'boot', 'raid', 'lvm', 'esp'
37 :param state: Desiable flag state. 'on' or 'off'. Default is 'on'.
40 @@ -103,7 +103,7 @@ def set_partition_flag(dev, num, flag, state='on'):
41 # parted supports more flags but we are interested in
42 # setting only this subset of them.
43 # not all of these flags are compatible with one another.
44 - if flag not in ('bios_grub', 'legacy_boot', 'boot', 'raid', 'lvm'):
45 + if flag not in ('bios_grub', 'legacy_boot', 'boot', 'raid', 'lvm', 'esp'):
46 raise errors.WrongPartitionSchemeError(
47 'Unsupported partition flag: %s' % flag)
48 if state not in ('on', 'off'):