Skip to contentSkip to conversation

fastboot: Add "is-userspace" variable

PATCH New Sam Protsenko 3 participants 4 messages Jun 20, 2019 – Jul 3, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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/README.md#client-variables

---
 drivers/fastboot/fb_getvar.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/fastboot/fb_getvar.c +9 -0
index 9ee5054485..fd0823b2bf 100644
@@ -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.
  *
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 fastboot: Add "is-userspace" variable

Hi Sam,

Quoted 47 lines · Sam Protsenko

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/README.md#client-variables

---
 drivers/fastboot/fb_getvar.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/fastboot/fb_getvar.c +9 -1
index 9ee5054485..fd0823b2bf 100644
@@ -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.
  *
--
Quoted 2 lines

2.20.1

Signature · 8 lines
Best regards - Freundliche Grüsse - Meilleures salutations

Igor Opaniuk

mailto: igor.opaniuk at gmail.com
skype: igor.opanyuk
+380 (93) 836 40 67
http://ua.linkedin.com/in/iopaniuk
#2 lore raw

PATCH 1/1 fastboot: Add "is-userspace" variable

In reply to Sam Protsenko

Hi Sam,

Two nits as input for future patches. No real concerns. Thanks!

Quoted 5 lines · Sam Protsenko

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/README.md#client-variables

This reference is floating, since it uses a branch name.

Quoted 2 lines

The title could be more specific: fastboot: getvar: *.

Thanks!

Signature · 2 lines
Best Regards,
Eugeniu.
#3 lore raw

PATCH 1/1 fastboot: Add "is-userspace" variable

Hi Eugeniu,

Quoted 5 lines · Eugeniu Rosca

Hi Sam,

Two nits as input for future patches. No real concerns. Thanks!

Quoted 9 lines
Quoted 5 lines · Sam Protsenko

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/README.md#client-variables

This reference is floating, since it uses a branch name.

Will be fixed in next version.

Quoted 5 lines
Quoted 2 lines

The title could be more specific: fastboot: getvar: *.

Will be fixed in next version. Thanks for the review!

Quoted 7 lines

Thanks!

--
Best Regards,
Eugeniu.