From 0bbfb3976e9491b3e1a872ebdaa850ef868a24aa Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 24 Jul 2012 18:05:21 -0700 Subject: [PATCH] fastboot: change default sparse limit to disabled Change the default sparse limit to disabled to prevent resparsing files unless the bootloader or user specifies a sparse limit. Some bootloaders issue an erase before every flash command, which causes earlier parts of the downloaded image to get erased. Change-Id: Iac6f3b05580aba8b82ed0f2f800979a49c33c691 --- fastboot/fastboot.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fastboot/fastboot.c b/fastboot/fastboot.c index 595444433..57363d860 100644 --- a/fastboot/fastboot.c +++ b/fastboot/fastboot.c @@ -54,8 +54,6 @@ #define O_BINARY 0 #endif -#define DEFAULT_SPARSE_LIMIT (256 * 1024 * 1024) - char cur_product[FB_RESPONSE_SZ + 1]; void bootimg_set_cmdline(boot_img_hdr *h, const char *cmdline); @@ -281,7 +279,7 @@ void usage(void) " -b specify a custom kernel base address\n" " -n specify the nand page size. default: 2048\n" " -S [K|M|G] automatically sparse files greater than\n" - " size. default: 256M, 0 to disable\n" + " size. 0 to disable\n" ); } @@ -535,7 +533,7 @@ static int64_t get_sparse_limit(struct usb_handle *usb, int64_t size) if (target_sparse_limit > 0) { limit = target_sparse_limit; } else { - limit = DEFAULT_SPARSE_LIMIT; + return 0; } }