从如下代码中可以看到,fastboot的命令是由这几个宏打开的,只要在user模式下强制使能这几个宏开关即可
#define ENABLE_UPDATE_PARTITIONS_CMDS
#define ENABLE_DEVICE_CRITICAL_LOCK_UNLOCK_CMDS
#define ENABLE_BOOT_CMD
struct FastbootCmdDesc cmd_list[] = {
/* By Default enable list is empty */
{"", NULL},
/*CAUTION(High): Enabling these commands will allow changing the partitions
*like system,userdata,cachec etc...
*/
#ifdef ENABLE_UPDATE_PARTITIONS_CMDS
{"flash:", CmdFlash},
{"erase:", CmdErase},
{"set_active", CmdSetActive},
{"flashing get_unlock_ability", CmdFlashingGetUnlockAbility},
{"flashing unlock", CmdFlashingUnlock},
{"flashing lock", CmdFlashingLock},
#endif
/*
*CAUTION(CRITICAL): Enabling these commands will allow changes to bootimage.
*/
#ifdef ENABLE_DEVICE_CRITICAL_LOCK_UNLOCK_CMDS
{"flashing unlock_critical", CmdFlashingUnLockCritical},