kindle: detect if launcher script has changed

And a complete restart from the parent launcher (e.g. KUAL) is needed.
This commit is contained in:
Benoit Pierre authored and Frans de Jonge committed 2025-12-13 10:59:04 +01:00
1 parent e04f1800ba
commit c93624d2c5
2 files changed
+9

No files matched your search

+6
View File
@@ -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
+3
View File
@@ -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