From 70b2564c4b85d74503fc6bb259d617061fabd18b Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Tue, 17 Dec 2019 00:28:51 +0100 Subject: [PATCH] Ensure we flush everything to disk after an update. (#5685) WIll stall for longer, but with a visible message (vs. less stalling on a white screen during the startup and a laggy FM for a while). --- platform/cervantes/koreader.sh | 2 ++ platform/kindle/koreader.sh | 2 ++ platform/kobo/koreader.sh | 2 ++ 3 files changed, 6 insertions(+) diff --git a/platform/cervantes/koreader.sh b/platform/cervantes/koreader.sh index 29470e41b..961d73128 100755 --- a/platform/cervantes/koreader.sh +++ b/platform/cervantes/koreader.sh @@ -34,6 +34,8 @@ ko_update_check() { fi rm -f "${NEWUPDATE}" # always purge newupdate in all cases to prevent update loop unset BLOCKS CPOINTS + # Ensure everything is flushed to disk before we restart. This *will* stall for a while on slow storage! + sync fi } diff --git a/platform/kindle/koreader.sh b/platform/kindle/koreader.sh index 576588fbb..db82f15cb 100755 --- a/platform/kindle/koreader.sh +++ b/platform/kindle/koreader.sh @@ -134,6 +134,8 @@ ko_update_check() { fi rm -f "${NEWUPDATE}" # always purge newupdate in all cases to prevent update loop unset BLOCKS CPOINTS + # Ensure everything is flushed to disk before we restart. This *will* stall for a while on slow storage! + sync fi } # NOTE: Keep doing an initial update check, in addition to one during the restart loop, so we can pickup potential updates of this very script... diff --git a/platform/kobo/koreader.sh b/platform/kobo/koreader.sh index 8725813b9..f48256655 100755 --- a/platform/kobo/koreader.sh +++ b/platform/kobo/koreader.sh @@ -49,6 +49,8 @@ ko_update_check() { fi rm -f "${NEWUPDATE}" # always purge newupdate in all cases to prevent update loop unset BLOCKS CPOINTS + # Ensure everything is flushed to disk before we restart. This *will* stall for a while on slow storage! + sync fi } # NOTE: Keep doing an initial update check, in addition to one during the restart loop, so we can pickup potential updates of this very script...