Commit Graph

148 Commits (master)

Author SHA1 Message Date
zwim f836f6a237
Clear UI leftovers before doing an OTA-install, add unmovable to InfoMessage and ConfirmBox (#11412) 3 months ago
NiLuJe 689d9e2976
Kobo: Initial Elipsa 2E support (#10719)
Untested, but mostly everything should be there ;p.

Bumps base for MTK support (https://github.com/koreader/koreader-base/pull/1642)
9 months ago
NiLuJe 17bdd56e02 Never export LD_LIBRARY_PATH
It's been made redundant by the RPATH changes

The only platform that gets the dubious honor of actually needing an
LD_LIBRARY_PATH is PocketBook, because of InkView.

Co-authored-by: Benoit Pierre <benoit.pierre@gmail.com>

Bump base to pull in the aforementioned RPATH changes ;).

https://github.com/koreader/koreader-base/pull/1638
10 months ago
NiLuJe 304d393949 Kobo: Unbreak KSM detection
There isn't actually a kbmenu binary, the process names are all shell
scripts, kbmenu just happens to be the default folder name,
so we need full commandline matching ;).

Fix https://github.com/koreader/koreader/pull/9738#issuecomment-1312473323
Regression since #9738

Bump base

https://github.com/koreader/koreader-base/pull/1552
1 year ago
NiLuJe bf0f8d66f0 Kobo: Don't exit the startup script on shutdown when started via KSM.
This ensures we keep displaying our own stuff, without KSM interference.

Fix #9748
2 years ago
NiLuJe 8fcc712c76
Kobo: Clara 2E fixes (#9559)
* Handle the power button input device
* Handle the charging LED properly
* Handle the new Wi-Fi chip properly
* Handle frontlight warmth adjustments
* Handle the battery gauge properly
* Bump base (a lot of third-party updates) [https://github.com/koreader/koreader-base/pull/1523]
* Bump android-luajit-launcher to match the LuaJIT update [https://github.com/koreader/android-luajit-launcher/pull/386]

Fix #9552 (many thanks to @Bartvelp for bearing with my stupid tests ;)).
2 years ago
NiLuJe e88bda6826
Kobo: Kill new FW 4.32 stuff on startup (#9010)
* Kill new services introduced in FW 4.32 on startup
* Murder BT on startup
2 years ago
Scarlett a2b641822f
[chore, doc] Remove legacy fmon Kobo installation instructions (#8833) 2 years ago
NiLuJe 2c94291af8 Kobo: Fix the upgrade progress bar on sunxi
Merges are extremely broken outside of REAGL/REAGLD on recent kernels,
while things appear to mostly behave with REAGL, so, use that...

(AUTO was a bad call on sunxi anyway)
2 years ago
NiLuJe 40116fa830 Kobo: Switch crash screen to REAGL on sunxi
It's less prone to weird merging quirks.

Kobo: Simplify the sunxi crash screen workaround

Switching to REAGL made explicit flashing unnecessary.
2 years ago
NiLuJe 1084c6e151 Kobo: Set the CPU governor on *every* CPU (if available)
Fix #8578
2 years ago
NiLuJe 98b53b0390 Kobo: More readable crash screen on sunxi (Sage, especially).
Switch to flashing GC16, because the screen is so fast that using GL16
simply leaves us with an unreadable mess of ghosting.

I'm halfway considering rewriting this in Lua so that I can do a proper
batched update...
3 years ago
NiLuJe 48da545e32 Kobo/Elipsa: More fine-grained control over the amount of online CPU
cores

* Only keep a single core online most of the time.
* Device: Add an enableCPUCores method to allow controlling the amount of
  online CPU cores.
* Move the initial core onlining setup to Kobo:init, instead of the startup script.
* Enable two CPU cores while hinting new (e.g., cache miss) pages in PDF land.
* Enable two CPU cores while processing book metadata.
* Drive-by fix to isolate the DocCache pressure check to KoptInterface
  and actually apply it when it matters most (e.g., k2pdfopt stuff).
3 years ago
NiLuJe af8988ef5f
Minor script tweaks (#8169)
* Neater fbdepth usage on sunxi
* Make sure we only ever match *loaded* modules when we check lsmod
3 years ago
NiLuJe 1a583af4a2
Unbreak Wi-Fi on < Mk.8 (#8077)
Don't pass empty parameters to insmod, it apparently doesn't like it...

Fix #8075
Regression since a91ba05e34
3 years ago
NiLuJe 6d30835b3b Handle new stuff from 4.28.18220
While we're in the vicinity... ;).
3 years ago
NiLuJe a91ba05e34 Set the WiFi regulatory domain properly on the Elipsa
No idea how restrictive the defaults are, but stuff is weird in the 5G
band, so, do it right.
3 years ago
NiLuJe 1e9346aec6 Fix Wi-Fi toggle on the Elipsa
It turns out that the kernel needs a little push now that the dedicated
wifi power control module is gone ;).

Issue was only exposed if you booted KOReader while the Wi-Fi was down.
3 years ago
NiLuJe 0acf1a2b29 Kill NanoClock on startup
It's not terribly useful for us, as we already provide similar
functionaility.

(It'll be restarted automatically when nickel restarts).
3 years ago
NiLuJe ae35e898fb
Kobo Elipsa support (#7986)
Includes a few minor cleanups along the way ;).
3 years ago
NiLuJe 5310381106 Kobo: Various other minor 4.28/Elipsa stuff 3 years ago
NiLuJe 94b0e974e1 Kobo: Kill new stuff from FW 4.28 on startup 3 years ago
NiLuJe e0a67bb656
OTA: Handle tar checkpointing visual feedback w/ an FBInk daemon (#7588)
Instead of forking it on every checkpoint.

Won't change much in the grand scheme of things, but FIFOs are fun.
3 years ago
NiLuJe b0336e9982
PocketBook: Workaround platform shenanigans when aplying an OTA (#7585)
We can't avoid hitting a few permission errors, so, just filter them out.

Fix #7581
3 years ago
yparitcher dc964f3941
reader.lua: rework file/directory argument handling. (#7053)
platform: do not pass a directory on the command line.
The home directory will be properly set by Device.home_dir.

It was sometimes crashing when opened with no args.

Fixes: #7049
3 years ago
NiLuJe 8e3a117c68
Rejig CBB toggling on startup to avoid an extra jit.flush (#7023)
* When the CBB is disabled, attempt to apply the JIT tweaks earlier,
avoiding the JIT code flush in the process

* Drop debug prints

* Bump base

https://github.com/koreader/koreader-base/pull/1263
https://github.com/koreader/koreader-base/pull/1264
3 years ago
NiLuJe 931f01ef26
Kobo: Warn on restart if the startup script is outdated (#6916)
* Warn on restart if the startup script has been updated, because a restart will not reload it.

* Also warn right after the update if it contained a startup script update...
3 years ago
NiLuJe cb2314d11b
Kobo, Mk.5: Tweak CPU frequency scaling (#6905)
* Run grep against /proc/modules directly instead of forking to lsmod

* Revamp the CPUFreq governor choice logic

I finally figured out why the scaling on the H2O was so wonky:
Because it relies on an obscure i.MX hardware feature called DVFS,
and it gets flipped for mysterious workaround-y reasons depending on
Wi-Fi state...

* Start playing with conservative, because just staying pegged at max
clock is entirely stupid.

And DVFS is extremely conservative, it needs somewhat sustained load to
clock up...

* Take care of the DVFS switcheroo in the Wi-Fi scripts
3 years ago
NiLuJe 510ea5963c
[Kobo] Don't attempt to restart Nickel when asking for a reboot/shutdown (#6880)
* Don't attempt to restart Nickel when asking for a reboot/shutdown

Use a magic exit code to ID those cases.

* Limit this to Kobo, to avoid breaking potentially existing assumptions
with other platform's startup scripts
4 years ago
NiLuJe d9b658034d
Ensure the SD card is actually detected in Nickel on exit. (#6800)
* Ensure the SD card is actually detected in Nickel on exit.

Regression since #6522
4 years ago
NiLuJe ba927fe4b5
Don't grab input devices on Kobo (#6705)
* Don't grab input devices on Kobo

(... as long as we're started via KFMon/NM.
... and MiniClock is not running ^^).

* Bump base

(https://github.com/koreader/koreader-base/pull/1197)
(https://github.com/koreader/koreader-base/pull/1199)
4 years ago
NiLuJe 051c8c0d95
Update KoboUSBMS for CJK support (#6639)
* Making the startup script even more tortuous in the process...

* Bump base

https://github.com/koreader/koreader-base/pull/1179
https://github.com/koreader/koreader-base/pull/1180
4 years ago
NiLuJe 12df296b90
Detect early KoboUSBMS returns, and just restart KOReader (#6603)
We know onboard is safe in these cases.
4 years ago
NiLuJe e402c9d6f3
More KoboUSBMS related tweaks & cleanups (#6590)
* Be even more defensive around KoboUSBMS handling in the startup script

And add some more logging. To the log before a session, to the syslog
after, because we can't be sure onboard is viable.

* Display a short version string straight in the Version label

* Move system statistics inside the Help menu

* Move Version inside Help


* Bump base

https://github.com/koreader/koreader-base/pull/1173
4 years ago
NiLuJe 1919764825
Some more KoboUSBMS tweaks (#6566)
* Enable i18n in KoboUSBMS

* Rejig the "No confirmation" USBMS setting:

In now *only* affects the USB plug in event.
The menu entry will never show the popup (clicking on it should already
be confirmation enough, that, yes, we really would like to do that,
please ;)).

Also, enable said plug in behavior on Cervantes, too ;).

* Add an option to disable USBMS entirely

* Bump base

https://github.com/koreader/koreader-base/pull/1170
4 years ago
NiLuJe 6e3a3e8069
[Kobo] Support USBMS exports (#6552)
* \o/

* Make sure the (debug) event log doesn't end up in the fd table of our child processes...
Otherwise, it breaks USBMS.

* Close suspicious fds in the Wi-Fi scripts
To prevent any and all issues w/ USBMS down the road...

* Minor USBMS UI tweaks

* Always ask for confirmation to start on USBMS session on plug

* Bump base

https://github.com/koreader/koreader-base/pull/1161
https://github.com/koreader/koreader-base/pull/1162
https://github.com/koreader/koreader-base/pull/1163
https://github.com/koreader/koreader-base/pull/1165
https://github.com/koreader/koreader-base/pull/1167
4 years ago
NiLuJe b14cabb6de
[Kobo] Unbreak Wi-Fi on FW >= 4.23 (#6522)
* Unbreak Wi-Fi on Kobo w/ FX >= 4.23+

Stop relying on WIFI_MODULE_PATH, it's no longer exported by the init
script.

Fix #6500

* Resync the nickel restart script w/ upstream

Let udev handle the SD card, and actually allow nickel to see those events by re-creating the FIFO ourselves, to avoid races.
4 years ago
NiLuJe 4a3d5f3d66
Fix a minor snafu in the Kobo startup script. (#6466)
Oops, too much Python/Lua ^^.
4 years ago
NiLuJe 2ad976387d
More #6424 cleanups (#6442)
* Simplify logic, and more detailed debug logging
* Kill Nickel's FIFO on startup
Avoids udev/udhcpc scripts hanging when trying to open() it.
4 years ago
NiLuJe 37a01100b7
Various Wi-Fi QoL improvements (#6424)
* Revamped most actions that require an internet connection to a new/fixed backend that allows forwarding the initial action and running it automatically once connected. (i.e., it'll allow you to set "Action when Wi-Fi is off" to "turn_on", and whatch stuff connect and do what you wanted automatically without having to re-click anywhere instead of showing you a Wi-Fi prompt and then not doing anything without any other feedback).
* Speaking of, fixed the "turn_on" beforeWifi action to, well, actually work. It's no longer marked as experimental.
* Consistently use "Wi-Fi" everywhere.
* On Kobo/Cervantes/Sony, implemented a "Kill Wi-Fi connection when inactive" system that will automatically disconnect from Wi-Fi after sustained *network* inactivity (i.e., you can keep reading, it'll eventually turn off on its own). This should be smart and flexible enough not to murder Wi-Fi while you need it, while still not keeping it uselessly on and murdering your battery.
(i.e., enable that + turn Wi-Fi on when off and enjoy never having to bother about Wi-Fi ever again).
* Made sending `NetworkConnected` / `NetworkDisconnected` events consistent (they were only being sent... sometimes, which made relying on 'em somewhat problematic).
* restoreWifiAsync is now only run when really needed (i.e., we no longer stomp on an existing working connection just for the hell of it).
* We no longer attempt to kill a bogus non-existent Wi-Fi connection when going to suspend, we only do it when it's actually needed.
* Every method of enabling Wi-Fi will now properly tear down Wi-Fi on failure, instead of leaving it in an undefined state.
* Fixed an issue in the fancy crash screen on Kobo/reMarkable that could sometime lead to the log excerpt being missing.
* Worked-around a number of sneaky issues related to low-level Wi-Fi/DHCP/DNS handling on Kobo (see the lengthy comments [below](https://github.com/koreader/koreader/pull/6424#issuecomment-663881059) for details). Fix #6421 
Incidentally, this should also fix the inconsistencies experienced re: Wi-Fi behavior in Nickel when toggling between KOReader and Nickel (use NM/KFMon, and run a current FW for best results).
* For developers, this involves various cleanups around NetworkMgr and NetworkListener. Documentation is in-line, above the concerned functions.
4 years ago
NiLuJe 416c1c7356
More robust way to detect our own path on Kobo (#6283)
* More robust way to detect our own path on Kobo

Should take care of all the weird and interesting ways people manage to
find to break it...

NOTE: "$(dirname $(realpath "${0}"))" works, too, but I'm not sure if
really old devices ship with the realpath applet...

* Abort early if KOREADER_DIR is null
4 years ago
NiLuJe 799a68ef59
Kill the RMSDK, too. (#6179)
It's a big pile 'o RAM we could use.
Plus, it might be causing bad interactions with DRM if we keep it around.
4 years ago
NiLuJe e4d3b266ef
Some more Kobo startup script tweaks (#6147)
* Simplify env siphoning some more

* Nope, shellcheck, quoting this breaks it.

(it preserves the LNs instead of abusing them as free field separators with word splitting).

And, while this does break on env vars with spaces (since they'll be
unquoted), that was already the case of the xargs approach.
If we had read -d & printf %q, we could go with a pure shell approach,
but we don't ;).

* Document a working quoted variant.

For science!
4 years ago
NiLuJe 12675be065
Minor Kobo startup script cleanups (#6144)
* Minor tweaks to Kobo env setup

* Bump base

(Pickup https://github.com/koreader/koreader-base/pull/1099)
4 years ago
NiLuJe be72203b83
Minor Kobo startup script cleanups (#6102)
* Start re-factoring the launcher detection code in order to future-proof
it
4 years ago
NiLuJe e49198cef8
Don't bypass fbdepth when starting KOReader @ 8bpp (#5841)
* [Kobo/reMarkable] Don't skip fbdepth when launching KOReader @ 8bpp

I'm not quite sure how that can happen unless you really want to, but
apparently it did on @Frenzie's H2O ;p
4 years ago
NiLuJe 9a20fb5836
Switch to zsync2 (#5810)
* Switch to zsync2

Requires https://github.com/koreader/koreader-base/pull/1036

* Simplify FBInk syntax

The weird-ass workarounds for -s's subopts handling are
no longer needed w/ FBInk >= 1.21.0

* Update base

* Re-enable HW dithering on Kindle
  (https://github.com/koreader/koreader-base/pull/1034)
* Update SQLite to 3.31.1
  (https://github.com/koreader/koreader-base/pull/1035)
* reMarkable port
  (https://github.com/koreader/koreader-base/pull/1023)
* zsync2
  (https://github.com/koreader/koreader-base/pull/1036)

* zsync2 means we can finally have nice things

(OpenStack backed storage)

* We also no longer need that insane workaround on ARM

* And comment out @chrox's mirror, which appears to be down.

* Warn that a malformed URL will horribly blow up in fun and interesting
ways
4 years ago
Frans de Jonge 668eee97fa
[CI] Add curly braces check (#5809)
Update shellcheck and shfmt to the latest version.

Fixes <https://github.com/koreader/koreader/issues/5152>.

Btw, you can apply shellcheck suggestions with a command like:

```
shellcheck --include=SC2250 -f diff *.sh | git apply
```
4 years ago
NiLuJe 70b2564c4b
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).
4 years ago
Frans de Jonge 63dd2ec0c0
[chore] Make ShellCheck happy (#5484)
Cf. https://github.com/koreader/koreader/pull/5477#discussion_r334234063
5 years ago