Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-16 Thread Andy Lutomirski
On Mar 13, 2015 7:42 AM, "Greg Kroah-Hartman" wrote: > > On Thu, Mar 12, 2015 at 10:47:54PM +, Matt Fleming wrote: > > On Tue, 10 Mar, at 08:51:59AM, Andy Lutomirski wrote: > > > > > > I'm not 100% happy with write(2) (which is all we have in sysfs) for > > > two reasons: > > > > > > 1. If we

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-13 Thread Greg Kroah-Hartman
On Thu, Mar 12, 2015 at 10:47:54PM +, Matt Fleming wrote: > On Tue, 10 Mar, at 08:51:59AM, Andy Lutomirski wrote: > > > > I'm not 100% happy with write(2) (which is all we have in sysfs) for > > two reasons: > > > > 1. If we write a file name, eww. That's more complicated, requires > > tempo

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-12 Thread Matt Fleming
On Tue, 10 Mar, at 08:51:59AM, Andy Lutomirski wrote: > > I'm not 100% happy with write(2) (which is all we have in sysfs) for > two reasons: > > 1. If we write a file name, eww. That's more complicated, requires > temporary files, has annoying mount namespace issues, etc. > > 2. If we write th

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-10 Thread Andy Lutomirski
On Tue, Mar 10, 2015 at 10:26 AM, Peter Jones wrote: > On Tue, Mar 10, 2015 at 08:51:59AM -0700, Andy Lutomirski wrote: >> On Tue, Mar 10, 2015 at 8:40 AM, Peter Jones wrote: >> > >> >> >> So, for the sysfs interface, let's not allow loading from /lib. Let's >> >> >> not require a userland tool.

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-10 Thread Peter Jones
On Tue, Mar 10, 2015 at 08:51:59AM -0700, Andy Lutomirski wrote: > On Tue, Mar 10, 2015 at 8:40 AM, Peter Jones wrote: > > > >> >> So, for the sysfs interface, let's not allow loading from /lib. Let's > >> >> not require a userland tool. Let's just do, > >> >> > >> >> # echo /path/to/my/awesome/

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-10 Thread Andy Lutomirski
On Tue, Mar 10, 2015 at 8:40 AM, Peter Jones wrote: > >> >> So, for the sysfs interface, let's not allow loading from /lib. Let's >> >> not require a userland tool. Let's just do, >> >> >> >> # echo /path/to/my/awesome/capsule.bin > /sys/../capsule >> > >> >> >> >> and be done with it. >> >> >>

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-10 Thread Peter Jones
> >> So, for the sysfs interface, let's not allow loading from /lib. Let's > >> not require a userland tool. Let's just do, > >> > >> # echo /path/to/my/awesome/capsule.bin > /sys/../capsule > > > >> > >> and be done with it. > >> > >> Hmmm? > > > > I assume you're implying a) the capsule header

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-10 Thread Andy Lutomirski
On Tue, Mar 10, 2015 at 8:21 AM, Peter Jones wrote: > On Tue, Mar 10, 2015 at 12:26:52PM +, Matt Fleming wrote: >> On Fri, 06 Mar, at 04:39:12PM, Peter Jones wrote: >> > >> > So again: do we really need or want to do this? >> >> One thing that we totally lose the ability to do is use the capsu

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-10 Thread Peter Jones
On Tue, Mar 10, 2015 at 12:26:52PM +, Matt Fleming wrote: > On Fri, 06 Mar, at 04:39:12PM, Peter Jones wrote: > > > > So again: do we really need or want to do this? > > One thing that we totally lose the ability to do is use the capsule > interface for things *other* than firmware updates, e

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-10 Thread Matt Fleming
On Fri, 06 Mar, at 04:39:12PM, Peter Jones wrote: > > So again: do we really need or want to do this? One thing that we totally lose the ability to do is use the capsule interface for things *other* than firmware updates, e.g. https://lkml.org/lkml/2013/10/16/327 Also, requiring embedded or c

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-06 Thread Peter Jones
On Fri, Mar 06, 2015 at 01:49:20PM -0800, Roy Franz wrote: > On Fri, Mar 6, 2015 at 1:39 PM, Peter Jones wrote: > > On Tue, Feb 24, 2015 at 12:49:09PM +, Kweh, Hock Leong wrote: > >> Hi All, > >> > >> After some internal discussion and re-design prototyping & testing on > >> this efi capsule i

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-06 Thread Roy Franz
On Fri, Mar 6, 2015 at 1:39 PM, Peter Jones wrote: > On Tue, Feb 24, 2015 at 12:49:09PM +, Kweh, Hock Leong wrote: >> Hi All, >> >> After some internal discussion and re-design prototyping & testing on >> this efi capsule interface kernel module, I would like to start a discussion >> here on t

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-06 Thread Peter Jones
On Tue, Feb 24, 2015 at 12:49:09PM +, Kweh, Hock Leong wrote: > Hi All, > > After some internal discussion and re-design prototyping & testing on > this efi capsule interface kernel module, I would like to start a discussion > here on the new idea and wish to get input for the implementation a

