Loading fastboot/fastboot.cpp +0 −32 Original line number Diff line number Diff line Loading @@ -115,19 +115,6 @@ static bool g_disable_verification = false; fastboot::FastBootDriver* fb = nullptr; enum fb_buffer_type { FB_BUFFER_FD, FB_BUFFER_SPARSE, }; struct fastboot_buffer { enum fb_buffer_type type; std::vector<SparsePtr> files; int64_t sz; unique_fd fd; int64_t image_size; }; static std::vector<Image> images = { // clang-format off { "boot", "boot.img", "boot.sig", "boot", false, ImageType::BootCritical }, Loading Loading @@ -1784,25 +1771,6 @@ std::vector<std::unique_ptr<Task>> ParseFastbootInfo(const FlashingPlan* fp, std return ParseFastbootInfo(fp, file); } class FlashAllTool { public: FlashAllTool(FlashingPlan* fp); void Flash(); private: void CheckRequirements(); void DetermineSlot(); void CollectImages(); void FlashImages(const std::vector<std::pair<const Image*, std::string>>& images); void FlashImage(const Image& image, const std::string& slot, fastboot_buffer* buf); void HardcodedFlash(); std::vector<ImageEntry> boot_images_; std::vector<ImageEntry> os_images_; FlashingPlan* fp_; }; FlashAllTool::FlashAllTool(FlashingPlan* fp) : fp_(fp) {} void FlashAllTool::Flash() { Loading fastboot/fastboot.h +33 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ #include <string> #include "fastboot_driver.h" #include "filesystem.h" #include "super_flash_helper.h" #include "util.h" Loading @@ -47,6 +48,19 @@ class FastBootTool { unsigned ParseFsOption(const char*); }; enum fb_buffer_type { FB_BUFFER_FD, FB_BUFFER_SPARSE, }; struct fastboot_buffer { enum fb_buffer_type type; std::vector<SparsePtr> files; int64_t sz; unique_fd fd; int64_t image_size; }; enum class ImageType { // Must be flashed for device to boot into the kernel. BootCritical, Loading Loading @@ -87,6 +101,25 @@ struct FlashingPlan { fastboot::FastBootDriver* fb; }; class FlashAllTool { public: FlashAllTool(FlashingPlan* fp); void Flash(); private: void CheckRequirements(); void DetermineSlot(); void CollectImages(); void FlashImages(const std::vector<std::pair<const Image*, std::string>>& images); void FlashImage(const Image& image, const std::string& slot, fastboot_buffer* buf); void HardcodedFlash(); std::vector<ImageEntry> boot_images_; std::vector<ImageEntry> os_images_; FlashingPlan* fp_; }; bool should_flash_in_userspace(const std::string& partition_name); bool is_userspace_fastboot(); void do_flash(const char* pname, const char* fname, const bool apply_vbmeta); Loading Loading
fastboot/fastboot.cpp +0 −32 Original line number Diff line number Diff line Loading @@ -115,19 +115,6 @@ static bool g_disable_verification = false; fastboot::FastBootDriver* fb = nullptr; enum fb_buffer_type { FB_BUFFER_FD, FB_BUFFER_SPARSE, }; struct fastboot_buffer { enum fb_buffer_type type; std::vector<SparsePtr> files; int64_t sz; unique_fd fd; int64_t image_size; }; static std::vector<Image> images = { // clang-format off { "boot", "boot.img", "boot.sig", "boot", false, ImageType::BootCritical }, Loading Loading @@ -1784,25 +1771,6 @@ std::vector<std::unique_ptr<Task>> ParseFastbootInfo(const FlashingPlan* fp, std return ParseFastbootInfo(fp, file); } class FlashAllTool { public: FlashAllTool(FlashingPlan* fp); void Flash(); private: void CheckRequirements(); void DetermineSlot(); void CollectImages(); void FlashImages(const std::vector<std::pair<const Image*, std::string>>& images); void FlashImage(const Image& image, const std::string& slot, fastboot_buffer* buf); void HardcodedFlash(); std::vector<ImageEntry> boot_images_; std::vector<ImageEntry> os_images_; FlashingPlan* fp_; }; FlashAllTool::FlashAllTool(FlashingPlan* fp) : fp_(fp) {} void FlashAllTool::Flash() { Loading
fastboot/fastboot.h +33 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ #include <string> #include "fastboot_driver.h" #include "filesystem.h" #include "super_flash_helper.h" #include "util.h" Loading @@ -47,6 +48,19 @@ class FastBootTool { unsigned ParseFsOption(const char*); }; enum fb_buffer_type { FB_BUFFER_FD, FB_BUFFER_SPARSE, }; struct fastboot_buffer { enum fb_buffer_type type; std::vector<SparsePtr> files; int64_t sz; unique_fd fd; int64_t image_size; }; enum class ImageType { // Must be flashed for device to boot into the kernel. BootCritical, Loading Loading @@ -87,6 +101,25 @@ struct FlashingPlan { fastboot::FastBootDriver* fb; }; class FlashAllTool { public: FlashAllTool(FlashingPlan* fp); void Flash(); private: void CheckRequirements(); void DetermineSlot(); void CollectImages(); void FlashImages(const std::vector<std::pair<const Image*, std::string>>& images); void FlashImage(const Image& image, const std::string& slot, fastboot_buffer* buf); void HardcodedFlash(); std::vector<ImageEntry> boot_images_; std::vector<ImageEntry> os_images_; FlashingPlan* fp_; }; bool should_flash_in_userspace(const std::string& partition_name); bool is_userspace_fastboot(); void do_flash(const char* pname, const char* fname, const bool apply_vbmeta); Loading