blob: f2e1117c337bd3bcce5a5f92811c72e2de06b6c6 [file] [log] [blame]
echo CzechLight BeagleBone Black RAUC
test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3;
test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3;
test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B";
for BOOT_SLOT in "${BOOT_ORDER}"; do
if test "x${rauc_part}" != "x"; then
;
elif test "x${BOOT_SLOT}" = "xA"; then
if test ${BOOT_A_LEFT} -gt 0; then
setexpr BOOT_A_LEFT ${BOOT_A_LEFT} - 1;
echo "Found valid slot A, ${BOOT_A_LEFT} attempts remaining";
rauc_part=2;
rauc_slot=A;
fi;
elif test "x${BOOT_SLOT}" = "xB"; then
if test ${BOOT_B_LEFT} -gt 0; then
setexpr BOOT_B_LEFT ${BOOT_B_LEFT} - 1;
echo "Found valid slot B, ${BOOT_B_LEFT} attempts remaining";
rauc_part=5;
rauc_slot=B;
fi;
fi;
done;
if test -n "${rauc_part}"; then
saveenv;
else
echo "No valid slot found, resetting tries to 3";
setenv BOOT_A_LEFT 3;
setenv BOOT_B_LEFT 3;
saveenv;
reset;
fi;
load mmc 1:${rauc_part} ${scriptaddr} /boot/boot.scr || reset;
source ${scriptaddr} || reset;