Skip to content

Commit

Permalink
Fixed slot md5 health check failing to fix one of the two entries doe…
Browse files Browse the repository at this point in the history
…sn't exist in unrd at all.
  • Loading branch information
j005u committed May 4, 2023
1 parent 12b1f19 commit ae85a9b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions units/01-slot_hash_mismatch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

#this script enforces wtfos usage to slot 1 and will re-flash slot 1 before switching if it appears corrupt
check () {
#if either of the md5s is null, lets set it to a default value so the rest works as expected
unrd slot_1.system_md5 2>&1 > /dev/null || unrd slot_1.system_md5 "deadbeef" 2>&1 > /dev/null
unrd slot_2.system_md5 2>&1 > /dev/null || unrd slot_2.system_md5 "deadbeef" 2>&1 > /dev/null

#check whatever our conditions is - this may be more complicated for other issues
if [ "$(unrd slot_1.system_md5)" != "$(unrd slot_2.system_md5)" ]; then
echo "Firmware slot version mismatch, can reflash"
Expand Down

0 comments on commit ae85a9b

Please sign in to comment.