HI,
misc_message.command is ment for telling uboot or bootloader, that device needs to be booted into recovery mode i.e. the kernel from recovery image should be loaded instead of kernel of boot image.
and until recovery image overrides/resets the misc_message.command block device always boots in recovery mode just for the safety if devices power goes down recovery can perform its tasks again, and misc_message.command is only reset at the end of the intended tasks done by recovery.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
Some key things about /misc and the BCB:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
1. /misc and the BCB:
•Tiny partition used for communication between RC (Recovery console) and bootloader, and for RC to save state information
•Contains Bootloader Control Block (BCB)
–command[32]: Commands for the bootloader
•“boot-recovery” boot into RC instead of Android
•Other platform-specific commands may be implemented for update tasks that must be done by the bootloader
•If empty, garbage, or no known commands matched, normal Android boot
–status[32]: Return status field written by bootloader after performing platform-specific commands
•No specification, platform-dependent
–recovery[1024]: Command line for Recovery Console
•Arguments tokenized by ‘\n’
•Invalid if first argument not ‘recovery’
2. Bootloader selects boot image (or other task) based on BCB.command
–BCB.command is persistent; keep booting into RC until RC clears it
–Garbage or zeroed out contents should simply boot into Android
3. Recovery Console
• Upon startup, looks for command line arguments in decreasing precedence:
–Actual command line to ‘recovery’, debug-only scenario
–BCB.recovery
–Command file in /cache/recovery/command (written by RecoverySystem APIs)
• RecoverySystem doesn’t write to BCB due to permissions on doing raw block device I/O
• Always copies arguments into BCB.recovery and sets BCB.command to “boot-recovery”
–Makes sure we keep booting into RC with the same arguments in event of unexpected power loss
• finish_recovery()
–Called when requested operations (SW update, factory data reset, etc) are complete, whether successful or failed
–BCB is cleared so that subsequent reboot goes back into Android
• A divergent update process is very very bad, should always at some point complete so that finish_recovery() can be called
–Else the device will get stuck, user resets it, gets stuck again, can never boot back into Android
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks,
Shridutt Kothari,
Impetus Infotech India Ltd.