Update order that U-Boot environment gets updated
It turns out that my refactor of the code to initialize both primary and
secondary environments when clearing the environment reordered which
gets written first. This updates the test and adds comments.
@@ -136,16 +136,16 @@ dd if=$TESTFILE_1K seek=4096 of=$WORK/check.bin conv=sync,notrunc 2>/dev/null
cmp_bytes 2098176 $WORK/check.bin $IMGFILE
# Now upgrade the IMGFILE file
-# NOTE: The last write should be to the u-boot environment
-VERIFY_SYSCALLS_LAST_WRITE=262144 $FWUP_APPLY -a -d $IMGFILE -i $FWFILE -t upgrade
+# NOTE: The last write should be to the first u-boot environment
+VERIFY_SYSCALLS_LAST_WRITE=131072 $FWUP_APPLY -a -d $IMGFILE -i $FWFILE -t upgrade
cp $WORK/check.bin $WORK/check-upgraded.bin
dd if=$WORK/ubootb.bin seek=256 of=$WORK/check-upgraded.bin conv=notrunc 2>/dev/null
dd if=$TESTFILE_150K seek=2048 of=$WORK/check-upgraded.bin conv=sync,notrunc 2>/dev/null
cmp_bytes 2098176 $WORK/check-upgraded.bin $IMGFILE
-# Upgrade the IMGFILE file again
-VERIFY_SYSCALLS_LAST_WRITE=131072 $FWUP_APPLY -a -d $IMGFILE -i $FWFILE -t upgrade
+# Upgrade the IMGFILE file again. This time the last write should go to the second environment
+VERIFY_SYSCALLS_LAST_WRITE=262144 $FWUP_APPLY -a -d $IMGFILE -i $FWFILE -t upgrade
cp $WORK/check-upgraded.bin $WORK/check-upgraded2.bin
dd if=$WORK/ubootc.bin seek=256 of=$WORK/check-upgraded2.bin conv=sync,notrunc 2>/dev/null
cmp_bytes 2098176 $WORK/check-upgraded2.bin $IMGFILE
