diff --git a/brcmbca/base-files/etc/init.d/ack_boot_success b/brcmbca/base-files/etc/init.d/ack_boot_success index c0764999e5387bc509c5ff56df588787671ab719..c3c5ca9f9d8858d37348b7f8e5b4cdcdc5a4c596 100755 --- a/brcmbca/base-files/etc/init.d/ack_boot_success +++ b/brcmbca/base-files/etc/init.d/ack_boot_success @@ -4,6 +4,23 @@ # because bcm_bootsate resets /proc/bootstate/reset_reason START=13 +boot() { + local ret=0 + # If the loader attempts to load a committed image with support_fallback / bcm_support_fallback + # enabled, the watchdog and bootstate driver are set to detect if a reboot occurs before + # the Linux userspace sets the "steadystate" as done below + set_steady_state || ret=$? + # If the image reboots prior to reaching steady state, the loader boots the non-committed image once. + # + # Ordinarily, the non-committed image then commits itself after having itself + # booted successfully (see set_bank_permanently function) as done below + set_bank_permanently || ret=$? + return $ret +} + +set_steady_state() { + echo "steadystate" >/proc/bootstate/reset_reason +} # Set bank temporarily booted by sysupgrade to boot permanently after # "successful" boot @@ -50,9 +67,4 @@ set_bank_permanently() { fi echo "Permanently set boot bank to $booted_partition" | tee /dev/console fi - -} - -boot() { - set_bank_permanently }