diff --git a/plugins/autosuspend.koplugin/main.lua b/plugins/autosuspend.koplugin/main.lua index 7f3435409..813f52eef 100644 --- a/plugins/autosuspend.koplugin/main.lua +++ b/plugins/autosuspend.koplugin/main.lua @@ -195,13 +195,15 @@ function AutoSuspend:_schedule_standby() end -- When we're in a state where entering suspend is undesirable, we simply postpone the check by the full delay. - local standby_delay = self.auto_standby_timeout_seconds + local standby_delay if NetworkMgr:isWifiOn() then -- Don't enter standby if wifi is on, as this will break in fun and interesting ways (from Wi-Fi issues to kernel deadlocks). --logger.dbg("AutoSuspend: WiFi is on, delaying standby") + standby_delay = self.auto_standby_timeout_seconds elseif Device.powerd:isCharging() and not Device:canPowerSaveWhileCharging() then -- Don't enter standby when charging on devices where charging prevents entering low power states. --logger.dbg("AutoSuspend: charging, delaying standby") + standby_delay = self.auto_standby_timeout_seconds else local now_tv = UIManager:getElapsedTimeSinceBoot() standby_delay = self.auto_standby_timeout_seconds - (now_tv - self.last_action_tv):tonumber() diff --git a/plugins/terminal.koplugin/main.lua b/plugins/terminal.koplugin/main.lua index 6c7dd761e..93e2ee18c 100644 --- a/plugins/terminal.koplugin/main.lua +++ b/plugins/terminal.koplugin/main.lua @@ -25,6 +25,15 @@ int tcflush(int fd, int queue_selector) __attribute__((nothrow, leaf)); ]] local function check_prerequisites() + -- We of course need to be able to manipulate pseudoterminals, + -- but Kobo's init scripts fail to set this up... + if Device:isKobo() then + os.execute([[if [ ! -d "/dev/pts" ] ; then + mkdir -p /dev/pts + mount -t devpts devpts /dev/pts + fi]]) + end + local ptmx = C.open("/dev/ptmx", bit.bor(C.O_RDWR, C.O_NONBLOCK, C.O_CLOEXEC)) if ptmx == -1 then logger.warn("Terminal: can not open /dev/ptmx:", ffi.string(C.strerror(ffi.errno())))