RE: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-06 Thread Andy Lutomirski
On Mar 6, 2015 4:20 AM, "Kweh, Hock Leong" wrote: > > > -Original Message- > > From: Andy Lutomirski [mailto:l...@amacapital.net] > > Sent: Friday, March 06, 2015 7:09 AM > > > > On Mar 5, 2015 1:19 AM, "Kweh, Hock Leong" > > wrote: > > > > > > > > This really is not a big deal. User shou

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-06 Thread Borislav Petkov
On Fri, Mar 06, 2015 at 11:41:57AM +, Kweh, Hock Leong wrote: > # cat /any/path/capsule.bin > /sys/devices/platform/efi_capsule/capsule_load This is straight-forward and clean. > or doing: > # echo "/any/path/capsule.bin" > > /sys/devices/platform/efi_capsule/capsule_load This is strange an

RE: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-06 Thread Kweh, Hock Leong
> -Original Message- > From: Andy Lutomirski [mailto:l...@amacapital.net] > Sent: Friday, March 06, 2015 7:09 AM > > On Mar 5, 2015 1:19 AM, "Kweh, Hock Leong" > wrote: > > > > > > This really is not a big deal. User should cope with it. > > > > > > No, it's a big deal, and the user shoul

RE: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-06 Thread Kweh, Hock Leong
> -Original Message- > From: Borislav Petkov [mailto:b...@alien8.de] > Sent: Friday, March 06, 2015 4:14 PM > > On Thu, Mar 05, 2015 at 03:08:42PM -0800, Andy Lutomirski wrote: > > No. Only root should be able to load capsules, but even root may not > > be able to write to /lib. > > So b

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-06 Thread Borislav Petkov
On Thu, Mar 05, 2015 at 03:08:42PM -0800, Andy Lutomirski wrote: > No. Only root should be able to load capsules, but even root may not > be able to write to /lib. So basically what we want to do is: # cat /any/path/to/efi/capsule/accessible/to/root/efi_capsule.img > /sys/firmware/efi/update N

RE: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-05 Thread Andy Lutomirski
On Mar 5, 2015 1:19 AM, "Kweh, Hock Leong" wrote: > > > -Original Message- > > From: Andy Lutomirski [mailto:l...@amacapital.net] > > Sent: Wednesday, March 04, 2015 4:38 AM > > > > On Mon, Mar 2, 2015 at 9:56 PM, Kweh, Hock Leong > > wrote: > > > > > > Just to call out that using firmwar

