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 4880f4d1..fbef6e5a 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`