From patchwork Mon Jan 31 09:18:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 538479 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp1560673imr; Mon, 31 Jan 2022 01:19:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxVTZL3WQrkbBBlVgyeaGfRM0um1AQbl6x/rX5Xbwgwo7GLVVHNHHDwz1oZ3JtHir5AJ1nn X-Received: by 2002:a05:6402:27d4:: with SMTP id c20mr13567123ede.182.1643620745910; Mon, 31 Jan 2022 01:19:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643620745; cv=none; d=google.com; s=arc-20160816; b=xxSQVgpIBXSXnwoB6jXWB6cbAw8G68e3G1zCQLd/z+d+JROH5+cPVkPDj814htsoGW G8cLZl2McHezlAcDyMyrFoQzrWME58hAetKEyQacdnsAbakcY6HzJnOzywZyBRPqwM8G Pmy7yQpuGxaIb6K0Q+oNWos8qmSL8RcYpV8SEJquJZtfyU5hE7JTCE9LDnodXmlZtddq o2WzBz/w7KO75CbRM46OdBxbYJTeoYqUOD3hhD2WD1iylAtIglv+0TEwoFInTdnjxUMm GqmOLkfTH1wWCPhTCs+lV35ACXQE/3UNeUVX1nTWquW6+h4lP0G1NHKAa+zVKQ1WRRHL pN0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=HfZl83iKDo2+VVEewWr4yfcFjeVxEn3Z024ZTCG+dBc=; b=cxLpv5Efzyw25uH8bMTU8kTLU8MfOdbbazqjNsi0b08OF/RhIjoWwHOSrahUXcMSyY 4yKF5dDhDoVrkwK2Oh803xiaIW/5I6HunPFRZhN8Faq6xIj+3k8k6yPQs1q+AjbTPzWj BTFc/j3gSVkYyLtvWQ1fkrqtlX/uboenawNxTX61j1gbyMFQslyMbpLovg7Mdw8eDRVE 91YMCRb7KlPgk5NAzkZhjwhNo3OMzEzxvUijwa9g75le8NX1ZZgb5USa3hQdhZm11dns rkbOtI7alDyAXWjaeWHj5PP199zK9PJ0sDF8v45obO3I7VF2MF9J2JTs1gdCkfyen+On ODIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GoSUPYzT; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id oz9si4369437ejc.814.2022.01.31.01.19.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 01:19:05 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GoSUPYzT; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B3D4283035; Mon, 31 Jan 2022 10:19:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="GoSUPYzT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 807FE82F5A; Mon, 31 Jan 2022 10:19:02 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3984E83102 for ; Mon, 31 Jan 2022 10:18:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masami.hiramatsu@linaro.org Received: by mail-pf1-x42b.google.com with SMTP id a8so12345311pfa.6 for ; Mon, 31 Jan 2022 01:18:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=HfZl83iKDo2+VVEewWr4yfcFjeVxEn3Z024ZTCG+dBc=; b=GoSUPYzTr80FM62EK0XjoEEsjGmNYwN9xxnr/NMKVUC4T4RWhyFd1fOwEchdVdVNZz SLlKLNlhvMw5X5ZZSEC4DUk0HQKIOnN0sZz4nZLO/xnlVn7ciue3n3mFXtyD2W5z6iL7 FE8ZNmSnI4QMnynpnL7vXpGkBq7FViDutt9XdtqY8tIdxg36Rhwe8vSoRQ7J+cgX5E5G VSq2OxBEd595zmgWwkrkLHTk0sPmASLljkSUowlZkp1bt5i/pzNJErygC7U30NdfwMiG PLIBKx213V4boMgP1H3ankZpc0BfrcDqMYqnY41pMFiWd30Rm6ANiHCvkB1NWpWjuaSt Z9vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=HfZl83iKDo2+VVEewWr4yfcFjeVxEn3Z024ZTCG+dBc=; b=pwGIYC2Vp8ealR5qIcWCuGeF1KpU0Lix/zLOq9v41BjqgMetVCNnN7RDndcMin729f nX5/Hh3c+rhCWrNqOWPVNSbbkwzB7jqHAS6W8vtAGQO1QBwuQnQ+dnM28QR9ey5cZUrv h6pLiF0+o3JnmpgzDnFdhE8IEDFzQvQSa61Fx8JLEbyN+nQL0uU1CWn+aG8dfKC3PxDp HgGtKDzjrAkGKC7wFkBZ1aJWp987wbpykKDhZ+CLLznYS8Q0vopuft40B5D7Lk4bTJSd ijJskD32IQKdr58Yw5Rz/gp1HSff+YOWyMp/yn1ZCfEiBhjTnum6Brm04HOEbXMqQwPz xNKA== X-Gm-Message-State: AOAM533nSCHO7nY7De5RhemkYwgxzr9Q7zn18CeIYLxK+sIrAcUm2pse uL1XOJAVgEGMQXRX6Eizcarx4c2u94TOzg== X-Received: by 2002:a63:dc42:: with SMTP id f2mr15727899pgj.477.1643620734474; Mon, 31 Jan 2022 01:18:54 -0800 (PST) Received: from localhost.localdomain (113x37x226x201.ap113.ftth.ucom.ne.jp. [113.37.226.201]) by smtp.gmail.com with ESMTPSA id nl12sm11248381pjb.1.2022.01.31.01.18.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 01:18:54 -0800 (PST) From: Masami Hiramatsu To: u-boot@lists.denx.de Cc: Masami Hiramatsu , Patrick Delaunay , Patrice Chotard , Heinrich Schuchardt , Alexander Graf , AKASHI Takahiro , Simon Glass , Bin Meng , Ilias Apalodimas , Jose Marinho , Grant Likely , Tom Rini , Etienne Carriere , Sughosh Ganu , Paul Liu Subject: [PATCH 1/2] efi_loader: Avoid using efi_update_capsule() from update capsule on disk Date: Mon, 31 Jan 2022 18:18:49 +0900 Message-Id: <164362072975.312714.5769638615920735810.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <164362071931.312714.14793570668139727572.stgit@localhost> References: <164362071931.312714.14793570668139727572.stgit@localhost> User-Agent: StGit/0.19 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean The efi_update_capsule() may have to handle the capsule flags as an UEFI runtime and boottime service, but the capsule-on-disk process doesn't. Thus, the capsule-on-disk should use the efi_capsule_update_firmware() directly instead of efi_update_capsule(). To keep the consistency ESRT also will be updated after all capsule updates are completed. Suggested-by: AKASHI Takahiro Signed-off-by: Masami Hiramatsu --- lib/efi_loader/efi_capsule.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index 4463ae00fd..98dab1c6f5 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -1118,7 +1118,7 @@ efi_status_t efi_launch_capsules(void) index = 0; ret = efi_capsule_read_file(files[i], &capsule); if (ret == EFI_SUCCESS) { - ret = EFI_CALL(efi_update_capsule(&capsule, 1, 0)); + ret = efi_capsule_update_firmware(&capsule); if (ret != EFI_SUCCESS) log_err("Applying capsule %ls failed\n", files[i]); @@ -1142,6 +1142,13 @@ efi_status_t efi_launch_capsules(void) free(files[i]); free(files); + if (IS_ENABLED(CONFIG_EFI_ESRT)) { + /* Rebuild the ESRT to reflect any updated FW images. */ + ret = efi_esrt_populate(); + if (ret != EFI_SUCCESS) + log_warning("ESRT update failed\n"); + } + return ret; } #endif /* CONFIG_EFI_CAPSULE_ON_DISK */ From patchwork Mon Jan 31 09:19:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 538480 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp1560749imr; Mon, 31 Jan 2022 01:19:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJyPeZeD5EAuXgT6aTuCAPKyDtbs9aZPWwn09haM2h9rjABEV6VKgrmQx4ljd1Bx+uNPKvud X-Received: by 2002:a17:907:968f:: with SMTP id hd15mr8142271ejc.208.1643620754685; Mon, 31 Jan 2022 01:19:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643620754; cv=none; d=google.com; s=arc-20160816; b=fd+MNPkEtd+zOblNChXfqp+JpQTVH0LmNCgUdWx7C2DIzw6YVJToQZnBTlg8qSFt28 GysjQgTuEJg1VhggOPLf5kZeFwdkndoQvDjm0cmL2kr1fTgPWiVXRbQLc4XJJrLywGAg y9LaC3tLDf4d0dkuXgYy+6I1ajddx4ZFM1VN1mNUA3XZcV+151mMo94DwYmhGQDL4JG4 Kb0cAJ/fedquVpnXn82/LfTCFB4UFulMvNOLIDzLdUy7C65ppEZxo4n19OqOFS6+/h8E /3oxbF4dFukD/bakZf8iZEJ+yA/aSY2+OMhfPYmh19b8NzJrw5ZETOTMVwcLuV+rNfCU 3lEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=q5iRLj5pXydNTfkMyNfbG+EJFce3wCGI5N7tlf/8VzA=; b=bLzfXlm42DvGGRN74Sg61XWSZMWsJ5dB/8zUE3TO14FaYpeTVIDL2rG+T+9gqxuKjJ /ShGKPnxf+/cWfLTkJmK09GTu/DGPnXeOMQvhAc8ZShtyzWguehOM/1X1SaHnkM1ZKKe cHIDx2WeTySO20hDdALB5cXLt5DS2hZLStZjfVXuFBPaq9Fc5OS+RyZpatec2uMI7pt2 5Q0xjrlZ6ZV9LxY6pxkaoRUdAGVG/7xE47sxvYlNfz7+9hzH8DPbvXdm1hUtuw8yHmFW ZY0WRl292ip5hGVKp1KbY3/aGn16fQy4hoPKb4/pOfmhb9J8NDZ1OK7bHsYggY9xCnSs RY6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ebFJjcXU; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id x93si3754397ede.570.2022.01.31.01.19.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 01:19:14 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ebFJjcXU; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9300483677; Mon, 31 Jan 2022 10:19:12 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="ebFJjcXU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6D8758342C; Mon, 31 Jan 2022 10:19:09 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2D6AF831F8 for ; Mon, 31 Jan 2022 10:19:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masami.hiramatsu@linaro.org Received: by mail-pj1-x102d.google.com with SMTP id oa14-20020a17090b1bce00b001b61aed4a03so11811923pjb.5 for ; Mon, 31 Jan 2022 01:19:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=q5iRLj5pXydNTfkMyNfbG+EJFce3wCGI5N7tlf/8VzA=; b=ebFJjcXUYUrsXw7PBs7DVKTnUz1+1DY4DrmQe/Qf7FrXR/MhpOmXHzEkxLK2zbxNPK VBc56IYacYd8907RTo29YxOR0b0yZ7Y5Jwr4nAd4IAoHQ7s32bVDRAfV5SD0xiBFqMDq jFxO+TIdGaBOqLKTLof/b/Pf/ytlaQgjiO0i5wWQJa8I2Ao6f6G/CzbQtn2k6lgGcoPX QQZnJC/Rxj2nejgHma0ldb1nU1Gj4R2CpISh5JFFJ7zVKN1esCLg26bBFEZbRagsX7YO t05SJZbX37kVTCQV6jrQQuUJxrmlF5skWB7961PqpeBlCpMR+wS3vHiecUSvzJKI7yGr xvNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=q5iRLj5pXydNTfkMyNfbG+EJFce3wCGI5N7tlf/8VzA=; b=AUyyvab83YKbbGmUapqNUnDJVkFgdd2MHT+eIPV5Wp4ERlwVk9BLEUdzNF7Z2JB3IR o9Bls5iSnl1XVgFxWLY/Hu4smv04CIfyGpGplnN7M1UWJDIeyMm5apAxONhLMHguz3gX QTc1Z3QmVg0G413m1paA0Jae12K/mc5B3OLHW7hkMsWez00FRXWVkgQg5naea25hgRVD r5t4IinkdYoGXgIvCRxFvgJDsfGunzfk/tnmAdvZ6xLD/KSAoUQdZvwdqeOFDprf9Wml dE2Otae8fcKiFywDrFAOmhZLft9PheiydJX48ZIto75Eb6z6EJSmurwRCGVpb2ZUpGto KC6w== X-Gm-Message-State: AOAM532rObAJb2MZEiAOsUhLGvbmZe3CGuf+q8xp7eNjSpHcQfRj0o5b RGYEGP0TYy9ngZ8hkzs4UJVRqMJgW4meFQ== X-Received: by 2002:a17:902:d507:: with SMTP id b7mr19647936plg.11.1643620744417; Mon, 31 Jan 2022 01:19:04 -0800 (PST) Received: from localhost.localdomain (113x37x226x201.ap113.ftth.ucom.ne.jp. [113.37.226.201]) by smtp.gmail.com with ESMTPSA id 9sm9008049pjg.50.2022.01.31.01.19.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 01:19:04 -0800 (PST) From: Masami Hiramatsu To: u-boot@lists.denx.de Cc: Masami Hiramatsu , Patrick Delaunay , Patrice Chotard , Heinrich Schuchardt , Alexander Graf , AKASHI Takahiro , Simon Glass , Bin Meng , Ilias Apalodimas , Jose Marinho , Grant Likely , Tom Rini , Etienne Carriere , Sughosh Ganu , Paul Liu Subject: [PATCH 2/2] efi_loader: Reset system after CapsuleUpdate on disk Date: Mon, 31 Jan 2022 18:19:00 +0900 Message-Id: <164362073982.312714.10153796355309762567.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <164362071931.312714.14793570668139727572.stgit@localhost> References: <164362071931.312714.14793570668139727572.stgit@localhost> User-Agent: StGit/0.19 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Add a config option to reset system soon after processing capsule update on disk. This is required in UEFI specification 2.9 Section 8.5.5 "Delivery of Capsules via file on Mass Storage device" as; In all cases that a capsule is identified for processing the system is restarted after capsule processing is completed. Signed-off-by: Masami Hiramatsu --- lib/efi_loader/Kconfig | 10 ++++++++++ lib/efi_loader/efi_capsule.c | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index 24f9a2bb75..db05c3ad90 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -146,6 +146,16 @@ config EFI_IGNORE_OSINDICATIONS without setting the EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED flag in variable OsIndications. +config EFI_RESET_AFTER_CAPSULE_ON_DISK + bool "Reset right after CapsuleUpdate on-disk" + depends on EFI_CAPSULE_ON_DISK + default y + help + UEFI specification requests the system to be restarted after capsule + processing is complete. This implements that, but for some reason, + if you want to keep the (old) system running after the capsule update + on-disk, you can say 'n' here. + config EFI_CAPSULE_ON_DISK_EARLY bool "Initiate capsule-on-disk at U-Boot boottime" depends on EFI_CAPSULE_ON_DISK diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index 98dab1c6f5..44d4fa2f82 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -1142,6 +1142,15 @@ efi_status_t efi_launch_capsules(void) free(files[i]); free(files); + /* + * UEFI spec requires to reset system after complete processing capsule + * update on the storage. + */ + if (IS_ENABLED(CONFIG_EFI_RESET_AFTER_CAPSULE_ON_DISK)) { + log_info("Restarting the system to boot the updated firmware.\n"); + do_reset(NULL, 0, 0, NULL); + } + if (IS_ENABLED(CONFIG_EFI_ESRT)) { /* Rebuild the ESRT to reflect any updated FW images. */ ret = efi_esrt_populate();