Make the GRUB images modular
[grml-live.git] / etc / grml / fai / config / scripts / GRMLBASE / 45-grub-images
index 6024989..5541da6 100755 (executable)
@@ -16,13 +16,11 @@ 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
+search.file /conf/bootid.txt root
+set prefix=(\$root)/boot/grub
+insmod normal
+normal
+echo "E: Could not find root device!"
 EOF
 
 BOOTX64="${BOOTX64##${target}}"
@@ -50,11 +48,8 @@ TMP_CONFIG="${TMP_CONFIG##${target}}"
 
 for arch in ${ARCHS[@]} ; do
 $ROOTCMD grub-mkimage -O $arch -o /boot/$arch.img --prefix=/boot/grub/ --config="$TMP_CONFIG" \
-  bitmap boot btrfs cat chain cmp configfile cpio echo elf ext2    \
-  fat gfxmenu gfxterm gzio help iso9660 jpeg linux loopback lvm    \
-  memdisk 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 ${ADDITIONAL_MODULES[$arch]}
+  echo iso9660 part_msdos search_fs_file test \
+  ${ADDITIONAL_MODULES[$arch]}
 done
 
 if [ -f "${target}/boot/i386-pc.img" ] ; then
@@ -71,7 +66,7 @@ if ifclass AMD64 ; then
     exit 1
   fi
 
-  SIZE=$(du --apparent-size -sk "${target}/${BOOTX64}" | awk -F" " '{print $1'})
+  SIZE=$(du --apparent-size -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