diff options
| author | Wink Saville <wink@google.com> | 2011-04-04 17:54:59 -0700 |
|---|---|---|
| committer | Wink Saville <wink@google.com> | 2011-04-04 17:54:59 -0700 |
| commit | b98762f7824c291dc5d9a9b757af434ef31d8c81 (patch) | |
| tree | 7f719a05275e43a74a312d17987f74a22e8e0112 /fastboot/fastboot.c | |
| parent | 47e4ee5958bfd48c741f17c23b3a4a3f7866416e (diff) | |
| download | core-b98762f7824c291dc5d9a9b757af434ef31d8c81.tar.gz core-b98762f7824c291dc5d9a9b757af434ef31d8c81.tar.bz2 core-b98762f7824c291dc5d9a9b757af434ef31d8c81.zip | |
Teach fastboot to allow required variables per product.
This is needed for products like xoom-cdma and xoom-cdma-lte.
The xoom-cdma-lte product requires an lte baseband binary but
it's not needed for xoom-cdma.
This is implemented by allowing an optional product parameter
to "required" statements. The parameter is separated from
"required" by a colon so the version-baseband-2 requirment in
board-info.txt for stingray becomes:
require-for-product:xoom-cdma-lte version-baseband-2=ltedc_u_03.25.00|ltedc_u_03.19.00
In the above statement, only xoom-cdma-lte requires version-baseband-2
and the baseband can be lte_u_03.25.00 or lte_u_03.19.00. For other
products version-baseband-2 will be ignored.
Change-Id: I786bec5f5661c2243d87925b064fc6124d3cffa1
Diffstat (limited to 'fastboot/fastboot.c')
| -rw-r--r-- | fastboot/fastboot.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/fastboot/fastboot.c b/fastboot/fastboot.c index 2ddc4f89a..4a2de2062 100644 --- a/fastboot/fastboot.c +++ b/fastboot/fastboot.c @@ -42,6 +42,8 @@ #include "fastboot.h" +char cur_product[FB_RESPONSE_SZ + 1]; + void bootimg_set_cmdline(boot_img_hdr *h, const char *cmdline); boot_img_hdr *mkbootimg(void *kernel, unsigned kernel_size, @@ -340,6 +342,7 @@ static int setup_requirement_line(char *name) { char *val[MAX_OPTIONS]; const char **out; + char *prod = NULL; unsigned n, count; char *x; int invert = 0; @@ -350,6 +353,14 @@ static int setup_requirement_line(char *name) } else if (!strncmp(name, "require ", 8)) { name += 8; invert = 0; + } else if (!strncmp(name, "require-for-product:", 20)) { + // Get the product and point name past it + prod = name + 20; + name = strchr(name, ' '); + if (!name) return -1; + *name = 0; + name += 1; + invert = 0; } x = strchr(name, '='); @@ -381,7 +392,7 @@ static int setup_requirement_line(char *name) if (out[n] == 0) return -1; } - fb_queue_require(name, invert, n, out); + fb_queue_require(prod, name, invert, n, out); return 0; } @@ -432,6 +443,8 @@ void do_update(char *fn) queue_info_dump(); + fb_queue_query_save("product", cur_product, sizeof(cur_product)); + zdata = load_file(fn, &zsize); if (zdata == 0) die("failed to load '%s'", fn); @@ -498,6 +511,8 @@ void do_flashall(void) queue_info_dump(); + fb_queue_query_save("product", cur_product, sizeof(cur_product)); + fname = find_item("info", product); if (fname == 0) die("cannot find android-info.txt"); data = load_file(fname, &sz); |
