1 From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2 Date: Thu, 24 Aug 2017 04:09:59 +0200
3 Subject: [PATCH] states/maas: rm Ubuntu boot entry on EFI systems
5 On EFI-enabled systems, grub-install from grub-efi-* package
6 installs a boot entry named "ubuntu".
8 MaaS relies on IPMI to set boot order to PXE first; however
9 on systems with buggy firmware or without full IPMI support,
10 that fails, leading to booting Ubuntu from hard disk instead.
12 Work around this by clearing any previous Ubuntu boot entry
15 NOTE: This only runs against nodes that are online from a
16 previous deploy, and already automatically registered with
17 the new Salt master node.
21 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
23 mcp/config/states/maas | 5 +++++
24 1 file changed, 5 insertions(+)
26 diff --git a/mcp/config/states/maas b/mcp/config/states/maas
27 index 697f83c..383063d 100755
28 --- a/mcp/config/states/maas
29 +++ b/mcp/config/states/maas
30 @@ -44,6 +44,11 @@ function maas_fixup() {
34 +# UEFI: Clean up Ubuntu boot entry if kvm node online from previous deploy
35 +salt -C 'kvm* or cmp*' cmd.run "(which efibootmgr > /dev/null 2>&1 && \
36 + efibootmgr | grep -oP '(?<=Boot)[0-9]+(?=.*ubuntu)' | \
37 + xargs -I{} efibootmgr --delete-bootnum --bootnum {}) || true"
39 # MaaS rack/region controller, node commissioning
40 salt -C 'mas01*' cmd.run "add-apt-repository ppa:maas/stable"