Loading fastboot/fastboot.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -1053,8 +1053,10 @@ static bool load_buf_fd(unique_fd fd, struct fastboot_buffer* buf, const Flashin return false; } sparse_file_destroy(s); buf->file_type = FB_BUFFER_SPARSE; } else { buf->image_size = sz; buf->file_type = FB_BUFFER_FD; } lseek(fd.get(), 0, SEEK_SET); Loading Loading @@ -1191,6 +1193,15 @@ static void copy_avb_footer(const ImageSource* source, const std::string& partit should_flash_in_userspace(source, partition)) { return; } // If the image is sparse, moving the footer will simply corrupt the sparse // format, so currently we don't support moving the footer on sparse files. if (buf->file_type == FB_BUFFER_SPARSE) { LOG(ERROR) << "Warning: skip copying " << partition << " image avb footer due to sparse " << "image."; return; } // If overflows and negative, it should be < buf->sz. int64_t partition_size = static_cast<int64_t>(get_partition_size(partition)); Loading fastboot/fastboot.h +2 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,8 @@ enum fb_buffer_type { }; struct fastboot_buffer { enum fb_buffer_type type; fb_buffer_type type; fb_buffer_type file_type; std::vector<SparsePtr> files; int64_t sz; unique_fd fd; Loading Loading
fastboot/fastboot.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -1053,8 +1053,10 @@ static bool load_buf_fd(unique_fd fd, struct fastboot_buffer* buf, const Flashin return false; } sparse_file_destroy(s); buf->file_type = FB_BUFFER_SPARSE; } else { buf->image_size = sz; buf->file_type = FB_BUFFER_FD; } lseek(fd.get(), 0, SEEK_SET); Loading Loading @@ -1191,6 +1193,15 @@ static void copy_avb_footer(const ImageSource* source, const std::string& partit should_flash_in_userspace(source, partition)) { return; } // If the image is sparse, moving the footer will simply corrupt the sparse // format, so currently we don't support moving the footer on sparse files. if (buf->file_type == FB_BUFFER_SPARSE) { LOG(ERROR) << "Warning: skip copying " << partition << " image avb footer due to sparse " << "image."; return; } // If overflows and negative, it should be < buf->sz. int64_t partition_size = static_cast<int64_t>(get_partition_size(partition)); Loading
fastboot/fastboot.h +2 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,8 @@ enum fb_buffer_type { }; struct fastboot_buffer { enum fb_buffer_type type; fb_buffer_type type; fb_buffer_type file_type; std::vector<SparsePtr> files; int64_t sz; unique_fd fd; Loading