summaryrefslogtreecommitdiffstats
path: root/patches/opnfv-fuel/0014-lib.sh-rm-Ubuntu-boot-entry-on-EFI-systems.patch
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-09-11 20:17:20 +0200
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-09-11 21:43:00 +0200
commit9519a11e1fe0eb26cf5b776d8479065f2f710737 (patch)
tree984abae9d48cbc1a53612921d344949bfd40b877 /patches/opnfv-fuel/0014-lib.sh-rm-Ubuntu-boot-entry-on-EFI-systems.patch
parent6ea6921ad4ad2bea138151da0fea02b30d0c839a (diff)
u/fuel: Bump & rebase for multiarch reclass
Change-Id: I3de41645b7424195b9c8d5884a7c9de1fabf68cb Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'patches/opnfv-fuel/0014-lib.sh-rm-Ubuntu-boot-entry-on-EFI-systems.patch')
-rw-r--r--patches/opnfv-fuel/0014-lib.sh-rm-Ubuntu-boot-entry-on-EFI-systems.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/patches/opnfv-fuel/0014-lib.sh-rm-Ubuntu-boot-entry-on-EFI-systems.patch b/patches/opnfv-fuel/0014-lib.sh-rm-Ubuntu-boot-entry-on-EFI-systems.patch
new file mode 100644
index 00000000..aa6aa5a3
--- /dev/null
+++ b/patches/opnfv-fuel/0014-lib.sh-rm-Ubuntu-boot-entry-on-EFI-systems.patch
@@ -0,0 +1,60 @@
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+: Copyright (c) 2017 Enea AB and others.
+:
+: All rights reserved. This program and the accompanying materials
+: are made available under the terms of the Apache License, Version 2.0
+: which accompanies this distribution, and is available at
+: http://www.apache.org/licenses/LICENSE-2.0
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Thu, 24 Aug 2017 04:09:59 +0200
+Subject: [PATCH] lib.sh: rm Ubuntu boot entry on EFI systems
+
+On EFI-enabled systems, grub-install from grub-efi-* package
+installs a boot entry named "ubuntu".
+
+MaaS relies on IPMI to set boot order to PXE first; however
+on systems with buggy firmware or without full IPMI support,
+that fails, leading to booting Ubuntu from hard disk instead.
+
+Work around this by clearing any previous Ubuntu boot entry
+from board flash, before starting a new baremetal deploy.
+
+NOTE: This only runs against nodes that are online from a
+previous deploy.
+
+Closes: ARMBAND-47
+
+Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+---
+ mcp/scripts/lib.sh | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh
+index e123e52..2da13c0 100644
+--- a/mcp/scripts/lib.sh
++++ b/mcp/scripts/lib.sh
+@@ -28,6 +28,15 @@ get_base_image() {
+ wget -P "${image_dir}" -N "${base_image}"
+ }
+
++cleanup_uefi() {
++ # Clean up Ubuntu boot entry if cfg01, kvm nodes online from previous deploy
++ # shellcheck disable=SC2086
++ ssh ${SSH_OPTS} "ubuntu@${SALT_MASTER}" "sudo salt -C 'kvm* or cmp*' cmd.run \
++ \"which efibootmgr > /dev/null 2>&1 && \
++ efibootmgr | grep -oP '(?<=Boot)[0-9]+(?=.*ubuntu)' | \
++ xargs -I{} efibootmgr --delete-bootnum --bootnum {}\"" || true
++}
++
+ cleanup_vms() {
+ # clean up existing nodes
+ for node in $(virsh list --name | grep -P '\w{3}\d{2}'); do
+@@ -45,6 +54,7 @@ prepare_vms() {
+ local base_image=$2
+ local image_dir=$3
+
++ cleanup_uefi
+ cleanup_vms
+ get_base_image "${base_image}" "${image_dir}"
+ # shellcheck disable=SC2016