RE: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-05 Thread Kweh, Hock Leong
> -Original Message- > From: Andy Lutomirski [mailto:l...@amacapital.net] > Sent: Wednesday, March 04, 2015 4:38 AM > > On Mon, Mar 2, 2015 at 9:56 PM, Kweh, Hock Leong > wrote: > > > > Just to call out that using firmware class auto locate binary feature is > > limited > > to locations:

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-03 Thread Andy Lutomirski
On Mar 3, 2015 12:51 PM, "Borislav Petkov" wrote: > > On Tue, Mar 03, 2015 at 12:37:54PM -0800, Andy Lutomirski wrote: > > The user *should not* be required to have write access to anything in > > /lib to install a UEFI capsule that they download from their > > motherboard vendor's website. /lib

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-03 Thread Borislav Petkov
On Tue, Mar 03, 2015 at 12:37:54PM -0800, Andy Lutomirski wrote: > The user *should not* be required to have write access to anything in > /lib to install a UEFI capsule that they download from their > motherboard vendor's website. /lib belongs to the distro, and UEFI > capsules do not belong to t

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-03 Thread Andy Lutomirski
On Mon, Mar 2, 2015 at 9:56 PM, Kweh, Hock Leong wrote: >> -Original Message- >> From: Matt Fleming [mailto:m...@console-pimps.org] >> Sent: Monday, March 02, 2015 8:30 PM >> >> On Mon, 02 Mar, at 10:59:00AM, Kweh Hock Leong wrote: >> > > -Original Message- >> > > From: Borislav Pe

RE: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-02 Thread Kweh, Hock Leong
> -Original Message- > From: Matt Fleming [mailto:m...@console-pimps.org] > Sent: Monday, March 02, 2015 8:30 PM > > On Mon, 02 Mar, at 10:59:00AM, Kweh Hock Leong wrote: > > > -Original Message- > > > From: Borislav Petkov [mailto:b...@alien8.de] > > > Sent: Wednesday, February 25

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-02 Thread Matt Fleming
On Mon, 02 Mar, at 10:59:00AM, Kweh Hock Leong wrote: > > -Original Message- > > From: Borislav Petkov [mailto:b...@alien8.de] > > Sent: Wednesday, February 25, 2015 8:49 PM > > > > On Wed, Feb 25, 2015 at 12:38:20PM +, Kweh, Hock Leong wrote: > > > The reason we use this interface for

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-02 Thread Matt Fleming
On Thu, 26 Feb, at 04:54:58PM, Borislav Petkov wrote: > On Thu, Feb 26, 2015 at 07:30:54AM -0800, Andy Lutomirski wrote: > > How can the error code be propagated? Would that echo command fail in > > case of error? > > Yeah, either that or we can put the error code in the sysfs file which > usersp

RE: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-03-02 Thread Kweh, Hock Leong
> -Original Message- > From: Borislav Petkov [mailto:b...@alien8.de] > Sent: Wednesday, February 25, 2015 8:49 PM > > On Wed, Feb 25, 2015 at 12:38:20PM +, Kweh, Hock Leong wrote: > > The reason we use this interface for efi capsule is that efi capsule > > support multi binaries to be

RE: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-02-27 Thread Kweh, Hock Leong
> -Original Message- > From: Roy Franz [mailto:roy.fr...@linaro.org] > Sent: Friday, February 27, 2015 1:07 PM > > On Sun, Nov 2, 2014 at 7:07 PM, Kweh Hock Leong > > +/* > > + * This function will store the capsule binary and pass it to > > + * efi_capsule_update() API in capsule.c */ st

Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-02-26 Thread Roy Franz
On Sun, Nov 2, 2014 at 7:07 PM, Kweh Hock Leong wrote: > From: "Kweh, Hock Leong" > > Introducing a kernel module to expose user helper interface for > user to upload capsule binaries. This module leverage the > request_firmware_nowait() to expose an interface to user. > > Example steps to load t

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-02-26 Thread Borislav Petkov
On Thu, Feb 26, 2015 at 07:30:54AM -0800, Andy Lutomirski wrote: > How can the error code be propagated? Would that echo command fail in > case of error? Yeah, either that or we can put the error code in the sysfs file which userspace can cat. -- Regards/Gruss, Boris. ECO tip #101: Trim yo

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-02-26 Thread Andy Lutomirski
On Wed, Feb 25, 2015 at 3:47 AM, Borislav Petkov wrote: > On Tue, Feb 24, 2015 at 12:49:09PM +, Kweh, Hock Leong wrote: >> So the process steps basically look like this: >> 1.) cat capsule_ticket===> acquire a number and lock mutex then >>

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-02-25 Thread Borislav Petkov
On Wed, Feb 25, 2015 at 12:38:20PM +, Kweh, Hock Leong wrote: > The reason we use this interface for efi capsule is that efi capsule > support multi binaries to be uploaded and each binary file name > can be different. So you can write the file path to a second file and reload then, once per f

