From 6f8b8f07b20ca501c0e3a19bde11ddd630979269 Mon Sep 17 00:00:00 2001 From: Lucas Alvares Gomes Date: Fri, 12 Jul 2013 17:15:08 +0100 Subject: [PATCH] F19 GRUB configuration file In the 51-grub hook, after the GRUB installation, the script will look for a GRUB configuration file and in case it's not present one will be generated using the grub-mkconfig command. The reason why it have to be done is because the new Fedora 19 cloud images is using extlinux by default. Change-Id: I80b15b3122698d98ac4d47dc06faf5909a90ab00 --- .../52-force-text-mode-console} | 0 elements/vm/finalise.d/51-grub | 11 +++++++++++ 2 files changed, 11 insertions(+) rename elements/base/{install.d/05-force-text-mode-console => finalise.d/52-force-text-mode-console} (100%) diff --git a/elements/base/install.d/05-force-text-mode-console b/elements/base/finalise.d/52-force-text-mode-console similarity index 100% rename from elements/base/install.d/05-force-text-mode-console rename to elements/base/finalise.d/52-force-text-mode-console diff --git a/elements/vm/finalise.d/51-grub b/elements/vm/finalise.d/51-grub index 4880f4d1f..fbef6e5af 100755 --- a/elements/vm/finalise.d/51-grub +++ b/elements/vm/finalise.d/51-grub @@ -35,6 +35,17 @@ if [ -f "/boot/grub/grub.cfg" ] ; then elif [ -f "/boot/grub2/grub.cfg" ] ; then GRUB_CFG=/boot/grub2/grub.cfg fi + +# If GRUB configuration file does not exist, generate one +if [ ! $GRUB_CFG ]; then + if [ -d /boot/grub2 ]; then + GRUB_CFG=/boot/grub2/grub.cfg + elif [ -d /boot/grub ]; then + GRUB_CFG=/boot/grub/grub.cfg + fi + grub2-mkconfig -o $GRUB_CFG +fi; + DIST=`lsb_release -is` [ -n "$DIST" ] RELEASE=`lsb_release -cs`