# Calculate format=diff merge(sys-boot/grub)>=2.00
diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
index 2622638..2a4726b 100644
--- a/util/grub.d/00_header.in
+++ b/util/grub.d/00_header.in
@@ -100,13 +100,13 @@ cat <<EOF
   if [ x\$feature_all_video_module = xy ]; then
     insmod all_video
   else
-    insmod efi_gop
-    insmod efi_uga
-    insmod ieee1275_fb
-    insmod vbe
-    insmod vga
-    insmod video_bochs
-    insmod video_cirrus
+    for vm in efi_gop efi_uga ieee1275_fb vbe vga video_bochs video_cirrus
+    do
+      if [ -f \${prefix}/\${vm}.mod ]
+      then
+        insmod \$vm
+      fi
+    done
   fi
 EOF
 fi
