Jan Kundrát | 5fb4992 | 2019-08-05 18:27:25 +0200 | [diff] [blame] | 1 | echo CzechLight BeagleBone Black RAUC |
| 2 | |
| 3 | test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3; |
| 4 | test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3; |
| 5 | test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B"; |
| 6 | for BOOT_SLOT in "${BOOT_ORDER}"; do |
| 7 | if test "x${rauc_part}" != "x"; then |
| 8 | ; |
| 9 | elif test "x${BOOT_SLOT}" = "xA"; then |
| 10 | if test ${BOOT_A_LEFT} -gt 0; then |
| 11 | setexpr BOOT_A_LEFT ${BOOT_A_LEFT} - 1; |
| 12 | echo "Found valid slot A, ${BOOT_A_LEFT} attempts remaining"; |
| 13 | rauc_part=2; |
| 14 | rauc_slot=A; |
| 15 | fi; |
| 16 | elif test "x${BOOT_SLOT}" = "xB"; then |
| 17 | if test ${BOOT_B_LEFT} -gt 0; then |
| 18 | setexpr BOOT_B_LEFT ${BOOT_B_LEFT} - 1; |
| 19 | echo "Found valid slot B, ${BOOT_B_LEFT} attempts remaining"; |
| 20 | rauc_part=4; |
| 21 | rauc_slot=B; |
| 22 | fi; |
| 23 | fi; |
| 24 | done; |
| 25 | if test -n "${rauc_part}"; then |
| 26 | saveenv; |
| 27 | else |
| 28 | echo "No valid slot found, resetting tries to 3"; |
| 29 | setenv BOOT_A_LEFT 3; |
| 30 | setenv BOOT_B_LEFT 3; |
| 31 | saveenv; |
| 32 | reset; |
| 33 | fi; |
| 34 | load mmc 0:${rauc_part} ${scriptaddr} /boot/boot.scr || reset; |
| 35 | source ${scriptaddr} || reset; |