Skip to contentSkip to conversation

fastboot: Remove "bootloader-version" variable

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

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fastboot: Remove "bootloader-version" variable

As per [1], there is no such fastboot variable as "bootloader-version". Only "version-bootloader" is supported. Let's reflect this and not confuse users further.

[1] https://android.googlesource.com/platform/system/core/+/master/fastboot/README.md#client-variables

---
 doc/README.android-fastboot  | 4 ++--
 drivers/fastboot/fb_getvar.c | 9 +++------
 2 files changed, 5 insertions(+), 8 deletions(-)
doc/README.android-fastboot +2 -2
index 431191c473..ce852a4fd1 100644
@@ -169,8 +169,8 @@ On the client side you can fetch the bootloader version for instance:
 
 ::
 
-   $ fastboot getvar bootloader-version
-   bootloader-version: U-Boot 2014.04-00005-gd24cabc
+   $ fastboot getvar version-bootloader
+   version-bootloader: U-Boot 2014.04-00005-gd24cabc
    finished. total time: 0.000s
 
 or initiate a reboot:
drivers/fastboot/fb_getvar.c +3 -6
index fd0823b2bf..ebe5c8a104 100644
@@ -12,7 +12,7 @@
 #include <version.h>
 
 static void getvar_version(char *var_parameter, char *response);
-static void getvar_bootloader_version(char *var_parameter, char *response);
+static void getvar_version_bootloader(char *var_parameter, char *response);
 static void getvar_downloadsize(char *var_parameter, char *response);
 static void getvar_serialno(char *var_parameter, char *response);
 static void getvar_version_baseband(char *var_parameter, char *response);
