From c1c2f7147b47c651d8d0f7d6c7ba6ff1c35b454d Mon Sep 17 00:00:00 2001 From: Matthew Thode Date: Mon, 22 Aug 2016 07:09:57 -0500 Subject: [PATCH] Update GRUB_MKCONFIG for detecting what's installed Gentoo has updated it's grub ebuild to default to the upstream recommended installation parameter of grub-mkconfig instead of our default multislot installation of grub2-mkconfig. Update the command line parameter so that it works with both. Change-Id: I359b44338a4f76af7c026f5cad212e6dc3dbf2b3 --- elements/bootloader/finalise.d/50-bootloader | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/elements/bootloader/finalise.d/50-bootloader b/elements/bootloader/finalise.d/50-bootloader index eb902f6c..b64f4e7d 100755 --- a/elements/bootloader/finalise.d/50-bootloader +++ b/elements/bootloader/finalise.d/50-bootloader @@ -137,7 +137,11 @@ function install_grub2 { echo 'GRUB_GFXPAYLOAD_LINUX=text' >>/etc/default/grub echo 'GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200 no_timer_check"' >>/etc/default/grub echo 'GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"' >>/etc/default/grub - GRUB_MKCONFIG="grub2-mkconfig -o $GRUB_CFG" + if which grub2-mkconfig >/dev/null; then + GRUB_MKCONFIG="grub2-mkconfig -o $GRUB_CFG" + else + GRUB_MKCONFIG="grub-mkconfig -o $GRUB_CFG" + fi DISTRO_NAME=${DISTRO_NAME:-} case $DISTRO_NAME in 'ubuntu'|'debian')