diff --git a/tools/appliance/definitions/systemvmtemplate/configure_grub.sh b/tools/appliance/definitions/systemvmtemplate/configure_grub.sh index d530bb93bf9..7978bec5301 100644 --- a/tools/appliance/definitions/systemvmtemplate/configure_grub.sh +++ b/tools/appliance/definitions/systemvmtemplate/configure_grub.sh @@ -1,5 +1,13 @@ +#!/bin/bash + +set -e +set -x + # Remove 5s grub timeout to speed up booting -cat < /etc/default/grub +function configure_grub() { + grep GRUB_TIMEOUT=0 /etc/default/grub && return + + cat < /etc/default/grub # If you change this file, run 'update-grub' afterwards to update # /boot/grub/grub.cfg. @@ -10,4 +18,7 @@ GRUB_CMDLINE_LINUX_DEFAULT="quiet" GRUB_CMDLINE_LINUX="debian-installer=en_US" EOF -update-grub + update-grub +} + +return 2>/dev/null || configure_grub