Skip to content

Commit

Permalink
Merge pull request rauc#73 from matthiasklein/boot-scripts
Browse files Browse the repository at this point in the history
boot-scripts: use itest for comparison, as setexpr calculates in hexa…
  • Loading branch information
leon-anavi authored Jan 24, 2024
2 parents b361b4b + eaa9b00 commit 308216e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions meta-rauc-nxp/recipes-bsp/u-boot/files/boot.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ for BOOT_SLOT in "${BOOT_ORDER}"; do
# stop checking after selecting a slot

elif test "x${BOOT_SLOT}" = "xA"; then
if test ${BOOT_A_LEFT} -gt 0; then
if itest ${BOOT_A_LEFT} -gt 0; then
setexpr BOOT_A_LEFT ${BOOT_A_LEFT} - 1
echo "Booting RAUC slot A"

Expand All @@ -24,7 +24,7 @@ for BOOT_SLOT in "${BOOT_ORDER}"; do
fi

elif test "x${BOOT_SLOT}" = "xB"; then
if test ${BOOT_B_LEFT} -gt 0; then
if itest ${BOOT_B_LEFT} -gt 0; then
setexpr BOOT_B_LEFT ${BOOT_B_LEFT} - 1
echo "Booting RAUC slot B"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ for BOOT_SLOT in "${BOOT_ORDER}"; do
if test "x${bootpart}" != "x"; then
# skip remaining slots
elif test "x${BOOT_SLOT}" = "xA"; then
if test ${BOOT_A_LEFT} -gt 0; then
if itest ${BOOT_A_LEFT} -gt 0; then
setexpr BOOT_A_LEFT ${BOOT_A_LEFT} - 1
echo "Found valid RAUC slot A"
setenv bootpart "/dev/mmcblk0p2"
setenv raucslot "A"
setenv BOOT_DEV "mmc 0:2"
fi
elif test "x${BOOT_SLOT}" = "xB"; then
if test ${BOOT_B_LEFT} -gt 0; then
if itest ${BOOT_B_LEFT} -gt 0; then
setexpr BOOT_B_LEFT ${BOOT_B_LEFT} - 1
echo "Found valid RAUC slot B"
setenv bootpart "/dev/mmcblk0p3"
Expand Down
4 changes: 2 additions & 2 deletions meta-rauc-sunxi/recipes-bsp/u-boot/files/boot.cmd.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ for BOOT_SLOT in "${BOOT_ORDER}"; do
if test "x${bootpart}" != "x"; then
# skip remaining slots
elif test "x${BOOT_SLOT}" = "xA"; then
if test ${BOOT_A_LEFT} -gt 0; then
if itest ${BOOT_A_LEFT} -gt 0; then
setexpr BOOT_A_LEFT ${BOOT_A_LEFT} - 1
echo "Found valid RAUC slot A"
setenv bootpart "/dev/mmcblk0p2"
setenv raucslot "A"
setenv BOOT_DEV "mmc 0:2"
fi
elif test "x${BOOT_SLOT}" = "xB"; then
if test ${BOOT_B_LEFT} -gt 0; then
if itest ${BOOT_B_LEFT} -gt 0; then
setexpr BOOT_B_LEFT ${BOOT_B_LEFT} - 1
echo "Found valid RAUC slot B"
setenv bootpart "/dev/mmcblk0p3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ index 6f36a0d2c4..d093a963b9 100644
+ " if test \"x${raucslot}\" != \"x\"; then " \
+ " echo \"skip remaining slots...\"; " \
+ " elif test \"x${BOOT_SLOT}\" = \"xA\"; then " \
+ " if test ${BOOT_A_LEFT} -gt 0; then " \
+ " if itest ${BOOT_A_LEFT} -gt 0; then " \
+ " setexpr BOOT_A_LEFT ${BOOT_A_LEFT} - 1; " \
+ " echo \"Found valid RAUC slot A\"; " \
+ " setenv raucslot \"rauc.slot=A\"; " \
+ " setenv raucpart 1; set distro_bootpart 1;" \
+ " fi; " \
+ " elif test \"x${BOOT_SLOT}\" = \"xB\"; then " \
+ " if test ${BOOT_B_LEFT} -gt 0; then " \
+ " if itest ${BOOT_B_LEFT} -gt 0; then " \
+ " setexpr BOOT_B_LEFT ${BOOT_B_LEFT} - 1; " \
+ " echo \"Found valid RAUC slot B\"; " \
+ " setenv raucslot \"rauc.slot=B\"; " \
Expand Down

0 comments on commit 308216e

Please sign in to comment.