Skip to content
Snippets Groups Projects
Commit 24808427 authored by Tobias Kahlki's avatar Tobias Kahlki
Browse files

uboot:scripts: Change slot names to match bootselect names

Historically, we use the names "alternative", "regular" and "regularB"
to name the three operating systems on the boards. The bootselect tool
also sets these names in the U-Boot ENV. Change the boot script to align
with these names, too.
parent 5f379095
No related branches found
No related tags found
Loading
Pipeline #127903 passed with stage
in 19 seconds
......@@ -53,10 +53,10 @@ fi
# Regular Boot
##########################################
test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "recover A B"
test -n "${BOOT_recover_LEFT}" || setenv BOOT_recover_LEFT 3
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 "alternative regular regularB"
test -n "${BOOT_alternative_LEFT}" || setenv BOOT_alternative_LEFT 3
test -n "${BOOT_regular_LEFT}" || setenv BOOT_regular_LEFT 3
test -n "${BOOT_regularB_LEFT}" || setenv BOOT_regularB_LEFT 3
setenv ramdisk
setenv bootargs
......@@ -66,19 +66,19 @@ setenv TMP_BOOT_ORDER ${BOOT_ORDER}
seco_ne bootselect
if test "${bootmode_gpio}" = "alternative"; then
setenv TMP_BOOT_ORDER "recover A B"
setenv TMP_BOOT_ORDER "alternative regular regularB"
fi
for BOOT_SLOT in "${TMP_BOOT_ORDER}"; do
if test "x${bootargs}" != "x"; then
# Skip remaining slots
elif test "x${BOOT_SLOT}" = "xrecover"; then
if test 0x${BOOT_recover_LEFT} -gt 0; then
echo "Found valid slot recover, ${BOOT_recover_LEFT} attempts remaining"
elif test "x${BOOT_SLOT}" = "xalternative"; then
if test 0x${BOOT_alternative_LEFT} -gt 0; then
echo "Found valid slot alternative, ${BOOT_alternative_LEFT} attempts remaining"
# @TODO: Reset the BOOT_LEFT variable from
# the OS via a Systemd service unit and reactivate
# the boot counter here (also for slots A and B).
#setexpr BOOT_recover_LEFT ${BOOT_recover_LEFT} - 1
#setexpr BOOT_alternative_LEFT ${BOOT_alternative_LEFT} - 1
setenv ramdisk "-"
......@@ -87,12 +87,12 @@ for BOOT_SLOT in "${TMP_BOOT_ORDER}"; do
setenv ramdisk "${ramdisk_addr_r}:${filesize}"
fatload mmc 0:3 ${fdt_addr_r} ${fdtfile}
setenv bootargs "${default_bootargs} root=/dev/mmcblk0p3 rauc.slot=recover"
setenv bootargs "${default_bootargs} root=/dev/mmcblk0p3 rauc.slot=alternative"
fi
elif test "x${BOOT_SLOT}" = "xA"; then
if test 0x${BOOT_A_LEFT} -gt 0; then
echo "Found valid slot A, ${BOOT_A_LEFT} attempts remaining"
#setexpr BOOT_A_LEFT ${BOOT_A_LEFT} - 1
elif test "x${BOOT_SLOT}" = "xregular"; then
if test 0x${BOOT_regular_LEFT} -gt 0; then
echo "Found valid slot regular, ${BOOT_regular_LEFT} attempts remaining"
#setexpr BOOT_regular_LEFT ${BOOT_regular_LEFT} - 1
${storage} dev ${storage_dev}
part start ${storage} ${storage_dev} kernel kernel_part_addr
......@@ -101,12 +101,12 @@ for BOOT_SLOT in "${TMP_BOOT_ORDER}"; do
env exists boot_conf || setenv boot_conf "${fdt_boot_conf}"
setenv bootargs "${default_bootargs} root=PARTLABEL=ROOTFS rootwait rauc.slot=A"
setenv bootargs "${default_bootargs} root=PARTLABEL=ROOTFS rootwait rauc.slot=regular"
fi
elif test "x${BOOT_SLOT}" = "xB"; then
if test 0x${BOOT_B_LEFT} -gt 0; then
echo "Found valid slot B, ${BOOT_B_LEFT} attempts remaining"
#setexpr BOOT_B_LEFT ${BOOT_B_LEFT} - 1
elif test "x${BOOT_SLOT}" = "xregularB"; then
if test 0x${BOOT_regularB_LEFT} -gt 0; then
echo "Found valid slot regularB, ${BOOT_regularB_LEFT} attempts remaining"
#setexpr BOOT_regularB_LEFT ${BOOT_regularB_LEFT} - 1
# @TODO: Load artefacts and set bootargs for B
fi
......@@ -154,9 +154,9 @@ if test -n "${bootargs}"; then
saveenv
else
echo "No valid slot found, resetting attempts to 3"
setenv BOOT_recover_LEFT 3
setenv BOOT_A_LEFT 3
setenv BOOT_B_LEFT 3
setenv BOOT_alternative_LEFT 3
setenv BOOT_regular_LEFT 3
setenv BOOT_regularB_LEFT 3
saveenv
reset
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment