2014-07-03 11:40:53 +00:00
#!/bin/sh
[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.
2018-04-15 13:05:45 +00:00
PATH = "/sbin:/bin:/usr/sbin:/usr/bin:/usr/lib:"
2015-04-26 20:09:14 +00:00
2018-07-04 17:25:55 +00:00
# We don't need to duplicate any of the env setup from rcS, since we will only ever run this to *restart* nickel, and not bootstrap it.
# Meaning we've already got most of the necessary env from nickel itself via both our launcher (fmon/KFMon) and our own startup script.
# NOTE: LD_LIBRARY_PATH is the only late export from rcS we don't siphon in koreader.sh, for obvious reasons ;).
export LD_LIBRARY_PATH = "/usr/local/Kobo"
2018-12-28 03:32:42 +00:00
# Reset PWD, and clear up our own custom stuff from the env while we're there, otherwise, USBMS may become very wonky on newer FW...
# shellcheck disable=SC2164
cd /
2019-03-29 19:12:09 +00:00
unset OLDPWD EXT_FONT_DIR TESSDATA_PREFIX FROM_NICKEL STARDICT_DATA_DIR LC_ALL KO_NO_CBB
2018-12-28 03:32:42 +00:00
[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.
2018-04-15 13:05:45 +00:00
# Ensures fmon will restart. Note that we don't have to worry about reaping this, nickel kills on-animator.sh on start.
2017-04-11 09:28:01 +00:00
(
2018-06-16 21:05:20 +00:00
if [ " ${ PLATFORM } " = "freescale" ] || [ " ${ PLATFORM } " = "mx50-ntx" ] || [ " ${ PLATFORM } " = "mx6sl-ntx" ] ; then
usleep 400000
fi
2017-04-11 09:28:01 +00:00
/etc/init.d/on-animator.sh
) &
2014-07-03 11:40:53 +00:00
2015-05-06 14:53:17 +00:00
# Make sure we kill the WiFi first, because nickel apparently doesn't like it if it's up... (cf. #1520)
# 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.
2017-04-11 09:28:01 +00:00
if lsmod | grep -q sdio_wifi_pwr; then
2019-07-30 23:00:51 +00:00
killall restore-wifi-async.sh enable-wifi.sh obtain-ip.sh udhcpc default.script wpa_supplicant 2>/dev/null
2018-07-01 15:35:12 +00:00
[ " ${ WIFI_MODULE } " != "8189fs" ] && [ " ${ WIFI_MODULE } " != "8192es" ] && wlarm_le -i " ${ INTERFACE } " down
[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.
2018-04-15 13:05:45 +00:00
ifconfig " ${ INTERFACE } " down
2018-06-16 21:05:20 +00:00
# NOTE: Kobo's busybox build is weird. rmmod appears to be modprobe in disguise, defaulting to the -r flag...
# But since there's currently no modules.dep file being shipped, nor do they include the depmod applet,
# go with what the FW is doing, which is rmmod.
[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.
2018-04-15 13:05:45 +00:00
# c.f., #2394?
2018-05-10 10:26:07 +00:00
usleep 250000
2018-06-16 21:05:20 +00:00
rmmod " ${ WIFI_MODULE } "
2018-05-10 10:26:07 +00:00
usleep 250000
2018-06-16 21:05:20 +00:00
rmmod sdio_wifi_pwr
2015-05-06 14:53:17 +00:00
fi
# Flush buffers to disk, who knows.
sync
2015-04-26 20:09:14 +00:00
[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.
2018-04-15 13:05:45 +00:00
# And finally, simply restart nickel.
# We don't care about horribly legacy stuff, because if people switch between nickel and KOReader in the first place, I assume they're using a decently recent enough FW version.
2018-12-28 03:32:42 +00:00
# Last tested on an H2O & a Forma running FW 4.7.x - 4.12.x
[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.
2018-04-15 13:05:45 +00:00
/usr/local/Kobo/hindenburg &
LIBC_FATAL_STDERR_ = 1 /usr/local/Kobo/nickel -platform kobo -skipFontLoad &
2018-12-28 03:32:42 +00:00
udevadm trigger &
2015-04-26 23:59:50 +00:00
2015-08-23 11:33:34 +00:00
# Handle sdcard
2017-04-11 09:28:01 +00:00
if [ -e "/dev/mmcblk1p1" ] ; then
echo sd add /dev/mmcblk1p1 >>/tmp/nickel-hardware-status &
2015-08-23 11:33:34 +00:00
fi
2015-04-26 23:59:50 +00:00
return 0