blob: 8e5ba65a48eace6d7bdae2e5e88adedd7e143fef [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=4;
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 0:${rauc_part} ${scriptaddr} /boot/boot.scr || reset;
source ${scriptaddr} || reset;