diff options
author | Mark Salyzyn <salyzyn@google.com> | 2018-08-24 14:37:11 -0700 |
---|---|---|
committer | Mark Salyzyn <salyzyn@google.com> | 2018-08-24 15:24:41 -0700 |
commit | 8fb0fb86a78379c96d99825ff05c2f228e037fe3 (patch) | |
tree | 51113ec84c6023be74783fc8dcaf4e532c9f3f93 /fastboot/fastboot.cpp | |
parent | eff7027a8cf8d02722be66e665c316f11d0b89ae (diff) |
fastboot: allow automatic detection of super location
Add "super" to the table of known images so that automatic file
resolution can occur. Add a flag to indicate if the image should
be flashed with flashall and set it to false for the new "super"
image, all else true.
Test: 'fastboot flash super' works.
'fastboot flashall' does not flash super
Bug: 78793464
Change-Id: I5b85536b1d4890264531af357aba84a061d6df44
Diffstat (limited to 'fastboot/fastboot.cpp')
-rw-r--r-- | fastboot/fastboot.cpp | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index 20c33591d..4a8ee3312 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -114,28 +114,30 @@ struct Image { const char* part_name; bool optional_if_no_image; bool optional_if_no_partition; + bool flashall; bool IsSecondary() const { return nickname == nullptr; } }; static Image images[] = { // clang-format off - { "boot", "boot.img", "boot.sig", "boot", false, false }, - { nullptr, "boot_other.img", "boot.sig", "boot", true, false }, - { "dtbo", "dtbo.img", "dtbo.sig", "dtbo", true, false }, - { "dts", "dt.img", "dt.sig", "dts", true, false }, - { "odm", "odm.img", "odm.sig", "odm", true, false }, - { "product", "product.img", "product.sig", "product", true, false }, + { "boot", "boot.img", "boot.sig", "boot", false, false, true, }, + { nullptr, "boot_other.img", "boot.sig", "boot", true, false, true, }, + { "dtbo", "dtbo.img", "dtbo.sig", "dtbo", true, false, true, }, + { "dts", "dt.img", "dt.sig", "dts", true, false, true, }, + { "odm", "odm.img", "odm.sig", "odm", true, false, true, }, + { "product", "product.img", "product.sig", "product", true, false, true, }, { "product_services", "product_services.img", "product_services.sig", "product_services", - true, true }, - { "recovery", "recovery.img", "recovery.sig", "recovery", true, false }, - { "system", "system.img", "system.sig", "system", false, true }, - { nullptr, "system_other.img", "system.sig", "system", true, false }, - { "vbmeta", "vbmeta.img", "vbmeta.sig", "vbmeta", true, false }, - { "vendor", "vendor.img", "vendor.sig", "vendor", true, true }, - { nullptr, "vendor_other.img", "vendor.sig", "vendor", true, false }, + true, true, true, }, + { "recovery", "recovery.img", "recovery.sig", "recovery", true, false, true, }, + { "system", "system.img", "system.sig", "system", false, true, true, }, + { nullptr, "system_other.img", "system.sig", "system", true, false, true, }, + { "vbmeta", "vbmeta.img", "vbmeta.sig", "vbmeta", true, false, true, }, + { "vendor", "vendor.img", "vendor.sig", "vendor", true, true, true, }, + { nullptr, "vendor_other.img", "vendor.sig", "vendor", true, false, true, }, + { "super", "super.img", "super.sig", "super", true, true, false, }, // clang-format on }; @@ -1242,6 +1244,7 @@ static void do_flashall(const std::string& slot_override, bool skip_secondary, b // List of partitions to flash and their slots. std::vector<std::pair<const Image*, std::string>> entries; for (size_t i = 0; i < arraysize(images); i++) { + if (!images[i].flashall) continue; const char* slot = NULL; if (images[i].IsSecondary()) { if (!skip_secondary) slot = secondary.c_str(); |