RE: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-02-25 Thread Kweh, Hock Leong
> -Original Message- > From: Borislav Petkov [mailto:b...@alien8.de] > Sent: Wednesday, February 25, 2015 7:48 PM > > On Tue, Feb 24, 2015 at 12:49:09PM +, Kweh, Hock Leong wrote: > > So this sounds pretty overengineered for no reason, or maybe I'm missing > the reason. > > If I had

Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-02-25 Thread Borislav Petkov
On Tue, Feb 24, 2015 at 12:49:09PM +, Kweh, Hock Leong wrote: > So the process steps basically look like this: > 1.) cat capsule_ticket===> acquire a number and lock mutex then > expose > firmware_class user helper >

RE: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-02-24 Thread Kweh, Hock Leong
> -Original Message- > From: Kweh, Hock Leong > Sent: Tuesday, February 24, 2015 6:54 PM > > In callbackfn_efi_capsule, you call request_firmware_nowait. When that > callback is invoked, I think that the /sys/class/firmware/efi-capsule-file > directory doesn't exist at all. > If the callb

Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2014-11-10 Thread Andy Lutomirski
On Mon, Nov 10, 2014 at 12:31 AM, Kweh, Hock Leong wrote: >> -Original Message- >> From: Andy Lutomirski [mailto:l...@amacapital.net] >> > #!/bin/sh >> > >> > old=$(cat >> > /sys/devices/platform/efi_capsule_user_helper/capsule_loaded) >> > >> > for arg in "$@" >> > do >> > if [ -f

RE: [PATCH v2 3/3] efi: Capsule update with user helper interface

2014-11-10 Thread Kweh, Hock Leong
> -Original Message- > From: Andy Lutomirski [mailto:l...@amacapital.net] > > #!/bin/sh > > > > old=$(cat > > /sys/devices/platform/efi_capsule_user_helper/capsule_loaded) > > > > for arg in "$@" > > do > > if [ -f $arg ] > > then > > echo 1 > /sys/class/firm

Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2014-11-08 Thread Andy Lutomirski
On Nov 8, 2014 5:05 AM, "Matt Fleming" wrote: > > On Tue, 04 Nov, at 08:35:40AM, Andy Lutomirski wrote: > > > > Am I missing something here? The current proposal is missing the > > success/failure part, unless you count the loaded count (in a > > different sysfs directory) as a useful interface f

Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2014-11-08 Thread Matt Fleming
On Tue, 04 Nov, at 08:35:40AM, Andy Lutomirski wrote: > > Am I missing something here? The current proposal is missing the > success/failure part, unless you count the loaded count (in a > different sysfs directory) as a useful interface for that. As Wilson pointed out, you only get the ability

RE: [PATCH v2 3/3] efi: Capsule update with user helper interface

2014-11-06 Thread Andy Lutomirski
On Nov 6, 2014 4:56 AM, "Kweh, Hock Leong" wrote: > > > -Original Message- > > From: Andy Lutomirski [mailto:l...@amacapital.net] > > Sent: Wednesday, November 05, 2014 12:36 AM > > > > Am I missing something here? The current proposal is missing the > > success/failure part, unless you c

