From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1YRlSV-00049m-R0 for mharc-grub-devel@gnu.org; Sat, 28 Feb 2015 12:45:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRlST-00049a-Lw for grub-devel@gnu.org; Sat, 28 Feb 2015 12:45:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YRlSO-0004Nx-IM for grub-devel@gnu.org; Sat, 28 Feb 2015 12:45:45 -0500 Received: from mail-lb0-x22a.google.com ([2a00:1450:4010:c04::22a]:40498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRlSO-0004Nd-7S for grub-devel@gnu.org; Sat, 28 Feb 2015 12:45:40 -0500 Received: by lbdu10 with SMTP id u10so22843622lbd.7 for ; Sat, 28 Feb 2015 09:45:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-type :content-transfer-encoding; bh=dKbdbMRhrafs9NDrKbcuOHz4W5lp+Z1U3ofHlaY4ZqU=; b=b3d+pD30OdcbQZYt1c0nDNolXTe84nMIp3aeT58fiDGr9I9ui4sh12odXOPVyyxJwd Vr0pdIUxeGBMKOEkfFR5+XVJF2op+4BfgNsrzpwg46O2xIbcE0Tk6shGy7s4VQ762ty/ mKI9p6MnTUqqTDNIxpj7lF2ohmCY1EvlWMpuC1joxF+9wi7QwQOWPJg6f3oY6IqU+NWz QWCQgJjjTBilpGF/AtI5h80GmZd3JdBoWo+TwKad1r7bbwA8rdK6NXc4XKK9o1wX51PR dVTfojSHmznLDMTGtgzuLOCkJCl+8D1kagskpeZtcesyDarZL8ti0tWAc2HYZPEc2b+G 27Dg== X-Received: by 10.112.201.69 with SMTP id jy5mr3234933lbc.78.1425145539094; Sat, 28 Feb 2015 09:45:39 -0800 (PST) Received: from opensuse.site (ppp91-76-14-38.pppoe.mtu-net.ru. [91.76.14.38]) by mx.google.com with ESMTPSA id iy9sm1563490lbc.8.2015.02.28.09.45.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Feb 2015 09:45:38 -0800 (PST) Date: Sat, 28 Feb 2015 20:45:36 +0300 From: Andrei Borzenkov To: grub-devel@gnu.org Subject: normal does not load if there was an error processing embedded config Message-ID: <20150228204536.2e6b197f@opensuse.site> X-Mailer: Claws Mail 3.11.0 (GTK+ 2.24.25; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::22a X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Feb 2015 17:45:46 -0000 Resetting grub_errno to GRUB_ERR_NONE before loading normal does allow it to proceed. At this point I'm not sure what is the correct behavior. Either explicitly check for error and simply do not even try to automatically jump into normal (it is still possible to load it manually) or reset grub_errno and ignore. The problem was exposed by someone trying to build minimal possible image using grub-mkrescue and so omitting most partition modules. This resulted in insmod for partition modules failure in embedded config. I still tend to think the following patch matches current behavior - we do not abort processing embedded config on error either. Alternative would be to check and abort processing as soon as error is encountered. From: Andrei Borzenkov Subject: [PATCH] kernel: reset grub_errno before loading normal If last command in embedded config set grub_errno, loading of normal fails. As we do not really check for any errors during processing of embedded config and cannot handle error that happened in the middle of it, just ignore error and hope for best. --- grub-core/kern/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c index 9cad0c4..2e46e2c 100644 --- a/grub-core/kern/main.c +++ b/grub-core/kern/main.c @@ -304,6 +304,8 @@ grub_main (void) if (load_config) grub_parser_execute (load_config); + /* Reset error, otherwise loading of normal fails */ + grub_errno = GRUB_ERR_NONE; grub_boot_time ("After execution of embedded config. Attempt to go to normal mode"); -- tg: (018f79d..) u/reset-error-before-normal (depends on: master)