从如下代码中可以看到,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},
{"flashing lock_critical", CmdFlashingLockCritical},
#endif
/*
*CAUTION(CRITICAL): Enabling this command will allow boot with different
*bootimage.
*/
#ifdef ENABLE_BOOT_CMD
{"boot", CmdBoot},
#endif
{"oem enable-charger-screen", CmdOemEnableChargerScreen},
{"oem disable-charger-screen", CmdOemDisableChargerScreen},
{"oem off-mode-charge", CmdOemOffModeCharger},
{"oem select-display-panel", CmdOemSelectDisplayPanel},
{"oem device-info", CmdOemDevinfo},
{"continue", CmdContinue},
{"reboot", CmdReboot},
{"reboot-bootloader", CmdRebootBootloader},
{"getvar:", CmdGetVar},
{"download:", CmdDownload},
};