Build grub.img for loading grub from within syslinux
[grml-live.git] / etc / grml / fai / config / scripts / GRMLBASE / 45-efi
diff --git a/etc/grml/fai/config/scripts/GRMLBASE/45-efi b/etc/grml/fai/config/scripts/GRMLBASE/45-efi
deleted file mode 100755 (executable)
index 673ac6b..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/bash
-# Filename:      ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/45-efi
-# Purpose:       create grub image for use in ISO for EFI boot
-# 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
-
-if ! ifclass AMD64 ; then
-  echo "Not in AMD64 class but EFI feature is restricted to amd64 only, skipping."
-  exit 0
-fi
-
-set -u
-
-if ! [ -r "${target}"/usr/lib/grub/x86_64-efi/moddep.lst ] ; then
-  echo "/usr/lib/grub/x86_64-efi/moddep.lst could not be found, skipping."
-  echo "NOTE: grub-efi-amd64-bin not installed?"
-  exit 0
-fi
-
-BOOTX64="${target}/boot/bootx64.efi"
-EFI_IMG="${target}/boot/efi.img"
-TMP_CONFIG="${target}/tmp/grub_config_efi"
-
-rm -f "$BOOTX64" "$EFI_IMG" "$TMP_CONFIG"
-
-cat > "$TMP_CONFIG" <<EOF
-search --set -f /conf/bootid.txt root
-if [ -e /boot/grub/grub.cfg ]; then
- set prefix=(\$root)/boot/grub
- configfile /boot/grub/grub.cfg
-else
- echo "E: Could not find root device!"
-fi
-EOF
-
-BOOTX64="${BOOTX64##${target}}"
-EFI_IMG="${EFI_IMG##${target}}"
-TMP_CONFIG="${TMP_CONFIG##${target}}"
-
-$ROOTCMD grub-mkimage -O x86_64-efi -o "$BOOTX64" --prefix=/boot/grub/ --config="$TMP_CONFIG" \
-  bitmap boot btrfs cat chain cmp configfile cpio echo efi_gop       \
-  efi_uga elf ext2 fat gfxmenu gfxterm gzio help iso9660 jpeg linux  \
-  loopback lvm minicmd multiboot normal part_gpt part_msdos play png \
-  probe raid regexp reiserfs search search_fs_file search_fs_uuid    \
-  search_label squash4 terminal test video videoinfo xfs
-
-if ! [ -r "${target}/${BOOTX64}" ] ; then
-  echo "Can not access grub efi image." >&2
-  exit 1
-fi
-
-SIZE=$(du -sk "${target}/${BOOTX64}" | awk -F" " '{print $1'})
-SIZE=$(((($SIZE / 32 )+2)*32))
-
-dd if=/dev/zero of="${target}/${EFI_IMG}" bs=1k count="$SIZE" 2>/dev/null
-$ROOTCMD mkfs.vfat -n GRML "$EFI_IMG" >/dev/null
-$ROOTCMD mmd -i "$EFI_IMG" ::EFI
-$ROOTCMD mmd -i "$EFI_IMG" ::EFI/BOOT
-$ROOTCMD mcopy -i "$EFI_IMG" "$BOOTX64" ::EFI/BOOT/bootx64.efi >/dev/null
-
-rm -f "${target}/${TMP_CONFIG}"
-
-echo "Generated EFI image $BOOTX64"
-echo "Generated bootx64 image $EFI_IMG"
-
-## END OF FILE #################################################################
-# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2