New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A round of Kobo specific script cleanup #3876

Merged
merged 8 commits into from Apr 15, 2018

Conversation

Projects
None yet
2 participants
@NiLuJe
Member

NiLuJe commented Apr 14, 2018

Mostly revolving about updating/slimming down the startup & nickel script now that I finally fixed KFMon ;p.

See individual commits for more details.

Tested on an H2O, FW 4.7, latest KO beta at the time (v2015.11-1644).

NiLuJe added some commits Apr 14, 2018

Start a pass of Kobo script cleanups
By starting somewhat randomly with this ;p.
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.
@NiLuJe

This comment has been minimized.

Member

NiLuJe commented Apr 14, 2018

Oh, yeah, relevant user-facing bit: updated the install instructions to point to modern launchers (KSM09, @baskerville's fmon, KFMon), and to strongly discourage people from using the legacy fmon implementation.

Bonus: we get to drop the KoboRoot tarball!

@Frenzie

This comment has been minimized.

Member

Frenzie commented on 4e9834c Apr 14, 2018

Btw I haven't updated shellcheck in a while, it's got some new checks so you might want to check it on https://www.shellcheck.net/ or locally as well ;-)

This comment has been minimized.

Member

NiLuJe replied Apr 14, 2018

Neat, thanks ;).

This comment has been minimized.

Member

NiLuJe replied Apr 14, 2018

Ha! Now I remember why I don't have a local copy installed:

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] dev-lang/ghc-8.0.2:0/8.0.2::gentoo  USE="gmp profile -binary -doc -ghcbootstrap -ghcmakebinary" 138,224 KiB
[ebuild  N     ] app-admin/haskell-updater-1.2.12-r1::gentoo  27 KiB
[ebuild  N     ] dev-haskell/cabal-1.24.2.0:0/1.24.2.0::gentoo  USE="-profile {-test}" 432 KiB
[ebuild  N     ] dev-haskell/transformers-0.5.2.0:0/0.5.2.0::gentoo  USE="-doc -hscolour -profile" 34 KiB
[ebuild  N     ] dev-haskell/binary-0.8.3.0:0/0.8.3.0::gentoo  USE="-doc -hscolour -profile {-test}" 51 KiB
[ebuild  N     ] dev-haskell/random-1.1:0/1.1::gentoo  USE="-doc -hscolour -profile {-test}" 11 KiB
[ebuild  N     ] dev-haskell/syb-0.5.1:0/0.5.1::gentoo  USE="-doc -hscolour -profile {-test}" 39 KiB
[ebuild  N     ] dev-haskell/bytestring-builder-0.10.8.1.0:0/0.10.8.1.0::gentoo  USE="-profile" 43 KiB
[ebuild  N     ] dev-haskell/tagged-0.8.4:0/0.8.4::gentoo  USE="-doc -hscolour -profile" 10 KiB
[ebuild  N     ] dev-haskell/mtl-2.2.1-r1:0/2.2.1::gentoo  USE="-doc -hscolour -profile" 16 KiB
[ebuild  N     ] dev-haskell/text-1.2.2.1:0/1.2.2.1::gentoo  USE="-doc -hscolour -profile {-test}" 147 KiB
[ebuild  N     ] dev-haskell/primitive-0.6.1.0-r1:0/0.6.1.0::gentoo  USE="-doc -hscolour -profile {-test}" 13 KiB
[ebuild  N     ] dev-haskell/parsec-3.1.11:0/3.1.11::gentoo  USE="-doc -hscolour -profile {-test}" 32 KiB
[ebuild  N     ] dev-haskell/hashable-1.2.4.0:0/1.2.4.0::gentoo  USE="-doc -hscolour -profile {-test}" CPU_FLAGS_X86="sse2 sse4_1" 24 KiB
[ebuild  N     ] dev-haskell/regex-base-0.93.2-r1:0/0.93.2::gentoo  USE="-doc -hscolour -profile" 9 KiB
[ebuild  N     ] dev-haskell/tf-random-0.5:0/0.5::gentoo  USE="-profile" 19 KiB
[ebuild  N     ] dev-haskell/nats-1:0/1::gentoo  USE="hashable -profile" 6 KiB
[ebuild  N     ] dev-haskell/json-0.9.1:0/0.9.1::gentoo  USE="generic parsec pretty -doc -hscolour -mapdict -profile" 23 KiB
[ebuild  N     ] dev-haskell/regex-tdfa-1.2.2:0/1.2.2::gentoo  USE="-doc -hscolour -profile" 65 KiB
[ebuild  N     ] dev-haskell/unordered-containers-0.2.7.2:0/0.2.7.2::gentoo  USE="-debug -doc -hscolour -profile {-test}" 31 KiB
[ebuild  N     ] dev-haskell/semigroups-0.18.2:0/0.18.2::gentoo  USE="binary transformers -doc -hscolour -profile" 17 KiB
[ebuild  N     ] dev-haskell/quickcheck-2.9.2:2/2.9.2::gentoo  USE="template_haskell -doc -hscolour -profile {-test}" 43 KiB
[ebuild  N     ] dev-util/shellcheck-0.4.7:0/0.4.7::gentoo  USE="-doc -hscolour -profile {-test}" 124 KiB

