Add device_board_set_boot_success in booting-done.service 24/269024/4
authorHyotaek Shim <hyotaek.shim@samsung.com>
Thu, 6 Jan 2022 11:32:30 +0000 (20:32 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Thu, 6 Jan 2022 11:40:09 +0000 (20:40 +0900)
/usr/bin/device_board_set_boot_success reports boot success to the bootloader.
If boot success is not reported for, e.g., 10-times booting in a row,
bootloader recovers the system.

-- Bootloader --
If (BOOT_SUCCESS flag is set) {
Clear the BOOT_SUCCESS flag
BOOT_FAIL_COUNT = 0
} Else {
If (++ BOOT_FAIL_COUNT > 10) {
BOOT_FAIL_COUNT = 0
Restore to the other partitions (e.g., b -> a)
Proceed to the recovery booting (ramdisk-recovery, bootmode="recovery")
          }
}

Proceed to the normal booting (ramdisk, bootmode="")

Change-Id: I581c5dbcf216806dfcff826bbdf7ca82dc944676
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
units/booting-done.service.in

index 41d14ad..42c9a5c 100644 (file)
@@ -7,5 +7,6 @@ RefuseManualStop=yes
 User=system_fw
 Group=system_fw
 ExecStart=@rootbindir@/wait-delayed-target.sh
+ExecStartPost=-/usr/bin/device_board_set_boot_success
 RemainAfterExit=yes
 SmackProcessLabel=System