From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kjdk0-0004oz-5g for mharc-grub-devel@gnu.org; Sat, 27 Sep 2008 13:38:00 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kjdjy-0004op-7N for grub-devel@gnu.org; Sat, 27 Sep 2008 13:37:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kjdjw-0004od-NL for grub-devel@gnu.org; Sat, 27 Sep 2008 13:37:56 -0400 Received: from [199.232.76.173] (port=59167 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kjdjw-0004oa-Hl for grub-devel@gnu.org; Sat, 27 Sep 2008 13:37:56 -0400 Received: from 197.red-80-32-81.staticip.rima-tde.net ([80.32.81.197]:34561 helo=mail.pina.cat) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kjdjv-0007AQ-Vq for grub-devel@gnu.org; Sat, 27 Sep 2008 13:37:56 -0400 Received: from pinux (unknown [192.168.0.78]) by mail.pina.cat (Postfix) with ESMTP id 502BD288FBA37 for ; Sat, 27 Sep 2008 19:37:53 +0200 (CEST) Received: by pinux (Postfix, from userid 1000) id EF7D3491D; Sat, 27 Sep 2008 19:37:52 +0200 (CEST) Date: Sat, 27 Sep 2008 19:37:52 +0200 From: Carles Pina i Estany To: The development of GRUB 2 Message-ID: <20080927173752.GA23044@pina.cat> References: <20080823144313.GA24757@pina.cat> <20080830114315.GC16775@thorin> <20080905165932.GC5625@pina.cat> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="tKW2IUtsqtDRztdT" Content-Disposition: inline In-Reply-To: <20080905165932.GC5625@pina.cat> User-Agent: Mutt/1.5.18 (2008-05-17) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: [PATCH] Warning if grub.cfg not found X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2008 17:37:58 -0000 --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 * 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 --tKW2IUtsqtDRztdT Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="warning_grub.cfg.patch" 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); --tKW2IUtsqtDRztdT--