From: Carles Pina i Estany <carles@pina.cat>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] Warning if grub.cfg not found
Date: Sat, 27 Sep 2008 19:37:52 +0200 [thread overview]
Message-ID: <20080927173752.GA23044@pina.cat> (raw)
In-Reply-To: <20080905165932.GC5625@pina.cat>
[-- Attachment #1: Type: text/plain, Size: 1126 bytes --]
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 <carles@pina.cat>
* 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
[-- Attachment #2: warning_grub.cfg.patch --]
[-- Type: text/x-diff, Size: 534 bytes --]
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);
next prev parent reply other threads:[~2008-09-27 17:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-23 14:43 [PATCH] Warning if grub.cfg not found Carles Pina i Estany
2008-08-23 14:48 ` Carles Pina i Estany
2008-08-30 11:43 ` Robert Millan
2008-09-05 16:59 ` Carles Pina i Estany
2008-09-27 17:37 ` Carles Pina i Estany [this message]
2008-09-28 13:26 ` Robert Millan
2008-09-28 21:41 ` Carles Pina i Estany
2008-09-29 14:54 ` Robert Millan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080927173752.GA23044@pina.cat \
--to=carles@pina.cat \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.