diff --git a/frontend/device/kobo/device.lua b/frontend/device/kobo/device.lua index c4a0cfa7d..81e4be691 100644 --- a/frontend/device/kobo/device.lua +++ b/frontend/device/kobo/device.lua @@ -1610,12 +1610,9 @@ function Kobo:defaultCPUGovernor() end function Kobo:isStartupScriptUpToDate() - -- Compare the hash of the *active* script (i.e., the one in /tmp) to the *potential* one (i.e., the one in KOREADER_DIR) - local current_script = "/tmp/koreader.sh" - local new_script = os.getenv("KOREADER_DIR") .. "/" .. "koreader.sh" - local md5 = require("ffi/MD5") - return md5.sumFile(current_script) == md5.sumFile(new_script) + -- Compare the hash of the *active* script to the *potential* one. + return md5.sumFile("/tmp/koreader.sh") == md5.sumFile(os.getenv("KOREADER_DIR") .. "/koreader.sh") end function Kobo:UIManagerReady(uimgr) diff --git a/platform/kobo/koreader.sh b/platform/kobo/koreader.sh index 58c218d45..fb4f3c0a6 100755 --- a/platform/kobo/koreader.sh +++ b/platform/kobo/koreader.sh @@ -10,7 +10,9 @@ UNPACK_DIR="${KOREADER_DIR%/*}" # We rely on starting from our working directory, and it needs to be set, sane and absolute. cd "${KOREADER_DIR:-/dev/null}" || exit -# To make USBMS behave, relocalize ourselves outside of onboard +# To make USBMS behave, relocalize ourselves outside of onboard. 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 [ "${SCRIPT_DIR}" != "/tmp" ]; then cp -pf "${0}" "/tmp/koreader.sh" chmod 777 "/tmp/koreader.sh"