bootcount 702 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh /etc/rc.common
  2. # SPDX-License-Identifier: GPL-2.0-only
  3. START=99
  4. boot() {
  5. case $(board_name) in
  6. xiaomi,mi-router-ax3000t)
  7. . /lib/upgrade/common.sh
  8. [ "$(rootfs_type)" = "tmpfs" ] && \
  9. logger "bootcount: initramfs mode detected, exit" && \
  10. return 0
  11. [ "$(fw_printenv -n flag_try_sys2_failed 2>&1)" = "8" ] && \
  12. logger "bootcount: rd03 model detected, exit" && \
  13. return 0
  14. fw_setenv -s - <<-EOF
  15. flag_boot_rootfs 0
  16. flag_boot_success 1
  17. flag_last_success 0
  18. flag_ota_reboot 0
  19. flag_try_sys1_failed 0
  20. flag_try_sys2_failed 0
  21. EOF
  22. logger "bootcount: rd23 model detected, nvram was updated"
  23. ;;
  24. zyxel,ex5700-telenor)
  25. fw_setenv uboot_bootcount 0
  26. ;;
  27. esac
  28. }