1 From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
2 Date: Tue, 8 Mar 2016 21:08:55 +0100
3 Subject: [PATCH] Add fs for efi partition
7 fuel_agent/drivers/nailgun.py | 13 ++++++++++---
8 specs/fuel-agent.spec | 1 +
9 3 files changed, 12 insertions(+), 3 deletions(-)
11 diff --git a/debian/control b/debian/control
12 index 189dc00..acfda35 100644
15 @@ -39,6 +39,7 @@ Depends: bzip2,
23 diff --git a/fuel_agent/drivers/nailgun.py b/fuel_agent/drivers/nailgun.py
24 index bc532b4..f092865 100644
25 --- a/fuel_agent/drivers/nailgun.py
26 +++ b/fuel_agent/drivers/nailgun.py
27 @@ -81,6 +81,9 @@ class Nailgun(BaseDataDriver):
28 # was already allocated on first matching volume
30 self._boot_partition_done = False
31 + # this var states whether ESP partition was already
32 + # allocated on the first matching volume or not
33 + self._esp_partition_done = False
34 # this var is used as a flag that /boot fs
35 # has already been added. we need this to
36 # get rid of md over all disks for /boot partition.
37 @@ -321,10 +324,14 @@ class Nailgun(BaseDataDriver):
38 LOG.debug('Adding bios_grub partition on disk %s: size=24' %
40 parted.add_partition(size=24, flags=['bios_grub'])
41 - # uefi partition (for future use)
42 - LOG.debug('Adding UEFI partition on disk %s: size=200' %
43 + # uefi partition - added only once.
44 + if self._is_boot_disk(disk) and not self._esp_partition_done:
45 + LOG.debug('Adding UEFI partition on disk %s: size=200' %
47 - parted.add_partition(size=200, flags=['esp'])
48 + prt = parted.add_partition(size=200, flags=['esp'])
49 + partition_scheme.add_fs(device=prt.name, mount='/boot/efi',
51 + self._esp_partition_done = True
53 LOG.debug('Looping over all volumes on disk %s' % disk['name'])
54 for volume in disk['volumes']:
55 diff --git a/specs/fuel-agent.spec b/specs/fuel-agent.spec
56 index a43f693..c2b9b51 100644
57 --- a/specs/fuel-agent.spec
58 +++ b/specs/fuel-agent.spec
59 @@ -50,6 +50,7 @@ Requires: xfsprogs
65 Requires: qemu-user-static