[U-Boot] [PATCH] fastboot: Add "is-userspace" variable

As per documentation [1], Android-Q requires for bootloader to provide "is-userspace" variable. "no" value should be always returned. This patch implements this fastboot variable.
[1] https://android.googlesource.com/platform/system/core/+/master/fastboot/READ...
Signed-off-by: Sam Protsenko semen.protsenko@linaro.org --- drivers/fastboot/fb_getvar.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/drivers/fastboot/fb_getvar.c b/drivers/fastboot/fb_getvar.c index 9ee5054485..fd0823b2bf 100644 --- a/drivers/fastboot/fb_getvar.c +++ b/drivers/fastboot/fb_getvar.c @@ -28,6 +28,7 @@ static void getvar_partition_type(char *part_name, char *response); #if CONFIG_IS_ENABLED(FASTBOOT_FLASH) static void getvar_partition_size(char *part_name, char *response); #endif +static void getvar_is_userspace(char *var_parameter, char *response);
static const struct { const char *variable; @@ -78,6 +79,9 @@ static const struct { .variable = "partition-size", .dispatch = getvar_partition_size #endif + }, { + .variable = "is-userspace", + .dispatch = getvar_is_userspace } };
@@ -243,6 +247,11 @@ static void getvar_partition_size(char *part_name, char *response) } #endif
+static void getvar_is_userspace(char *var_parameter, char *response) +{ + fastboot_okay("no", response); +} + /** * fastboot_getvar() - Writes variable indicated by cmd_parameter to response. *

Hi Sam,
On Thu, Jun 20, 2019 at 4:40 PM Sam Protsenko semen.protsenko@linaro.org wrote:
As per documentation [1], Android-Q requires for bootloader to provide "is-userspace" variable. "no" value should be always returned. This patch implements this fastboot variable.
[1] https://android.googlesource.com/platform/system/core/+/master/fastboot/READ...
Signed-off-by: Sam Protsenko semen.protsenko@linaro.org
drivers/fastboot/fb_getvar.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/drivers/fastboot/fb_getvar.c b/drivers/fastboot/fb_getvar.c index 9ee5054485..fd0823b2bf 100644 --- a/drivers/fastboot/fb_getvar.c +++ b/drivers/fastboot/fb_getvar.c @@ -28,6 +28,7 @@ static void getvar_partition_type(char *part_name, char *response); #if CONFIG_IS_ENABLED(FASTBOOT_FLASH) static void getvar_partition_size(char *part_name, char *response); #endif +static void getvar_is_userspace(char *var_parameter, char *response);
static const struct { const char *variable; @@ -78,6 +79,9 @@ static const struct { .variable = "partition-size", .dispatch = getvar_partition_size #endif
}, {
.variable = "is-userspace",
.dispatch = getvar_is_userspace }
};
@@ -243,6 +247,11 @@ static void getvar_partition_size(char *part_name, char *response) } #endif
+static void getvar_is_userspace(char *var_parameter, char *response) +{
fastboot_okay("no", response);
+}
/**
- fastboot_getvar() - Writes variable indicated by cmd_parameter to response.
-- 2.20.1
Reviewed-by: Igor Opaniuk igor.opaniuk@toradex.com

Hi Sam,
Two nits as input for future patches. No real concerns. Thanks!
On Thu, Jun 20, 2019 at 04:40:26PM +0300, Sam Protsenko wrote:
As per documentation [1], Android-Q requires for bootloader to provide "is-userspace" variable. "no" value should be always returned. This patch implements this fastboot variable.
[1] https://android.googlesource.com/platform/system/core/+/master/fastboot/READ...
This reference is floating, since it uses a branch name.
Signed-off-by: Sam Protsenko semen.protsenko@linaro.org
The title could be more specific: `fastboot: getvar: *`.
Reviewed-by: Eugeniu Rosca erosca@de.adit-jv.com
Thanks!

Hi Eugeniu,
On Fri, Jun 21, 2019 at 5:16 PM Eugeniu Rosca erosca@de.adit-jv.com wrote:
Hi Sam,
Two nits as input for future patches. No real concerns. Thanks!
On Thu, Jun 20, 2019 at 04:40:26PM +0300, Sam Protsenko wrote:
As per documentation [1], Android-Q requires for bootloader to provide "is-userspace" variable. "no" value should be always returned. This patch implements this fastboot variable.
[1] https://android.googlesource.com/platform/system/core/+/master/fastboot/READ...
This reference is floating, since it uses a branch name.
Will be fixed in next version.
Signed-off-by: Sam Protsenko semen.protsenko@linaro.org
The title could be more specific: `fastboot: getvar: *`.
Will be fixed in next version. Thanks for the review!
Reviewed-by: Eugeniu Rosca erosca@de.adit-jv.com
Thanks!
-- Best Regards, Eugeniu.
participants (3)
-
Eugeniu Rosca
-
Igor Opaniuk
-
Sam Protsenko