grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: grub-devel@gnu.org
Subject: normal does not load if there was an error processing embedded config
Date: Sat, 28 Feb 2015 20:45:36 +0300	[thread overview]
Message-ID: <20150228204536.2e6b197f@opensuse.site> (raw)

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 <arvidjaar@gmail.com>
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)


             reply	other threads:[~2015-02-28 17:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-28 17:45 Andrei Borzenkov [this message]
2015-02-28 18:11 ` normal does not load if there was an error processing embedded config Vladimir 'phcoder' Serbinenko
2015-02-28 19:33   ` Andrei Borzenkov
2015-12-16 18:45     ` Andrei Borzenkov

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=20150228204536.2e6b197f@opensuse.site \
    --to=arvidjaar@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).