From patchwork Wed Nov 28 06:00:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 152194 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp699370ljp; Tue, 27 Nov 2018 21:58:53 -0800 (PST) X-Google-Smtp-Source: AJdET5d+ULxie7LDF+ISKwmbNVNe270Thz7KfxZqV0vGkirH0/hFxnQ4iFBiDyeJZ6faf6Ii+Djo X-Received: by 2002:a17:906:37da:: with SMTP id o26-v6mr25636252ejc.179.1543384733253; Tue, 27 Nov 2018 21:58:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543384733; cv=none; d=google.com; s=arc-20160816; b=trp2h8bGoqyZXGXgoelAS/h1yMfSr5XGV8uIi+pIzCqjnzZisdE9M72xoCILHX0Oxk 7flxDoEx1hNdX8fjsGjY0oHL+sS1Z/Sblsfz/Xf6J13pkD8DnwfBpnOGqIrnYXBtCram URg18eAZKVlVsn1vZxWhlqMhYfBoX3ARHlWS0/eKdLlO7LG4RoFK67578SfXnlHeFsUg saj3K/yMN+ChSWFaAo690HjbufN38yhpdlIXu8ZlcVhvnJFW59F0UIBZf2bncADk23FG +I21bx3Sn7lbtsXELKBmNUdTkNb7jQ8BkoSUdWKyTRwY+DgFuNMWkC0KaNZDJ05Vl+j6 tCcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:message-id:date:to:from:dkim-signature; bh=adCzwplWPHaJaEzbjFq2lEdhfI8GG6UPBFdu5ZNLC8o=; b=DOto8xj/3yKhj5+XW5fVEUXX0rHodve4UG5gAHH70SaDnAWTc2rWYrPd1YPpkGYJmF UAvN4/7uFCEUznqhrGFvPzSBQAbVIXKpxJZ8eWK12+fjImXIRuN1QWT1fkLYEHRoZEbu 1s6SkV1puMR7ObEXaLzTlMkqJtDP35RpiQSETEhenj/PybsMz7zlf74y+Ux6CnZI1WWR L8Vr34R/9Jnc2yPLaO+Y9keywgt/boDwLQ4GYc4iEa9GQH3jLhRYH6jemAECPx/d2I2L /+L0LTE+FFS6v6U1rEetYU7SlXOWbXHmemIOiBF9OpAG7jXZyUP8/Yue8fOlC1C6cjlX u1Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="BMgT/gOR"; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id t4-v6si710417eju.217.2018.11.27.21.58.52; Tue, 27 Nov 2018 21:58:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="BMgT/gOR"; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 73707C220CF; Wed, 28 Nov 2018 05:58:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id EAB2EC2212E; Wed, 28 Nov 2018 05:58:44 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D6285C220CF; Wed, 28 Nov 2018 05:58:43 +0000 (UTC) Received: from mail-yb1-f196.google.com (mail-yb1-f196.google.com [209.85.219.196]) by lists.denx.de (Postfix) with ESMTPS id 53224C220CF for ; Wed, 28 Nov 2018 05:58:43 +0000 (UTC) Received: by mail-yb1-f196.google.com with SMTP id u103-v6so10155983ybi.5 for ; Tue, 27 Nov 2018 21:58:43 -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:mime-version :content-transfer-encoding; bh=86YbgciQJStPu3kgXgb2VB+prGLxDSSe/AjlB0osr/Q=; b=BMgT/gOR9Bhgfy0Uel5XD5ECHNlycHKmamnZhz0W89cUOrQ8YBQ2Xbwf3FYmSty0eO 0MrUn1NXpMY/B/IL5H14GvGtCvMZLjxVnoCGXz+eJmHMafO2qrrq1mA1gneV5S/Z5bz0 /dXvUq77KmLAIPzPsb1dfSnjodgBmZjgLdWYE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=86YbgciQJStPu3kgXgb2VB+prGLxDSSe/AjlB0osr/Q=; b=jIlPml6Yg2UTBcc52YKcVS4IISwmNu1bOv+mhULdPK4NM+m9eUfGPfZO72WfAZaIzo APQUrcBamHONRcgj7WZHTh+mwnVWOUy4CeNEHb0FFNsM1thTxeaPqaNqgXPmMDjeSUO6 h/rivikxv2ivVY9uGFUGZLtjuyr+Si4VtUfVDxZFJrIvUhG/VYHI4AChuevG3kzJJjpZ dt+aNbby0DNeck/YzN41jztbAwSRoLS//nzRqkDTs671pNZMWCxQmWhEFAleoH5EX57Y XFOY0RxRAHXGU0BGGdpOAwOx4s/tHk64VVB7HYrMTq21OUCMHf6MqLlcfzfYRiGLRRyS b26w== X-Gm-Message-State: AA+aEWZYUWz/td59eBXAWbo2zFB/keu8/ckzmCGCAc0CpCqW8ktrKpiK MivuvWuhPZj0E0NNsuqZ3YuFwg== X-Received: by 2002:a25:b31d:: with SMTP id l29-v6mr36252319ybj.270.1543384721922; Tue, 27 Nov 2018 21:58:41 -0800 (PST) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id 131sm1647361ywn.88.2018.11.27.21.58.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Nov 2018 21:58:41 -0800 (PST) From: AKASHI Takahiro To: trini@konsulko.com, agraf@suse.de, xypron.glpk@gmx.de Date: Wed, 28 Nov 2018 15:00:55 +0900 Message-Id: <20181128060059.5508-1-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 0/4] efi_loader: non-volatile variables support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" As the subject suggested, this patch set allows any efi variable to be volatile or non-volatile as UEFI specification describes. With my efishell patch[1] with patch #2, you can try as follows: => efi setvar PlatformLang en => efi setvar -nv BootNext =H0200 => env save BootNext will be preserved across reboot, while PlatformLang not. Please note that, currently, setvar command does not automatically append NON_VOLATILE attribute, while UEFI specification expects that PlatformLang be non-volatile, you'd better also specify -nv for this variable here. Patch #2/#3 depend on my efishell patch[1]. Patch #4 depends on my BootNext patch[2]. Patch[1] and [2] have not been merged yet, so patch#1 can be applied on its own. [1] https://lists.denx.de/pipermail/u-boot/2018-November/346450.html [2] https://lists.denx.de/pipermail/u-boot/2018-November/349281.html AKASHI Takahiro (4): efi_loader: support non-volatile variable behavior cmd: efishell: support -nv option to setvar sub-command cmd: efishell: make Boot####/BootOrder variable non-volatile efi_loader: bootmgr: make BootNext non-volatile cmd/efishell.c | 20 ++++++++--- env/env.c | 4 +++ include/efi_loader.h | 1 + lib/efi_loader/efi_bootmgr.c | 3 +- lib/efi_loader/efi_variable.c | 64 +++++++++++++++++++++++++++++++++-- 5 files changed, 84 insertions(+), 8 deletions(-)