Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757637AbcCXOry (ORCPT ); Thu, 24 Mar 2016 10:47:54 -0400 Received: from mail-wm0-f45.google.com ([74.125.82.45]:33981 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757577AbcCXOro (ORCPT ); Thu, 24 Mar 2016 10:47:44 -0400 Date: Thu, 24 Mar 2016 14:47:41 +0000 From: Matt Fleming To: "Stanacar, Stefan" Cc: "Baluta, Daniel" , "linux-efi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Abbas, Mohamed" , "Gumbel, Matthew K" , "Musca, Constantin" , "Purdila, Octavian" , Darren Hart Subject: Re: [PATCH v2] efi: Introduce EFI bootloader control driver Message-ID: <20160324144741.GA4328@codeblueprint.co.uk> References: <1458295910-26557-1-git-send-email-daniel.baluta@intel.com> <20160318161505.GU2619@codeblueprint.co.uk> <1458328697.16385.21.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1458328697.16385.21.camel@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: 1442 Lines: 35 (Sorry for the delay) On Fri, 18 Mar, at 07:18:17PM, Stanacar, Stefan wrote: > > Hi Matt, > > It is possible, but that means modifying those userspace apps :) > There are reboot implementations that do "reboot ", such as > Android's reboot command [1] and Upstart's reboot replacement [2], which > pass the reason as an argument to the reboot syscall.? > Probably your first question will be - "Why don't you modify those > apps?" Your guess is correct ;) > Well, I don't see platform-agnostic way how those could be > modified to pass the reason to the bootloader, regardless of platform or > bootloader. This is true. But then again, what you're proposing isn't boot loader or platform agnostic anyway. Yes it's transparent to both the app and boot loader, but it's only going to work on EFI platforms running gummiboot. And because of that, if this is going to be merged upstream I think something like drivers/power/reset/ would be a more appropriate place, or drivers/platform/x86. If this does get merged, please rework the patch to use the efivar API instead of accessing efi.set_variable() directly. We've also got a bunch of ucs2 string functions in lib/ucs2_string.c that you could use. In fact, this version of the driver I found on the net is much more like what I had in mind, https://github.com/BORETS24/Kernel-for-Asus-Zenfone-2/blob/master/drivers/external_drivers/drivers/platform/x86/reboot_target_uefi.c