Make sure grub-mkimage exists, otherwise warn user about grub-common/grub-pc
authorMichael Prokop <mika@grml.org>
Thu, 25 Aug 2011 11:15:45 +0000 (13:15 +0200)
committerMichael Prokop <mika@grml.org>
Fri, 9 Sep 2011 08:38:16 +0000 (10:38 +0200)
grml-live

index 25d13d7..d02bb57 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -770,14 +770,20 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then
        if [ -e ${TEMPLATE_DIRECTORY}/compat/grub/linux.mod ]; then
          cp "${TEMPLATE_DIRECTORY}"/compat/grub/* "${BUILD_OUTPUT}"/boot/grub/
        else
-         # copy system grub files if grml-live-compat is not
-         # installed.
-         cp -a /usr/lib/grub/*-pc/*.mod "${BUILD_OUTPUT}"/boot/grub/
-         cp -a /usr/lib/grub/*-pc/*.o "${BUILD_OUTPUT}"/boot/grub/
-         cp -a /usr/lib/grub/*-pc/*.lst "${BUILD_OUTPUT}"/boot/grub/
-         cp -a /usr/share/grub/ascii.pf2 "${BUILD_OUTPUT}"/boot/grub/
-         /usr/bin/grub-mkimage -d /usr/lib/grub/*-pc -o \
-           "${BUILD_OUTPUT}/boot/grub/core.img" biosdisk iso9660 --format=i386-pc
+         if ! [ -x /usr/bin/grub-mkimage ] ; then
+           log   "grub-mkimage not found, skipping Grub step therefore." ; eend 0
+           ewarn "grub-mkimage not found, skipping Grub step therefore."
+           ewarn "Either install grub-common >= 1.98+20100804-14 or grub-pc." ; eend 0
+         else
+           # copy system grub files if grml-live-compat is not
+           # installed.
+           cp -a /usr/lib/grub/*-pc/*.mod "${BUILD_OUTPUT}"/boot/grub/
+           cp -a /usr/lib/grub/*-pc/*.o "${BUILD_OUTPUT}"/boot/grub/
+           cp -a /usr/lib/grub/*-pc/*.lst "${BUILD_OUTPUT}"/boot/grub/
+           cp -a /usr/share/grub/ascii.pf2 "${BUILD_OUTPUT}"/boot/grub/
+           /usr/bin/grub-mkimage -d /usr/lib/grub/*-pc -o \
+             "${BUILD_OUTPUT}/boot/grub/core.img" biosdisk iso9660 --format=i386-pc
+         fi
        fi
 
        if ! [ -d "${TEMPLATE_DIRECTORY}"/GRML ] ; then