@@ -37,12 +37,9 @@ static const struct {
 	{
 		.variable = "version",
 		.dispatch = getvar_version
-	}, {
-		.variable = "bootloader-version",
-		.dispatch = getvar_bootloader_version
 	}, {
 		.variable = "version-bootloader",
-		.dispatch = getvar_bootloader_version
+		.dispatch = getvar_version_bootloader
 	}, {
 		.variable = "downloadsize",
 		.dispatch = getvar_downloadsize
@@ -131,7 +128,7 @@ static void getvar_version(char *var_parameter, char *response)
 	fastboot_okay(FASTBOOT_VERSION, response);
 }
 
-static void getvar_bootloader_version(char *var_parameter, char *response)
+static void getvar_version_bootloader(char *var_parameter, char *response)
 {
 	fastboot_okay(U_BOOT_VERSION, response);
 }
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 fastboot: Remove "bootloader-version" variable

Hi Sam,

Quoted 65 lines · Sam Protsenko

As per [1], there is no such fastboot variable as "bootloader-version". Only "version-bootloader" is supported. Let's reflect this and not confuse users further.

[1] https://android.googlesource.com/platform/system/core/+/master/fastboot/README.md#client-variables

---
 doc/README.android-fastboot  | 4 ++--
 drivers/fastboot/fb_getvar.c | 9 +++------
 2 files changed, 5 insertions(+), 8 deletions(-)
doc/README.android-fastboot +2 -2
index 431191c473..ce852a4fd1 100644
@@ -169,8 +169,8 @@ On the client side you can fetch the bootloader version for instance:
 
 ::
 
-   $ fastboot getvar bootloader-version
-   bootloader-version: U-Boot 2014.04-00005-gd24cabc
+   $ fastboot getvar version-bootloader
+   version-bootloader: U-Boot 2014.04-00005-gd24cabc
    finished. total time: 0.000s
 
 or initiate a reboot:
drivers/fastboot/fb_getvar.c +3 -7
index fd0823b2bf..ebe5c8a104 100644
@@ -12,7 +12,7 @@
 #include <version.h>
 
 static void getvar_version(char *var_parameter, char *response);
-static void getvar_bootloader_version(char *var_parameter, char *response);
+static void getvar_version_bootloader(char *var_parameter, char *response);
 static void getvar_downloadsize(char *var_parameter, char *response);
 static void getvar_serialno(char *var_parameter, char *response);
 static void getvar_version_baseband(char *var_parameter, char *response);
@@ -37,12 +37,9 @@ static const struct {
        {
                .variable = "version",
                .dispatch = getvar_version
-       }, {
-               .variable = "bootloader-version",
-               .dispatch = getvar_bootloader_version
        }, {
                .variable = "version-bootloader",
-               .dispatch = getvar_bootloader_version
+               .dispatch = getvar_version_bootloader
        }, {
                .variable = "downloadsize",
                .dispatch = getvar_downloadsize
@@ -131,7 +128,7 @@ static void getvar_version(char *var_parameter, char *response)
        fastboot_okay(FASTBOOT_VERSION, response);
 }
 
-static void getvar_bootloader_version(char *var_parameter, char *response)
+static void getvar_version_bootloader(char *var_parameter, char *response)
 {
        fastboot_okay(U_BOOT_VERSION, response);
 }
--
Quoted 2 lines

2.20.1

My two cents here,

Based on the commit messages from "git log --grep=bootloader-version" people prefer to use "bootloader-version" instead of "version-bootloader", and totally removing it will probably affect usual workflow with fastboot (probably someone will be suprised that "bootloader-version" doesn't work anymore), including some CI automate testing etc (if there is any);

I think I does make sense to involve all of them to this discussion also (already added to CC).

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: Remove "bootloader-version" variable

Hi Igor,

Quoted 75 lines · Igor Opaniuk

Hi Sam,

Quoted 65 lines · Sam Protsenko

As per [1], there is no such fastboot variable as "bootloader-version". Only "version-bootloader" is supported. Let's reflect this and not confuse users further.

[1] https://android.googlesource.com/platform/system/core/+/master/fastboot/README.md#client-variables

---
 doc/README.android-fastboot  | 4 ++--
 drivers/fastboot/fb_getvar.c | 9 +++------
 2 files changed, 5 insertions(+), 8 deletions(-)
doc/README.android-fastboot +2 -2
index 431191c473..ce852a4fd1 100644
@@ -169,8 +169,8 @@ On the client side you can fetch the bootloader version for instance:
 
 ::
 
-   $ fastboot getvar bootloader-version
-   bootloader-version: U-Boot 2014.04-00005-gd24cabc
+   $ fastboot getvar version-bootloader
+   version-bootloader: U-Boot 2014.04-00005-gd24cabc
    finished. total time: 0.000s
 
 or initiate a reboot:
drivers/fastboot/fb_getvar.c +3 -7
index fd0823b2bf..ebe5c8a104 100644
@@ -12,7 +12,7 @@
 #include <version.h>
 
 static void getvar_version(char *var_parameter, char *response);
-static void getvar_bootloader_version(char *var_parameter, char *response);
+static void getvar_version_bootloader(char *var_parameter, char *response);
 static void getvar_downloadsize(char *var_parameter, char *response);
 static void getvar_serialno(char *var_parameter, char *response);
 static void getvar_version_baseband(char *var_parameter, char *response);
@@ -37,12 +37,9 @@ static const struct {
        {
                .variable = "version",
                .dispatch = getvar_version
-       }, {
-               .variable = "bootloader-version",
-               .dispatch = getvar_bootloader_version
        }, {
                .variable = "version-bootloader",
-               .dispatch = getvar_bootloader_version
+               .dispatch = getvar_version_bootloader
        }, {
                .variable = "downloadsize",
                .dispatch = getvar_downloadsize
@@ -131,7 +128,7 @@ static void getvar_version(char *var_parameter, char *response)
        fastboot_okay(FASTBOOT_VERSION, response);
 }
 
-static void getvar_bootloader_version(char *var_parameter, char *response)
+static void getvar_version_bootloader(char *var_parameter, char *response)
 {
        fastboot_okay(U_BOOT_VERSION, response);
 }
--
Quoted 2 lines

2.20.1

My two cents here,

Quoted 7 lines

Based on the commit messages from "git log --grep=bootloader-version" people prefer to use "bootloader-version" instead of "version-bootloader", and totally removing it will probably affect usual workflow with fastboot (probably someone will be suprised that "bootloader-version" doesn't work anymore), including some CI automate testing etc (if there is any);

We need to decide what has more value in this particular case:
1. Keeping protocol clean, correct and up-to-date
2. Supporting all erroneous choices we've done before

If we follow golden rule of kernel, (2) is proffered. But I don't think in this particular case a lot of harm will be done. So from my POV (1) is preferred. Otherwise we can clutter the protocol, causing some confusion.

You can check fastboot project in AOSP [1]

    $ git log -S'bootloader-version' -- fastboot/

No occurrences, ever. AOSP is unaware we have 'bootloader-version' variable in U-Boot, but AOSP defines 'version-bootloader' variable, for the same stuff. I would really prefer we avoid using some weird undocumented stuff, and I think in this particular case the cleanliness of protocol overrules golden rule of kernel development, as it seems relatively easy to fix that command (matter of one sed execution).

[1] https://android.googlesource.com/platform/system/core/+/master/

Quoted 12 lines

I think I does make sense to involve all of them to this discussion also (already added to CC).

--
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

#3 lore raw

PATCH 1/1 fastboot: Remove "bootloader-version" variable

Quoted 108 lines · Sam Protsenko

Hi Igor,

Quoted 75 lines · Igor Opaniuk

Hi Sam,

Quoted 65 lines · Sam Protsenko

As per [1], there is no such fastboot variable as "bootloader-version". Only "version-bootloader" is supported. Let's reflect this and not confuse users further.

[1] https://android.googlesource.com/platform/system/core/+/master/fastboot/README.md#client-variables

---
 doc/README.android-fastboot  | 4 ++--
 drivers/fastboot/fb_getvar.c | 9 +++------
 2 files changed, 5 insertions(+), 8 deletions(-)
doc/README.android-fastboot +2 -2
index 431191c473..ce852a4fd1 100644
@@ -169,8 +169,8 @@ On the client side you can fetch the bootloader version for instance:
 
 ::
 
-   $ fastboot getvar bootloader-version
-   bootloader-version: U-Boot 2014.04-00005-gd24cabc
+   $ fastboot getvar version-bootloader
+   version-bootloader: U-Boot 2014.04-00005-gd24cabc
    finished. total time: 0.000s
 
 or initiate a reboot:
drivers/fastboot/fb_getvar.c +3 -7
index fd0823b2bf..ebe5c8a104 100644
@@ -12,7 +12,7 @@
 #include <version.h>
 
 static void getvar_version(char *var_parameter, char *response);
-static void getvar_bootloader_version(char *var_parameter, char *response);
+static void getvar_version_bootloader(char *var_parameter, char *response);
 static void getvar_downloadsize(char *var_parameter, char *response);
 static void getvar_serialno(char *var_parameter, char *response);
 static void getvar_version_baseband(char *var_parameter, char *response);
@@ -37,12 +37,9 @@ static const struct {
        {
                .variable = "version",
                .dispatch = getvar_version
-       }, {
-               .variable = "bootloader-version",
-               .dispatch = getvar_bootloader_version
        }, {
                .variable = "version-bootloader",
-               .dispatch = getvar_bootloader_version
+               .dispatch = getvar_version_bootloader
        }, {
                .variable = "downloadsize",
                .dispatch = getvar_downloadsize
@@ -131,7 +128,7 @@ static void getvar_version(char *var_parameter, char *response)
        fastboot_okay(FASTBOOT_VERSION, response);
 }
 
-static void getvar_bootloader_version(char *var_parameter, char *response)
+static void getvar_version_bootloader(char *var_parameter, char *response)
 {
        fastboot_okay(U_BOOT_VERSION, response);
 }
--
Quoted 2 lines

2.20.1

My two cents here,

Quoted 7 lines

Based on the commit messages from "git log --grep=bootloader-version" people prefer to use "bootloader-version" instead of "version-bootloader", and totally removing it will probably affect usual workflow with fastboot (probably someone will be suprised that "bootloader-version" doesn't work anymore), including some CI automate testing etc (if there is any);

We need to decide what has more value in this particular case:
1. Keeping protocol clean, correct and up-to-date
2. Supporting all erroneous choices we've done before

If we follow golden rule of kernel, (2) is proffered. But I don't think in this particular case a lot of harm will be done. So from my POV (1) is preferred. Otherwise we can clutter the protocol, causing some confusion.

You can check fastboot project in AOSP [1]

    $ git log -S'bootloader-version' -- fastboot/

No occurrences, ever. AOSP is unaware we have 'bootloader-version' variable in U-Boot, but AOSP defines 'version-bootloader' variable, for the same stuff. I would really prefer we avoid using some weird undocumented stuff, and I think in this particular case the cleanliness of protocol overrules golden rule of kernel development, as it seems relatively easy to fix that command (matter of one sed execution).

Quoted 14 lines

[1] https://android.googlesource.com/platform/system/core/+/master/

Quoted 12 lines

I think I does make sense to involve all of them to this discussion also (already added to CC).

--
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

It's was just about making people aware about these changes :). Anyway:

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
#4 lore raw

PATCH 1/1 fastboot: Remove "bootloader-version" variable

In reply to Sam Protsenko

Hi Sam,

Quoted 4 lines · Sam Protsenko

As per [1], there is no such fastboot variable as "bootloader-version". Only "version-bootloader" is supported. Let's reflect this and not confuse users further.

FWIW, this could carry a Fixes line?

Fixes 3aab70afc531d1 ("usb/gadget: add the fastboot gadget")

I strongly believe there are ongoing attempts/projects to build relationships/dependencies between commits, which would help in the context of bug prediction. Code Maat [2] comes to mind, but there could be better examples.

Quoted 1 line

[1] https://android.googlesource.com/platform/system/core/+/master/fastboot/README.md#client-variables

[2] https://github.com/adamtornhill/code-maat

In case AOSP gives it a second thought and drops or renames the "is-userspace" option or the Client Variables section (both unlikely, but possible), then the link will point to the wrong contents. This happened to me in the past, but I am lazy to look for some records.

[..]

doc/README.android-fastboot On the client side you can fetch the bootloader version for instance: · line 173

Quoted 12 lines
doc/README.android-fastboot +2 -2
index 431191c473..ce852a4fd1 100644
@@ -169,8 +169,8 @@ On the client side you can fetch the bootloader version for instance:
 
 ::
 
-   $ fastboot getvar bootloader-version
-   bootloader-version: U-Boot 2014.04-00005-gd24cabc
+   $ fastboot getvar version-bootloader
+   version-bootloader: U-Boot 2014.04-00005-gd24cabc

I am afraid this may introduce confusion, specifically that v2014.04+ (more precisely v2014.04-207-g3aab70afc531) U-Boot responded properly to 'fastboot getvar version-bootloader'. Please, feel free to ignore.

[..]

doc/README.android-fastboot static const struct { · line 40

Quoted 8 lines
doc/README.android-fastboot +0 -3
@@ -37,12 +37,9 @@ static const struct {
 	{
 		.variable = "version",
 		.dispatch = getvar_version
-	}, {
-		.variable = "bootloader-version",
-		.dispatch = getvar_bootloader_version
 	}, {

On one hand, I agree with Igor that certain users might be hurt by this change. On the other hand, it sounds good not to spend time and effort maintaining non-AOSP options, added to U-Boot by accident.

Thanks!

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

PATCH 1/1 fastboot: Remove "bootloader-version" variable

Hi Eugeniu,

Quoted 46 lines · Eugeniu Rosca

Hi Sam,

Quoted 4 lines · Sam Protsenko

As per [1], there is no such fastboot variable as "bootloader-version". Only "version-bootloader" is supported. Let's reflect this and not confuse users further.

FWIW, this could carry a Fixes line?

Fixes 3aab70afc531d1 ("usb/gadget: add the fastboot gadget")

I strongly believe there are ongoing attempts/projects to build relationships/dependencies between commits, which would help in the context of bug prediction. Code Maat [2] comes to mind, but there could be better examples.

Quoted 1 line

[1] https://android.googlesource.com/platform/system/core/+/master/fastboot/README.md#client-variables

[2] https://github.com/adamtornhill/code-maat

In case AOSP gives it a second thought and drops or renames the "is-userspace" option or the Client Variables section (both unlikely, but possible), then the link will point to the wrong contents. This happened to me in the past, but I am lazy to look for some records.

[..]

doc/README.android-fastboot On the client side you can fetch the bootloader version for instance: · line 173

Quoted 12 lines
doc/README.android-fastboot +2 -2
index 431191c473..ce852a4fd1 100644
@@ -169,8 +169,8 @@ On the client side you can fetch the bootloader version for instance:
 
 ::
 
-   $ fastboot getvar bootloader-version
-   bootloader-version: U-Boot 2014.04-00005-gd24cabc
+   $ fastboot getvar version-bootloader
+   version-bootloader: U-Boot 2014.04-00005-gd24cabc

I am afraid this may introduce confusion, specifically that v2014.04+ (more precisely v2014.04-207-g3aab70afc531) U-Boot responded properly to 'fastboot getvar version-bootloader'. Please, feel free to ignore.

[..]

Quoted 13 lines

doc/README.android-fastboot static const struct { · line 40

Quoted 8 lines
doc/README.android-fastboot +0 -3
@@ -37,12 +37,9 @@ static const struct {
      {
              .variable = "version",
              .dispatch = getvar_version
-     }, {
-             .variable = "bootloader-version",
-             .dispatch = getvar_bootloader_version
      }, {

On one hand, I agree with Igor that certain users might be hurt by this change. On the other hand, it sounds good not to spend time and effort maintaining non-AOSP options, added to U-Boot by accident.

All comments are addressed in v2. Thanks!

Quoted 7 lines

Thanks!

--
Best Regards,
Eugeniu.

#6 lore raw

PATCH 1/1 fastboot: Remove "bootloader-version" variable

In reply to Sam Protsenko

Hi Sam,

doc/README.android-fastboot

Quoted 16 lines · Sam Protsenko

As per [1], there is no such fastboot variable as "bootloader-version". Only "version-bootloader" is supported. Let's reflect this and not confuse users further.

[1] https://android.googlesource.com/platform/system/core/+/master/fastboot/README.md#client-variables

---
 doc/README.android-fastboot  | 4 ++--
 drivers/fastboot/fb_getvar.c | 9 +++------
 2 files changed, 5 insertions(+), 8 deletions(-)
doc/README.android-fastboot +0 -0
index 431191c473..ce852a4fd1 100644

This patch seems to depend on the BCB series [1].
The file renames which took place there are:

--------8<--------
doc/{README.avb2 => android/avb2.txt} doc/{README.android-fastboot => android/fastboot.txt} --------8<--------

The "README" wording is gone. Apparently Simon was fine with that. Do you prefer leaving the README in place in the filename or is this a typo? Sorry for any confusion contributed from my side and thanks in advance for feedback.

[1] https://patchwork.ozlabs.org/patch/1104245/

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

PATCH 1/1 fastboot: Remove "bootloader-version" variable

Hi Sam,

Last comment was posted in the wrong thread.

Quoted 4 lines · Eugeniu Rosca

doc/README.android-fastboot

Quoted 2 lines
doc/README.android-fastboot +0 -0

This patch seems to depend on the BCB series [1].

This observation is valid for the v2, found here:
https://patchwork.ozlabs.org/patch/1126954/

[..]

Quoted 3 lines

Do you prefer leaving the README in place in the filename or is this a typo? Sorry for any confusion contributed from my side and thanks in advance for feedback.

Please, ignore this feedback. It does not apply to v2.

Signature · 2 lines
Best Regards,
Eugeniu.