Merge pull request #4145 from MilhouseVH/le10_init_fix_race

init: remove file before overwriting
This commit is contained in:
Christian Hewitt 2020-01-31 10:45:28 +03:00 committed by GitHub
commit 26f52b6621
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -313,6 +313,7 @@ update_file() {
if [ -f "$UPDATE_DIR/$2" -a -f "$3" ]; then
mount -o remount,rw /flash
rm -f "$3"
StartProgress percent "Updating $1... " "$3" $(stat -t "$UPDATE_DIR/$2" | awk '{print $2}')
# use dd here with conv=fsync so that all writes are non-buffered
# ensuring accurate progress - take the sync hit during the