Merge "UX: Update bootstrap/target build time estimate."
[armband.git] / patches / fuel-agent / 0007-Add-fs-for-efi-partition.patch
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
4
5 ---
6  debian/control                |  1 +
7  fuel_agent/drivers/nailgun.py | 13 ++++++++++---
8  specs/fuel-agent.spec         |  1 +
9  3 files changed, 12 insertions(+), 3 deletions(-)
10
11 diff --git a/debian/control b/debian/control
12 index 189dc00..acfda35 100644
13 --- a/debian/control
14 +++ b/debian/control
15 @@ -39,6 +39,7 @@ Depends: bzip2,
16          qemu-user-static,
17          binfmt-support,
18          dmidecode,
19 +        dosfstools,
20          ethtool,
21          gdisk,
22          genisoimage,
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
29          # or not
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' %
39                            disk['name'])
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' %
46                            disk['name'])
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',
50 +                                            fs_type='vfat')
51 +                    self._esp_partition_done = True
52  
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
60  Requires:    pciutils
61  Requires:    ethtool
62  Requires:    debootstrap
63 +Requires:    dosfstools
64  Requires:    dpkg
65  Requires:    qemu-user-static
66  Requires:    xz