X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=chroot-script;h=8f8e5ff1eba1aec73e8628bdf7f68ef81e5d7d13;hb=3bcafe4b44b7fa06e12a218e05ebdf21eb00d7e7;hp=ad2344999c9625cba7f85454c6026a88ff69ea3c;hpb=94b63adbec9c06ba30e6e898871462e251ca1823;p=grml-debootstrap.git diff --git a/chroot-script b/chroot-script index ad23449..8f8e5ff 100755 --- a/chroot-script +++ b/chroot-script @@ -717,6 +717,10 @@ grub_install() { echo "Error: grub-install not available. (Error while installing grub package?)" >&2 return 1 fi + if ! [ -x "$(command -v update-grub)" ] ; then + echo "Error: update-grub not available. (Error while installing grub package?)" >&2 + return 1 + fi if [ -n "$SELECTED_PARTITIONS" ] ; then # using sw-raid for device in $SELECTED_PARTITIONS ; do @@ -741,16 +745,6 @@ grub_install() { echo "Adjusting grub configuration for use on ${GRUB}." - # finally install grub - if [ -x /usr/sbin/update-grub ] ; then - UPDATEGRUB='/usr/sbin/update-grub' - elif [ -x /sbin/update-grub ] ; then - UPDATEGRUB='/sbin/update-grub' - else - echo "Error: update-grub not available, can not execute it." >&2 - return 1 - fi - if [ -n "${BOOT_APPEND}" ] ; then echo "Adding BOOT_APPEND configuration ['${BOOT_APPEND}'] to /etc/default/grub." sed -i "/GRUB_CMDLINE_LINUX_DEFAULT/ s#\"\$# ${BOOT_APPEND}\"#" /etc/default/grub @@ -758,7 +752,8 @@ grub_install() { mountpoint /boot/efi &>/dev/null && umount /boot/efi - $UPDATEGRUB + # finally install grub. Existence of update-grub is checked above. + update-grub } # }}}