Use grub from target
authorChristian Hofstaedtler <ch@grml.org>
Thu, 8 Dec 2011 02:09:56 +0000 (03:09 +0100)
committerChristian Hofstaedtler <ch@grml.org>
Thu, 8 Dec 2011 02:09:56 +0000 (03:09 +0100)
This clears up the sources problem and the features problem.

etc/grml/fai/config/scripts/GRMLBASE/44-grub [new file with mode: 0755]
grml-live

diff --git a/etc/grml/fai/config/scripts/GRMLBASE/44-grub b/etc/grml/fai/config/scripts/GRMLBASE/44-grub
new file mode 100755 (executable)
index 0000000..c96b3e3
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+# Filename:      ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/44-grub
+# Purpose:       build grub core.img to use outside
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2 or any later version.
+################################################################################
+
+set -e
+set -u
+
+$ROOTCMD grub-mkimage -d /usr/lib/grub/*-pc \
+  -o /boot/grub/core.img \
+  biosdisk iso9660 \
+  --format=i386-pc
+
+## END OF FILE #################################################################
+# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2
index 84ec355..83ef125 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -878,27 +878,12 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then
        fi
        cp ${TEMPLATE_DIRECTORY}/boot/grub/* "$BUILD_OUTPUT"/boot/grub/
 
-       if [ -e ${TEMPLATE_DIRECTORY}/compat/grub/linux.mod ]; then
-         cp "${TEMPLATE_DIRECTORY}"/compat/grub/* "${BUILD_OUTPUT}"/boot/grub/
-       else
-         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 "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
-           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/
-           grub-mkimage -d /usr/lib/grub/*-pc -o \
-             "${BUILD_OUTPUT}/boot/grub/core.img" biosdisk iso9660 --format=i386-pc
-         fi
-       fi
+       # copy grub files from target
+       cp -a "${CHROOT_OUTPUT}"/usr/lib/grub/*-pc/*.mod "${BUILD_OUTPUT}"/boot/grub/
+       cp -a "${CHROOT_OUTPUT}"/usr/lib/grub/*-pc/*.o "${BUILD_OUTPUT}"/boot/grub/
+       cp -a "${CHROOT_OUTPUT}"/usr/lib/grub/*-pc/*.lst "${BUILD_OUTPUT}"/boot/grub/
+       cp -a "${CHROOT_OUTPUT}"/usr/share/grub/ascii.pf2 "${BUILD_OUTPUT}"/boot/grub/
+       cp -a "${CHROOT_OUTPUT}"/boot/grub/core.img "${BUILD_OUTPUT}"/boot/grub/
 
        if ! [ -d "${TEMPLATE_DIRECTORY}"/GRML ] ; then
           log    "Error: ${TEMPLATE_DIRECTORY}/GRML does not exist. Exiting."