Android-cuttlefish cvd tool
Classes | Typedefs | Enumerations | Functions
fastboot.h File Reference
#include <functional>
#include <memory>
#include <string>
#include "fastboot_driver_interface.h"
#include "filesystem.h"
#include "task.h"
#include "util.h"
#include <bootimg.h>
#include "result.h"
#include "socket.h"
#include <zip.h>
Include dependency graph for fastboot.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  FastBootTool
 
struct  fastboot_buffer
 
struct  Image
 
struct  FlashingPlan
 
class  FlashAllTool
 
class  ZipImageSource
 
class  LocalImageSource
 
struct  NetworkSerial
 

Typedefs

using unique_zip_t = std::unique_ptr< zip_t, decltype(&zip_close)>
 
using ImageEntry = std::pair< const Image *, std::string >
 

Enumerations

enum  fb_buffer_type { FB_BUFFER_FD , FB_BUFFER_SPARSE }
 
enum class  ImageType { BootCritical , Normal , Extra }
 

Functions

char * get_android_product_out ()
 
bool should_flash_in_userspace (const ImageSource *source, const std::string &partition_name)
 
bool is_userspace_fastboot ()
 
void do_flash (const char *pname, const char *fname, const bool apply_vbmeta, const FlashingPlan *fp)
 
void do_for_partitions (const std::string &part, const std::string &slot, const std::function< void(const std::string &)> &func, bool force_slot)
 
std::string find_item (const std::string &item)
 
void reboot_to_userspace_fastboot ()
 
void syntax_error (const char *fmt,...)
 
std::string get_current_slot ()
 
bool CheckFastbootInfoRequirements (const std::vector< std::string > &command, uint32_t host_tool_version)
 
std::unique_ptr< FlashTaskParseFlashCommand (const FlashingPlan *fp, const std::vector< std::string > &parts)
 
std::unique_ptr< RebootTaskParseRebootCommand (const FlashingPlan *fp, const std::vector< std::string > &parts)
 
std::unique_ptr< WipeTaskParseWipeCommand (const FlashingPlan *fp, const std::vector< std::string > &parts)
 
std::unique_ptr< TaskParseFastbootInfoLine (const FlashingPlan *fp, const std::vector< std::string > &command)
 
bool AddResizeTasks (const FlashingPlan *fp, std::vector< std::unique_ptr< Task > > &tasks)
 
std::vector< std::unique_ptr< Task > > ParseFastbootInfo (const FlashingPlan *fp, const std::vector< std::string > &file)
 
Result< NetworkSerial, FastbootErrorParseNetworkSerial (const std::string &serial)
 
std::string GetPartitionName (const ImageEntry &entry, const std::string &current_slot_)
 
void flash_partition_files (const std::string &partition, const std::vector< SparsePtr > &files)
 
int64_t get_sparse_limit (int64_t size, const FlashingPlan *fp)
 
std::vector< SparsePtrresparse_file (sparse_file *s, int64_t max_size)
 
bool supports_AB (fastboot::IFastBootDriver *fb)
 
bool is_logical (const std::string &partition)
 
void fb_perform_format (const std::string &partition, int skip_if_not_supported, const std::string &type_override, const std::string &size_override, const unsigned fs_options, const FlashingPlan *fp)
 

Typedef Documentation

◆ ImageEntry

using ImageEntry = std::pair<const Image*, std::string>

◆ unique_zip_t

using unique_zip_t = std::unique_ptr<zip_t, decltype(&zip_close)>

Enumeration Type Documentation

◆ fb_buffer_type

Enumerator
FB_BUFFER_FD 
FB_BUFFER_SPARSE 

◆ ImageType

enum class ImageType
strong
Enumerator
BootCritical 
Normal 
Extra 

Function Documentation

◆ AddResizeTasks()

bool AddResizeTasks ( const FlashingPlan fp,
std::vector< std::unique_ptr< Task > > &  tasks 
)

◆ CheckFastbootInfoRequirements()

bool CheckFastbootInfoRequirements ( const std::vector< std::string > &  command,
uint32_t  host_tool_version 
)

◆ do_flash()

void do_flash ( const char *  pname,
const char *  fname,
const bool  apply_vbmeta,
const FlashingPlan fp 
)

◆ do_for_partitions()

void do_for_partitions ( const std::string &  part,
const std::string &  slot,
const std::function< void(const std::string &)> &  func,
bool  force_slot 
)

◆ fb_perform_format()

void fb_perform_format ( const std::string &  partition,
int  skip_if_not_supported,
const std::string &  type_override,
const std::string &  size_override,
const unsigned  fs_options,
const FlashingPlan fp 
)

◆ find_item()

std::string find_item ( const std::string &  item)

◆ flash_partition_files()

void flash_partition_files ( const std::string &  partition,
const std::vector< SparsePtr > &  files 
)

◆ get_android_product_out()

char * get_android_product_out ( )

◆ get_current_slot()

std::string get_current_slot ( )

◆ get_sparse_limit()

int64_t get_sparse_limit ( int64_t  size,
const FlashingPlan fp 
)

◆ GetPartitionName()

std::string GetPartitionName ( const ImageEntry entry,
const std::string &  current_slot_ 
)

◆ is_logical()

bool is_logical ( const std::string &  partition)

◆ is_userspace_fastboot()

bool is_userspace_fastboot ( )

◆ ParseFastbootInfo()

std::vector< std::unique_ptr< Task > > ParseFastbootInfo ( const FlashingPlan fp,
const std::vector< std::string > &  file 
)

◆ ParseFastbootInfoLine()

std::unique_ptr< Task > ParseFastbootInfoLine ( const FlashingPlan fp,
const std::vector< std::string > &  command 
)

◆ ParseFlashCommand()

std::unique_ptr< FlashTask > ParseFlashCommand ( const FlashingPlan fp,
const std::vector< std::string > &  parts 
)

◆ ParseNetworkSerial()

Result< NetworkSerial, FastbootError > ParseNetworkSerial ( const std::string &  serial)

◆ ParseRebootCommand()

std::unique_ptr< RebootTask > ParseRebootCommand ( const FlashingPlan fp,
const std::vector< std::string > &  parts 
)

◆ ParseWipeCommand()

std::unique_ptr< WipeTask > ParseWipeCommand ( const FlashingPlan fp,
const std::vector< std::string > &  parts 
)

◆ reboot_to_userspace_fastboot()

void reboot_to_userspace_fastboot ( )

◆ resparse_file()

std::vector< SparsePtr > resparse_file ( sparse_file *  s,
int64_t  max_size 
)

◆ should_flash_in_userspace()

bool should_flash_in_userspace ( const ImageSource source,
const std::string &  partition_name 
)

◆ supports_AB()

bool supports_AB ( fastboot::IFastBootDriver fb)

◆ syntax_error()

void syntax_error ( const char *  fmt,
  ... 
)