From 6339a342a20136df8c89826157b2378be80db9c6 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 25 Aug 2011 15:00:52 +0200 Subject: [PATCH] Check for --format option support in grub-mkimage, do not use absolute path for binary call --- grml-live | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/grml-live b/grml-live index 4d4722a..af49433 100755 --- 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 -- 2.1.4