4.7.15. hrut_switch_reason
hrut_switch_reason is a boot failure diagnostic tool designed for A/B dual-partition systems. It displays the root cause of abnormal system switches by parsing stored data in the misc partition.
4.7.15.1. Syntax Description
The following is the command format for executing hrut_switch_reason:
hrut_switch_reason [misc_path] <--current|--all>
4.7.15.2. Parameter Options Description
misc_path: Optional parameter specifying the misc partition or file path (default is /dev/block/platform/by-name/misc).
–current: Displays the reason for the most recent abnormal switch.
–all: Displays reasons for all abnormal switches.
4.7.15.3. Command Options and Their Function Descriptions
Display the Reason for the Most Recent Abnormal Switch
Command:
root@buildroot:~# hrut_switch_reason --current
Function:
Extracts the reason for the most recent abnormal switch from the specified misc file and prints the output.
Output:
misc broken
Result Analysis:
misc broken: Indicates that the most recent abnormal switch was caused by corruption of the misc partition.
Display Reasons for All Abnormal Switches
Command:
root@buildroot:~# hrut_switch_reason --all
Function:
Extracts reasons for all abnormal switches from the specified misc file and prints them in order from newest to oldest.
Output:
All Reasons (From the latest to the oldest):
1: misc broken
2: unused
3: unused
4: unused
5: unused
6: unused
7: unused
8: unused
9: unused
10: unused
Result Analysis:
misc broken: Indicates corruption of the misc partition.
unused: Indicates unused entries.
List of Abnormal Switch Reasons
Below are some possible causes of abnormal switches and their specific triggering scenarios:
misc broken (misc partition corrupted)
Triggering Causes:
Partition table error: The misc partition information in the GPT partition table is corrupted
Unexpected power loss: Power interruption during misc data update leads to incomplete data
Storage medium failure: Bad blocks in EMMC/NAND FLASH cause data corruption
boot corrupted (boot image corrupted)
Triggering Causes:
OTA update failure: The downloaded boot.img is incomplete or fails verification
dm-verity corrupted (dm-verity verification failed)
Triggering Causes:
System file tampering: The /system partition has been modified without authorization
Hash tree corruption: Data blocks of the dm-verity hash tree are damaged
uboot corrupted (U-Boot corrupted)
Triggering Causes:
QSPI Flash failure: Storage medium of U-Boot is damaged
Flashing operation error: Power loss or failure during
fastboot flash uboot
miniboot corrupted (MiniBoot corrupted)
Triggering Causes:
Secure boot chain broken: Failure in verification by the previous-stage bootloader