From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 7FFDCAC162C for ; Mon, 24 Jul 2023 17:07:44 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=p89zUZ8+ehZBtq7j26VCejEXc3AhC5IUTcssHbM1Cxo=; c=relaxed/simple; d=groups.io; h=X-Received:Subject:To:From:X-Originating-Location:X-Originating-Platform:User-Agent:MIME-Version:Date:Message-ID:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:X-Gm-Message-State:Content-Type; s=20140610; t=1690218463; v=1; b=K1793XbVT9NiUIOUpIWUL1kp5ifudO1vAqMgJpRcMweGyeclyEqzI45yNbkWLhbeXGZqlDqs JFnd8hplU8VDlUUWrd2IclgmMXWU229Ue5lOKhAA9M1EU5Q6a6hdIRSLl7llIPoyEldTP6svLCJ x3TXoBUPjoZvT5fRWUxINiMg= X-Received: by 127.0.0.2 with SMTP id lP5FYY7687511x8NCPEevVQK; Mon, 24 Jul 2023 10:07:43 -0700 Subject: [edk2-devel] Detecting Linux boot failure from UEFI shell (BootServices) To: devel@edk2.groups.io From: yashren.reddi@gmail.com X-Originating-Location: Cape Town, Western Cape, ZA (102.182.200.70) X-Originating-Platform: Linux Chrome 114 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Sun, 23 Jul 2023 23:41:13 -0700 Message-ID: Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,yashren.reddi@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: NugtB0stvdfasmG1hW8LrPrgx7686176AA= Content-Type: multipart/alternative; boundary="CmFCGbgt8gSkXItmFfXK" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=K1793XbV; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io --CmFCGbgt8gSkXItmFfXK Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable I am developing a UEFI application which functions as a bootloader. It is r= equired to handle loading between two Linux kernels dependending on which o= ne failed last (A/B system). Is there a way to detect if the kernel failed to load/start successfully fr= om the UEFI shell or application? I read that there is a hand-over of contr= ol 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? Do= es the return code get persisted in LastError variable? Also, do you know w= here 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 ExitBootS= ervice 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 t= he boot failure flag (I check this on boot to switch between systems). The = problem is that this also catches power failure between setting and clearin= g the flag which is undesirable. Thanks -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- 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] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --CmFCGbgt8gSkXItmFfXK Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable I am developing a UEFI application which functions as a bootloader. It is r= equired to handle loading between two Linux kernels dependending on which o= ne failed last (A/B system). 
Is there a way to detect if the ker= nel 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 ExitBo= otService
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 ca= lled? 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 succes= sfully it clears the boot failure flag (I check this on boot to switch betw= een systems). The problem is that this also catches power failure between s= etting and clearing the flag which is undesirable. 

Thanks
_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#107183) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--CmFCGbgt8gSkXItmFfXK--