2 # Filename: ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/45-grub-images
3 # Purpose: create grub images for use in ISO
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2 or any later version.
7 ################################################################################
12 TMP_CONFIG="/tmp/grub_config_efi"
14 cat > "${target}/${TMP_CONFIG}" <<EOF
15 search.file /conf/bootid.txt root
16 set prefix=(\$root)/boot/grub
19 echo "E: Could not find root device!"
23 declare -A ADDITIONAL_MODULES
24 ADDITIONAL_MODULES[i386-pc]="biosdisk"
26 if ifclass AMD64 ; then
27 if [ -r "${target}"/usr/lib/grub/x86_64-efi/moddep.lst ] ; then
29 ADDITIONAL_MODULES[x86_64-efi]="efi_gop efi_uga"
31 echo "/usr/lib/grub/x86_64-efi/moddep.lst could not be found, skipping."
32 echo "NOTE: grub-efi-amd64-bin not installed?"
36 if ifclass I386 ; then
37 if [ -r "${target}"/usr/lib/grub/i386-efi/moddep.lst ] ; then
39 ADDITIONAL_MODULES[i386-efi]="efi_gop efi_uga"
41 echo "/usr/lib/grub/i386-efi/moddep.lst could not be found, skipping."
42 echo "NOTE: grub-efi-ia32 not installed?"
46 for arch in "${ARCHS[@]}" ; do
49 i386-pc) filename=/boot/grub/grub.img ;;
50 x86_64-efi) filename=/boot/bootx64.efi ;;
51 i386-efi) filename=/boot/bootia32.efi ;;
54 $ROOTCMD grub-mkimage -O $arch -o "$filename" --prefix=/boot/grub/ --config="$TMP_CONFIG" \
55 echo iso9660 part_msdos search_fs_file test \
56 fat ext2 reiserfs xfs btrfs squash4 part_gpt lvm \
57 ${ADDITIONAL_MODULES[$arch]}
60 rm -f "${target}/${TMP_CONFIG}"
61 echo "Generated Grub images"
63 ## END OF FILE #################################################################
64 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2