RE: [PATCH v2 3/3] efi: Capsule update with user helper interface

2014-11-06 Thread Kweh, Hock Leong
> -Original Message- > From: Andy Lutomirski [mailto:l...@amacapital.net] > Sent: Wednesday, November 05, 2014 12:36 AM > > Am I missing something here? The current proposal is missing the > success/failure part, unless you count the loaded count (in a different sysfs > directory) as a us

Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2014-11-04 Thread Andy Lutomirski
On Tue, Nov 4, 2014 at 7:40 AM, Greg KH wrote: > On Tue, Nov 04, 2014 at 06:57:21AM -0800, Andy Lutomirski wrote: >> >> I don't particularly care what the foundation is, but given that a >> misc char device currently looks like it would be considerably less >> code for a nicer interface, using the

Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2014-11-04 Thread Greg KH
On Tue, Nov 04, 2014 at 06:57:21AM -0800, Andy Lutomirski wrote: > On Nov 4, 2014 6:18 AM, "Matt Fleming" wrote: > > > > On Mon, 2014-11-03 at 22:32 -0800, Andy Lutomirski wrote: > > > > > > It seems like a large fraction of the code in this module exists just > > > to work around the fact that re

Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2014-11-04 Thread Andy Lutomirski
On Nov 4, 2014 6:18 AM, "Matt Fleming" wrote: > > On Mon, 2014-11-03 at 22:32 -0800, Andy Lutomirski wrote: > > > > It seems like a large fraction of the code in this module exists just > > to work around the fact that request_firmware doesn't do what you want > > it to do. You have code to: > >

Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2014-11-04 Thread Matt Fleming
On Mon, 2014-11-03 at 22:32 -0800, Andy Lutomirski wrote: > > It seems like a large fraction of the code in this module exists just > to work around the fact that request_firmware doesn't do what you want > it to do. You have code to: > > - Prevent the /lib/firmware mechanism from working. > -

RE: [PATCH v2 3/3] efi: Capsule update with user helper interface

2014-11-04 Thread Kweh, Hock Leong
> -Original Message- > From: Andy Lutomirski [mailto:l...@amacapital.net] > Sent: Tuesday, November 04, 2014 2:32 PM > > It seems like a large fraction of the code in this module exists just to work > around the fact that request_firmware doesn't do what you want it to do. > You have code

Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2014-11-03 Thread Andy Lutomirski
On Mon, Nov 3, 2014 at 10:04 PM, Kweh, Hock Leong wrote: >> -Original Message- >> From: Andy Lutomirski [mailto:l...@amacapital.net] >> > >> > Andy, here's the steps to load a capsule. I don't have a problem with >> > this, it's userspace driven, no "autoloading" of files in /lib/, and >>

RE: [PATCH v2 3/3] efi: Capsule update with user helper interface

2014-11-03 Thread Kweh, Hock Leong
> -Original Message- > From: Andy Lutomirski [mailto:l...@amacapital.net] > > > > Andy, here's the steps to load a capsule. I don't have a problem with > > this, it's userspace driven, no "autoloading" of files in /lib/, and > > works with sysfs. > > > > Have any objection to it, I don't.

Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2014-11-03 Thread Andy Lutomirski
On Mon, Nov 3, 2014 at 8:32 PM, Greg Kroah-Hartman wrote: > On Mon, Nov 03, 2014 at 11:07:10AM +0800, Kweh Hock Leong wrote: >> From: "Kweh, Hock Leong" >> >> Introducing a kernel module to expose user helper interface for >> user to upload capsule binaries. This module leverage the >> request_fi

Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2014-11-03 Thread Greg Kroah-Hartman
On Mon, Nov 03, 2014 at 11:07:10AM +0800, Kweh Hock Leong wrote: > From: "Kweh, Hock Leong" > > Introducing a kernel module to expose user helper interface for > user to upload capsule binaries. This module leverage the > request_firmware_nowait() to expose an interface to user. > > Example step