[U-Boot] [PATCH 2/2] fastboot: getvar_partition_type: Return 'raw' when FS-unaware

Eugeniu Rosca erosca at de.adit-jv.com
Tue Mar 19 22:57:06 UTC 2019


Only a handful of Android/fastboot partitions (e.g. /system,
/vendor, /userdata) have filesystem:

host $> fastboot getvar partition-type:userdata
partition-type:userdata: ext4
Finished. Total time: 0.013s

Most of them (/misc, /pstore, /vbmeta, /dtb{o}, /boot, etc) don't.
And for the latter fastboot reports:

host $> fastboot getvar partition-type:misc
getvar:partition-type:misc FAILED (remote: failed to set partition)
Finished. Total time: 0.219s

Rather than creating pointless worries via error reporting, tell
the users they are dealing with a 'raw' partition:

host $> fastboot getvar partition-type:misc
partition-type:misc: raw
Finished. Total time: 0.017s

Fixes: f73a7df984a9 ("net: fastboot: Merge AOSP UDP fastboot")
Signed-off-by: Eugeniu Rosca <erosca at de.adit-jv.com>
---
 drivers/fastboot/fb_getvar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/fastboot/fb_getvar.c b/drivers/fastboot/fb_getvar.c
index 28e3e2fa1619..beadf7f98e5d 100644
--- a/drivers/fastboot/fb_getvar.c
+++ b/drivers/fastboot/fb_getvar.c
@@ -154,7 +154,7 @@ static void getvar_partition_type(char *part_name, char *response)
 	if (r >= 0) {
 		r = fs_set_blk_dev_with_part(dev_desc, r);
 		if (r < 0)
-			fastboot_fail("failed to set partition", response);
+			fastboot_okay("raw", response);
 		else
 			fastboot_okay(fs_get_type_name(), response);
 	}
-- 
2.21.0



More information about the U-Boot mailing list