Hello,

I "recover" an old thread...

Long time ago I was thinking in a better warning when Grub2 couldn't
open grub.cfg file.

I send attached a new patch for it (previous one was a bit incorrect,
this one is shorter cleaner, showing the warning in a better place).

Question: What should Grub do when Grub cannot open find fs.lst and
command.lst?  I'm reading the code and in both cases it's doing nothing
(no warning, etc.).

In my understanding, if grub.cfg is missing probably it's a user error
and we should warn the user. If user doesn't want a grub.cfg (??) user
can have an empty grub.cfg.

I also send the ChangeLog, just in case it's correct and we don't want
anything else for fs.lst and command.lst:

-------
2008-09-27  Carles Pina i Estany  <[EMAIL PROTECTED]>
        * normal/main.c (read_config_file): Warn the user when Grub
        cannot open grub.cfg file.
-------
          
Thanks,

PS: if you want to test the patch, don't waste your time and remember
that grub-mkrescue is generating a grub.cfg file with the modules! (I
lost quite much time with it :-) )

-- 
Carles Pina i Estany            GPG id: 0x17756391
        http://pinux.info
Index: normal/main.c
===================================================================
--- normal/main.c	(revision 1877)
+++ normal/main.c	(working copy)
@@ -230,7 +230,13 @@
   /* Try to open the config file.  */
   file = grub_file_open (config);
   if (! file)
-    return 0;
+    {
+      grub_printf("Cannot open %s file\n",config);
+      grub_print_error ();
+      grub_printf("Falling back to the Grub console\n");
+      grub_wait_after_message ();
+      return 0;
+    }
 
   grub_env_set_data_slot ("menu", newmenu);
 
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to