Loading fastboot/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -132,6 +132,7 @@ cc_binary { "libext2_uuid", "libext4_utils", "libfs_mgr", "libgsi", "libhidlbase", "libhidltransport", "libhwbinder", Loading fastboot/constants.h +1 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ #define FB_CMD_RESIZE_PARTITION "resize-logical-partition" #define FB_CMD_UPDATE_SUPER "update-super" #define FB_CMD_OEM "oem" #define FB_CMD_GSI "gsi" #define RESPONSE_OKAY "OKAY" #define RESPONSE_FAIL "FAIL" Loading fastboot/device/commands.cpp +20 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ #include <cutils/android_reboot.h> #include <ext4_utils/wipe.h> #include <fs_mgr.h> #include <libgsi/libgsi.h> #include <liblp/builder.h> #include <liblp/liblp.h> #include <uuid/uuid.h> Loading Loading @@ -460,3 +461,22 @@ bool UpdateSuperHandler(FastbootDevice* device, const std::vector<std::string>& bool wipe = (args.size() >= 3 && args[2] == "wipe"); return UpdateSuper(device, args[1], wipe); } bool GsiHandler(FastbootDevice* device, const std::vector<std::string>& args) { if (!android::gsi::IsGsiInstalled()) { return device->WriteStatus(FastbootResult::FAIL, "No GSI is installed"); } if (args.size() != 2) { return device->WriteFail("Invalid arguments"); } if (args[1] == "wipe") { if (!android::gsi::UninstallGsi()) { return device->WriteStatus(FastbootResult::FAIL, strerror(errno)); } } else if (args[1] == "disable") { if (!android::gsi::DisableGsi()) { return device->WriteStatus(FastbootResult::FAIL, strerror(errno)); } } return device->WriteStatus(FastbootResult::OKAY, "Success"); } fastboot/device/commands.h +1 −0 Original line number Diff line number Diff line Loading @@ -48,3 +48,4 @@ bool DeletePartitionHandler(FastbootDevice* device, const std::vector<std::strin bool ResizePartitionHandler(FastbootDevice* device, const std::vector<std::string>& args); bool UpdateSuperHandler(FastbootDevice* device, const std::vector<std::string>& args); bool OemCmdHandler(FastbootDevice* device, const std::vector<std::string>& args); bool GsiHandler(FastbootDevice* device, const std::vector<std::string>& args); fastboot/device/fastboot_device.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ FastbootDevice::FastbootDevice() {FB_CMD_RESIZE_PARTITION, ResizePartitionHandler}, {FB_CMD_UPDATE_SUPER, UpdateSuperHandler}, {FB_CMD_OEM, OemCmdHandler}, {FB_CMD_GSI, GsiHandler}, }), transport_(std::make_unique<ClientUsbTransport>()), boot_control_hal_(IBootControl::getService()), Loading Loading
fastboot/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -132,6 +132,7 @@ cc_binary { "libext2_uuid", "libext4_utils", "libfs_mgr", "libgsi", "libhidlbase", "libhidltransport", "libhwbinder", Loading
fastboot/constants.h +1 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ #define FB_CMD_RESIZE_PARTITION "resize-logical-partition" #define FB_CMD_UPDATE_SUPER "update-super" #define FB_CMD_OEM "oem" #define FB_CMD_GSI "gsi" #define RESPONSE_OKAY "OKAY" #define RESPONSE_FAIL "FAIL" Loading
fastboot/device/commands.cpp +20 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ #include <cutils/android_reboot.h> #include <ext4_utils/wipe.h> #include <fs_mgr.h> #include <libgsi/libgsi.h> #include <liblp/builder.h> #include <liblp/liblp.h> #include <uuid/uuid.h> Loading Loading @@ -460,3 +461,22 @@ bool UpdateSuperHandler(FastbootDevice* device, const std::vector<std::string>& bool wipe = (args.size() >= 3 && args[2] == "wipe"); return UpdateSuper(device, args[1], wipe); } bool GsiHandler(FastbootDevice* device, const std::vector<std::string>& args) { if (!android::gsi::IsGsiInstalled()) { return device->WriteStatus(FastbootResult::FAIL, "No GSI is installed"); } if (args.size() != 2) { return device->WriteFail("Invalid arguments"); } if (args[1] == "wipe") { if (!android::gsi::UninstallGsi()) { return device->WriteStatus(FastbootResult::FAIL, strerror(errno)); } } else if (args[1] == "disable") { if (!android::gsi::DisableGsi()) { return device->WriteStatus(FastbootResult::FAIL, strerror(errno)); } } return device->WriteStatus(FastbootResult::OKAY, "Success"); }
fastboot/device/commands.h +1 −0 Original line number Diff line number Diff line Loading @@ -48,3 +48,4 @@ bool DeletePartitionHandler(FastbootDevice* device, const std::vector<std::strin bool ResizePartitionHandler(FastbootDevice* device, const std::vector<std::string>& args); bool UpdateSuperHandler(FastbootDevice* device, const std::vector<std::string>& args); bool OemCmdHandler(FastbootDevice* device, const std::vector<std::string>& args); bool GsiHandler(FastbootDevice* device, const std::vector<std::string>& args);
fastboot/device/fastboot_device.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ FastbootDevice::FastbootDevice() {FB_CMD_RESIZE_PARTITION, ResizePartitionHandler}, {FB_CMD_UPDATE_SUPER, UpdateSuperHandler}, {FB_CMD_OEM, OemCmdHandler}, {FB_CMD_GSI, GsiHandler}, }), transport_(std::make_unique<ClientUsbTransport>()), boot_control_hal_(IBootControl::getService()), Loading