Total: 23 packages (23 new), Size of downloads: 139,429 KiB

^^

This comment has been minimized.

Member

Frenzie replied Apr 14, 2018

Oh drat, a few weeks ago I told someone Pandoc was the only thing written in Haskell I regularly used, but so is Shellcheck. xD

@Frenzie

"Somewhat" 🤣

@@ -16,7 +16,7 @@ export LD_LIBRARY_PATH="/usr/local/Kobo"
# NOTE: That check is possibly wrong on PLATFORM == freescale (because I don't know if the sdio_wifi_pwr module exists there), but we don't terribly care about that.
if lsmod | grep -q sdio_wifi_pwr; then
killall udhcpc default.script wpa_supplicant 2>/dev/null
[ "${WIFI_MODULE}" != 8189fs ] && wlarm_le -i ${INTERFACE} down
[ "${WIFI_MODULE}" != "8189fs" ] && wlarm_le -i ${INTERFACE} down

This comment has been minimized.

@Frenzie

Frenzie Apr 14, 2018

Member

You really like quotation marks, haha.

Newer installation based on Start Menu:
- Install "Start Menu" (http://www.mobileread.com/forums/showthread.php?t=255978)
- Extract the koreader folder of the zip into the ".adds" directory (both KoboRoot.tgz and the koreader.png file are only needed for the older installation based on Filemonitor. See below.).
Main installation method based on Start Menu:

This comment has been minimized.

@Frenzie

Frenzie Apr 14, 2018

Member

Oh, I normally never look in the fmon folder. I have been updating the install instructions here: https://github.com/koreader/koreader/wiki/Installation-on-Kobo-devices

(I prefer the "Recommended installation method based on Start Menu" phrasing)

This comment has been minimized.

@NiLuJe

NiLuJe Apr 14, 2018

Member

Yeah, given how outdated that file looked, I'm grateful there's something maintained elsewhere ;D.

Selecting the KOReader icon in your home, you will be able to launch KOReader. Simple enough, isn't it? Just be sure to process the image properly (follow those steps carefully) if it's the first time you install koreader, if you made a factory reset or if you deleted it in some way, otherwise you could end up launching koreader automatically at every boot, being unable to exit it without a factory reset.
Selecting the KOReader icon in your home, you will be able to launch KOReader. Simple enough, isn't it? Just be sure to process the image properly (follow those steps carefully) if it's the first time you install koreader, after a factory reset or if you deleted it in some way, in order to make sure KOReader starts properly.

This comment has been minimized.

@Frenzie

Frenzie Apr 14, 2018

Member

Seems a bit wordy in the first sentence. :-P

Quick suggestion:

Select the KOReader icon in your home to launch KOReader. Simple enough, isn't it? Just be sure to process the image properly. Follow these steps carefully if it's your first time installing KOReader, after a factory reset, or if you deleted it in some way. This will ensure KOReader starts properly.

This comment has been minimized.

@NiLuJe

NiLuJe Apr 14, 2018

Member

Yeah, that's my curse ^^. Thanks for the suggestion, will use it.

When you update koreader, it should be sufficient to extract the koreader folder, without KoboRoot.tgz - that one is needed to add the launcher.
When you update koreader manually, it should be sufficient to simply extract the koreader folder.

This comment has been minimized.

@Frenzie

Frenzie Apr 14, 2018

Member

KOReader (at least the first one)

@@ -16,8 +16,8 @@ export LD_LIBRARY_PATH="/usr/local/Kobo"
# NOTE: That check is possibly wrong on PLATFORM == freescale (because I don't know if the sdio_wifi_pwr module exists there), but we don't terribly care about that.
if lsmod | grep -q sdio_wifi_pwr; then
killall udhcpc default.script wpa_supplicant 2>/dev/null
[ "${WIFI_MODULE}" != "8189fs" ] && wlarm_le -i ${INTERFACE} down
ifconfig ${INTERFACE} down
[ "${WIFI_MODULE}" != "8189fs" ] && wlarm_le -i "${INTERFACE}" down

This comment has been minimized.

@Frenzie

Frenzie Apr 14, 2018

Member

Oh sure, quote the non-var but forget the vars. ShellCheck was right! ;-D

This comment has been minimized.

@NiLuJe

NiLuJe Apr 14, 2018

Member

And I'm usually a bit OCD about unbalanced quoting in tests :D.

Reword README a bit
Following suggestions, thanks ;).

@Frenzie Frenzie merged commit bdb82d0 into koreader:master Apr 15, 2018

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

@NiLuJe NiLuJe referenced this pull request May 9, 2018

Merged

Another round of Kobo Fixes #3939

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment