Commit Graph

68 Commits (668eee97fa4a322d434b5de11df8b9b8d1df3329)

Author SHA1 Message Date
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
NiLuJe fe90a8febe [Kobo] Log the FW/kernel version on crash (#5477)
(Because it gets tedious asking for it in every bug report ;p).
5 years ago
NiLuJe 4363576066 Support the Kobo Libra
(Hopefully?).
5 years ago
NiLuJe a3acc667d6
[Kobo] Restart KOReader after a crash (#5328)
* 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.
5 years ago
NiLuJe 7210fb478d
Faster blitting @ BB8/BBRGB32 when no processing is needed (#4847)
* Pickup the eponymous blitting performance tweaks from koreader/koreader-base#878
* Cleanup BitOpts usage (require & cache)
* Unify oddness checks (MOD -> AND)
* Enforce the native Portrait orientation on Kobo (except @ 16bpp, i.e., KSM w/ 8bpp swap disabled), to allow for faster blitting when unrotted.
* Switch CRe BB to 32BPP on color screens
* Minor cleanups
5 years ago
NiLuJe 90df2f1997
Fix fb rotation on the Forma w/ KSM (#4779)
* 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.
5 years ago
NiLuJe 7c2df53808
Update FBInk (#4765)
* Add a bit of logging before fbdepth calls, to make the progression
easier to grasp.
* Bump base (pickup FBInk update)
5 years ago
NiLuJe bb3f49a566 [feat, Kobo] On Kobo, drop fb to 8bpp on startup (#4637)
* The Great 8bpp Experiment

Swap to 8bpp on Kobo, because we're 'effing grayscale, for pete's sake!

* Always swap to 8bpp, no matter the launch method.

Because it turned out that, even when restarting Nickel, we had to
restore the expected bitdepth ourselves, because pickel/Nickel didn't do
the job completely.

(I'm going to guess the grayscale flag wasn't getting flipped properly).

* Dither every non-transparent icon to the eInk palette

* Make sure hasBGRFrameBuffer is only enabled when the Kobo fb actually is
@ 32bpp...

* Re-process badly grayscaled icons

* And re-grayscale that one w/ gamma correction so the squares show up
better.

* Allow the fbdepth switch to be disabled (in Developer settings).

Also, allow setting debug mode that way.

Also, forcibly disable verbose logging when disabling debug.

* Update setting name to piggyback on the existing check in reader.lua

* Update icons postprocessing info
5 years ago
NiLuJe f6743a45db
Proper Forma support (#4414)
* Enforce a known rotation on startup, to make sure we handle touch input coordinates properly.
* Proper FrontLight warmth support (thanks to @cairnsh & @pazos in #4291)!
* Fix the PageTurn buttons mapping to match Nickel's defaults
* Properly remap PageTurn buttons depending on the current rotation.
* Actually enable the Mk.7 screen refresh codepath on *all* Mk.7 devices (I'd messed up the device check...).
* Full accelerometer handling (includes a touch of refactoring regarding orientation handling in general).
* Fix insidiously broken USBMS behavior in Nickel after we exit on FW >4.8.

Fix #4291
Fix #3002
5 years ago
NiLuJe ababbd7aad
Enhanced visual feedback around tar & zsync! (#4194)
* Move Kindle scripts to FBInk
* Proper progress bars around tar invocations
* Spinner during zsync processing
6 years ago
NiLuJe 0924b57877
Tweak/unbreak my CPUFreq experiment (#4119)
* Only switch to ondemand when we actually can, and when it's better than the current governor...
  This potentially leaves Mk.5 in the lurch, but there's no perfect solution there :/.

* Switch to UI for the unmark event of navigation hints markers
Might help on non-REAGL devices, and doesn't hurt there (re #3983).

* Switch SQLite DBs to WAL
Sounds nice in theory, behaves fine in practice.
6 years ago
NiLuJe b509e54a2a
CPUFreq shenanigans on Kobo (#4114)
* Switch to ondemand CPUFreq governor on Kobo

My H2O boots with the userspace (!!) governor...
Note that the hardware appears to blissfully ignore any of this, because
the stats still show the CPU changing state on its own...
6 years ago
NiLuJe 6835c18ee6
Re-exec startup script on Kindle/Kobo when an OTA update is processed on startup (#4062)
So that we may properly pickup potential updates to the startup script
itself.
6 years ago
NiLuJe 4ffd959df4
Handle OTA updates during the restart loop on Kobo/Kindle (#4049)
* Handle OTA updates during the restart loop on Kobo/Kindle

So we can actually process OTA updates without ever truly exiting
KOReader (i.e., via the "Restart KOReader" menu entry) ;).
6 years ago
NiLuJe 8089d916a5
Visual feedback around tar/zsync on Kobo during OTA updates (#4043)
* With a bonus version normalizer fix.
  * And a zsync bump/fix to avoid softlocks with OpenStack HTTP frontends (also, pull those from the OTA mirror list).
6 years ago
NiLuJe 18db509325 Assorted bag of fixes (#4014)
* Link to the WiKi, it's a bit more explainy ;).

* More WiFi trickery for some HW revs

* Fix Rev2 detection under KSM

That's to future-proof it, the other end of this hasn't made it into
current KSM build yet.

* Resync nickel.sh w/ current rcS

We don't have CPU, but we have PLATFORM, which is based on CPU, so,
that'll do :).

* Go back to using rmmod instead of modprobe -r

Functionally identical on current FW, will potentially avoid getting
outsmarted by modprobe if Kobo ever deigns shipping an actually usable
Linux system one day...

* Don't crash if screensavers directory doesn't exist

c.f., https://www.mobileread.com/forums/showpost.php?p=3706979&postcount=2919
6 years ago
NiLuJe e3b7524d9c Another round of Kobo Fixes (#3939)
* Trim unneeded stuff from startup script

I was somehow convinced I'd already done that...
While we're there, explain why we need to siphon those specific vars

* Fix a stray eth0

-> $INTERFACE

* Be very very sure we have INTERFACE set in our env

re #3936

* Make getFirmwareVersion less fragile on Kobo

Not that we actually use it right now, but, still. :D

* Use the same syntax as the PRODUCT check

* Actually implement getProductId

Instead of a stray c/p ^^

* Properly identify the Rev2/Mark7 variants of existing devices

Namely, the H2O² and Aura SE
Not that the H2O²r2 support is still broken, this just allows us to
implement it cleanyl without breaking handling of the original H2O²

re #3925

* Tweak sleeps a bit around Kobo WiFi modules...

See if that jog things up (re #3936)

* Try harder not to suspend with WiFi on on Kobos

Because otherwise, things go boom. (re #3936)
6 years ago
NiLuJe bdb82d09c1 [chore] A round of Kobo specific script cleanup (#3876)
* Flag those scripts as executable in git

Somewhat irrelevant because we'll end up living on a FAT32 drive, but,
still.

* Cleanup Kobo startup script

Support KFMon >= 0.9.5

Don't siphon PRODUCT from nickel, it's exported by rcS, so fmon/KFMon
already inherit it.
Siphon NICKEL_HOME, on the off-chance nickel fails to figure that one
out for itself on restart.
Siphon LANG (This may be a terrible idea, rcS sets LANG to en_US.UTF-8,
while we set LC_ALL to en_US.UTF-8, but I don't know if nickel itself
ever updates LANG, since I have mine set to en_US also ;)).
My secret hope if that everything's working as it should and this ensures
we default to Nickel's locale on fresh installs?

Remove the extra sync on startup, both @Baskerville's fmon and KFMon are
smart enough not to do anything overly stupid, and recent FW versions
have a slightly more resilient DB anyway (rollback journal -> WAL).
This effectively shaves over a second off our startup time.

* Slimmed down the nickel restart script.

Based on current rcS
Scrapped a bucketload of irrelevant & legacy crap, since we're never
bootstrapping nickel, only restarting it.

* Update Kobo install instrcutions.

Point to KSM09, @Baskerville's fmon, and KFMon.
Deprecate legacy fmon, and as such, stop shipping a useless KoboRoot
tarball.
6 years ago
Hzj_jie 30378eb2a8 Add restart koreader function and ensure FlushSettings event can be delivered to all widgets (#2772) 7 years ago
Frans de Jonge 1850ebca0d (chore) koreader.sh: remove 32-bit workaround
Final fix for #2502.
7 years ago
Qingping Hou d1cc3bd6c2 ota(fix): always purge ota update files 7 years ago
a-kohout 870c4d3859 Update koreader.sh; fixes #2791
tar fails to apply permissions on fat32 filesystem. thus mv doesn't get executed and consequently OTA package gets applied on every launch.
7 years ago
Frans de Jonge 0eec5b5174 Simplify koreader.sh
`-C "${KOREADER_DIR}"` isn't needed, see https://github.com/koreader/koreader/issues/2752#issuecomment-293698136.
7 years ago
Frans de Jonge 5de8310aa6 Kobo (koreader.sh): install OTA update in working directory
Thanks to @a-kohout

Fixes #2752
7 years ago
Frans de Jonge e8c01274f4 Travis: enforce shellscript coding style
* enormous coding style update

* update luajit-launcher

All changes are formatting only except for:

* new more correct pushd/popd style
	* keeps useful indentation
	* prevents execution of commands when pushd failed (cf. https://github.com/koalaman/shellcheck/wiki/SC2164 and https://github.com/koalaman/shellcheck/issues/863)

```
pushd some_dir && {
    command1
    command2
} || exit
popd
```
7 years ago
Frans de Jonge e5bcdee85e Add ShellCheck and shfmt shell code quality analysis (#2712)
* Add ShellCheck and shfmt shell code quality analysis

* kobo/koreader.sh: remove useless $PREFIX

* kobo/koreader.sh: fix rotation issue caused by #2731

* Travis: speed up (caching Luarocks should shave a minute off install process)
7 years ago
pazos 3a75b6deab use fullpath for reboot 7 years ago
pazos 31b246574b Kobo framebuffer: workaround to support +4.0FW 7 years ago
Martín Fernández 79fd02e020 Kobo: remove useless error messages from ntx_hwconfig 7 years ago
Qingping Hou 744115de9f crash.log(fix): obviously I suck at counting zeros 8 years ago
Hzj_jie 8e5f294902 Return correct result from koreader.sh 8 years ago
Qingping Hou 0ed95406a4 log(fix): do not pipe stdout to /dev/null during crash log rotation 8 years ago
Qingping Hou 5309a0a47f misc: rotate crash.log for kobo/kindle/pocketbook 8 years ago
NiLuJe 892e3c0f1e Kobo startup script tweak.
When using KFMon, make the reboot on exit user-configurable.
The user can now choose to try to restart Nickel directly, like with
fmon.
For now, we still do a full reboot by default.
8 years ago
Frans de Jonge 8643d38a68 Removed some bashisms 8 years ago
NiLuJe e90f1018db Make the KFMon chekc actually accurate...
Sleep does wonder for your brain!
8 years ago
NiLuJe b406e3591f Update Kobo startup script for KFMon
Takes care of some potentially critical stuff ;p
8 years ago
Qingping Hou dceaa01250 minor: redirect all output to crash.log 8 years ago
Frans de Jonge b8b0684e30 Add a comment with 'from_nickel', fixes #1889 8 years ago
NiLuJe 770625d756 Tweak the 'IR down on resume' workaround...
Only apply it when started from nickel, because I'm guessing we'd have
seen a number of reports of this if it happened more widely...
8 years ago
NiLuJe ea382aea86 Tweak the sd is ro check a bit
Inspired from MRPI, but without a strict check of the device name,
because I'm not sure it'll be the same across the whole range of
Kobos...
8 years ago
zijiehe e7b8bdcde2 Check whether sd card is presenting and mounting as RO, before do the real remount 8 years ago
zijiehe 38553b5ef8 Mount SD card as RW on kobo, but ignore errors, since we may not have sd
card installed.
8 years ago
Frans de Jonge 475ee28173 Fix KOReader exit
Should reboot less unnecessarily for older versions of KSM, and hopefully this would also be more forward-compatible.
9 years ago
NiLuJe 02fcb9037b Fix startup scripts.
Thanks to @Markismus's questions, I realized that some of what i thought
was true, wasn't.

First, pkill is a terrible idea to check for interpreted scripts.
Second, pidof is also potentially not that great for interpreted
scripts, because it'll only work with a shebang, and one that is
following the Linux syntax.
We don't have the full version with the -x to paper over that,
so use pgrep -f instead.

cf.
a736a571d2 (commitcomment-10948910)
for the gory details.
9 years ago
NiLuJe 9f89fc8e47 Fix Kobo startup script w/ KSM
pkill probably only checks the actual name of the binary.
We were checking a shell script, which I'm guessing is not launched
via a shebang, so that name was actually an arg to sh, or something like
that.

Use pidof instead, which matches the full command line.
9 years ago
NiLuJe a99359fa44 Add a comment to explicit the KSM check 9 years ago
NiLuJe 7fd45c6cd3 And even more Kobo startup script tweaks.
Good news: restarting nickel doesn't deadlock anymore. Yay.
9 years ago