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

[machine][tanaro] Added sysdata to the boot script

Adapted the boot script to use the active partition from sysdata.
Also adapted the loading of the boot artifacts to the new partition
layout.
parent 43196109
No related branches found
No related tags found
1 merge request!13[machine][tanaro] Fixed protocol and branch for BT driver
kernel=Image kernel=Image
devicetree= devicetree=
cmdline="console=ttymxc0,115200 root=/dev/mmcblk0p4 rootflags=data=journal rootwait rootfstype=ext4 bootloader=sysdata bootdevice=mmcblk0 cma=128M loglevel=6 vt.global_cursor_default=0 vt.color=0xF7 fbcon=logo-pos:center,logo-count:1,rotate:0" cmdline="console=ttymxc0,115200 rootflags=data=journal rootwait rootfstype=ext4 bootloader=sysdata cma=128M loglevel=6 vt.global_cursor_default=0 vt.color=0xF7 fbcon=logo-pos:center,logo-count:1,rotate:0"
...@@ -4,7 +4,7 @@ if fatload mmc ${current_partition} ${loadaddr} boot.cfg && env import -t ${load ...@@ -4,7 +4,7 @@ if fatload mmc ${current_partition} ${loadaddr} boot.cfg && env import -t ${load
if test -n ${cmdline} if test -n ${cmdline}
then then
echo "cmdline: ${cmdline}" echo "cmdline: ${cmdline}"
setenv bootargs ${cmdline} setenv bootargs "${bootargs} ${cmdline}"
fi fi
# Load DT # Load DT
......
test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B" #test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B"
test -n "${BOOT_A_LEFT}" || setenv BOOT_A_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_B_LEFT}" || setenv BOOT_B_LEFT 3
sysdata dev
sysdata switchslot status
if env exists slot_partition; then
echo "Found valid sysdata environment; Active boot slot: ${slot_partition}"
setenv BOOT_ORDER "${slot_partition} recovery"
else
echo "No valid sysdata environment found; Falling back to slot A"
setenv BOOT_ORDER "A recovery"
fi
setenv bootargs setenv bootargs
...@@ -11,19 +22,19 @@ for BOOT_SLOT in "${BOOT_ORDER}"; do ...@@ -11,19 +22,19 @@ for BOOT_SLOT in "${BOOT_ORDER}"; do
if test ${BOOT_A_LEFT} -gt 0; then if test ${BOOT_A_LEFT} -gt 0; then
echo "Found valid slot A, ${BOOT_A_LEFT} attempts remaining" echo "Found valid slot A, ${BOOT_A_LEFT} attempts remaining"
setexpr BOOT_A_LEFT ${BOOT_A_LEFT} - 1 setexpr BOOT_A_LEFT ${BOOT_A_LEFT} - 1
setenv kernel_partition 3 setenv kernel_partition 2
setenv fdt_partition 3 setenv fdt_partition 2
setenv root_partition 4 setenv root_partition 3
setenv bootargs "${default_bootargs} root=/dev/disk/by-label/A rauc.slot=A" setenv bootargs "${default_bootargs} root=/dev/mmcblk0p3 rauc.slot=A"
fi fi
elif test "x${BOOT_SLOT}" = "xB"; then elif test "x${BOOT_SLOT}" = "xB"; then
if test ${BOOT_B_LEFT} -gt 0; then if test ${BOOT_B_LEFT} -gt 0; then
echo "Found valid slot B, ${BOOT_B_LEFT} attempts remaining" echo "Found valid slot B, ${BOOT_B_LEFT} attempts remaining"
setexpr BOOT_B_LEFT ${BOOT_B_LEFT} - 1 setexpr BOOT_B_LEFT ${BOOT_B_LEFT} - 1
setenv kernel_partition 5 setenv kernel_partition 4
setenv fdt_partition 5 setenv fdt_partition 4
setenv root_partition 6 setenv root_partition 5
setenv bootargs "${default_bootargs} root=/dev/disk/by-label/B rauc.slot=B" setenv bootargs "${default_bootargs} root=/dev/mmcblk0p5 rauc.slot=B"
fi fi
fi fi
done done
......
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