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/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to