diff --git a/frontend/device/kindle/device.lua b/frontend/device/kindle/device.lua index f310939b5..26d1d3e19 100644 --- a/frontend/device/kindle/device.lua +++ b/frontend/device/kindle/device.lua @@ -782,6 +782,12 @@ function Kindle:readyToSuspend(delay) self.suspend_time = time.boottime_or_realtime_coarse() end +function Kindle:isStartupScriptUpToDate() + local md5 = require("ffi/MD5") + -- Compare the hash of the *active* script to the *potential* one. + return md5.sumFile("/var/tmp/koreader.sh") == md5.sumFile(os.getenv("KOREADER_DIR") .. "/koreader.sh") +end + function Kindle:UIManagerReady(uimgr) UIManager = uimgr end diff --git a/platform/kindle/koreader.sh b/platform/kindle/koreader.sh index 086187b96..a7ef26f84 100755 --- a/platform/kindle/koreader.sh +++ b/platform/kindle/koreader.sh @@ -4,6 +4,9 @@ # living in a magical land that doesn't suffer from gross filesystem deficiencies. # Otherwise, the vfat+fuse mess means an OTA update will break the script on exit, # and potentially leave the user in a broken state, with the WM still paused... +# Additionally, this is used by KOReader to detect if the original script has +# changed after an update (requiring a complete restart from the parent +# launcher). if [ "$(dirname "${0}")" != "/var/tmp" ]; then cp -pf "${0}" /var/tmp/koreader.sh chmod 777 /var/tmp/koreader.sh