Check for --format option support in grub-mkimage, do not use absolute path for binar...
authorMichael Prokop <mika@grml.org>
Thu, 25 Aug 2011 13:00:52 +0000 (15:00 +0200)
committerMichael Prokop <mika@grml.org>
Fri, 9 Sep 2011 08:38:16 +0000 (10:38 +0200)
grml-live

index 4d4722a..af49433 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -771,18 +771,21 @@ 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
-         if ! [ -x /usr/bin/grub-mkimage ] ; then
+         if ! which "grub-mkimage" >/dev/null 2>&1 ; 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
+           ewarn "Please install grub-pc-bin or grub-common >= 1.98+20100804-14." ; eend 0
+         elif ! grub-mkimage --help | grep -q -- --format ; then
+           log   "grub-mkimage does not support --format=i386-pc, skipping Grub step therefore." ; eend 0
+           ewarn "grub-mkimage does not support --format=i386-pc, skipping Grub step therefore."
+           ewarn "Please install grub-common >= 1.98+20100804-14 or grub-pc-bin." ; eend 0
          else
-           # copy system grub files if grml-live-compat is not
-           # installed.
+           # 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 \
+           grub-mkimage -d /usr/lib/grub/*-pc -o \
              "${BUILD_OUTPUT}/boot/grub/core.img" biosdisk iso9660 --format=i386-pc
          fi
        fi