Here is a list of hooks that the recovery may conditionally run if they exist in your recovery tree
[pre-gui] tag run before the interactive GUI is loaded to the user[blocking] tag are synchronous, and will stall the operation until the scripts are finished executing. Make sure they don't run forever, and avoid unsafe loops.Some hooks are available only on certain manifest versions and above. For example, the beforemodules.sh hook does not exist on fox_11.0 and below as defined by the respective [fox_12.1+] tag.
fox_10.0+ manifests
FOX_BUILD_BASH is defined as 1, the scripts must use the /system/bin/sh shebang instead of /sbin/shfox_9.0 and other older deprecated manifests
/sbin instead of /system/binThese hooks run during the recovery boot process
beforemodules.sh [pre-gui] [fox_12.1+]
/system/bin/beforemodules.shKernelModuleLoader::Load_Vendor_Modules()TW_LOAD_VENDOR_MODULES is defined with a list of modules to loadrunatboot.sh [pre-gui] [fox_9.0+]
/system/bin/runatboot.shfastbootd and recovery mode initializationpostfastboot.sh [pre-gui] [fox_12.1+]
/system/bin/postfastboot.shfastbootd mode initialization, after all system setuppostrecoveryboot.sh [pre-gui] [fox_9.0+]
/system/bin/postrecoveryboot.shrecovery mode initialization, after all system setupThese hooks run when user performs an operation in recovery
pre_rom_flash.sh [blocking] [fox_9.0+]
/system/bin/pre_rom_flash.shpost_rom_flash.sh [blocking] [fox_9.0+]
/system/bin/post_rom_flash.shpost_rom_flash_completion.sh [blocking] [fox_12.1+]
/system/bin/post_rom_flash_completion.shformatdata.sh [blocking] [fox_12.1+]
/system/bin/formatdata.sh/data partition format initiated by the "Format Data" operation beginsfactoryreset.sh [blocking] [fox_9.0+]
/system/bin/factoryreset.shThese hooks run when the user clicks an option from the power menu
beforereboot.sh [blocking] [fox_9.0+] [universal]
/system/bin/beforereboot.shrebootsystem.sh [blocking] [fox_9.0+]
/system/bin/rebootsystem.shrebootrecovery.sh [blocking] [fox_9.0+]
/system/bin/rebootrecovery.shTW_NO_REBOOT_RECOVERY is not defined, or falserebootbootloader.sh [blocking] [fox_9.0+]
/system/bin/rebootbootloader.shTW_NO_REBOOT_BOOTLOADER is not defined, or falserebootdownload.sh [blocking] [fox_9.0+]
/system/bin/rebootdownload.shTW_HAS_DOWNLOAD_MODE is defined as truerebootedl.sh [blocking] [fox_9.0+]
/system/bin/rebootedl.shTW_HAS_EDL_MODE is defined as truepoweroff.sh [blocking] [fox_9.0+]
/system/bin/poweroff.sh