From 0c489b5f88c9ed907ce274ae28a573a9f9961abb Mon Sep 17 00:00:00 2001
From: Ian Wienand <iwienand@redhat.com>
Date: Thu, 19 Mar 2015 14:34:29 +1100
Subject: [PATCH] Work-around grubby boot failure on Fedora 20

Something about Fedora 20 and the rax layout of /boot/extlinux.conf
makes grubby fail to correctly set the correct default when the kernel
package is updated.  I found what appears to be the bug (referenced
inline) but there is no clear solution.  However, testing shows the
rawhide version works OK, so we can just install that.

Change-Id: I0880c850dedada893d6e3e7e922c2994ece74930
---
 install_puppet.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/install_puppet.sh b/install_puppet.sh
index 65768b330e..f94f85ec12 100755
--- a/install_puppet.sh
+++ b/install_puppet.sh
@@ -53,6 +53,16 @@ function is_opensuse {
 #
 
 function setup_puppet_fedora {
+    # grubby on f20 can eat the "default" line of extlinux.conf when
+    # updating the kernel and create an unbootable system.  There is
+    # an unresolved bug [1], but just install the latest -- which
+    # seems to get around this -- before we update.
+    # [1] https://bugzilla.redhat.com/show_bug.cgi?id=964178
+    if grep -q 'Fedora release 20' /etc/redhat-release; then
+        sudo yum install -y fedora-release-rawhide
+        sudo yum install -y grubby --enablerepo rawhide
+    fi
+
     yum update -y
 
     # NOTE: we preinstall lsb_release to ensure facter sets