public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1 1/1] fastboot: Update getvar command to get 'userdata' partition size
Date: Wed, 16 Mar 2016 13:51:42 +0100	[thread overview]
Message-ID: <20160316135142.5bdb72c8@bbrezillon> (raw)
In-Reply-To: <CABGGisyOM9+o1ceTixdjF+6HWoC9GGXoYUEyhWYFQNfUHQ6AGw@mail.gmail.com>

Hi Rob,

On Fri, 20 Feb 2015 08:54:56 -0600
Rob Herring <rob.herring@linaro.org> wrote:

> On Wed, Feb 18, 2015 at 1:52 PM, Dileep Katta <dileep.katta@linaro.org> wrote:
> > This patch adds functionality to getvar command to get the userdata partition
> > size.
> 
> This is non-standard and doesn't scale to other partitions. There is
> already a standard var "partition-size:<part name>". There is also
> "partition-type:<part name>" which probably needs to be supported as
> well. It would probably be good to have generic code to retrieve
> fastboot variables from a u-boot environment variables. Something like
> this:
> 
>     fastboot: allow retrieving fastboot variables from env
> 
>     Signed-off-by: Rob Herring <robh@kernel.org>
> 
> diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
> index 310175a..31e1063 100644
> --- a/drivers/usb/gadget/f_fastboot.c
> +++ b/drivers/usb/gadget/f_fastboot.c
> @@ -364,8 +364,15 @@ static void cb_getvar(struct usb_ep *ep, struct
> usb_request *req)
>                 else
>                         strcpy(response, "FAILValue not set");
>         } else {
> -               error("unknown variable: %s\n", cmd);
> -               strcpy(response, "FAILVariable not implemented");
> +               char envstr[32];
> +               snprintf(envstr, sizeof(envstr) - 1, "fastboot.%s", cmd);
> +               s = getenv(envstr);
> +               if (s) {
> +                       strncat(response, s, chars_left);
> +               } else {
> +                       error("unknown variable: %s\n", cmd);
> +                       strcpy(response, "FAILVariable not implemented");
> +               }
>         }
>         fastboot_tx_write_str(response);
>  }
> 

I need this feature to expose some uboot variable through 'fastboot
getvar', would you mind if I resend this patch for you?

Best Regards,

Boris

-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  parent reply	other threads:[~2016-03-16 12:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-18 19:52 [U-Boot] [PATCH v1 1/1] fastboot: Update getvar command to get 'userdata' partition size Dileep Katta
2015-02-20 14:54 ` Rob Herring
2015-02-25 21:45   ` Dileep Katta
2015-02-26  0:38     ` Rob Herring
2016-03-16 12:51   ` Boris Brezillon [this message]
2016-03-17 12:12     ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160316135142.5bdb72c8@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox