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)
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...
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).
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.
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
* 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...
* 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
* 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
* 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
* 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
* 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.
* 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.
* 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
* 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!
* [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
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
```
* Restart KOReader after a crash, after showing a fancy crash recap screen (our very own Gray Screen of Death!).
Kobo only, because it's possibly the platform where getting booted out
of KOReader is the most annoying.
Keeps track of crashes, to be able to give up after a while, in order to
avoid boot loops in the unlikely event of a crash loop on startup.
Adds a dev option to *always* exit KOReader after the crash screen.
* Try to make sure restoreWifiAsync eventually sends a NetworkConnected
event...
re: #5109
* Take a page from @shermp's book, and make sure wpa_supplicant managed to
connect to the AP before acquiring an IP.
Tear down WiFi modules in case of failure.
c.f., https://github.com/shermp/Kobo-UNCaGED/pull/21
* Don't let restore-wifi-async.sh enable WiFi behind our back when we're
killing it to start Nickel...
* Don't even call ping if there's no default gw
* Add a toggle to disable the C blitter in the Dev menu (depends on https://github.com/koreader/koreader-base/pull/882) (never shown if the JIT is disabled, grayed out if the C blitter is not installed)
* Fix a few sizeUtf8Text call sites that were doing a nil check in order to account for the new return type.
* Tweak statusbar handling to avoid spurious sizeUtf8Text warnings when it's hidden, and unify its behavior between being hidden via toggle, and hidden on book open (at least when all-at-once is not enabled).
* c.f., https://github.com/koreader/koreader-base/pull/882 (Android, PB, RGB32 & Legacy Kindle regression fixes).
* Enforce Portrait rotation on the Forma *everywhere*, KSM included.
KSM is currently emulating a bogus rotation, which causes issues with
FBInk, but also happens to be insidiously quirky in weird corner-cases.