Add device_board_set_boot_success in booting-done.service
authorHyotaek Shim <hyotaek.shim@samsung.com>
Thu, 6 Jan 2022 11:32:30 +0000 (20:32 +0900)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Mon, 25 Mar 2024 11:49:10 +0000 (12:49 +0100)
/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

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