Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dd2ef111 authored by Tom Cherry's avatar Tom Cherry Committed by Gerrit Code Review
Browse files

Merge changes I11ff0aed,Ia442a41d

* changes:
  fastboot: remove 'verify'
  fastboot: remove 'powerdown'
parents 6316be2e e51dadb8
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -136,10 +136,6 @@ The various currently defined commands are:
                       should not support "upload" unless it supports an
                       oem command that requires "upload" capabilities.

    verify:%08x        Send a digital signature to verify the downloaded
                       data.  Required if the bootloader is "secure"
                       otherwise "flash" and "boot" will be ignored.

    flash:%s           Write the previously downloaded image to the
                       named partition (if possible).

@@ -159,8 +155,6 @@ The various currently defined commands are:
                       the bootloader and then upgrading other partitions
                       using the new bootloader.

    powerdown          Power off the device.



## Client Variables
+0 −2
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@
#define FB_CMD_GETVAR "getvar"
#define FB_CMD_DOWNLOAD "download"
#define FB_CMD_UPLOAD "upload"
#define FB_CMD_VERIFY "verify"
#define FB_CMD_FLASH "flash"
#define FB_CMD_ERASE "erase"
#define FB_CMD_BOOT "boot"
@@ -29,7 +28,6 @@
#define FB_CMD_REBOOT_BOOTLOADER "reboot-bootloader"
#define FB_CMD_REBOOT_RECOVERY "reboot-recovery"
#define FB_CMD_REBOOT_FASTBOOT "reboot-fastboot"
#define FB_CMD_POWERDOWN "powerdown"
#define FB_CMD_CREATE_PARTITION "create-logical-partition"
#define FB_CMD_DELETE_PARTITION "delete-logical-partition"
#define FB_CMD_RESIZE_PARTITION "resize-logical-partition"
+0 −11
Original line number Diff line number Diff line
@@ -89,10 +89,6 @@ RetCode FastBootDriver::GetVarAll(std::vector<std::string>* response) {
    return GetVar("all", &tmp, response);
}

RetCode FastBootDriver::Powerdown(std::string* response, std::vector<std::string>* info) {
    return RawCommand(Commands::POWERDOWN, response, info);
}

RetCode FastBootDriver::Reboot(std::string* response, std::vector<std::string>* info) {
    return RawCommand(Commands::REBOOT, response, info);
}
@@ -107,11 +103,6 @@ RetCode FastBootDriver::SetActive(const std::string& part, std::string* response
    return RawCommand(Commands::SET_ACTIVE + part, response, info);
}

RetCode FastBootDriver::Verify(uint32_t num, std::string* response, std::vector<std::string>* info) {
    std::string cmd = android::base::StringPrintf("%s%08" PRIx32, Commands::VERIFY.c_str(), num);
    return RawCommand(cmd, response, info);
}

RetCode FastBootDriver::FlashPartition(const std::string& part, const std::vector<char>& data) {
    RetCode ret;
    if ((ret = Download(data))) {
@@ -436,11 +427,9 @@ const std::string FastBootDriver::Commands::DOWNLOAD = "download:";
const std::string FastBootDriver::Commands::ERASE = "erase:";
const std::string FastBootDriver::Commands::FLASH = "flash:";
const std::string FastBootDriver::Commands::GET_VAR = "getvar:";
const std::string FastBootDriver::Commands::POWERDOWN = "powerdown";
const std::string FastBootDriver::Commands::REBOOT = "reboot";
const std::string FastBootDriver::Commands::SET_ACTIVE = "set_active:";
const std::string FastBootDriver::Commands::UPLOAD = "upload";
const std::string FastBootDriver::Commands::VERIFY = "verify:";

/******************************* PRIVATE **************************************/
RetCode FastBootDriver::SendBuffer(int fd, size_t size) {
+0 −5
Original line number Diff line number Diff line
@@ -86,7 +86,6 @@ class FastBootDriver {
    RetCode GetVar(const std::string& key, std::string* val,
                   std::vector<std::string>* info = nullptr);
    RetCode GetVarAll(std::vector<std::string>* response);
    RetCode Powerdown(std::string* response = nullptr, std::vector<std::string>* info = nullptr);
    RetCode Reboot(std::string* response = nullptr, std::vector<std::string>* info = nullptr);
    RetCode RebootTo(std::string target, std::string* response = nullptr,
                     std::vector<std::string>* info = nullptr);
@@ -94,8 +93,6 @@ class FastBootDriver {
                      std::vector<std::string>* info = nullptr);
    RetCode Upload(const std::string& outfile, std::string* response = nullptr,
                   std::vector<std::string>* info = nullptr);
    RetCode Verify(uint32_t num, std::string* response = nullptr,
                   std::vector<std::string>* info = nullptr);

    /* HIGHER LEVEL COMMANDS -- Composed of the commands above */
    RetCode FlashPartition(const std::string& part, const std::vector<char>& data);
@@ -136,11 +133,9 @@ class FastBootDriver {
        static const std::string ERASE;
        static const std::string FLASH;
        static const std::string GET_VAR;
        static const std::string POWERDOWN;
        static const std::string REBOOT;
        static const std::string SET_ACTIVE;
        static const std::string UPLOAD;
        static const std::string VERIFY;
    };

    Transport* transport_;
+2 −3
Original line number Diff line number Diff line
@@ -86,9 +86,8 @@ std::vector<std::pair<std::string, extension::Configuration::PartitionInfo>>

const std::string DEFAULT_OUPUT_NAME = "out.img";
// const char scratch_partition[] = "userdata";
const std::vector<std::string> CMDS{"boot",        "continue", "download:", "erase:",
                                    "flash:",      "getvar:",  "powerdown", "reboot",
                                    "set_active:", "upload",   "verify"};
const std::vector<std::string> CMDS{"boot",    "continue", "download:",   "erase:", "flash:",
                                    "getvar:", "reboot",   "set_active:", "upload"};

// For pretty printing we need all these overloads
::std::ostream& operator<<(::std::ostream& os, const RetCode& ret) {