public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: yashren.reddi@gmail.com
To: devel@edk2.groups.io
Subject: [edk2-devel] Detecting Linux boot failure from UEFI shell (BootServices)
Date: Sun, 23 Jul 2023 23:41:13 -0700	[thread overview]
Message-ID: <Hcas.1690180873632562857.fblt@groups.io> (raw)

[-- Attachment #1: Type: text/plain, Size: 1559 bytes --]

I am developing a UEFI application which functions as a bootloader. It is required to handle loading between two Linux kernels dependending on which one failed last (A/B system).
Is there a way to detect if the kernel failed to load/start successfully from the UEFI shell or application? I read that there is a hand-over of control to the OS at some point and the OS calls ExitBootService ( https://uefi.org/specs/UEFI/2.9_A/07_Services_Boot_Services.html#efi-boot-services-exit )
but I am not sure about how to retrieve this information from the Shell? Does the return code get persisted in LastError variable? Also, do you know where in the Linux boot process the ExitBootService is called? I'm trying to figure out what actual Linux boot failures I can detect with the ExitBootService return code. For instance, could I detect kernel panic?

Currently, I have a catch all approach, where I persist a boot failure flag before loading the OS, then when the OS is booted successfully it clears the boot failure flag (I check this on boot to switch between systems). The problem is that this also catches power failure between setting and clearing the flag which is undesirable.

Thanks


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107183): https://edk2.groups.io/g/devel/message/107183
Mute This Topic: https://groups.io/mt/100333279/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 2048 bytes --]

             reply	other threads:[~2023-07-24 17:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-24  6:41 yashren.reddi [this message]
2023-07-24 17:28 ` [edk2-devel] Detecting Linux boot failure from UEFI shell (BootServices) Pedro Falcato
2023-07-25 10:06   ` Ard Biesheuvel

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-list 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=Hcas.1690180873632562857.fblt@groups.io \
    --to=devel@edk2.groups.io \
    /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