Loading fastboot/README.md +35 −0 Original line number Diff line number Diff line Loading @@ -186,10 +186,45 @@ The various currently defined names are: bootloader requiring a signature before it will install or boot images. is-userspace If the value is "yes", the device is running fastbootd. Otherwise, it is running fastboot in the bootloader. Names starting with a lowercase character are reserved by this specification. OEM-specific names should not start with lowercase characters. ## Logical Partitions There are a number of commands to interact with logical partitions: update-super:%s:%s Write the previously downloaded image to a super partition. Unlike the "flash" command, this has special rules. The image must have been created by the lpmake command, and must not be a sparse image. If the last argument is "wipe", then all existing logical partitions are deleted. If no final argument is specified, the partition tables are merged. Any partition in the new image that does not exist in the old image is created with a zero size. In all cases, this will cause the temporary "scratch" partition to be deleted if it exists. create-logical-partition:%s:%d Create a logical partition with the given name and size, in the super partition. delete-logical-partition:%s Delete a logical partition with the given name. resize-logical-partition:%s:%d Change the size of the named logical partition. In addition, there is a variable to test whether a partition is logical: is-logical:%s If the value is "yes", the partition is logical. Otherwise the partition is physical. ## TCP Protocol v1 Loading fastboot/constants.h +1 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ #define FB_CMD_CREATE_PARTITION "create-logical-partition" #define FB_CMD_DELETE_PARTITION "delete-logical-partition" #define FB_CMD_RESIZE_PARTITION "resize-logical-partition" #define FB_CMD_UPDATE_SUPER "update-super" #define RESPONSE_OKAY "OKAY" #define RESPONSE_FAIL "FAIL" Loading fastboot/device/commands.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -336,3 +336,11 @@ bool ResizePartitionHandler(FastbootDevice* device, const std::vector<std::strin } return device->WriteOkay("Partition resized"); } bool UpdateSuperHandler(FastbootDevice* device, const std::vector<std::string>& args) { if (args.size() < 2) { return device->WriteFail("Invalid arguments"); } bool wipe = (args.size() >= 3 && args[2] == "wipe"); return UpdateSuper(device, args[1], wipe); } fastboot/device/commands.h +1 −0 Original line number Diff line number Diff line Loading @@ -44,3 +44,4 @@ bool FlashHandler(FastbootDevice* device, const std::vector<std::string>& args); bool CreatePartitionHandler(FastbootDevice* device, const std::vector<std::string>& args); bool DeletePartitionHandler(FastbootDevice* device, const std::vector<std::string>& args); bool ResizePartitionHandler(FastbootDevice* device, const std::vector<std::string>& args); bool UpdateSuperHandler(FastbootDevice* device, const std::vector<std::string>& args); fastboot/device/fastboot_device.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ FastbootDevice::FastbootDevice() {FB_CMD_CREATE_PARTITION, CreatePartitionHandler}, {FB_CMD_DELETE_PARTITION, DeletePartitionHandler}, {FB_CMD_RESIZE_PARTITION, ResizePartitionHandler}, {FB_CMD_UPDATE_SUPER, UpdateSuperHandler}, }), transport_(std::make_unique<ClientUsbTransport>()), boot_control_hal_(IBootControl::getService()) {} Loading Loading
fastboot/README.md +35 −0 Original line number Diff line number Diff line Loading @@ -186,10 +186,45 @@ The various currently defined names are: bootloader requiring a signature before it will install or boot images. is-userspace If the value is "yes", the device is running fastbootd. Otherwise, it is running fastboot in the bootloader. Names starting with a lowercase character are reserved by this specification. OEM-specific names should not start with lowercase characters. ## Logical Partitions There are a number of commands to interact with logical partitions: update-super:%s:%s Write the previously downloaded image to a super partition. Unlike the "flash" command, this has special rules. The image must have been created by the lpmake command, and must not be a sparse image. If the last argument is "wipe", then all existing logical partitions are deleted. If no final argument is specified, the partition tables are merged. Any partition in the new image that does not exist in the old image is created with a zero size. In all cases, this will cause the temporary "scratch" partition to be deleted if it exists. create-logical-partition:%s:%d Create a logical partition with the given name and size, in the super partition. delete-logical-partition:%s Delete a logical partition with the given name. resize-logical-partition:%s:%d Change the size of the named logical partition. In addition, there is a variable to test whether a partition is logical: is-logical:%s If the value is "yes", the partition is logical. Otherwise the partition is physical. ## TCP Protocol v1 Loading
fastboot/constants.h +1 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ #define FB_CMD_CREATE_PARTITION "create-logical-partition" #define FB_CMD_DELETE_PARTITION "delete-logical-partition" #define FB_CMD_RESIZE_PARTITION "resize-logical-partition" #define FB_CMD_UPDATE_SUPER "update-super" #define RESPONSE_OKAY "OKAY" #define RESPONSE_FAIL "FAIL" Loading
fastboot/device/commands.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -336,3 +336,11 @@ bool ResizePartitionHandler(FastbootDevice* device, const std::vector<std::strin } return device->WriteOkay("Partition resized"); } bool UpdateSuperHandler(FastbootDevice* device, const std::vector<std::string>& args) { if (args.size() < 2) { return device->WriteFail("Invalid arguments"); } bool wipe = (args.size() >= 3 && args[2] == "wipe"); return UpdateSuper(device, args[1], wipe); }
fastboot/device/commands.h +1 −0 Original line number Diff line number Diff line Loading @@ -44,3 +44,4 @@ bool FlashHandler(FastbootDevice* device, const std::vector<std::string>& args); bool CreatePartitionHandler(FastbootDevice* device, const std::vector<std::string>& args); bool DeletePartitionHandler(FastbootDevice* device, const std::vector<std::string>& args); bool ResizePartitionHandler(FastbootDevice* device, const std::vector<std::string>& args); bool UpdateSuperHandler(FastbootDevice* device, const std::vector<std::string>& args);
fastboot/device/fastboot_device.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ FastbootDevice::FastbootDevice() {FB_CMD_CREATE_PARTITION, CreatePartitionHandler}, {FB_CMD_DELETE_PARTITION, DeletePartitionHandler}, {FB_CMD_RESIZE_PARTITION, ResizePartitionHandler}, {FB_CMD_UPDATE_SUPER, UpdateSuperHandler}, }), transport_(std::make_unique<ClientUsbTransport>()), boot_control_hal_(IBootControl::getService()) {} Loading