Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752554AbcCRQPM (ORCPT ); Fri, 18 Mar 2016 12:15:12 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:34019 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750947AbcCRQPI (ORCPT ); Fri, 18 Mar 2016 12:15:08 -0400 Date: Fri, 18 Mar 2016 16:15:05 +0000 From: Matt Fleming To: Daniel Baluta Cc: linux-efi@vger.kernel.org, stefan.stanacar@intel.com, octavian.purdila@intel.com, linux-kernel@vger.kernel.org, matthew.k.gumbel@intel.com, mohamed.abbas@intel.com, constantin.musca@intel.com Subject: Re: [PATCH v2] efi: Introduce EFI bootloader control driver Message-ID: <20160318161505.GU2619@codeblueprint.co.uk> References: <1458295910-26557-1-git-send-email-daniel.baluta@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1458295910-26557-1-git-send-email-daniel.baluta@intel.com> User-Agent: Mutt/1.5.24+41 (02bc14ed1569) (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1445 Lines: 33 On Fri, 18 Mar, at 12:11:50PM, Daniel Baluta wrote: > From: Matt Gumbel > > This driver intercepts system reboot requests and populates the > LoaderEntryOneShot EFI variable with the user-supplied reboot > argument. EFI bootloaders such as Gummiboot will consume this > variable and use it to control which OS is booted next. > > We use this with Android where reboot() tells the kernel that > we want to boot into recovery or other non-default OS environment. > > It is the bootloader's job to guard against this variable being > uninitialzed or containing invalid data, and just boot normally > if that is the case. > > Signed-off-by: Matt Gumbel > Signed-off-by: Mohamed Abbas > Signed-off-by: Constantin Musca > Signed-off-by: Daniel Baluta > --- > Changes since v1: > * updated Makefile after changing source name from efibc.c -> efi-bc.c > to comply with naming rules in drivers/firmware/efi/ > > drivers/firmware/efi/Kconfig | 11 ++ > drivers/firmware/efi/Makefile | 1 + > drivers/firmware/efi/efi-bc.c | 251 ++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 263 insertions(+) > create mode 100644 drivers/firmware/efi/efi-bc.c Why does this require a driver? Why is it not possible to solve this problem by creating the variable in userspace before invoking reboot(2)?